So I have a data frame (called SNPlist) which is of dimensions 1 by 500000 (rows by columns). I want SNP list to be the column names for my dataframe of data (called Data) which is of dimension 100 by 500000. I already tried colnames(Data) <- SNPlist
but it does not seem to be working. Can anyone help with this issue?
If SNPlist
is a data.frame
, then you need to point to the first row of it:
colnames(Data) <- SNPlist[1, ]
If it was a vector, what you'd tried would have worked
It's been a while since the question was asked, but I noticed nobody suggested what works for me: colnames(Data) <- colnames(SNPlist)
Amos
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With