rtry_select_row {rtry}R Documentation

Select rows

Description

This function selects rows based on specified criteria and the corresponding ObservationID from the imported data for further processing.

Usage

rtry_select_row(
  input,
  ...,
  getAncillary = FALSE,
  rmDuplicates = FALSE,
  showOverview = TRUE
)

Arguments

input

Input data frame or data table.

...

Criteria for row selection.

getAncillary

Default FALSE, set to TRUE selects all ancillary data based on the row selection criteria.

rmDuplicates

Default FALSE, set to TRUE calls the function rtry_remove_dup.

showOverview

Default TRUE displays the dimension of the data after row selection.

Value

An object of the same type as the input data.

Note

This function by default filters data based on the unique identifier ObservationID listed in the TRY data, therefore, if the column ObservationID has been removed, this function will not work.

References

This function makes use of the unique and subset functions within the base package. It also uses the function rtry_remove_dup.

Examples

# Within the provided sample data (data_TRY_15160) select the georeferenced traits
# records together with records for Latitude and Longitude (DataID 59 and 60) and
# exclude duplicate trait records
data_selected <- rtry_select_row(data_TRY_15160,
                   (TraitID > 0) | (DataID %in% c(59, 60)),
                   getAncillary = TRUE,
                   rmDuplicates = TRUE)

# Expected message:
# 45 duplicates removed.
# dim:   1737 28

[Package rtry version 1.1.0 Index]