[R] the first name of the first column

MacQueen, Don m@cqueen1 @end|ng |rom ||n|@gov
Fri May 11 00:55:23 CEST 2018


I think you are confusing row names with the first column. The first column in mtcars is not alphanumeric:

> class(mtcars)
[1] "data.frame"
> class(mtcars[,1])
[1] "numeric"

> rownames(mtcars)
 [1] "Mazda RX4"           "Mazda RX4 Wag"       "Datsun 710"          "Hornet 4 Drive"      "Hornet Sportabout"   "Valiant"            (etc)

Perhaps you should make a copy of my_data that includes only the numeric columns?

-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 
On 5/10/18, 2:36 PM, "R-help on behalf of greg holly" <r-help-bounces using r-project.org on behalf of mak.hholly using gmail.com> wrote:

    Dear all;
    
    I need to run heatmap. Because my first column in my data is alphanumeric,
    I can not run as.matrix(scale(my_data)). So I need to make my data readable
    as in data(mtcars). In *mtcars *data the first column is alphanumeric and
    has no  name.
    
    Thanks,
    
    Greg
    
    	[[alternative HTML version deleted]]
    
    ______________________________________________
    R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
    https://stat.ethz.ch/mailman/listinfo/r-help
    PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
    and provide commented, minimal, self-contained, reproducible code.
    



More information about the R-help mailing list