I have text files, each file has the name "pr_lat_lon", for example, "pr_30.25_125.25", "pr_30.25_125.75", "pr_30.75_125.25", "pr_30.75_125.75", etc. Each text file has just one column, which is the value for each day. They are daily data from 1950 to 2010 at each grid centroid. How to write each text file as a netcdf in R? Thanks for your help.
I read the data like this:
timespan = length(seq(as.Date('1950-01-01'),as.Date('2010-12-31'),by='day')) # which gives 22280 pr_30.25_125.25= data.frame(V1=rnorm(1:22280)) pr_30.25_125.75= data.frame(V1=rnorm(1:22280))