diff --git a/DESCRIPTION b/DESCRIPTION index 50e8206e4beacfbc1a54728caeacfd3991a7b364..1f907418188c5d6e4b5733ef326db695d739f61b 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 2f123fb70fdb450a1f74c7f338e386238e7c102f..7623aab9cbd9f5d4949e611f364d67ca947e4c30 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 395fdd9ba3f300b9dc3f1d1b8f1bf0ac6ae78da5..6e0271cb0291d3c2bfc7d7c0db426fca29f3841d 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}}