so I pulled an hourly time series from a netcdf file and wanted to convert it to monthly data for some runs I'm doing. I keep getting the error in the title whenever I try to use the Zoo package to convert. I've tried running R as an administrator because someone else suggested that, but still can't get zoo to read the file. Any advice? Thanks!
Here's the code I use:
library(ncdf4)
library(zoo)
Clim <- nc_open("CANESM5_erw.nc")
Temp <- ncvar_get(Clim, varid="T2")
String <- toString(Temp)
Mon <- read.zoo(String, FUN = as.Date.yearmon, aggregate = mean)
I have tried running R as an administrator and formatting Temp as an array, a string, and a table.