I tried the solution given here.
I'm having an identical problem, where my dataframe uses numbers instead of the first column as row names.
When I use the solution from 2012, I get the error:
Error in row.names<-.data.frame
(*tmp*, value = value) : invalid 'row.names' length
In addition:
Warning message: Setting row names on a tibble is deprecated.
I saw there is another comment on the original post with the same error, so I think maybe it's an issue with a newer version of R? I would like to know why this error comes up and how I can set my rownames in a dataframe using a column of characters/strings. The end goal is to be able to use these rownames to label the points in a graph (specifically, a prcomp autoplot, if that's important).
I've tried other ways to set my rownames, including loading up the dataframe with just the last two columns while setting the rownames from another dataset, and trying to label plots after the fact with rownames from elsewhere. No matter what, I get the error that my row names are of the wrong length, even though the number of rows is identical.