Skip to content

Commit e11bee5

Browse files
committed
modify gridlines example; #117
* also passes if _R_CHECK_DEPENDS_ONLY_=true;
1 parent 684edc9 commit e11bee5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

man/gridlines.Rd

+8-2
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,22 @@ on its coordinates, and takes care of attributes \code{pos}, \code{labels},
6060

6161
\seealso{ \link[rgdal:spTransform-methods]{spTransform}; llgridlines in \code{rgdal} (recent versions) for plotting long-lat grid over projected data }
6262
\examples{
63+
64+
run <- FALSE
65+
if (get("evolution_status", envir=sp:::.spOptions) != 1L) run <- TRUE
66+
if (get("evolution_status", envir=sp:::.spOptions) == 2L && requireNamespace("sf", quietly=TRUE)) run <- TRUE
67+
if (get("evolution_status", envir=sp:::.spOptions) == 0L && requireNamespace("rgdal", quietly=TRUE)) run <- TRUE
68+
6369
data(meuse)
6470
coordinates(meuse) = ~x+y
6571
plot(meuse)
6672
plot(gridlines(meuse), add = TRUE)
6773
text(labels(gridlines(meuse)))
6874
title("default gridlines within Meuse bounding box")
6975

76+
if (run && require(rgdal, quietly = TRUE)) {
7077
proj4string(meuse) <- CRS("+init=epsg:28992")
7178
crs.longlat <- CRS("+init=epsg:4326")
72-
if (require(rgdal, quietly=TRUE)) {
7379
meuse_ll <- spTransform(meuse, crs.longlat)
7480
grd <- gridlines(meuse_ll)
7581
grd_x <- spTransform(grd, CRS("+init=epsg:28992"))
@@ -121,6 +127,6 @@ title("grid line labels on polar projection, epsg 3031")
121127
\dontrun{
122128
if (require(maps)) demo(polar) # adds the map of the antarctic
123129
}
124-
}
125130

131+
}
126132
\keyword{spatial}

0 commit comments

Comments
 (0)