0 votes
in AEM3D by [email protected] (360 points)
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)

1 Answer

0 votes
by [email protected] (920 points)
I have done it in MATLAB. But with the new NetCDF version, there is no size limit. Let me know if my MATLAB code would be helpful for you so I can send it to you.

Mohammad
Welcome to Hydronumerics Q&A, where you can ask questions and receive answers about the software we develop and distribute

Categories

Hydronumerics

  • Suite 103 757 Bourke St Docklands Victoria 3008
  • Suite 103 757 Bourke St Docklands Victoria 3008
  • +61 3 9037 0892
  • [email protected]
  • Twitter
...