[R] Random resampling of columns in species association matrices
mariasve
lmsd5d at umsl.edu
Wed May 9 16:34:33 CEST 2012
I have a host-parasite association matrix in which parasite species are rows
and host species columns and cells contain the frequency of interactions.
Some parasites are associated with many hosts, and some hosts harbor several
parasites, and I want to repeatedly select only one single representative
host per "generalized" (multi-host) parasite to create a new matrix in which
no hosts are repeated. That is, I want multiple randomly generated symmetric
matrices in which a host and a parasite species appear only once.
Furthermore, I want to weight the probability of selecting a particular host
for a parasite by the frequency of interactions between the two. Finally, a
handful of parasites associate with only one single host. I do not want to
lose these from the matrix, but rather fix these associations and only
randomly select hosts for the generalized parasite species.
My goal is to eventually perform generalized least squares regressions
between a parasite trait and several host traits, but the first major hurdle
for me to get over is how to randomly select only one host per parasite with
no repetition of species in the matrix. I am also generally interested in
how to resample columns instead of rows (in the package boot, for instance)
because of another analysis I'm working on, and I have been unable to find a
solution to this when searching the R help site.
Any suggestions would be most welcomed.
Maria
--
View this message in context: http://r.789695.n4.nabble.com/Random-resampling-of-columns-in-species-association-matrices-tp4620618.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list