Skip to content
Prev 306281 / 398506 Next

Write table with data in other .csv template

CSV files are on disk, with filenames. You can call them whatever you want, but they are not variables in R.

Data frames are variables in memory. You can read any CSV file into any data frame you like, but it replaces the original contents of the data frame completely. You can also write a data frame into a CSV file, but that always overwrites the entire file on disk. You may want to avoid writing over your input files, instead create a new output file.

You cannot manipulate CSV files in place using normal R programming techniques. You must load them into data frames, manipulate them, and write the result back to disk.

I used the name "template" because you did. You can use different names if you wish.

 I strongly recommend that you read "An Introduction to R" until you understand the syntax I used and can re-create it yourself using your own variables. Blindly using any code without understanding it is risky to your data.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
"s.s.m. fauzi" <ssmfone at gmail.com> wrote: