Browse Source

hello CRAN :^|

i'm all in for quality control, but some of these checks are just ridiculous..
rejecting a package b/c of typos auto-checked against an aspell dict - in a text
read by ~1% of users?? and the only workaround (whitelisting words) is not
documented, and TOTALLY overengineered?!?
going for the tech elitism awards, huh
/rant

but hey, we're on board of that train now! :}
tags/v0.4.0
noerw 1 year ago
parent
commit
4f95ae19a8
11 changed files with 93 additions and 75 deletions
  1. 4
    0
      .aspell/defaults.R
  2. BIN
      .aspell/opensensmapr.rds
  3. 6
    5
      DESCRIPTION
  4. 8
    7
      R/box.R
  5. 20
    17
      R/measurement.R
  6. 4
    3
      R/phenomena.R
  7. 16
    13
      README.md
  8. 1
    1
      man/opensensmapr.Rd
  9. 8
    7
      man/osem_boxes.Rd
  10. 22
    19
      man/osem_measurements.Rd
  11. 4
    3
      man/osem_phenomena.Rd

+ 4
- 0
.aspell/defaults.R View File

@@ -0,0 +1,4 @@
1
+Rd_files <- vignettes <- R_files <- description <-
2
+  list(encoding = "UTF-8",
3
+    language = "en",
4
+    dictionaries = c("en_stats", "opensensmapr"))

BIN
.aspell/opensensmapr.rds View File


+ 6
- 5
DESCRIPTION View File

@@ -1,6 +1,6 @@
1 1
 Package: opensensmapr
2 2
 Type: Package
3
-Title: Work with Sensor Data from Opensensemap.org in R
3
+Title: Client for the data API of openSenseMap.org
4 4
 Version: 0.3.3
5 5
 URL: http://github.com/noerw/opensensmapR
6 6
 BugReports: http://github.com/noerw/opensensmapR/issues
@@ -23,12 +23,13 @@ Suggests:
23 23
     covr
24 24
 Authors@R: c(person("Norwin", "Roosen", role = c("aut", "cre"), email = "hello@nroo.de"),
25 25
     person("Daniel", "Nuest", role = c("ctb"), email = "daniel.nuest@uni-muenster.de", comment = c(ORCID = "0000-0003-2392-6140")))
26
-Description: Download data (environmental measurements, sensorstations) from the
27
-    API of open data sensor web platform 'opensensemap.org' for analysis in R.
28
-    This platform provides realtime data of more than 1500 low-cost sensor
26
+Description: Download environmental measurements and sensor station metadata
27
+    from the API of open data sensor web platform <https://opensensemap.org> for
28
+    analysis in R.
29
+    This platform provides real time data of more than 1500 low-cost sensor
29 30
     stations for PM10, PM2.5, temperature, humidity, UV-A intensity and more
30 31
     phenomena.
31
-    The package aims to be compatible with sf and the tidyverse, and provides
32
+    The package aims to be compatible with 'sf' and the 'Tidyverse', and provides
32 33
     several helper functions for data exploration and transformation.
33 34
 License: GPL (>= 2) | file LICENSE
34 35
 Encoding: UTF-8

+ 8
- 7
R/box.R View File

@@ -27,15 +27,16 @@
27 27
 #' @seealso \code{\link{osem_box}}
28 28
 #' @export
29 29
 #' @examples
30
-#' # get *all* boxes available on the API
31
-#' b = osem_boxes()
30
+#' \donttest{
31
+#'   # get *all* boxes available on the API
32
+#'   b = osem_boxes()
32 33
 #'
33
-#' # get all boxes with grouptag 'ifgi' that are placed outdoors
34
-#' b = osem_boxes(grouptag = 'ifgi', exposure = 'outdoor')
35
-#'
36
-#' # get all boxes that have measured PM2.5 in the last 4 hours
37
-#' b = osem_boxes(date = Sys.time(), phenomenon = 'PM2.5')
34
+#'   # get all boxes with grouptag 'ifgi' that are placed outdoors
35
+#'   b = osem_boxes(grouptag = 'ifgi', exposure = 'outdoor')
38 36
 #'
37
+#'   # get all boxes that have measured PM2.5 in the last 4 hours
38
+#'   b = osem_boxes(date = Sys.time(), phenomenon = 'PM2.5')
39
+#' }
39 40
 osem_boxes = function (exposure = NA, model = NA, grouptag = NA,
40 41
                       date = NA, from = NA, to = NA, phenomenon = NA,
41 42
                       endpoint = osem_endpoint(),

+ 20
- 17
R/measurement.R View File

@@ -35,9 +35,10 @@ osem_measurements = function (x, ...) UseMethod('osem_measurements')
35 35
 #' @describeIn osem_measurements Get measurements from \strong{all} senseBoxes.
36 36
 #' @export
37 37
 #' @examples
38
-#' # get measurements from all boxes
39
-#' m1 = osem_measurements('Windrichtung')
40
-#'
38
+#' \donttest{
39
+#'   # get measurements from all boxes
40
+#'   m1 = osem_measurements('Windrichtung')
41
+#' }
41 42
 osem_measurements.default = function (x, ...) {
42 43
   bbox = structure(c(-180, -90, 180, 90), class = 'bbox')
43 44
   osem_measurements(bbox, x, ...)
@@ -48,14 +49,15 @@ osem_measurements.default = function (x, ...) {
48 49
 #' @describeIn osem_measurements Get measurements by a spatial filter.
49 50
 #' @export
50 51
 #' @examples
51
-#' # get measurements from sensors within a bounding box
52
-#' bbox = structure(c(7, 51, 8, 52), class = 'bbox')
53
-#' m2 = osem_measurements(bbox, 'Temperatur')
54
-#'
55
-#' points = sf::st_multipoint(matrix(c(7.5, 7.8, 51.7, 52), 2, 2))
56
-#' bbox2 = sf::st_bbox(points)
57
-#' m3 = osem_measurements(bbox2, 'Temperatur', exposure = 'outdoor')
52
+#' \donttest{
53
+#'   # get measurements from sensors within a bounding box
54
+#'   bbox = structure(c(7, 51, 8, 52), class = 'bbox')
55
+#'   m2 = osem_measurements(bbox, 'Temperatur')
58 56
 #'
57
+#'   points = sf::st_multipoint(matrix(c(7.5, 7.8, 51.7, 52), 2, 2))
58
+#'   bbox2 = sf::st_bbox(points)
59
+#'   m3 = osem_measurements(bbox2, 'Temperatur', exposure = 'outdoor')
60
+#' }
59 61
 osem_measurements.bbox = function (x, phenomenon, exposure = NA,
60 62
                                    from = NA, to = NA, columns = NA,
61 63
                                    ...,
@@ -73,14 +75,15 @@ osem_measurements.bbox = function (x, phenomenon, exposure = NA,
73 75
 #' @describeIn osem_measurements Get measurements from a set of senseBoxes.
74 76
 #' @export
75 77
 #' @examples
76
-#' # get measurements from a set of boxes
77
-#' b = osem_boxes(grouptag = 'ifgi')
78
-#' m4 = osem_measurements(b, phenomenon = 'Temperatur')
79
-#'
80
-#' # ...or a single box
81
-#' b = osem_box('57000b8745fd40c8196ad04c')
82
-#' m5 = osem_measurements(b, phenomenon = 'Temperatur')
78
+#' \donttest{
79
+#'   # get measurements from a set of boxes
80
+#'   b = osem_boxes(grouptag = 'ifgi')
81
+#'   m4 = osem_measurements(b, phenomenon = 'Temperatur')
83 82
 #'
83
+#'   # ...or a single box
84
+#'   b = osem_box('57000b8745fd40c8196ad04c')
85
+#'   m5 = osem_measurements(b, phenomenon = 'Temperatur')
86
+#' }
84 87
 osem_measurements.sensebox = function (x, phenomenon, exposure = NA,
85 88
                                        from = NA, to = NA, columns = NA,
86 89
                                        ...,

+ 4
- 3
R/phenomena.R View File

@@ -24,9 +24,10 @@ osem_phenomena = function (boxes) UseMethod('osem_phenomena')
24 24
 #' )
25 25
 #'
26 26
 #' # get phenomena with at least 30 sensors on opensensemap
27
-#' phenoms = osem_phenomena(osem_boxes())
28
-#' names(phenoms[phenoms > 29])
29
-#'
27
+#' \donttest{
28
+#'   phenoms = osem_phenomena(osem_boxes())
29
+#'   names(phenoms[phenoms > 29])
30
+#' }
30 31
 osem_phenomena.sensebox = function (boxes) {
31 32
   p = Reduce(`c`, boxes$phenomena) %>% # get all the row contents in a single vector
32 33
     table() %>%                    # get count for each phenomenon

+ 16
- 13
README.md View File

@@ -7,18 +7,26 @@ The package aims to be compatible with sf and the tidyverse.
7 7
 
8 8
 ## Installation
9 9
 
10
-Right now, the package is not on CRAN. To install it from GitHub, run:
10
+The package is available on CRAN, install it via
11
+
12
+```r
13
+install.packages('opensensmapr')
14
+```
15
+
16
+To install the veryy latest from GitHub, run:
11 17
 
12 18
 ```r
13 19
 install.packages('devtools')
14
-devtools::install_github('noerw/opensensmapr')
20
+devtools::install_github('noerw/opensensmapr@master')      # latest stable version
21
+devtools::install_github('noerw/opensensmapr@development') # bleeding edge version
15 22
 ```
16 23
 
17 24
 ## Usage
18 25
 
19
-A verbose usage example is shown in the vignette [`osem-intro`](https://noerw.github.com/opensensmapR/inst/doc/osem-intro.html).
20
-Each functions documentation can be viewed with `?<function-name>`.
26
+Each function's documentation can be viewed with `?<function-name>`.
21 27
 An overview is given in `?opensensmapr`.
28
+A verbose usage example is shown in the vignette [`osem-intro`](https://noerw.github.com/opensensmapR/inst/doc/osem-intro.html).
29
+
22 30
 In short, the following pseudocode shows the main functions for data retrieval:
23 31
 
24 32
 ```r
@@ -46,16 +54,11 @@ Additionally there are some helpers: `summary.sensebox(), plot.sensebox(), st_as
46 54
 
47 55
 This project adheres to semantic versioning, for changes in recent versions please consult [CHANGES.md](CHANGES.md).
48 56
 
49
-## FAQ
50
-
51
-- *Whats up with that package name?* idk, the R people seem to [enjoy][1] [dropping][2] [vovels][3] so..
52
-Unfortunately I couldn't fit the naming convention to drop an `y` in there.
53
-
54
-[1]: https://github.com/tidyverse/readr
55
-[2]: https://github.com/tidyverse/dplyr
56
-[3]: https://github.com/tidyverse/tidyr
57
+## Contributing & Development
57 58
 
58
-## Development
59
+Contributions are very welcome!
60
+When submitting a patch, please follow the existing [code style](.lintr),
61
+and run `R CMD check --no-vignettes .` on the package.
59 62
 
60 63
 Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md).
61 64
 By participating in this project you agree to abide by its terms.

+ 1
- 1
man/opensensmapr.Rd View File

@@ -92,7 +92,7 @@ openSenseMap API: \url{https://api.opensensemap.org/}
92 92
 official openSenseMap API documentation: \url{https://docs.opensensemap.org/}
93 93
 }
94 94
 \author{
95
-\strong{Maintainer}: Norwin Roosen \email{bugs@nroo.de}
95
+\strong{Maintainer}: Norwin Roosen \email{hello@nroo.de}
96 96
 
97 97
 Other contributors:
98 98
 \itemize{

+ 8
- 7
man/osem_boxes.Rd View File

@@ -41,15 +41,16 @@ Note that some filters do not work together:
41 41
 }
42 42
 }
43 43
 \examples{
44
-# get *all* boxes available on the API
45
-b = osem_boxes()
44
+\donttest{
45
+  # get *all* boxes available on the API
46
+  b = osem_boxes()
46 47
 
47
-# get all boxes with grouptag 'ifgi' that are placed outdoors
48
-b = osem_boxes(grouptag = 'ifgi', exposure = 'outdoor')
49
-
50
-# get all boxes that have measured PM2.5 in the last 4 hours
51
-b = osem_boxes(date = Sys.time(), phenomenon = 'PM2.5')
48
+  # get all boxes with grouptag 'ifgi' that are placed outdoors
49
+  b = osem_boxes(grouptag = 'ifgi', exposure = 'outdoor')
52 50
 
51
+  # get all boxes that have measured PM2.5 in the last 4 hours
52
+  b = osem_boxes(date = Sys.time(), phenomenon = 'PM2.5')
53
+}
53 54
 }
54 55
 \seealso{
55 56
 \href{https://docs.opensensemap.org/#api-Measurements-findAllBoxes}{openSenseMap API documentation (web)}

+ 22
- 19
man/osem_measurements.Rd View File

@@ -62,25 +62,28 @@ a bounding box spanning the whole world.
62 62
 }}
63 63
 
64 64
 \examples{
65
-# get measurements from all boxes
66
-m1 = osem_measurements('Windrichtung')
67
-
68
-# get measurements from sensors within a bounding box
69
-bbox = structure(c(7, 51, 8, 52), class = 'bbox')
70
-m2 = osem_measurements(bbox, 'Temperatur')
71
-
72
-points = sf::st_multipoint(matrix(c(7.5, 7.8, 51.7, 52), 2, 2))
73
-bbox2 = sf::st_bbox(points)
74
-m3 = osem_measurements(bbox2, 'Temperatur', exposure = 'outdoor')
75
-
76
-# get measurements from a set of boxes
77
-b = osem_boxes(grouptag = 'ifgi')
78
-m4 = osem_measurements(b, phenomenon = 'Temperatur')
79
-
80
-# ...or a single box
81
-b = osem_box('57000b8745fd40c8196ad04c')
82
-m5 = osem_measurements(b, phenomenon = 'Temperatur')
83
-
65
+\donttest{
66
+  # get measurements from all boxes
67
+  m1 = osem_measurements('Windrichtung')
68
+}
69
+\donttest{
70
+  # get measurements from sensors within a bounding box
71
+  bbox = structure(c(7, 51, 8, 52), class = 'bbox')
72
+  m2 = osem_measurements(bbox, 'Temperatur')
73
+
74
+  points = sf::st_multipoint(matrix(c(7.5, 7.8, 51.7, 52), 2, 2))
75
+  bbox2 = sf::st_bbox(points)
76
+  m3 = osem_measurements(bbox2, 'Temperatur', exposure = 'outdoor')
77
+}
78
+\donttest{
79
+  # get measurements from a set of boxes
80
+  b = osem_boxes(grouptag = 'ifgi')
81
+  m4 = osem_measurements(b, phenomenon = 'Temperatur')
82
+
83
+  # ...or a single box
84
+  b = osem_box('57000b8745fd40c8196ad04c')
85
+  m5 = osem_measurements(b, phenomenon = 'Temperatur')
86
+}
84 87
 }
85 88
 \seealso{
86 89
 \href{https://docs.opensensemap.org/#api-Measurements-getDataMulti}{openSenseMap API documentation (web)}

+ 4
- 3
man/osem_phenomena.Rd View File

@@ -35,9 +35,10 @@ osem_phenomena(
35 35
 )
36 36
 
37 37
 # get phenomena with at least 30 sensors on opensensemap
38
-phenoms = osem_phenomena(osem_boxes())
39
-names(phenoms[phenoms > 29])
40
-
38
+\donttest{
39
+  phenoms = osem_phenomena(osem_boxes())
40
+  names(phenoms[phenoms > 29])
41
+}
41 42
 }
42 43
 \seealso{
43 44
 \code{\link{osem_boxes}}

Loading…
Cancel
Save