r-lidar / lidR

Airborne LiDAR data manipulation and visualisation for forestry application
https://CRAN.R-project.org/package=lidR
GNU General Public License v3.0
587 stars 132 forks source link

Las Plot Error #660

Closed Johanson20 closed 1 year ago

Johanson20 commented 1 year ago

Hi, I tried plotting my las files with colorPalletes which threw this error:

"Error in args$colorPalette == "auto" : 
  comparison (==) is possible only for atomic and list types"

The code I used is the same as the documentation and attached below for reproducibility of the error. All but the last line for plotting worked:

LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
poi <- "-drop_z_below 0 -inside 481280 3812940 481320 3812980"
las <- readLAS(LASfile, select = "xyz", filter = poi)
col <- pastel.colors(250)

chm <- rasterize_canopy(las, res = 0.5, p2r(0.3), pkg = "raster")
ker <- matrix(1,3,3)
chm <- raster::focal(chm, w = ker, fun = mean, na.rm = TRUE)
las <- segment_trees(las, watershed(chm))

plot(las, color = "treeID", colorPalette = col)
Jean-Romain commented 1 year ago

Your example is working but you have a message

The argument 'coloPalette' is deprecated. Use 'pal' instead