Many kelp segments may have only a few pixels ever detected within them, so this function serves to classify these different kelp segments, based on the area that each detected pixel occupies relative to the area of the entire kelp segment.
Usage
get_kelp_presence(
segmented_landsat_data,
kelp_segments_file_path,
...,
no_kelp_bound = 0.02,
ephemeral_kelp_bound = 0.15
)
Arguments
- segmented_landsat_data
A dataframe generated by
segment_landsat_data()
with rows for each pixel, and columns for each quarter and year of the landsat data, with the assigned segment from a given shapefile- kelp_segments_file_path
character string path to the kelp segments shapefile. Must contain a Segment_ID attribute and use the WGS 84 coordinate reference system (EPSG:4326)
- ...
These dots are for future extensions and must be empty.
- no_kelp_bound
Upper bound, in percent of segment area, for the "No Historical Kelp" category. Default is 0.02
- ephemeral_kelp_bound
Upper bound, in percentage of segment area, for the "Ephemeral Kelp" category. Default is 0.15
Value
A dataframe with the following columns:
Segment_ID
: The ID of the kelp area segmentsegment_area
: The area in km2 of the kelp segmentpixel_percent
: The percentage of the kelp segment's area that the total number of pixels ever detected occupy. This calculation assumes each pixel contains the full 900 m2 of kelp areapresence
: The category of kelp presence for each segment."No Historical Kelp":
pixel_percent
<=no_kelp_bound
ORpixel_percent
isNA
"Ephemeral Kelp":
pixel_percent
<=ephemeral_kelp_bound
"Kelp": otherwise