Entering edit mode
6.7 years ago
Björn
▴
110
I have a dataset with a missing column header for first column. How to name it so that I can find it using
a$
I used following command but got error
a$miRNAs<-row.names(a)
Warning message:
In a$miRNAs <- row.names(a) : Coercing LHS to a list
How to find the solution?
It is not a data frame column, these are the row names:
You can't assign a name to the row names.
If you are trying to access a single column from a dataframe, you should use this syntax instead:
a[["column_name"]]
. There are methods for renaming columns listed here