Closed mgacc0 closed 2 years ago
This is mentioned in the documentation here. The point of compute()
in dtplyr is to "generate an intermediate assignment in the translation", so this is working as intended.
collect()
, as_tibble()
, as.data.frame()
, and as.data.table()
actually enforce the computation.
Then, I will continue using
df1 <- df1 %>%
collect() %>%
lazy_dt()
to enforce computation.
As you know, this is an optimization to improve performance (when nrows(df1) > 10M
): caching df1 if it is going to be reused multiple times.
I suspect
dplyr::compute()
is not enforcing computation.For example:
The call to
compute()
returns inmediatly (without doing calculations):And to enforce the execution, I'm using (provisionally) this alternative:
Both should be true: