Re: [R] help with "by" function

2015-05-12 Thread DIGHE, NILESH [AG/2362]
Jean: Thanks a lot!! The changes you made to the code gave me what I needed. I truly appreciate your time in correcting the code. Nilesh From: Adams, Jean [mailto:jvad...@usgs.gov] Sent: Tuesday, May 12, 2015 2:14 PM To: DIGHE, NILESH [AG/2362] Cc: r-help@r-project.org Subject: Re: [R] help

Re: [R] help with "by" function

2015-05-12 Thread Adams, Jean
Nilesh, I found a couple errors in your code. First, in your by() statement you have a function to operate on the selected subset of data, which you refer to as x but then, in your aov statement you refer to data_set not x Second, your funC() statement is a function of trait_

[R] help with "by" function

2015-05-12 Thread DIGHE, NILESH [AG/2362]
Hi, I have an anonymous function called function(x) that will run anova, run HSD.test on the model, and then sort the results. I am passing this anonymous function to the "by" function to get results by "Isopair" factor which is my index variable. Since I want to run the anova on multiple depe

Re: [R] help with "by" command

2011-08-24 Thread Jorge I Velez
Hi Ari, Try this instead with(foo, tapply(V2, trust, mean, na.rm = TRUE)) See ?tapply and ?with for more information. HTH, Jorge On Wed, Aug 24, 2011 at 2:51 PM, amalka <> wrote: > Hello, > > I am a new user of R, and I'd be grateful if someone could help me with the > following: > > I would

[R] help with "by" command

2011-08-24 Thread amalka
Hello, I am a new user of R, and I'd be grateful if someone could help me with the following: I would like to compute the mean of variable "trust" in dataframe "foo", but separately for each level of variable V2. That is, I'd like to compute the mean of trust at each level of V2. I have done th

Re: [R] Help with "by"

2009-04-04 Thread David Winsemius
On Apr 4, 2009, at 3:42 PM, AllenL wrote: Searched for "by" in forums and no hits, should be simple problem. The help page for by must surely have have *some* information? This is my line: bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd)) I want to calculate the mean of "AbvBio

Re: [R] Help with "by"

2009-04-04 Thread Uwe Ligges
AllenL wrote: Searched for "by" in forums and no hits, should be simple problem. This is my line: bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd)) I want to calculate the mean of "AbvBioAnnProd" in each Plot. What am I doing wrong? What is AbvBioAnnProd? I only see that you pass D

[R] Help with "by"

2009-04-04 Thread AllenL
Searched for "by" in forums and no hits, should be simple problem. This is my line: >bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd)) I want to calculate the mean of "AbvBioAnnProd" in each Plot. What am I doing wrong? Thanks in advance, -AL -- View this message in context: http://ww