How to import files and install packages in Quickstart

Hi there,

I want to test out QuickStart using my own files, what would be the best way for RStudio to read a dataset inside QuickStart?

Also, my file requires installing packages from CRAN. It seems the option is not available.

image

Thanks,

Ethan

2 Likes

In what format do you have the data?

For file based data (CSV etc.) you can upload it within RStudio Server, so that your R code can access it. When you publish your app/document/... you can make the data file part of the bundle such that RStudio Connect can make use of it as well.

1 Like

I have a tsv file and a xlsx file. I will try upload the file from RStudio Server.

Also, here is the screenshot of package pane, it doesn't look like I can change the repo:

OK, I can upload the files using the Files pane.

But I still cannot install the necessary libraries to run the analysis.

Thanks for reaching out! So what happens when you try to do install.packages("mypackage")?

If I remember correctly, we set the QuickStart up to install from RSPM, so all of CRAN should be available... but I may be mistaken here as well... If you can share the output in your console, that'd be super helpful!

Here is an example of failed install:

Well that's no good! If you go to http://localhost:5000/packages in your browser, do you see the RSPM interface? Or does it complain about licensing?

If you are looking for the "get out of the pain quickly" approach, this should fix you up in your active session (although it will likely not persist into a new session):

options("repos" = c("CRAN" = "https://cran.rstudio.com"))
install.packages("data.table")

If you have the patience to figure out what is going on with RSPM, I'd love the feedback to see if there is anything we can improve! Knowing what is going on in the user interface, and maybe the log files at /var/log/rstudio-pm.log would be helpful! You can get the log from the RSP terminal with sudo cat /var/log/rstudio-pm.log

I can see the package manager interface.

Here is the latest log:

I also couldn't get it to work using

options("repos" = c("CRAN" = "https://cran.rstudio.com"))
install.packages("data.table")

Here is the message on the console

Very interesting! And thanks for sharing! Is the computer running the RStudio QuickStart connected to the internet? It seems like the QuickStart may be having trouble reaching outside of its borders.

What does the following give you in your terminal?

curl -i -v https://cran.rstudio.com/src/contrib/Archive/data.table/

Here is the output from the command:

Interesting! Are you on a corporate network? I'm thinking you probably have an outbound proxy or something that is intercepting traffic, and the SSL certificate chain is complaining. You can try this command to confirm if ignoring the cert problem gets you past it:

curl -i -v -k https://cran.rstudio.com/src/contrib/Archive/data.table/

Related, you can try this to resolve. Maybe plain HTTP is the answer! :smile:

options("repos" = c("CRAN" = "http://cran.rstudio.com"))
install.packages("data.table")

EDIT: Nevermind my previous edit. :rofl: I was having crazy ideas. The haxx.se link is just an explanation of the behavior and the problem.

Using HTTP solved the issue, that will get me started. Thanks Cole!

I would be interested to find out why I cannot install packages from the pre-installed repo.

1 Like

Good to hear!! Yeah, I will have to do some thinking on this.

The RSPM repository does not have packages pre-downloaded (lest the QuickStart be 200+ GB :scream:). As a result, it still has to go fetch the packages when you request them. To do that, it reaches out to the URL that you saw in the error log: https://rspm-sync.rstudio.com . Because that is an SSL domain, it has the same certificate problem that you saw when going directly to CRAN.

There is a proxy or something between you and the internet that is doing some SSL certificate shenanigans and your computer doesn't like it. This would not be surprising in some corporate environments, which I suspect is your case, although perhaps you can confirm.

These types of SSL / certificate errors are worth paying attention to generally, though, because it can also evidence a Man-In-The-Middle (MITM) attack, where someone/something nefarious is trying to decrypt or intercept your traffic.

Yes, I am running the QuickStart behind a corporate network.

1 Like

Good to know, thanks! We'll definitely do some thinking on how we can make this workflow a bit cleaner in the future! :slight_smile: Thanks so much for sharing! Please let us know if you run into any more issues!