there is a data frame £¬x
weekly.returns
2010-1-4 -0.015933327
2010-1-11 -0.015042868
2010-1-18 0.005350297
2010-1-25 -0.049324703
2010-2-1 -0.052674121
when i input
colnames(data)[1] <- 'date'
it becomes
date
2010-1-4 -0.015933327
2010-1-11 -0.015042868
2010-1-18 0.005350297
2010-1-25 -0.049324703
2010-2-1 -0.052674121
how can i change ti into:
date weekly.returns
1 2010-1-4 -0.015933327
2 2010-1-11 -0.015042868
3 2010-1-18 0.005350297
4 2010-1-25 -0.049324703
5 2010-2-1 -0.052674121
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.