Learn R Programming

rtry (version 1.1.0)

rtry_remove_col: Remove columns

Description

This function removes specified columns from the imported data for further processing.

Usage

rtry_remove_col(input, ..., showOverview = TRUE)

Value

An object of the same type as the input data.

Arguments

input

Input data frame or data table.

...

Names of columns to be removed separated by commas. The operator : can be used for selecting a range of consecutive variables.

showOverview

Default TRUE displays the dimension of the remaining data.

References

This function makes use of the select function within the dplyr package.

See Also

rtry_select_col

Examples

Run this code
# Remove certain columns from the provided sample data (data_TRY_15160)
data_rm_col <- rtry_remove_col(data_TRY_15160,
                 LastName, FirstName, DatasetID, Dataset, SpeciesName,
                 OrigUncertaintyStr, UncertaintyName, Replicates,
                 RelUncertaintyPercent, Reference, V28)

# Expected message:
# dim:   1782 17
# col:   AccSpeciesID AccSpeciesName ObservationID ObsDataID TraitID TraitName
#        DataID DataName OriglName OrigValueStr OrigUnitStr ValueKindName
#        StdValue UnitName OrigObsDataID ErrorRisk Comment

Run the code above in your browser using DataLab