print('rcouchutils Rinstall.R')
dot_is <- getwd()
envrr <- Sys.getenv()
plaba <- regexpr(pattern='/node_modules',envrr['PWD'])
if(plaba>0){
## stoppoint <- plaba + 12 ## same as attr(plaba,'match.length')
stoppoint <- plaba - 1 ## actually, go one up
dot_is <- substr(envrr['PWD'],1,stoppoint)
}
node_paths <- dir(dot_is,pattern='\\.Rlibs',
full.names=TRUE,recursive=TRUE,
ignore.case=TRUE,include.dirs=TRUE,
all.files = TRUE)
path <- normalizePath(paste(dot_is,'.Rlibs',sep='/')
, winslash = "/", mustWork = FALSE)
if(!file.exists(path)){
dir.create(path)
}
print(paste('installing to',path,paste(node_paths)))
lib_paths <- .libPaths()
.libPaths(c(path,node_paths,lib_paths))
## ready to go
devtools::document()
devtools::install()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.