spectral.curves.plot {spectralR}R Documentation

Make spectral reflectance curves for defined classes of surface

Description

Make spectral reflectance curves for defined classes of surface

Usage

spectral.curves.plot(data, target_classes = NULL)

Arguments

data

reflectance data as dataframe with pixel values for Sentinel optical bands B2, B3, B4, B5, B6, B7, B8, B8A, B11, B12

target_classes

list of the classes of surface which should be highlighted, others will be turned in gray, as a background. Defaults is NULL.

Value

ggplot2 object with basic visual aesthetics, represents smoother lines with confidence intervals for each surface class. Default aesthetic is smoother curve (geom_smooth). May be time-consuming depending on input dataframe size. See https://ggplot2.tidyverse.org/reference/geom_smooth.html for more details.

Examples

# Load example data
load(system.file("testdata/reflectance_test_data.RData", package = "spectralR"))

# Create a plot
p <- spectral.curves.plot(data = reflectance)

# Customize a plot
p +
  ggplot2::labs(x = 'Wavelength, nm', y = 'Reflectance',
      colour = "Surface classes",
      fill = "Surface classes",
      title = "Spectral reflectance curves for different classes of surface",
      caption = 'Data: Sentinel-2 Level-2A')+
  ggplot2::theme_minimal()

# Highlight only specific target classes
spectral.curves.plot(
  data = reflectance,
  target_classes = list("meadow", "coniferous_forest")
  )


[Package spectralR version 0.1.3 Index]