[R-sig-eco] mapply and use of formula (y~x)

Marcelino de la Cruz marcelino.delacruz at upm.es
Mon Mar 17 16:45:11 CET 2014


Maybe this way?

mapply(function(x,y) adonis(x~y), dist_list, group_list, SIMPLIFY=FALSE)


Cheers,

Marcelino

El 17/03/2014 14:24, jO escribió:
> Im trying to use mapply on two lists and using the {vegan} function adonis. I
> run this
>
> mapply(adonis, dist_list~group_list, SIMPLIFY=FALSE)
>
> The above gives the "Error: object of type 'symbol' is not subsettable"
>
> This works on single dist and group objects. Also this works
>
> mapply(betadisper, d = dist_list, group = group_list, SIMPLIFY=FALSE)
>
> Any suggestions on how to implement a formula when using mapply would be
> much appreciated, thanks!
>
>
>
>
> --
> View this message in context: http://r-sig-ecology.471788.n2.nabble.com/mapply-and-use-of-formula-y-x-tp7578734.html
> Sent from the r-sig-ecology mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



More information about the R-sig-ecology mailing list