If I have a data frame (or a tibble) df
as the following:
x <- c(2,2,2,1,1,2,3)
y <- c(5,5,4,5,4,4,5)
df <- data.frame(x,y)
Then, if I cross data with the instruction table(df$x,df$y)
I get a matrix form:
4 5
1 1 1
2 2 2
3 0 1
But if I do a View
of the same instruction what I see has a different structure, such as you can see next:
1 4 1
2 4 2
3 4 0
1 5 1
2 5 2
3 5 1
Do you know if there is some instruction to make something similar to View
(taking into account its description: Invoke a spreadsheet-style data viewer on a matrix-like R object
) preserving the first structure for the intersection table?
Thanks in advance.