[R] how to calculate weighted means by groups

2007-08-30 Thread Patrick Zimmermann
Hello, I want to calculate the weighted means of a table column, aggregated by other elements of the same table. For example I want to calculate mean species numbers weighted by area and grouped by year, altitude and/or region. I think a combination of aggregate() and weighted.mean() should work,

[R] extraction of vector elements to new list

2007-07-23 Thread Patrick Zimmermann
Dear R-community, I have got a list of vectors and would like to extract the first two elements of each vector to a new list. My list is of the style: my.list = list(c(a, b, c), c(d, e), c(f, g, h, i), ...) #I want: new.list = list(c(a, b), c(d, e), c(f, g), ...) # As my.list[[3]][1:2] #

[R] how to combine presence only data sets to one presence/absence table

2007-07-18 Thread Patrick Zimmermann
? (read.table() seems not to be appropriate, as data is not organized as a table) How can I create the species by sample matrix? Thanks for any help, Patrick Zimmermann __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE