You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is probably returning a logical class. To create the character string to indicate the directory for get.env() to store the downloaded sst files, remove the dir.create() call: sst.dir <- paste0(getwd(),"/test")
dir.create() only needed to create the directory described by that path in the file system, by using the assignment arrow you are getting what is usually a invisible logical vector that indicates if the directory was successfully created.
Personally I set up the folders and removed all the dir.create() calls, because the function temporarily changes your working directory and apparently doesn't change it back if you hit an error, then especially with dir.create(..., recursive = TRUE) as in the vignette you can quickly end up with 10+ additional levels of directories when trying to download environmental data. (or wrap them in if(!dir.exists(path)) { }
Function "get.env" from -dev branch seems to throw errors when trying to download oisst data.
devtools::install_github('camrinbraun/HMMoce', ref='dev')
library(HMMoce)
cat("\014")
rm(list=ls())
dates <- seq(as.Date("2020-01-01"),as.Date("2020-01-20"),"days")
sp.lim <- list(lonmin = -50, lonmax = 25, latmin = 0, latmax = 60)
sst.dir <- dir.create(paste0(getwd(),"/test"))
get.env(dates, filename='oisst', type = 'sst', sst.type='oi', spatLim = sp.lim, save.dir = sst.dir) # errors
"Error in setwd(dir) : character argument expected"
get.env(dates, filename='hycom', type = 'hycom', spatLim = sp.lim, save.dir = sst.dir) # works
The text was updated successfully, but these errors were encountered: