I am trying to vectorize this call to source_url
, in order to load some functions from GitHub:
library(devtools)
# Find ggnet functions.
fun = c("ggnet.R", "functions.R")
fun = paste0("https://raw.github.com/briatte/ggnet/master/", fun)
# Load ggnet functions.
source_url(fun[1], prompt = FALSE)
source_url(fun[2], prompt = FALSE)
The last two lines should be able to work in a lapply
call, but for some reason, this won't work from knitr: to have this code work when I process a Rmd
document to HTML, I have to call source_url
twice.
The same error shows up with source_url
from devtools
and with the one from downloader
: somehwere in my code, an object of type closure
is not subsettable.
I suspect that this has something to do with SHA; any explanation would be most welcome.