confused genius
confused genius

Reputation: 3254

In R want to connect to a remote server and read a file

In R I want to connect to a remote server and read a file. I am using

scp("host", "file path", "password", user="username") 

It is returning

could not find function scp

Upvotes: 0

Views: 8293

Answers (1)

SniderThanYou
SniderThanYou

Reputation: 96

The scp function is provided as part of the RCurl package. If you haven't done so already, install the latest version of the package:

Open an R terminal and execute the following command to install it:

R> install.packages("RCurl", dependencies = TRUE)

If it asks about using a personal library, enter y

You will then be prompted to select a mirror. Just pick a location somewhat near you for a hopefully-quicker download speed.

Now, at the top of your R script calling scp, add the following line:

library("RCurl")

this will allow you to use scp in your R script.

Upvotes: 6

Related Questions