Commit 3ec9bc1b authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

enable install with Rscript

parent 5643350f
## to do list
0. It looks like one can get some requests limitation on OSM. In this case, changing the base url https://nominatim.openstreetmap.org into an alternative.
1. innolyr: ask access rights to innosense metadata --- > the table will disappear: LAT,LON are variables
2. innolyr: df_friendly for COL_DATE --> to be checked whether relevant or not and then be deleted
3. system to import username and pwd into environ or a secure key store wit h a specific name of variable
sourcedir <- file.path(getwd(),"lib")
# osmdata
# friendlyr's dependencies
## osmdata
install.packages(file.path(sourcedir,"generics_0.0.2.tar.gz"), repos=NULL, type='source')
install.packages(file.path(sourcedir,"lubridate_1.7.4.tar.gz"), repos=NULL, type='source')
install.packages(file.path(sourcedir,"stringi_1.4.3.tar.gz"), repos=NULL, type='source')
......@@ -29,3 +31,6 @@ install.packages(file.path(sourcedir,"tidyr_0.8.3.tar.gz"), repos=NULL, type='so
### friendlyts
install.packages(file.path(sourcedir,"timemanip-0.9.4.tar.gz"), repos=NULL, type='source')
install.packages(file.path(sourcedir,"friendlyts-0.3.1.tar.gz"), repos=NULL, type='source')
## docopt
install.packages(file.path(sourcedir,"docopt-0.6.1.tar.gz"), repos=NULL, type='source')
......@@ -27,3 +27,6 @@ wget --quiet https://cran.r-project.org/src/contrib/Archive/tidyr/tidyr_0.8.3.ta
### friendlyts
wget --quiet https://git.nilu.no/RSpaceTimeManip/timemanip/-/archive/0.9.4/timemanip-0.9.4.tar.gz
wget --quiet https://git.nilu.no/RfriendlyTS/friendlyts/-/archive/0.3.1/friendlyts-0.3.1.tar.gz
## docopt
wget --quiet https://cran.r-project.org/src/contrib/Archive/docopt/docopt_0.6.1.tar.gz
#!/usr/local/bin/Rscript
# Jean-Marie Lepioufle
# NILU - nilu.no
# 2020-08-14
# install friendlyr
'install_friendlyr
Usage:
install_friendlyr.R -version <version> -path <path>
install_friendlyr.R (-h | --help)
install_friendlyr.R --version
Options:
-h --help Show this screen.
--version Show version.
Outcomes:
friendlyr: package friendlyr install with the chosen version.
' -> doc
#library(docopt)
arguments <- docopt::docopt(doc, version = 'install_friendlyr version 0.0.1')
cat("Initialising parameters... \n")
# init parameters
version <- tryCatch({
res <- as.character(arguments$version)
res
}, error = function(err) {
print(paste("Error in argument 'version': ",err))
print("It will crash.")
})
# get path
path <- tryCatch({
res <- normalizePath(file.path(as.character(arguments$path)),mustWork = FALSE)
res
}, error = function(err) {
print(paste("Error in argument 'result': ",err))
print("It will crash.")
})
cat("Installation... \n")
wd <- dirname(dirname(getwd()))
# install friendlyr
install.packages(file.path(path,paste0('friendlyr_',version,'.tar.gz')), repos=NULL, type='source')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment