From deadaa3026fa523cab9bb06b17ff887ce26d493d Mon Sep 17 00:00:00 2001 From: Will Foran Date: Fri, 19 Nov 2021 11:04:45 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20date=5Fmatch=20repeat=20error=20?= =?UTF-8?q?bad=20sprintf=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/date_match.R | 4 ++-- man/date_match.Rd | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/R/date_match.R b/R/date_match.R index 0275716..c7860c2 100644 --- a/R/date_match.R +++ b/R/date_match.R @@ -37,9 +37,9 @@ date_match <-function(d1, d2, idcol, datecol1, datecol2=datecol1, all.x=F, n_uniq_iddate <- length(unique(paste(d1[[idcol]], d1[[datecol1]]))) n_d1 <- nrow(d1) if (n_uniq_iddate < n_d1) - stop(sprintf("datecol1 '%s' repeats within id(%d uniue of %d total rows) + stop(sprintf("datecol1 '%s' repeats within id (%d unique id+date pairs in %d total rows) conider double merge:\n", - n_uniq_iddate, n_d1, datecol1), + datecol1, n_uniq_iddate, n_d1), " d1 %>% select(idcol, datecol1) %>%\n", " unique %>% date_merge(d2, 'idcol', 'datecol1') %>% inner_join(d1)") diff --git a/man/date_match.Rd b/man/date_match.Rd index 3f959cd..0da9191 100644 --- a/man/date_match.Rd +++ b/man/date_match.Rd @@ -44,6 +44,4 @@ match dates in a data frame by one-to-many merge and rank. Useful to match behav dummy1$d <- lubridate::ymd(dummy1$d) dummy2$d <- lubridate::ymd(dummy2$d) date_match(dummy1,dummy2,'id','d') - - }