lucC_plot_frequency_events: Plot Frequency Polygon

Description Usage Arguments Value Author(s) Examples

View source: R/lucC_plot_results.R

Description

Plot frequency line over time

Usage

1
2
3
4
lucC_plot_frequency_events (data_mtx = NULL, data_frequency = NULL,
custom_palette = FALSE, RGB_color = NULL, pixel_resolution = 250,
relabel = FALSE, original_labels = NULL, new_labels = NULL,
legend_text = "Legend:", column_legend = 2)

Arguments

data_mtx

Matrix. A matrix with values obtained from predicates RECUR, EVOLVE, CONVERT or HOLDS

data_frequency

Dataframe. A frequency table of a categorical variable from a data set

custom_palette

Boolean. A TRUE or FALSE value. If TRUE, user will provide its own color palette setting! Default is FALSE

RGB_color

Character. A vector with color names to map legend, for example, c("Green","Blue"). Default is setting scale_colour_hue

pixel_resolution

Numeric. Is a spatial resolution of the pixel. Default is 250 meters considering MODIS 250 m. See more at https://modis.gsfc.nasa.gov/about/specifications.php.

relabel

Boolean. A TRUE or FALSE value. If TRUE, user will provide its own legend text setting! Default is FALSE

original_labels

Character. A vector with original labels from legend text, for example, c("Forest","Pasture").

new_labels

Character. A vector with new labels to legend text, for example, c("Mature_Forest","Pasture1").

legend_text

Character. A text legend to show in plot. Default is "Legend:".

column_legend

Integer. A number with the desired number of columns in legend.

Value

Plot a frequency polygon in Y axis in square kilometers (Area km^2) = (Number of pixel *(pixel_resolution*pixel_resolution))/(1000*1000)

Author(s)

Adeline M. Maciel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
library(lucCalculus)

file <- c(system.file("extdata/raster/rasterSample.tif", package = "lucCalculus"))
rb_class <- raster::brick(file)
my_label <- c("Degradation", "Fallow_Cotton", "Forest", "Pasture", "Soy_Corn", "Soy_Cotton",
              "Soy_Fallow", "Soy_Millet", "Soy_Sunflower", "Sugarcane", "Urban_Area", "Water")
my_timeline <- c("2001-09-01", "2002-09-01", "2003-09-01", "2004-09-01", "2005-09-01",
                 "2006-09-01", "2007-09-01", "2008-09-01", "2009-09-01", "2010-09-01",
                 "2011-09-01", "2012-09-01", "2013-09-01", "2014-09-01", "2015-09-01",
                 "2016-09-01")

a <- lucC_pred_holds(raster_obj = rb_class, raster_class = c("Pasture"),
                     time_interval = c("2007-09-01","2010-09-01"),
                     relation_interval = "contains", label = my_label,
                     timeline = my_timeline)

lucC_plot_frequency_events(data_mtx = a, custom_palette = TRUE,
                           RGB_color = c("#929e6e"), pixel_resolution = 232,
                           legend_text = "Legend: ")


## End(Not run)

ammaciel/lucCalculus documentation built on June 13, 2020, 4:57 a.m.