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
lookup modifies data in place #7
Comments
There's a workaround: create a physical copy of |
My bad -- the script is faulty. Will reopen as necessary. |
This one's better. If you uncomment the line with library(magrittr)
library(qdapTools)
set.seed(123)
N <- 100
key <- data.frame(x = sample.int(N, N), y = 1:N, z = 1:N)
key$w <- key$x
key %>% head()
terms <- sample.int(2 * N, 1e2, replace = TRUE)
subkey <- key[c("x", "y")]
terms %l+% subkey %>% head
stopifnot(key$x == key$w)
stopifnot(key$y == key$z)
key$y
key$z
sessionInfo()
|
Reversing also helps: |
Hmm this can be problematic. I asked on SO. I hope there's an easy way to address this: http://stackoverflow.com/questions/26046143/cut-scoping-link-between-key-and-data-frame-for-data-table |
I think this has been fixed. If you feel it hasn't please re-open this issue. Thanks for the report. |
Thanks for the quick fix! |
Something I would not expect from R. I really had to look twice, but unfortunately
data.table
doesn't seem to behave well here. #3 is related.The code creates a lookup table from a larger data frame and checks that after lookup the order of the rows is unchanged. It isn't.
Find script in comment below.
The text was updated successfully, but these errors were encountered: