Learn R Programming

sits (version 1.12.0)

sits_relabel: Relabels a sits tibble

Description

Given a sits tibble with a set of labels, and a conversion list between the original labels and new labels, returns a new sits tibble whose labels are changed.

Usage

sits_relabel(data.tb, conv.lst = list())

Arguments

data.tb

A sits tibble.

conv.lst

A named list used to convert labels to a new value. Actual labels must be the names of the conv.lst elements. an empty list produces no difference.

Value

A new sits tibble with modified labels.

Examples

Run this code
# NOT RUN {
# Read a set of time series with information on deforestation
data(prodes_226_064)
# Print the labels
sits_labels(prodes_226_064)
# Create a conversion list.
# Three classes will be converted to "NonForest".
conv.lst = list(Deforestation_2014 = "NonForest",
                Deforestation_2015 = "NonForest",
                Pasture = "NonForest")
# relabel the data
new_data.tb <- sits_relabel(prodes_226_064, conv.lst)
# show the new labels
sits_labels(new_data.tb)
# }

Run the code above in your browser using DataLab