Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
132 views
in Technique[技术] by (71.8m points)

Sourcing R script over HTTPS

Is there some way to source an R script from the web?

e.g. source('http://github.com/project/R/file.r')

Reason: I currently have a project that I'd like to make available for use but isn't ready to be packaged yet. So it would be great to give people a single file to source from the web (that will then source all the individual function files).

On closer inspection, the problem appears to be https. How would I source this file?

https://raw.github.com/hadley/stringr/master/R/c.r
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use the source_url in the devtools library

library(devtools)
source_url('https://raw.github.com/hadley/stringr/master/R/c.r')

This is a wrapper for the RCurl method by @ROLO


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...