From 975500700d4830a7fd5af41f02307699b8a19c60 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Aug 2024 21:25:05 -0400 Subject: [PATCH] family given names ex --- DESCRIPTION | 2 +- NEWS | 4 ++++ R/alternatives.R | 11 +++++++++++ man/alternatives_with_shared_groups.Rd | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index db7f6b4..660840e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Authors@R: c( person("Toby", "Hocking", email="toby.hocking@r-project.org", role=c("aut", "cre"))) -Version: 2024.7.16 +Version: 2024.8.15 License: GPL-3 Title: Named Capture to Data Tables Description: User-friendly functions for extracting a data diff --git a/NEWS b/NEWS index ac0ae52..93c8791 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Changes in version 2024.8.15 + +- arrow::arrow_with_dataset() to avoid CRAN NOTE. + Changes in version 2024.7.16 - arrow::arrow_with_dataset() to avoid CRAN NOTE. diff --git a/R/alternatives.R b/R/alternatives.R index 6a66c11..bc77d51 100644 --- a/R/alternatives.R +++ b/R/alternatives.R @@ -121,6 +121,17 @@ alternatives_with_shared_groups <- structure(function ### list). }, ex=function(){ + ## Example 0: matching family and given names. + nc::capture_first_vec( + c("Toby Dylan Hocking","Hocking, Toby Dylan"), + nc::alternatives_with_shared_groups( + family="[A-Z][a-z]+", + given="[^,]+", + list(given, " ", family), + list(family, ", ", given) + ) + ) + ## Example 1: matching dates in different formats, but always same ## type in each alternative. subject.vec <- c("mar 17, 1983", "26 sep 2017", "17 mar 1984") diff --git a/man/alternatives_with_shared_groups.Rd b/man/alternatives_with_shared_groups.Rd index 4bde3a9..1907d44 100644 --- a/man/alternatives_with_shared_groups.Rd +++ b/man/alternatives_with_shared_groups.Rd @@ -21,6 +21,17 @@ list).} \examples{ +## Example 0: matching family and given names. +nc::capture_first_vec( + c("Toby Dylan Hocking","Hocking, Toby Dylan"), + nc::alternatives_with_shared_groups( + family="[A-Z][a-z]+", + given="[^,]+", + list(given, " ", family), + list(family, ", ", given) + ) +) + ## Example 1: matching dates in different formats, but always same ## type in each alternative. subject.vec <- c("mar 17, 1983", "26 sep 2017", "17 mar 1984")