Hi:

Using df as your data frame,

max(subset(df, condition == 'GPR119a', select = responce))
[1] 0.6451204

You asked this question yesterday with several correct responses. What was
wrong with them?

Dennis

On Wed, Feb 2, 2011 at 12:48 AM, Asan Ramzan <asanramzan@yahoo.com> wrote:

> Hello
>
> I am trying to find a way to find the max value, for only a subset of a
> dataframe, depending on how the data is grouped for example,
>
> How would I find the maxmium responce, for all the GPR119a condition below:
>
> I've tried tapply
>
> > tapply(GPR119data$responce, GPR119data$GPR119a, max)
> Error in tapply(GPR119data$responce, GPR119data$GPR119a, max) :
>   arguments must have same length
>
> responce,mouce,condition
> 0.105902,KO,con
> 0.232018561,KO,con
> 0.335008375,KO,con
> 0.387025433,KO,GPR119a
> 0.576769897,KO,GPR119a
> 0.645120419,KO,GPR119a
> 0.2538608,KO,GPR119b
> 0.183061952,KO,GPR119b
> 0.824035587,KO,GPR119b
> 0.399201597,KO,GPR119c
> 0.417006618,KO,GPR119c
> 0.572958834,KO,GPR119c
> 0.229467444,KO,GPR119d
> 0.294089745,KO,GPR119d
> 0.309964445,KO,GPR119d
> 0.30474325,KO,GPR119e
> 0.159374839,KO,GPR119e
> 0.467726848,KO,GPR119e
> 1.01841912,KO,GPR119f
> 0.423028621,KO,GPR119f
> 0.223588597,KO,GPR119f
>
> Thank
>
>
>
>
>        [[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.
>
>

	[[alternative HTML version deleted]]

