I've created a table which combines figures (correlations) with significance (stars). I want to convert my data to a dataframe for further processing. I tried tibble and as.data.frame, but both turn my matrix into a 1xn frame. I'm obviously doing something wrong. But what?
R <- matrix(data=-3:2/10, ncol=3, nrow=2, byrow=TRUE)
mystars <- matrix(data=c("* ", "* ", "* ", "***", " ", "** "), ncol=3, nrow=2, byrow=TRUE)
R1 <- tibble(paste(R, mystars))
R2 <- as.data.frame(paste(R, mystars), stringsAsFactors = FALSE, ncol=3, nrow=2, byrow=TRUE)
This gives a 6x1 tibble and a 6x1 data frame, instead of the original 2x3 matrix.