So I have created a data frame in R with this output called 'data'
But I want to convert my data frame to something like the one below
How would I go about doing this?
So I have created a data frame in R with this output called 'data'
But I want to convert my data frame to something like the one below
How would I go about doing this?
t(data)
returns list. If you want to shape your data, you can turn into data frame by coercion: as.data.frame(data)
Better solution: use melt
function from dplyr
package. It can easily turn your data into tabular form, then you can "effectively" play with your data.