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
Here is some sample data iris <- data.table(iris)
iris <- data.table(iris)
This code produces a one column vector when Species is a factor. as.data.table(combn(unique(iris$Species),2))
as.data.table(combn(unique(iris$Species),2))
V1 1: setosa 2: versicolor 3: setosa 4: virginica 5: versicolor 6: virginica
While this code produces a matrix. as.data.table(combn(unique(as.character(iris$Species)),2))
as.data.table(combn(unique(as.character(iris$Species)),2))
V1 V2 V3 1: setosa setosa versicolor 2: versicolor virginica virginica
Issue found through SO question here: http://stackoverflow.com/questions/26244685/r-count-every-possible-pair-of-values-in-a-column-grouped-by-multiple-columns/26246588?noredirect=1#comment41177317_26246588
The text was updated successfully, but these errors were encountered:
@mgahan 👍 thank you.
Sorry, something went wrong.
0fb9d57
arunsrinivasan
No branches or pull requests
Here is some sample data
iris <- data.table(iris)
This code produces a one column vector when Species is a factor.
as.data.table(combn(unique(iris$Species),2))
V1
1: setosa
2: versicolor
3: setosa
4: virginica
5: versicolor
6: virginica
While this code produces a matrix.
as.data.table(combn(unique(as.character(iris$Species)),2))
V1 V2 V3
1: setosa setosa versicolor
2: versicolor virginica virginica
Issue found through SO question here:
http://stackoverflow.com/questions/26244685/r-count-every-possible-pair-of-values-in-a-column-grouped-by-multiple-columns/26246588?noredirect=1#comment41177317_26246588
The text was updated successfully, but these errors were encountered: