Closed jriley-dhsc closed 4 years ago
The look_up documentation has the following example:
tempdf <- expand.grid(arg1 = c("A", "B", "C"), arg2 = 1:4, arg3 = 1:5) tempdf$value <- 1:60 look_up( data = tempdf, value = "value", arg1 = c("A", "B", "C", "B", "A"), arg2 = c(1, 1, 3.2, 3.0, 5), arg3 = c(-1, 1, 1, 2, 3) )
Which returns:
[1] NA 2 NA 20 NA Warning message: In look_up(data = tempdf, value = "value", arg1 = c("A", "B", "C", : Some values were not found, returning missing data: arguments to look_up: arg1 = A, arg2 = B, arg3 = C, arg1 = B, arg2 = A, arg3 = 1, arg1 = 1, arg2 = 3.2, arg3 = 3, arg1 = 5, arg2 = -1, arg3 = 1, arg1 = 1, arg2 = 2, arg3 = 3, value = value
Which isn't right - arg2 = B was never fed to look_up.
arg2 = B
Worse, B wasn't one of the bad values for arg1!
tempdf <- expand.grid(arg1 = c("A", "B", "C"), arg2 = 1:4, arg3 = 1:5) tempdf$value <- 1:60 tibble( arg1 = c("A", "B", "C", "B", "A"), arg2 = c(1, 1, 3.2, 3.0, 5), arg3 = c(-1, 1, 1, 2, 3) ) %>% anti_join(tempdf) %>% knitr::kable()
Thanks, you're right, the warning is not very informative! Would you make a pull request?
The look_up documentation has the following example:
Which returns:
Which isn't right -
arg2 = B
was never fed to look_up.Worse, B wasn't one of the bad values for arg1!