From 57e588339cb216080fb9fb5d7c067f626d6a4d2d Mon Sep 17 00:00:00 2001 From: jml <jm@nilu.no> Date: Mon, 7 Jan 2019 15:13:01 +0100 Subject: [PATCH] update vignettes --- DESCRIPTION | 4 +-- vignettes/data.eimet.Rmd | 6 ++++ vignettes/data.eipa.Rmd | 6 ++++ vignettes/data.luftkval.oslo10.Rmd | 56 ++++++++++++++++++++++++++++++ vignettes/frost.Rmd | 6 ++++ vignettes/innosense.Rmd | 7 +++- vignettes/luftkvalitet.Rmd | 10 +++--- 7 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 vignettes/data.luftkval.oslo10.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index b117cff..9dbd6ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,9 +6,9 @@ Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cr Title: friendlyr Description: Make remote timeserie dataset easy to get and to work with. The package focuses on: - 1. importing key functions from a chosen remote dataset. + 1. importing key libraries related to a specific remote dataset. 2. authentication to the related database/db/api. - 3. having access to the related database/db/api. + 3. having access to the related database/db/api/embedded dataset. 4. having timeserie dataset in a friendly format. 5. checking the date timeserie. 6. having metadata. diff --git a/vignettes/data.eimet.Rmd b/vignettes/data.eimet.Rmd index a49c667..3320104 100644 --- a/vignettes/data.eimet.Rmd +++ b/vignettes/data.eimet.Rmd @@ -11,6 +11,12 @@ vignette: > library(friendlyr) knitr::opts_chunk$set(collapse = T, comment = "#>") ``` +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/d.eimetlyr.git") +``` ## Get timeseries data diff --git a/vignettes/data.eipa.Rmd b/vignettes/data.eipa.Rmd index a821057..d59b142 100644 --- a/vignettes/data.eipa.Rmd +++ b/vignettes/data.eipa.Rmd @@ -11,6 +11,12 @@ vignette: > library(friendlyr) knitr::opts_chunk$set(collapse = T, comment = "#>") ``` +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/d.eipalyr.git") +``` ## Get timeseries data diff --git a/vignettes/data.luftkval.oslo10.Rmd b/vignettes/data.luftkval.oslo10.Rmd new file mode 100644 index 0000000..ac6ea20 --- /dev/null +++ b/vignettes/data.luftkval.oslo10.Rmd @@ -0,0 +1,56 @@ +--- +title: "data.eimet" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{data.eimet} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include = FALSE} +library(friendlyr) +knitr::opts_chunk$set(collapse = T, comment = "#>") +``` + +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/d.luft.oslyr.git") +``` + +## Get timeseries data + +Get data from luftkval.oslo10 embedded dataset. + +```R +fromDate="2008/03/01 02:00:00" +toDate="2008/03/01 09:00:00" +timeResolution="hourly" + +station_id=c("7","848","464","827","665","9","11","163","504","809") +element_id=c("NO2") +location <- NULL + + +df <- friendlyr::ts(service="d.luft.oslyr", + fromDate=fromDate,toDate=toDate,precision=timeResolution,timeResolution=timeResolution, + element_id=element_id,station_id=station_id) + + +``` +## Get metadata + +```R +metadata <- friendlyr::meta(service="d.luft.oslyr",station_id=station_id) + +``` + +## Get Quality flags + +```R +df <- friendlyr::qa(service="d.luft.oslyr", + fromDate=fromDate,toDate=toDate,precision=timeResolution,timeResolution=timeResolution, + element_id=element_id,station_id=station_id) + +``` diff --git a/vignettes/frost.Rmd b/vignettes/frost.Rmd index 350b020..a8c2bb2 100644 --- a/vignettes/frost.Rmd +++ b/vignettes/frost.Rmd @@ -11,6 +11,12 @@ vignette: > library(friendlyr) knitr::opts_chunk$set(collapse = T, comment = "#>") ``` +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/frostlyr.git") +``` ## Get timeseries data diff --git a/vignettes/innosense.Rmd b/vignettes/innosense.Rmd index 0383435..1679550 100644 --- a/vignettes/innosense.Rmd +++ b/vignettes/innosense.Rmd @@ -12,7 +12,12 @@ library(friendlyr) knitr::opts_chunk$set(collapse = T, comment = "#>") ``` -# Get the data from Innosense database +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/innolyr.git") +``` ## Get the timeseries at specific stations diff --git a/vignettes/luftkvalitet.Rmd b/vignettes/luftkvalitet.Rmd index 487f418..f5f88ad 100644 --- a/vignettes/luftkvalitet.Rmd +++ b/vignettes/luftkvalitet.Rmd @@ -11,7 +11,12 @@ vignette: > library(friendlyr) knitr::opts_chunk$set(collapse = T, comment = "#>") ``` - +## install +```R +library("devtools") +devtools::install_git("https://git.nilu.no/rfriendlyr/friendlyr.git") +devtools::install_git("https://git.nilu.no/rfriendlyr/luftlyr.git") +``` ## Get the timeseries data Get data from the luftkvalitet database. @@ -34,8 +39,6 @@ luft <- friendlyr::ts(service="luftlyr",username="****",password="****", element_id=c("NO2","O3"),location="Oslo,Norway") -plot(luft,target=c("NO2_7","NO2_848"),DESKTOP=TRUE) - ``` ## Get the timeseries QA data @@ -60,7 +63,6 @@ luft_qa <- friendlyr::qa(service="luftlyr",username="****",password="****", element_id=c("NO2","O3"),location="Oslo,Norway") -plot(luft_qa,target=c("NO2_7","NO2_848"),DESKTOP=TRUE) ``` ## Get the metadata data -- GitLab