library(MASS)
dat <- data.frame(
col1=as.factor(sample(1:4, 100, T)),
col2=as.factor(sample(1:4, 100, T)),
col3=as.factor(sample(1:4, 100, T)),
isi=rnorm(100)
)
dat <- split(dat, as.factor(sample(1:3, 100, T)))
lapply(dat, function(x, densfun) fitdistr(x$isi, densfun), 'normal')
It would have been nice if you had at least posted what the structure of
myList is. Assuming that this is the list of your data frames, then the
following might work:
lapply(myList, function(x) fitdistr(x$isi,
densfun='gamma',start=list(scale=1, shape=2)))
On Sun, Mar 7, 2010 at 7:30 PM, Dgnn
I have split my original dataframe to generate a list of dataframes each of
which has 3 columns of factors and a 4th column of numeric data.
I would like to use lapply to apply the fitdistr() function to only the 4th
column (x$isi) of the dataframes in the list.
Is there a way to do this or am I
I have split my original dataframe to generate a list of dataframes each of
which has 3 columns of factors and a 4th column of numeric data.
I would like to use lapply to apply the fitdistr() function to only the 4th
column (x$isi) of the dataframes in the list.
Is there a way to do this or am
4 matches
Mail list logo