Re: [R] dataframe - column value calculation in R

From: Timothy Bates <timothy.c.bates_at_gmail.com>
Date: Thu, 26 May 2011 08:21:23 +0100

On 26 May 2011, at 08:02, Vijayan Padmanabhan wrote:
> I have a requirement for which I am seeking help.

Best to just ask, compactly. This is a very straightforward question: best to read on how to use R: You are just set 1 column of a dataframe to a value based on the others, applying this to all rows: This is just what R does by default

So you can solve your problem by extension from

df$E = sqrt(df$A) + (df$B * df$D)

A B C D
1 2 3 4



R-help_at_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. Received on Thu 26 May 2011 - 07:23:43 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 26 May 2011 - 07:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive