match_ramet: Value matching for RametIDs

Description Usage Arguments Details Value Author(s)

View source: R/match_ramet.R

Description

'match_ramet' returns a vector of the positions of (first) matches of individual Antspec IDs in in a vector of RametIDs.

Usage

1
match_ramet(input, plantIDs, rametIDs)

Arguments

input

Vector of AntspecIDs for plants you would like to extract for.

plantIDs

Vector of primary genet names.

rametIDs

Vector of RametID strings.

Details

We often have data for a ste of plants from the field, but the Antspec IDs might not match the unique IDs after duplicate genotypes have been filtered. Instead, we get a table with a column "RametID" that gives names of likely duplicates as a string, which is difficult to parse.

'match_ramet' works like the base R function 'match' in that it finds the (first) position of your AntspecIDs in the column of RametIDs.

Note that 'match_ramet' assumes that there are no more than five names in any entry in 'RametIDs'.

Value

And vector of integers giving the position of each element in input in the vector of rametIDs. Use this to subset the Antspec data.table.

Author(s)

Tom Ellis


ellisztamas/snaptools documentation built on May 19, 2020, 2:03 p.m.