Also, have a look at each() in the plyr package,
library(plyr)
each(length, mean, var)(rnorm(100))
baptiste
2009/9/28 trumpetsaz :
>
> I am trying to write a function that will have an input of a vector of
> functions. Here is a simplistic example.
> sumstats <- c(mean,sd)
> sumstats[1]
> #Give
Hi,
You said,
>sumstats <- c(mean,sd)
>sumstats[1]
>#Gives this error
but this is not an error! You created a list that contains two
functions, and sumstats[1] simply prints the first one.
HTH,
baptiste
__
R-help@r-project.org mailing list
https://s
On 28/09/2009, at 4:30 PM, David Winsemius wrote:
On Sep 27, 2009, at 11:07 PM, Rolf Turner wrote:
On 28/09/2009, at 3:36 PM, trumpetsaz wrote:
I am trying to write a function that will have an input of a vector
of
functions. Here is a simplistic example.
sumstats <- c(mean,sd)
sumstats[
On Sep 27, 2009, at 11:07 PM, Rolf Turner wrote:
On 28/09/2009, at 3:36 PM, trumpetsaz wrote:
I am trying to write a function that will have an input of a vector
of
functions. Here is a simplistic example.
sumstats <- c(mean,sd)
sumstats[1]
#Gives this error
#> sumstats[1]
#[[1]]
#functi
On 28/09/2009, at 3:36 PM, trumpetsaz wrote:
I am trying to write a function that will have an input of a vector of
functions. Here is a simplistic example.
sumstats <- c(mean,sd)
sumstats[1]
#Gives this error
#> sumstats[1]
#[[1]]
#function (x, ...)
#UseMethod("mean")
#
I thought about restr
On Sun, Sep 27, 2009 at 10:36 PM, trumpetsaz wrote:
>
> I am trying to write a function that will have an input of a vector of
> functions. Here is a simplistic example.
> sumstats <- c(mean,sd)
> sumstats[1]
> #Gives this error
> #> sumstats[1]
> #[[1]]
> #function (x, ...)
> #UseMethod("mean")
>
I am trying to write a function that will have an input of a vector of
functions. Here is a simplistic example.
sumstats <- c(mean,sd)
sumstats[1]
#Gives this error
#> sumstats[1]
#[[1]]
#function (x, ...)
#UseMethod("mean")
#
I thought about restricting the input to character variables such as
7 matches
Mail list logo