1
0
Fork 0
mirror of https://github.com/sensebox/opensensmapr synced 2025-03-11 03:30:27 +01:00

dont install packages within functions or vignette

This commit is contained in:
jan 2023-03-06 16:44:19 +01:00
parent 1732084856
commit 19351bd487
3 changed files with 0 additions and 17 deletions

View file

@ -1,14 +1,5 @@
#' @export
plot.sensebox = function (x, ..., mar = c(2, 2, 1, 1)) {
if (
!requireNamespace('sf', quietly = TRUE) ||
!requireNamespace('maps', quietly = TRUE) ||
!requireNamespace('maptools', quietly = TRUE) ||
!requireNamespace('rgeos', quietly = TRUE)
) {
stop('this functions requires additional packages. install them with
install.packages(c("sf", "maps", "maptools", "rgeos"))')
}
geom = x %>%
sf::st_as_sf() %>%

View file

@ -67,10 +67,6 @@ Another feature of interest is the spatial distribution of the boxes: `plot()`
can help us out here. This function requires a bunch of optional dependencies though.
```{r, message=FALSE, warning=FALSE}
if (!require('maps')) install.packages('maps')
if (!require('maptools')) install.packages('maptools')
if (!require('rgeos')) install.packages('rgeos')
plot(boxes)
```

View file

@ -49,10 +49,6 @@ Another feature of interest is the spatial distribution of the boxes: `plot()`
can help us out here. This function requires a bunch of optional dependencies though.
```{r, message=FALSE, warning=FALSE}
if (!require('maps')) install.packages('maps')
if (!require('maptools')) install.packages('maptools')
if (!require('rgeos')) install.packages('rgeos')
plot(all_sensors)
```