Commit 88e6c408 authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

typo

parent 3e297845
...@@ -36,13 +36,13 @@ plot_tbl_basic <- function(x,target,group,path=tempdir(),name=NULL,DESKTOP=TRUE, ...@@ -36,13 +36,13 @@ plot_tbl_basic <- function(x,target,group,path=tempdir(),name=NULL,DESKTOP=TRUE,
names(x)[names(x)==target] <- "targ" names(x)[names(x)==target] <- "targ"
p <- switch(group, p <- switch(group,
"YEAR" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = YEAR, y = targ)) + ggplot2::labs(x = group, y = y_name), "YEAR" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = YEAR, y = targ, group = YEAR)) + ggplot2::labs(x = "YEAR", y = y_name),
"MONTH" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = MONTH, y = targ)) + ggplot2::labs(x = group, y = y_name), "MONTH" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = MONTH, y = targ, group = MONTH)) + ggplot2::labs(x = "MONTH", y = y_name),
"WDAY" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = WDAY, y = targ)) + ggplot2::labs(x = group, y = y_name), "WDAY" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = WDAY, y = targ, group = WDAY)) + ggplot2::labs(x = "WDAY", y = y_name),
"DAY" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = DAY, y = targ)) + ggplot2::labs(x = group, y = y_name), "DAY" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = DAY, y = targ, group = DAY)) + ggplot2::labs(x = "DAY", y = y_name),
"HOUR" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = HOUR, y = targ)) + ggplot2::labs(x = group, y = y_name), "HOUR" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = HOUR, y = targ, group = HOUR)) + ggplot2::labs(x = "HOUR", y = y_name),
"MINUTE" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = MINUTE, y = targ)) + ggplot2::labs(x = group, y = y_name), "MINUTE" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = MINUTE, y = targ, group = MINUTE)) + ggplot2::labs(x = "MINUTE", y = y_name),
"SECOND" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = SECOND, y = targ)) + ggplot2::labs(x = group, y = y_name), "SECOND" = ggplot2::ggplot(x) + ggplot2::geom_boxplot(ggplot2::aes(x = SECOND, y = targ, group = SECOND)) + ggplot2::labs(x = "SECOND", y = y_name),
stop("group not recognized")) stop("group not recognized"))
print(p) print(p)
......
...@@ -18,7 +18,7 @@ knitr::opts_chunk$set(collapse = T, comment = "#>") ...@@ -18,7 +18,7 @@ knitr::opts_chunk$set(collapse = T, comment = "#>")
### Get 'data.luftkval.oslo10' dataset. ### Get 'data.luftkval.oslo10' dataset.
```R ```R
library(dplyr)
fromDate <- "2015/01/01 00:00:00" fromDate <- "2015/01/01 00:00:00"
toDate <- "2018/12/31 23:00:00" toDate <- "2018/12/31 23:00:00"
timeResolution <- "hourly" timeResolution <- "hourly"
...@@ -27,7 +27,8 @@ precision <- "hourly" ...@@ -27,7 +27,8 @@ precision <- "hourly"
element_id <- c("NO2") element_id <- c("NO2")
# station ids # station ids
station_id <- c("7","848","827","665","9","11","163","504","809") #station_id <- c("7","848","827","665","9","11","163","504","809")
station_id <- c("7","464","827","665","9","11","163","504","809")
# luft # luft
...@@ -64,6 +65,8 @@ cond <- paste(qa_all, "%in%", known_ok,collapse=" & ") ...@@ -64,6 +65,8 @@ cond <- paste(qa_all, "%in%", known_ok,collapse=" & ")
study <- study %>% filter(eval(parse(text=cond))) %>% select(c("WDAY","YEAR","MONTH","DAY","HOUR"),tidyselect::all_of(all),tidyselect::all_of(qa_all)) %>% friendlyts::as_tbl_friendlyts(precision=precision,date_type="friendlyts",CHECKNAS=FALSE) study <- study %>% filter(eval(parse(text=cond))) %>% select(c("WDAY","YEAR","MONTH","DAY","HOUR"),tidyselect::all_of(all),tidyselect::all_of(qa_all)) %>% friendlyts::as_tbl_friendlyts(precision=precision,date_type="friendlyts",CHECKNAS=FALSE)
study <- stats::na.omit(study) study <- stats::na.omit(study)
write.csv(study,file="~/NO2_oslo10_2015_2018.csv")
``` ```
### Missing values ### Missing values
...@@ -120,6 +123,7 @@ basicr::plot_lmrd(x=res,DESKTOP=FALSE,path="~") ...@@ -120,6 +123,7 @@ basicr::plot_lmrd(x=res,DESKTOP=FALSE,path="~")
#res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("WDAY"))}) #res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("WDAY"))})
#res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("HOUR"))}) #res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("HOUR"))})
res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("WDAY","HOUR"))}) res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("WDAY","HOUR"))})
#res <- lapply(paste0(element_id,"_","7"),function(x){basicr::basic_info(df=study,target=x,group=c("MONTH","WDAY","HOUR"))})
res <- do.call("rbind",res) res <- do.call("rbind",res)
basicr::plot_lmrd(x=res,DESKTOP=FALSE,path="~") basicr::plot_lmrd(x=res,DESKTOP=FALSE,path="~")
......
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