Re: [R] help about fitdistr funtion

2011-11-30 Thread R. Michael Weylandt
I like to use split() to split your data into groups, then run lapply() to use fitdistr on each element of the list. E.g, df <- data.frame(X = rnorm(500), ID = sample(letters[1:5], 500, TRUE)) temp <- split(df$X, df$ID) lapply(temp, fitdistr, "normal") Though it's just as easy with tapply(): t

[R] help about fitdistr funtion

2011-11-30 Thread Carlos Javier Rincon Rodriguez
Hi, I have a variable X classified in a lot of groups and I need to run the [fitdistr] funtion for each group. I tried with the [by] or the [tapply] funtions because my data is organize in two columns (variable and the groups), but neither of these command work. If somebody have a tip to help me