Learn R Programming

powdR (version 1.1.0)

subset.powdRlib: Subset a powdRlib object

Description

subset.powdRlib is designed to provide an easy way of subsetting a powdRlib object by defining the phase ID's that the user wishes to either keep or remove.

Usage

# S3 method for powdRlib
subset(x, refs, mode, ...)

Arguments

x

a powdRlib object.

refs

a string of the phase ID's or names of reference patterns to be subset. The ID's or names supplied must be present within the lib$phases$phase_id or lib$phases$phase_name columns.

mode

denotes whether the phase ID's or names defined in the refs argument are retained ("keep") or removed ("remove").

...

other arguments

Value

a powdRlib object.

Examples

Run this code
# NOT RUN {
#Load the minerals library
data(minerals)

minerals_keep <- subset(minerals,
                        refs = c("QUA.1", "QUA.2"),
                        mode = "keep")

minerals_remove <- subset(minerals,
                          refs = c("QUA.1", "QUA.2"),
                          mode = "remove")
# }

Run the code above in your browser using DataLab