I have been trying to read the txt file "genes_tpm.txt" as a data frame where the first row is a name with the code
tab3rows <- read.table("gene_tpm.txt", header = TRUE, nrows = 3)
However, I get VX as names (V1, V2, V3...) instead of the first row.
I have tried using
my.names <- tab3rows[1,] colnames(tab3rows) <- my.names
BUT the colnames of "my.names" are "3, 2, 3, 3, 3, 3...", with a row with the actual names I want, and
colnames(tab3rows) <- my.names
adds those numbers as the names instead...
what am I doing wrong?