Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
citizenair
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vmm
citizenair
Commits
8d841000
Commit
8d841000
authored
Nov 12, 2018
by
Jan Wijffels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add citizenair_compare
parent
b7fbe585
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
2 deletions
+71
-2
citizenair/DESCRIPTION
+1
-1
citizenair/NAMESPACE
+6
-0
citizenair/R/pkg.R
+2
-1
citizenair/man/citizenair_compare.Rd
+37
-0
citizenair/man/plot.citizenair_comparison_ircel.Rd
+25
-0
No files found.
citizenair/DESCRIPTION
View file @
8d841000
...
...
@@ -24,4 +24,4 @@ Imports:
httr,
lubridate,
rgeos
Suggests: BelgiumMaps.StatBel
Suggests: BelgiumMaps.StatBel
, ggplot2
citizenair/NAMESPACE
View file @
8d841000
...
...
@@ -2,7 +2,9 @@
S3method(as.data.frame,citizenair_userdata)
S3method(error_message,default)
S3method(plot,citizenair_comparison_ircel)
export(CitizenAir)
export(citizenair_compare)
export(error_message)
export(read_citizenair)
export(read_stations)
...
...
@@ -22,6 +24,7 @@ importFrom(fasttime,fastPOSIXct)
importFrom(httr,GET)
importFrom(httr,content)
importFrom(lubridate,as.interval)
importFrom(lubridate,parse_date_time)
importFrom(readxl,excel_sheets)
importFrom(readxl,read_excel)
importFrom(rgeos,gIntersects)
...
...
@@ -41,6 +44,9 @@ importFrom(sensorweb4R,time)
importFrom(sensorweb4R,timeseries)
importFrom(sp,CRS)
importFrom(sp,SpatialPointsDataFrame)
importFrom(stats,lm)
importFrom(stats,na.pass)
importFrom(stats,predict)
importFrom(tools,file_path_sans_ext)
importFrom(utils,capture.output)
importFrom(utils,head)
...
...
citizenair/R/pkg.R
View file @
8d841000
...
...
@@ -6,12 +6,13 @@
#' @importFrom fasttime fastPOSIXct
#' @importFrom rmarkdown run
#' @importFrom sensorweb4R resourceURL id label as.Endpoint fetch timeseries phenomenon as.Timeseries getData time lastValue firstValue Station
#' @importFrom lubridate as.interval
#' @importFrom lubridate as.interval
parse_date_time
#' @importFrom httr GET content
#' @importFrom sp CRS SpatialPointsDataFrame
#' @importFrom rgeos gIntersects
#' @import methods
#' @import R6
#' @importFrom stats lm na.pass predict
NULL
citizenair/man/citizenair_compare.Rd
0 → 100644
View file @
8d841000
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/comparisons.R
\name{citizenair_compare}
\alias{citizenair_compare}
\title{Compare citizen data to official data}
\usage{
citizenair_compare(x, reference = "official", sensor = "citizen")
}
\arguments{
\item{x}{a data.frame with columns time/group/value}
\item{reference}{a character string of length 1 indicating in the \code{group} column of \code{x} what is the reference value.
Defaults to 'official'}
\item{sensor}{a character string of length 1 indicating in the \code{group} column of \code{x} what is the comparison value.
Defaults to 'citizen'}
}
\value{
an object of class \code{citizenair_comparison_ircel} which is a list with elements
\enumerate{
\item{data: the data containing columns time, REF, SENSOR, OLSQ, lower_CI, upper_CI, lower_PI, upper_PI and e}
\item{model: an object of class lm represendint the model SENSOR ~ REF}
\item{overview: a data.frame with columns statistic, time, REF, SENSOR, OLSQ, lower_CI, upper_CI, lower_PI, upper_PI and e with the
minimum/Q25/median/mean/Q75/max for each of these columns as well as the number of valid data points and the number of NA values}
}
}
\description{
Compare citizen data to official data
}
\examples{
x <- data.frame(
time = rep(seq.Date(from = Sys.Date()-364, to = Sys.Date(), by = "day"), 2),
group = sample(c("official", "citizen"), size = 365*2, replace = TRUE),
value = rnorm(365*2))
comparison <- citizenair_compare(x, reference = "official", sensor = "citizen")
plot(comparison)
}
citizenair/man/plot.citizenair_comparison_ircel.Rd
0 → 100644
View file @
8d841000
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/comparisons.R
\name{plot.citizenair_comparison_ircel}
\alias{plot.citizenair_comparison_ircel}
\title{Plot functionality for an object of class \code{citizenair_comparison_ircel} as returned by \code{citizenair_compare}}
\usage{
\method{plot}{citizenair_comparison_ircel}(x, ...)
}
\arguments{
\item{x}{an object of class \code{citizenair_comparison_ircel} as returned by \code{\link{citizenair_compare}}}
\item{...}{further arguments, currently not used yet}
}
\description{
Plot functionality for an object of class \code{citizenair_comparison_ircel} as returned by \code{\link{citizenair_compare}}
}
\examples{
library(ggplot2)
x <- data.frame(
time = rep(seq.Date(from = Sys.Date()-364, to = Sys.Date(), by = "day"), 2),
group = sample(c("official", "citizen"), size = 365*2, replace = TRUE),
value = rnorm(365*2))
comparison <- citizenair_compare(x, reference = "official", sensor = "citizen")
plot(comparison)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment