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

update lib

parent 8aea50b0
^.*\.Rproj$
^\.Rproj\.user$
^\TODO.md
^\NEW.md
lib/
......@@ -11,16 +11,18 @@ Basic information from a tbl_friendlyts data.frame:
- Plots.
## Installation
## Installation using base R
```R
library("devtools")
devtools::install_git("https://git.nilu.no/rdiagnosis/basicr.git")
# remarks
# basicr requires ggplot2 version 3.1.1
remove.packages("ggplot2")
install.packages("https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.1.1.tar.gz", repo=NULL, type="source")
setwd("~")
download.file("https://git.nilu.no/rdiagnosis/basicr/-/archive/0.0.7/basicr-0.0.7.tar.gz",destfile="basicr-0.0.7.tar.gz")
untar("basicr-0.0.7.tar.gz")
source(file.path("~/basicr-0.0.7/lib/plotfts.R"))
setwd(file.path("~","basicr-0.0.7"))
source(file.path("~/basicr-0.0.7/lib/buildpkgs.R"))
install.packages(file.path("~","basicr-0.0.7.tar.gz"), repos=NULL, type='source')
unlink(file.path("~/basicr-0.0.7"),recursive=TRUE)
file.remove(file.path("~/basicr-0.0.7.tar.gz"))
```
## Usage
......
## to do list
- remove dplyr dependency
- remove tidyr dependency
- remove ggplot2 dependency
- use data.table
sourcedir <- file.path(getwd(),"lib")
## lmom
install.packages(file.path(sourcedir,"lmom_2.8.tar.gz"), repos=NULL, type='source')
## docopt
install.packages(file.path(sourcedir,"docopt_0.6.1.tar.gz"), repos=NULL, type='source')
#!/usr/local/bin/Rscript
# Jean-Marie Lepioufle
# NILU - nilu.no
# 2020-08-14
# install
'install
Usage:
install.R pkg <pkg> branch <branch> dir <dir>
install.R (-h | --help)
install.R --version
Options:
-h --help Show this screen.
--version Show version.
Outcomes:
basicr: package basicr installed with the chosen version.
' -> doc
#library(docopt)
arguments <- docopt::docopt(doc, version = 'install version 0.0.1')
# arguments
pkg <- tryCatch({
res <- as.character(arguments$pkg)
res
}, error = function(err) {
print(paste("Error in argument 'pkg': ",err))
print("It will crash.")
})
branch <- tryCatch({
res <- as.character(arguments$branch)
res
}, error = function(err) {
print(paste("Error in argument 'branch': ",err))
print("It will crash.")
})
dir <- tryCatch({
res <- normalizePath(file.path(as.character(arguments$dir)),mustWork = FALSE)
res
}, error = function(err) {
print(paste("Error in argument 'dir': ",err))
print("It will crash.")
})
# install pkg
wd <- dirname(dirname(getwd()))
install.packages(file.path(dir,paste0(pkg,'-',branch,'.tar.gz')), repos=NULL, type='source')
setwd("~")
download.file("https://git.nilu.no/rfriendlyts/plotfts/-/archive/0.0.2/plotfts-0.0.2.tar.gz",destfile="plotfts-0.0.2.tar.gz")
untar("plotfts-0.0.2.tar.gz")
setwd(file.path("~","plotfts-0.0.2"))
source(file.path("~/plotfts-0.0.2/lib/friendlyts.R"))
source(file.path("~/plotfts-0.0.2/lib/buildpkgs.R"))
install.packages(file.path("~","plotfts-0.0.2.tar.gz"), repos=NULL, type='source')
unlink(file.path("~/plotfts-0.0.2"),recursive=TRUE)
file.remove(file.path("~/plotfts-0.0.2.tar.gz"))
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