-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rle() returns NULL #434
Comments
Root cause - Another example. Let's say we're trying to add a column of another data frame to our library(dplyr)
library(dtplyr)
df <- tibble(length = 1)
tibble(x = 1:3, y = c("a", "a", "b")) %>%
lazy_dt() %>%
mutate(new = df$length)
#> Warning: Unknown or uninitialised column: `..length`.
#> Warning in `[.data.table`(copy(`_DT1`), , `:=`(new = ..df$..length)): Column
#> 'new' does not exist to remove
#> Source: local data table [3 x 2]
#> Call: copy(`_DT1`)[, `:=`(new = ..df$..length)]
#>
#> x y
#> <int> <chr>
#> 1 1 a
#> 2 2 a
#> 3 3 b
#>
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results |
The problem gets even more complicated if you put an action inside a function since library(dtplyr)
library(dplyr, warn.conflicts = FALSE)
fn <- function() {
df <- tibble(length = 1)
tibble(x = 1:3, y = c("a", "a", "b")) %>%
lazy_dt() %>%
mutate(new = df$length)
}
fn()
#> Error in `$`(structure(list(length = 1), class = c("tbl_df", "tbl", "data.frame": invalid subscript type 'builtin' |
I recently updated the dtplyr package and the code snippet with rle() no longer works. The val should have values 19 and 4 but instead both are NULL.
The text was updated successfully, but these errors were encountered: