mapping_check: Check tree mapping data

View source: R/mapping_check.R

mapping_checkR Documentation

Check tree mapping data

Description

Checks a tree mapping dataset for missing data and formatting that could lead to errors when applying other functions in this package. Outputs a table of the trees with data issues and a table summarizing the number of trees in the mapping dataset that have data issues.

Usage

mapping_check(map_data, max_x, max_y)

Arguments

map_data

Data frame containing tree mapping data. Should contain the columns tree_id, stand_id, species, x_coord, and y_coord. Any additional columns will be ignored by this function.

max_x

Maximum expected x coordinate (i.e. should be 100 if the stands are 100 x 100 m).

max_y

Maximum expected y coordinate.

Details

The data issues checked for are: presence of required columns, duplicated tree ids, missing x or y coordinates, x or y coordinates outside the expected range, missing stand id or species information. This function does not check for misspelled stand ids or species, which should be checked independently.

Value

A list containing two elements:

  • problem_trees is a data frame containing the rows of map_data that contain data issues. An additional column describes the identified issue

  • issue_summary is a data frame that shows the number and percentage of trees with at least one issue and with each of the specific issues

Examples

map_check_test <- mapping_check(messy_mapping, 100, 100)

sgraham9319/ForestPlotR documentation built on April 15, 2022, 4:01 p.m.