We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have vector with characters: y <- c('B','Ā','Č','D','Ē','E')
When I sort using order for vector y2 <- y[order(y)] y2
[1] "Ā" "B" "Č" "D" "E" "Ē" y2 <- data.table(y = y2)
If I make vector as data.table and sort with setkeyv then can not get the same result as y2.
test2 <- data.table(y) setkeyv(test2, "y") test2
identical(y2, test2)
Maybe can give some solution for this situation?
The text was updated successfully, but these errors were encountered:
Closes #2114 -- add a clarifying note&link to setkey about C-sorting
53a118c
I believe this is due to C ordering:
sapply(c('B','Ā','Č','D','Ē','E'), utf8ToInt) # B Ā Č D Ē E # 66 256 268 68 274 69
whereas y[order(y)] is using locale sorting, C sorting will be according to utf8ToInt IINM.
y[order(y)]
utf8ToInt
Will add a note to the setkey documentation about this.
setkey
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I have vector with characters:
y <- c('B','Ā','Č','D','Ē','E')
When I sort using order for vector
y2 <- y[order(y)]
y2
[1] "Ā" "B" "Č" "D" "E" "Ē"
y2 <- data.table(y = y2)
If I make vector as data.table and sort with setkeyv then can not get the same result as y2.
test2 <- data.table(y)
setkeyv(test2, "y")
test2
identical(y2, test2)
Maybe can give some solution for this situation?
The text was updated successfully, but these errors were encountered: