[R] assigning rownames

Arne Henningsen ahenningsen at agric-econ.uni-kiel.de
Fri Nov 14 18:23:21 CET 2003


I have got a variable, say
    myVar <- matrix( 1:6, 3, 2 )
and a variable that contains the name of the variable, say
   myVarName <- "myVar"
Now, I want to assign rownames to the Variable "myVar".
I can do it by 
   rownames( myVar ) <- c( "A", "B", "C" )
but for some reason I want "myVarName" as argument, e.g.
  rownames( ????( myVarName ) )  <- c( "A", "B", "C" )
How can I do this?


Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
ahenningsen at agric-econ.uni-kiel.de

More information about the R-help mailing list