[R] Calculate Range
smartpink111 at yahoo.com
Mon Nov 18 04:30:14 CET 2013
You may also check:
df1 <- data.frame(group=rep(letters[1:3],c(5,10,15)), values=1:30)
ddply(df1,.(group),mutate,Range=describe(values)$range) ##depends on how you wanted the output
On Sunday, November 17, 2013 12:02 AM, SCRIPTHAM <JML at CWAZY.CO.UK> wrote:
My R version is the current version as at 15 Nov 2013.
I have tried to calculate range using tapply() with FUN=range.
tapply() returns two fields, the ID field and a field of two text items one
is the maximum and the other is the minimum.
I take as the difference max - min, does R use a different term for range in
I have also tried
aggregate() with Fun=range, with Fun=min and FUN=max
and they also gave problems.
What is the best route to calculate ranges for groups within a data frame.
View this message in context: http://r.789695.n4.nabble.com/Calculate-Range-tp4680579.html
Sent from the R help mailing list archive at Nabble.com.
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help