I'm trying to analyze a subset of the Woldclim bioclimatic data (19 raster layers) that covers the Canadian Arctic. I'd like to see how correlated the layers are. When using the layerCor function from the terra package, I keep getting the following error message:
cor_present_temp <- layerCor(bioclim_present, "pearson", na.rm = TRUE)
Error in h(simpleError(msg, call)) :
Error in evaluating the argument ‘x’ in selecting a method for function ‘global’: [is.na] insufficient disk space (perhaps from temporary files?)
After trying to run this code, my entire hard drive become full. I have to shut R down to erase the temporary files
So, I tried splitting the dataset into 4 groups of 5-6 layers. However, when I try to run this analysis, I still get the error message when running the second dataset. Shouldn't the temporary files be gone once the analyses is complete? Can I erase them within R so that I don't have to open and close R to run the full analysis?
tempdir()
but there's no guarantee any function is going to use that and not stash temp files somewhere else.tmpFiles(current = TRUE, remove = TRUE)
, I think.