Commit e3c0c202 authored by Monnet Jean-Matthieu's avatar Monnet Jean-Matthieu
Browse files

Simplified example in pointList2SPDF (error on solaris)

3.0.3
No related merge requests found
Showing with 7 additions and 13 deletions
+7 -13
Package: lidaRtRee Package: lidaRtRee
Type: Package Type: Package
Version: 3.0.2 Version: 3.0.3
Title: Forest Analysis with Airborne Laser Scanning (LiDAR) Data Title: Forest Analysis with Airborne Laser Scanning (LiDAR) Data
Date: 2021-04-01 Date: 2021-04-01
Author: Jean-Matthieu Monnet [aut, cre] Author: Jean-Matthieu Monnet [aut, cre]
......
...@@ -554,7 +554,7 @@ ellipses4Crown <- function(x, y, n, s, e, w, id=NULL, step=pi/12, angle.offset=0 ...@@ -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 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 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. #' @return an object of class \link[sp]{SpatialPolygons-class}, or class \link[sp]{SpatialPolygonsDataFrame-class} if input data.frame is specified.
#' @examples #' @examples
#' # Compute coordinates of polygons #' # Compute coordinates of polygons
...@@ -564,13 +564,10 @@ ellipses4Crown <- function(x, y, n, s, e, w, id=NULL, step=pi/12, angle.offset=0 ...@@ -564,13 +564,10 @@ ellipses4Crown <- function(x, y, n, s, e, w, id=NULL, step=pi/12, angle.offset=0
#' ellipses1 <- pointList2SPDF(ellipses) #' ellipses1 <- pointList2SPDF(ellipses)
#' ellipses1 #' ellipses1
#' # Convert to Spatial object with data.frame #' # Convert to Spatial object with data.frame
#' ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2), #' ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2))
#' proj4string = sp::CRS(SRS_string = "EPSG:2154"))
#' ellipses2
#' #'
#' # draw ellipses #' # draw ellipses
#' sp::plot(ellipses1) #' sp::plot(ellipses2, col = ellipses2$info)
#' sp::plot(ellipses2)
#' @seealso \code{\link{ellipses4Crown}} #' @seealso \code{\link{ellipses4Crown}}
#' @export #' @export
pointList2SPDF <- function(points.list, df=NULL, ...) pointList2SPDF <- function(points.list, df=NULL, ...)
......
...@@ -11,7 +11,7 @@ pointList2SPDF(points.list, df = NULL, ...) ...@@ -11,7 +11,7 @@ pointList2SPDF(points.list, df = NULL, ...)
\item{df}{data.frame. Optional data.frame to be associated to Spatial Polygons} \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{ \value{
an object of class \link[sp]{SpatialPolygons-class}, or class \link[sp]{SpatialPolygonsDataFrame-class} if input data.frame is specified. 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), ...@@ -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 <- pointList2SPDF(ellipses)
ellipses1 ellipses1
# Convert to Spatial object with data.frame # Convert to Spatial object with data.frame
ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2), ellipses2 <- pointList2SPDF(ellipses, df=data.frame(info=1:2))
proj4string = sp::CRS(SRS_string = "EPSG:2154"))
ellipses2
# draw ellipses # draw ellipses
sp::plot(ellipses1) sp::plot(ellipses2, col = ellipses2$info)
sp::plot(ellipses2)
} }
\seealso{ \seealso{
\code{\link{ellipses4Crown}} \code{\link{ellipses4Crown}}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment