lidR (version 1.1.0)

plot.lasmetrics: Plot an object of class lasmetrics in 2D

Description

This functions implements a plot method for a lasmetrics data.frame

Usage

# S3 method for lasmetrics
plot(x, z = NULL, colorPalette = height.colors(50),
  ...)

Arguments

x

A data.frame or data.table of class lasmetrics.

z

character. The field to plot. If NULL, autodetect.

colorPalette

characters. a list of colors such as that generated by heat.colors, topo.colors, terrain.colors or similar functions. Default is height.colors(50) provided by the package lidR

Supplementary parameters for plot

Details

The … param provides additional arguments to plot.

See Also

grid_metrics grid_canopy height.colors forest.colors heat.colors colorRampPalette

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)

# Canopy surface model with 4 m^2 cells
grid_canopy(lidar) %>% plot

# Mean height with 400 m^2 cells
grid_metrics(lidar, mean(Z)) %>% plot

# Define your own metric function
myMetrics = function(z, i, angle, pulseID)
{
  ret = list(
        npulse  = length(unique(pulseID)),
        hmean   = mean(z),
        hmax    = max(z),
        imean   = mean(i),
        angle   = mean(abs(angle))
        )

   return(ret)
 }

metrics = grid_metrics(lidar, myMetrics(Z, Intensity, ScanAngle, pulseID))

plot(metrics, "hmean")
plot(metrics, "hmax")
plot(metrics, "imean")
# }

Run the code above in your browser using DataLab