check_ids | R Documentation |
This function pads all short ids with leading zeros, then compares the animal
ids in your data file to those in an index file. Any ids matched to a species
with a value in the omit_animal
argument will be omitted from the data
set.
check_ids(r, ids, omit = c("wand", "error"), id_length = 10, bird_ids)
r |
Data frame. A data frame of read data, with at least column
|
ids |
Character or Data frame. Either the name and location of a
.csv file containing the animal id index or a data frame of the animal id
index. In either case, the data must contain two columns: |
omit |
Character vector. All the values of |
id_length |
Numeric. How many characters are expected in each id? This will test to make sure all ids are the right length (i.e. make sure leading zeros haven't been omitted). NA skips this test. |
bird_ids |
Deprecated. |
This is useful for removing ids you know are errors (e.g., 0000000000
)
or which you know are wands.
A data frame without the specified animal ids. Messages are printed to inform the user of matching or non-matching animal ids.
## Not run: r <- check_ids(finches, ids = "animal_index.csv") index <- read.csv("animal_index.csv") r <- check_ids(finches, ids = index) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.