0

I'm using package ncdf4 to read .nc file. After extracting the data, the .nc file stays open by RStudio, so I can't delete or rename the file in windows (I receive the error: "the action can´t be completed because the folder is open in RStudio R session"). There are no connections open. unlink doesn't solve the problem. The only thing that solves the issue is restarting R session. Any ideas for solution without restarting R?

library(ncdf4)
nc_data <- nc_open("DYsim.nc")
Tcalc <- ncvar_get(nc_data, "dyresmTEMPTURE_Var")
remove(nc_data)
Phil
  • 7,287
  • 3
  • 36
  • 66
Shajar
  • 87
  • 6

1 Answers1

0

Updating ncdf4 to version 1.19 and using nc_close solved the issue.

Shajar
  • 87
  • 6