Wrote a script in R to merge two .nc output files together, but received an error,
"Error in as.data.frame.default(x) :
cannot coerce class ""ncdf4"" to a data.frame"
Wondering how I might get around this?
Below is the R script.
# install.packages ('ncdf4', 'ncdf.tools)
library(ncdf4)
library(ncdf.tools)
#set working directory
setwd("D:/..........")
# gather files
data1 = nc_open('sheet_max_run_1.nc')
data2 = nc_open('sheet_max_restart_1.nc')
# create new file
combined= merge(data1,data2,all=TRUE)