Commit 4b396a17 authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

standardization of the function names

parent b4a1e958
......@@ -4,11 +4,12 @@ Version: 0.0.1
Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cre")),
person("NILU",role="cph"))
Title: luftlyr
Description: Get luftkval dataset as a timeserie data.frame easy to work with.
The package focuses on:
1. get the data from the database
1. putting a timeserie input into a friendly data.frame format
3. will deal with large dataset (later)
Description: Make luftkvalitet dataset easy to manipulate.
The package adapt friendlyr to luftkvalitet:
1. authentication to the storage
2. having timeserie dataset in a friendly format
3. having metadata
4. exporting dataset
Depends:
R (>= 3.2.0)
Imports:
......
......@@ -11,6 +11,6 @@
#' }
luftlyr <- function(...){
return(friendlyr::friendlyr(session_name="luftkvalitet", fn_get=get_data, fn_friendly=friendly_df,...))
return(friendlyr::friendlyr(session_name="luftlyr", fn_get=luftlyr_getdata, fn_friendly=luftlyr_friendlydf,...))
}
friendly_df <- function(x,res){
luftlyr_friendlydf <- function(x,res){
if (x$dateStructObj$COL_DATE) {
tmp <- friendly_df_(x=x,ugly_df=res)
......
get_data <- function(x,...) {
luftlyr_getdata <- function(x,...) {
db <- luftkvalr::luftkvalr()
db$start(...)
tmp_st <- db$GetAQStations(stationIDs=x$stationObj$station_id)
tmp_ts <- db$GetAQTimeseries(stationIDs=tmp_st$ST_ID,componentName=x$elementObj$element_id)
res <- db$GetAQData(stationIDs=tmp_st$ST_ID,timeSeriesIDs=tmp_ts$TS_ID,fromDateTime=as.character(x$timeObj$fromPeriod()),toDateTime=as.character(x$timeObj$toPeriod()))
res <- db$GetAQData(stationIDs=tmp_st$ST_ID,
timeSeriesIDs=tmp_ts$TS_ID,
fromDateTime=as.character(x$timeObj$fromPeriod()),
toDateTime=as.character(x$timeObj$toPeriod()))
db$stop()
#Missing values
......
Supports Markdown
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