From e3c0c20253a0f28ba962375b23803bc6d9577fe7 Mon Sep 17 00:00:00 2001 From: "jean-matthieu.monnet" <jean-matthieu.monnet@inrae.fr> Date: Mon, 12 Apr 2021 13:11:28 +0200 Subject: [PATCH] Simplified example in pointList2SPDF (error on solaris) 3.0.3 --- DESCRIPTION | 2 +- R/common.R | 9 +++------ man/pointList2SPDF.Rd | 9 +++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 50e8206..1f90741 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: lidaRtRee Type: Package -Version: 3.0.2 +Version: 3.0.3 Title: Forest Analysis with Airborne Laser Scanning (LiDAR) Data Date: 2021-04-01 Author: Jean-Matthieu Monnet [aut, cre] diff --git a/R/common.R b/R/common.R index 2f123fb..7623aab 100644 --- a/R/common.R +++ b/R/common.R @@ -554,7 +554,7 @@ ellipses4Crown <- function(x, y, n, s, e, w, id=NULL, step=pi/12, angle.offset=0 #' #' @param points.list list of dataframes of xy coordinates. The first and last coordinates in each dataframe must be the same #' @param df data.frame. Optional data.frame to be associated to Spatial Polygons -#' @param ... arguments to be passed to \code{\link[sp]{SpatialPolygons}}, e.g. proj4string info +#' @param ... arguments to be passed to \code{\link[sp]{SpatialPolygons}} #' @return an object of class \link[sp]{SpatialPolygons-class}, or class \link[sp]{SpatialPolygonsDataFrame-class} if input data.frame is specified. #' @examples #' # Compute coordinates of polygons @@ -564,13 +564,10 @@ ellipses4Crown <- function(x, y, n, s, e, w, id=NULL, step=pi/12, angle.offset=0 #' ellipses1 <- pointList2SPDF(ellipses) #' ellipses1 #' # Convert to Spatial object with data.frame -#' ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2), -#' proj4string = sp::CRS(SRS_string = "EPSG:2154")) -#' ellipses2 +#' ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2)) #' #' # draw ellipses -#' sp::plot(ellipses1) -#' sp::plot(ellipses2) +#' sp::plot(ellipses2, col = ellipses2$info) #' @seealso \code{\link{ellipses4Crown}} #' @export pointList2SPDF <- function(points.list, df=NULL, ...) diff --git a/man/pointList2SPDF.Rd b/man/pointList2SPDF.Rd index 395fdd9..6e0271c 100644 --- a/man/pointList2SPDF.Rd +++ b/man/pointList2SPDF.Rd @@ -11,7 +11,7 @@ pointList2SPDF(points.list, df = NULL, ...) \item{df}{data.frame. Optional data.frame to be associated to Spatial Polygons} -\item{...}{arguments to be passed to \code{\link[sp]{SpatialPolygons}}, e.g. proj4string info} +\item{...}{arguments to be passed to \code{\link[sp]{SpatialPolygons}}} } \value{ an object of class \link[sp]{SpatialPolygons-class}, or class \link[sp]{SpatialPolygonsDataFrame-class} if input data.frame is specified. @@ -27,13 +27,10 @@ ellipses <- ellipses4Crown(c(0,10), c(0,10), c(2,2), c(3,4), c(2.5,3), c(2,3), ellipses1 <- pointList2SPDF(ellipses) ellipses1 # Convert to Spatial object with data.frame -ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2), - proj4string = sp::CRS(SRS_string = "EPSG:2154")) -ellipses2 +ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2)) # draw ellipses -sp::plot(ellipses1) -sp::plot(ellipses2) +sp::plot(ellipses2, col = ellipses2$info) } \seealso{ \code{\link{ellipses4Crown}} -- GitLab