Thank you Christopher, that is actually very helpful. =)

Carol

On Sat, Apr 24, 2010 at 12:13 PM, Christopher W Ryan
<cr...@binghamton.edu>wrote:

> You should be aware that if you have read the data from your csv file
> into an object in R, generally nothing you do with that object in R
> will change your original csv file (this is generally a good thing),
> until/unless, you save or write something from R to that csv file
> (which is sometimes not a good idea, if you want to preserve what your
> original data looked like.)
>
> It would also be helpful if you could post to the list  the lines of
> code that you used to do whatever you are describing here in words.
> This will get you better answers.
>
> If the dataframe in R into which you read your data is called my.data,
> then you could create a new column or variable with a command like
> this:
>
> my.data$newcolumn <- [in here put the expression for your new column]
>
> for example:
>
> my.data$newcolumn <- my.data$firstcolumn + my.data$secondcolumn
>
> On Fri, Apr 23, 2010 at 9:49 PM, Carol Gao <carol.g...@gmail.com> wrote:
> > Hi,
> >
> > I've got a csv format of file. There are seven columns of variables all
> > together, and I've used the diff() function to take the differences
> between
> > the variables in one column. Now I want to add the differences as the 8th
> > column variable to the csv file. Is there any way that I can do this?
> >
> > Thanks in advance.
> >
> > Carol Gao
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@r-project.org 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.
> >
>
> ______________________________________________
> R-help@r-project.org 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to