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:
parent
1732084856
commit
19351bd487
3 changed files with 0 additions and 17 deletions
|
@ -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…
Add table
Reference in a new issue