0

I have a problem exporting data tables to csv files for Excel. After loading data from excel files, I want to add new columns to the data and then export it as a new csv file for excel. When I do this a new column appears on the left with the numbers 1,2,3 ... and the other columns are actualy directed left.

Anyone already encountred this problem and figured out how to fix it ?

Wady
  • 65
  • 1
  • 4

1 Answers1

1

I'm assuming you're using write.table() or write.csv() to export your data as a CSV. If so, then just use the row.names = FALSE argument to remove the first column which is the row names.

CephBirk
  • 6,422
  • 5
  • 56
  • 74
  • It works perfectly! thank you very much! Would you know how to implement a simple moving average for my data series? – Wady Mar 16 '16 at 11:55
  • Take a look here: http://stackoverflow.com/questions/743812/calculating-moving-average-in-r Also, if you feel that an answer has helped you solve your problem, you can check the green check mark to help let others know that this question has been solved. – CephBirk Mar 16 '16 at 12:01
  • thanks! I did it, it's just that I'm new on this forum ^^ – Wady Mar 16 '16 at 12:49
  • No worries. Welcome! – CephBirk Mar 16 '16 at 16:47