[R] transform row name in first column variable
David Winsemius
dwinsemius at comcast.net
Tue Aug 27 22:26:22 CEST 2013
If the goal is to change row names and the replacements are unique the it is as easy as:
rownames(dfrm) <- newnames
Include example data for more complete answers.
--
David
Sent from my iPhone
On Aug 27, 2013, at 2:41 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
> Hello,
>
> If your data.frame is named 'dat', try the following.
>
> cbind(year = rownames(dat), dat)
>
> Hope this helps,
>
> Rui Barradas
>
> Em 27-08-2013 20:34, catalin roibu escreveu:
>> hello all!
>> I have a problem! I don't know how to convert row names in first column
>> variables.
>>
>> Thank you very much for your help!
>>
>> CR
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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