diff --git a/inst/doc/osem-intro.R b/inst/doc/osem-intro.R index f47779a..e51d194 100644 --- a/inst/doc/osem-intro.R +++ b/inst/doc/osem-intro.R @@ -1,11 +1,13 @@ ## ----setup, include=FALSE------------------------------------------------ knitr::opts_chunk$set(echo = TRUE) -## ------------------------------------------------------------------------ +## ----results = F--------------------------------------------------------- library(magrittr) library(opensensmapr) all_sensors = osem_boxes() + +## ------------------------------------------------------------------------ summary(all_sensors) ## ----message=F, warning=F------------------------------------------------ @@ -22,13 +24,14 @@ str(phenoms) ## ------------------------------------------------------------------------ phenoms[phenoms > 20] -## ------------------------------------------------------------------------ +## ----results = F--------------------------------------------------------- pm25_sensors = osem_boxes( exposure = 'outdoor', date = Sys.time(), # ±4 hours phenomenon = 'PM2.5' ) +## ------------------------------------------------------------------------ summary(pm25_sensors) plot(pm25_sensors) @@ -45,6 +48,7 @@ berlin = st_point(c(13.4034, 52.5120)) %>% st_transform(4326) %>% # the opensensemap expects WGS 84 st_bbox() +## ----results = F--------------------------------------------------------- pm25 = osem_measurements( berlin, phenomenon = 'PM2.5', diff --git a/inst/doc/osem-intro.Rmd b/inst/doc/osem-intro.Rmd index 39590c0..5d6126a 100644 --- a/inst/doc/osem-intro.Rmd +++ b/inst/doc/osem-intro.Rmd @@ -35,11 +35,13 @@ this occurs. Before we look at actual observations, lets get a grasp of the openSenseMap datasets' structure. -```{r} +```{r results = F} library(magrittr) library(opensensmapr) all_sensors = osem_boxes() +``` +```{r} summary(all_sensors) ``` @@ -86,13 +88,14 @@ We should check how many sensor stations provide useful data: We want only those boxes with a PM2.5 sensor, that are placed outdoors and are currently submitting measurements: -```{r} +```{r results = F} pm25_sensors = osem_boxes( exposure = 'outdoor', date = Sys.time(), # ±4 hours phenomenon = 'PM2.5' ) - +``` +```{r} summary(pm25_sensors) plot(pm25_sensors) ``` @@ -117,7 +120,8 @@ berlin = st_point(c(13.4034, 52.5120)) %>% st_buffer(units::set_units(12, km)) %>% st_transform(4326) %>% # the opensensemap expects WGS 84 st_bbox() - +``` +```{r results = F} pm25 = osem_measurements( berlin, phenomenon = 'PM2.5', @@ -136,4 +140,4 @@ pm25_sf = osem_as_sf(pm25) plot(st_geometry(pm25_sf), axes = T) ``` -`TODO` +further analysis: `TODO` diff --git a/inst/doc/osem-intro.html b/inst/doc/osem-intro.html index 25a50a3..f0f4286 100644 --- a/inst/doc/osem-intro.html +++ b/inst/doc/osem-intro.html @@ -91,141 +91,6 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf library(opensensmapr) all_sensors = osem_boxes() -
## 
-Downloading: 4.1 kB     
-Downloading: 4.1 kB     
-Downloading: 4.1 kB     
-Downloading: 4.1 kB     
-Downloading: 8.2 kB     
-Downloading: 8.2 kB     
-Downloading: 8.2 kB     
-Downloading: 8.2 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 16 kB     
-Downloading: 16 kB     
-Downloading: 16 kB     
-Downloading: 16 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 29 kB     
-Downloading: 29 kB     
-Downloading: 29 kB     
-Downloading: 29 kB     
-Downloading: 29 kB     
-Downloading: 29 kB     
-Downloading: 33 kB     
-Downloading: 33 kB     
-Downloading: 33 kB     
-Downloading: 33 kB     
-Downloading: 33 kB     
-Downloading: 33 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 41 kB     
-Downloading: 41 kB     
-Downloading: 42 kB     
-Downloading: 42 kB     
-Downloading: 42 kB     
-Downloading: 42 kB     
-Downloading: 42 kB     
-Downloading: 42 kB     
-Downloading: 46 kB     
-Downloading: 46 kB     
-Downloading: 46 kB     
-Downloading: 46 kB     
-Downloading: 46 kB     
-Downloading: 46 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 64 kB     
-Downloading: 64 kB     
-Downloading: 64 kB     
-Downloading: 64 kB     
-Downloading: 64 kB     
-Downloading: 64 kB     
-Downloading: 68 kB     
-Downloading: 68 kB     
-Downloading: 68 kB     
-Downloading: 68 kB     
-Downloading: 68 kB     
-Downloading: 68 kB     
-Downloading: 72 kB     
-Downloading: 72 kB     
-Downloading: 72 kB     
-Downloading: 72 kB     
-Downloading: 72 kB     
-Downloading: 72 kB     
-Downloading: 76 kB     
-Downloading: 76 kB     
-Downloading: 76 kB     
-Downloading: 76 kB     
-Downloading: 80 kB     
-Downloading: 80 kB     
-Downloading: 80 kB     
-Downloading: 80 kB     
-Downloading: 84 kB     
-Downloading: 84 kB     
-Downloading: 86 kB     
-Downloading: 86 kB     
-Downloading: 86 kB     
-Downloading: 86 kB     
-Downloading: 90 kB     
-Downloading: 90 kB     
-Downloading: 94 kB     
-Downloading: 94 kB     
-Downloading: 94 kB     
-Downloading: 94 kB     
-Downloading: 98 kB     
-Downloading: 98 kB     
-Downloading: 98 kB     
-Downloading: 98 kB     
-Downloading: 98 kB     
-Downloading: 98 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB
summary(all_sensors)
## box total: 701
 ## 
@@ -245,7 +110,7 @@ Downloading: 120 kB
## ## $last_measurement_within ## 1h 1d 30d 365d never -## 313 327 418 554 63 +## 312 327 418 554 63 ## ## oldest box: 2014-05-28 15:36:14 (CALIMERO) ## newest box: 2017-08-23 08:44:14 (Messstation Steinheim am Albuch) @@ -400,35 +265,6 @@ if (!require('rgeos')) date = Sys.time(), # ±4 hours phenomenon = 'PM2.5' ) -
## 
-Downloading: 10 B     
-Downloading: 10 B     
-Downloading: 10 B     
-Downloading: 10 B     
-Downloading: 20 kB     
-Downloading: 20 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 21 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 25 kB     
-Downloading: 30 kB     
-Downloading: 30 kB     
-Downloading: 30 kB     
-Downloading: 30 kB     
-Downloading: 30 kB     
-Downloading: 30 kB     
-Downloading: 34 kB     
-Downloading: 34 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB     
-Downloading: 37 kB
summary(pm25_sensors)
## box total: 236
 ## 
@@ -471,338 +307,21 @@ berlin = st_point(  st_transform(3857) %>% # allow setting a buffer in meters
   st_buffer(units::set_units(12, km)) %>%
   st_transform(4326) %>% # the opensensemap expects WGS 84
-  st_bbox()
-
-pm25 = osem_measurements(
+  st_bbox()
+
pm25 = osem_measurements(
   berlin,
   phenomenon = 'PM2.5',
   from = now() - days(7), # defaults to 2 days
   to = now()
-)
-
## 
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 12 kB     
-Downloading: 16 kB     
-Downloading: 16 kB     
-Downloading: 20 kB     
-Downloading: 20 kB     
-Downloading: 20 kB     
-Downloading: 20 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 50 kB     
-Downloading: 54 kB     
-Downloading: 54 kB     
-Downloading: 54 kB     
-Downloading: 54 kB     
-Downloading: 54 kB     
-Downloading: 54 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 58 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 62 kB     
-Downloading: 66 kB     
-Downloading: 66 kB     
-Downloading: 66 kB     
-Downloading: 66 kB     
-Downloading: 66 kB     
-Downloading: 66 kB     
-Downloading: 70 kB     
-Downloading: 70 kB     
-Downloading: 70 kB     
-Downloading: 70 kB     
-Downloading: 70 kB     
-Downloading: 70 kB     
-Downloading: 75 kB     
-Downloading: 75 kB     
-Downloading: 75 kB     
-Downloading: 75 kB     
-Downloading: 75 kB     
-Downloading: 75 kB     
-Downloading: 79 kB     
-Downloading: 79 kB     
-Downloading: 79 kB     
-Downloading: 79 kB     
-Downloading: 83 kB     
-Downloading: 83 kB     
-Downloading: 83 kB     
-Downloading: 83 kB     
-Downloading: 83 kB     
-Downloading: 83 kB     
-Downloading: 87 kB     
-Downloading: 87 kB     
-Downloading: 87 kB     
-Downloading: 87 kB     
-Downloading: 87 kB     
-Downloading: 87 kB     
-Downloading: 91 kB     
-Downloading: 91 kB     
-Downloading: 91 kB     
-Downloading: 91 kB     
-Downloading: 91 kB     
-Downloading: 91 kB     
-Downloading: 95 kB     
-Downloading: 95 kB     
-Downloading: 95 kB     
-Downloading: 95 kB     
-Downloading: 95 kB     
-Downloading: 95 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 99 kB     
-Downloading: 100 kB     
-Downloading: 100 kB     
-Downloading: 100 kB     
-Downloading: 100 kB     
-Downloading: 100 kB     
-Downloading: 100 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 110 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 120 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 130 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 140 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 150 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 160 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 170 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 180 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 190 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 200 kB     
-Downloading: 210 kB     
-Downloading: 210 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 220 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 230 kB     
-Downloading: 240 kB     
-Downloading: 240 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 250 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 260 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 270 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 280 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 290 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     
-Downloading: 300 kB     2017-08-16T13:39:35Z - 2017-08-23T13:39:35Z
-
plot(pm25)
-

+) + +plot(pm25) +

Now we can get started with actual spatiotemporal data analysis. First plot the measuring locations:

pm25_sf = osem_as_sf(pm25)
 plot(st_geometry(pm25_sf), axes = T)

-

TODO

+

further analysis: TODO

diff --git a/vignettes/osem-intro.Rmd b/vignettes/osem-intro.Rmd index 39590c0..5d6126a 100644 --- a/vignettes/osem-intro.Rmd +++ b/vignettes/osem-intro.Rmd @@ -35,11 +35,13 @@ this occurs. Before we look at actual observations, lets get a grasp of the openSenseMap datasets' structure. -```{r} +```{r results = F} library(magrittr) library(opensensmapr) all_sensors = osem_boxes() +``` +```{r} summary(all_sensors) ``` @@ -86,13 +88,14 @@ We should check how many sensor stations provide useful data: We want only those boxes with a PM2.5 sensor, that are placed outdoors and are currently submitting measurements: -```{r} +```{r results = F} pm25_sensors = osem_boxes( exposure = 'outdoor', date = Sys.time(), # ±4 hours phenomenon = 'PM2.5' ) - +``` +```{r} summary(pm25_sensors) plot(pm25_sensors) ``` @@ -117,7 +120,8 @@ berlin = st_point(c(13.4034, 52.5120)) %>% st_buffer(units::set_units(12, km)) %>% st_transform(4326) %>% # the opensensemap expects WGS 84 st_bbox() - +``` +```{r results = F} pm25 = osem_measurements( berlin, phenomenon = 'PM2.5', @@ -136,4 +140,4 @@ pm25_sf = osem_as_sf(pm25) plot(st_geometry(pm25_sf), axes = T) ``` -`TODO` +further analysis: `TODO`