Howdy,
I'm looking to use this Shiny - Google Charts as an example and start to dig into how I can use my data with a display like this bubble graph with the slider.
I've copied the code and downloaded the RDS file. I even got it all running yesterday but now today I get this error:
Error in readRDS("healthexp.Rds") : error reading from connection
I've;
checked spelling (all fine)
checked that WD is correctly set
run another shiny app locally (all fine)
updated R to the latest version for MAC 1.1.453
searched the internet with no luck
It's possible your working directory has changed; use getwd() to see what it is. If it's different than you expect, you can use setwd() to change it to the directory that healthexp.Rds is in. Or better yet, use RStudio projects and never mess with your working directory--instead copy the assets you need (like the .Rds file) into the project directory.
The error message error reading from connection is most commonly an issue with one's filepath.
When I am confused by where an RDS files is relative to my working directory, I use RStudio's file pane to navigate to the offending file, click on it and open. The R console then reveals it's location.
Compare that to the current working directory getwd()
Yep, done a lot of playing around as noted with path. None of these path descriptions work. Same error with each.
Notes: R Project gives same issue, restarting R no resolution, starting over copying files from web in R project or just normal directory no luck either.
Thought I might add my finding here in case people in the future encounter the same problem.
Ran into exact error with a slight twist just now. After crawling through this thread and some painstaking guess work, I found out that RDS downloaded from "download.file()" will return this error while RDS downloaded from browser does not.
download.file(path, destfile, mode = "wb") solves this issue. I guess the function added some weird headers to the rds file if you use mode = "w" because the file size (under mode="w") is slightly larger than it should. mode = "wb" tells the function that the rds file is a binary.