[R] transform row name in first column variable

Rui Barradas ruipbarradas at sapo.pt
Tue Aug 27 21:41:11 CEST 2013


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
>



More information about the R-help mailing list