[Solved] R Error: Error in gzfile(file, “rb”) : cannot open the connection rds

When reading the rds file in Rstudio, an error “Error in gzfile(file, “rb”): cannot open the connection rds” is reported, the command is as follows:
out <- readRDS("file.rds")
The solution is to add an absolute path:
out <- readRDS("D:/path/to/file.rds")

Similar Posts: