Dataset in a Shiny directory not found

My working directory is

[1] "C:/Users/mlrob/OneDrive/Documents/census-app"
> ```
I've got an RDS dataset set in a data folder in the "census-app" directory.  But when I attempt to load the data with this code
```counties <- readRDS("census-app/data/counties.rds")
``` I will get this error message
```Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
  cannot open compressed file 'census-app/data/counties.rds', probable reason 'No such file or directory'
> head(counties)
Error in head(counties) : object 'counties' not found
> counties <- readRDS("census-app/data/counties.rds")

What's wrong?

If your working directory is "C:/Users/mlrob/OneDrive/Documents/census-app", then try

counties <- readRDS("data/counties.rds")
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.