Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
Hello, One more thing, if you do cbind(year = rownames(dat), dat), then the year variable defaults to a factor. Maybe it's better if you transform it into numeric: cbind(year = as.numeric(rownames(dat)), dat) Rui Barradas Em 27-08-2013 21:09, catalin roibu escreveu: Thank you very much! I

Re: [R] transform row name in first column variable

2013-08-27 Thread David Winsemius
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 wrote: > Hello, > > If your data.frame is named 'dat'

Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
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

[R] transform row name in first column variable

2013-08-27 Thread catalin roibu
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 -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4