I am reading in a data file with many different rows, all of which can have different lengths like so:
dataFile <- read.table("file.txt", as.is=TRUE);
The rows can be as follows:
1 5 2 6 2 1
2 6 24
2 6 1 5 2 7 982 24 6
25 2
I need the rows to be transformed into columns. I'll be then using the columns for a violin plot like so:
names(dataCol)[1] <- "x";
jpeg("violinplot.jpg", width = 1000, height = 1000);
do.call(vioplot,c(dataCol,))
dev.off()
I'm assuming there will be an empty string/placeholder for any column with fewer entries than the column with the maximum number of entries. How can it be done?