dont install packages within functions or vignette

master
jan 1 year ago
parent 1732084856
commit 19351bd487

@ -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() %>%

@ -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)
```

@ -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)
```

Loading…
Cancel
Save