find_xref | R Documentation |
Find an xref of a record given a set of search terms
find_xref( gedcom, search_patterns, mode = "strict", multiple = FALSE, ignore_case = FALSE )
gedcom |
A tidyged object. |
search_patterns |
A named vector of terms to search for (see Details). |
mode |
Whether to only return an xref if all patterns are matched ("strict"). A value of
"best" will return the xref with the most matches. If either of these still result in more than
one xref it will return an error unless |
multiple |
If more than one xref is found (according to |
ignore_case |
Should case differences be ignored in the match? |
This is a helper function to identify the xref of a record given information such
as a name or reference number. You provide a named search_patterns
vector of namespaced tag-pattern pairs,
such as:
c(INDI.NAME = "Homer", INDI.SEX = "M", INDI.BIRT.DATE = "JAN 1974")
If you're not sure what namespace to use, use the mutate_tag_namespace
function.
The search patterns will be treated as regular expressions, so they will match a value if it contains
the pattern provided. You can anchor your search pattern if you want an exact match, e.g. "^JAN 1974$".
If you're not familiar with regular expressions, you may need to escape certain characters such as
brackets and a full-stop/period (i.e. \\.
).
A vector of one or more xrefs.
find_xref(sample555, c(INDI.BURI.PLAC = "Spring Hill"), multiple = FALSE) find_xref(sample555, c(INDI.SEX = "M"), multiple = TRUE) find_xref(sample555, c(FAM.MARR.DATE = "1859"), multiple = FALSE) find_xref(sample555, c(REPO.ADDR.CITY = "Salt Lake"), multiple = TRUE) find_xref(sample555, c(INDI.NAME.SURN = "Williams", INDI.ADOP.DATE = "Never"), mode = "best", multiple = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.