Description Usage Arguments Details Value
View source: R/sample_newrow_presabs.R
Add a new row to a presence/absence matrix being reconstructed from a matrix of pairwise shared species
1 | sample_newrow_presabs(sharedmatrix, nsamples = 10000, startingmatrix = NULL)
|
sharedmatrix |
a matrix where each cell contains the number of species shared between the column and row. |
nsamples |
number of times to sample the possible new rows. Higher values take longer, but they are more likely to return the actual answers. |
startingmatrix |
the first few rows (two or more) of a presence/absence matrix being reconstructed. This might be, for example, the returned value from a previous run of this function. |
This function is the opposite of 'make_shared_sp_matrix()', which converts a presence/absence table to a matrix of pairwise shared species.
'sample_newrow_presabs()' uses a matrix of pairwise shared values to add an additional row to a presence/absence matrix being constructed from those values. If no startingmatrix is provided, this function outputs the first three rows. Otherwise, this function adds a row to the input startingmatrix.
This function randomly samples possible new rows and scores each sample based on its distance from matching the matrix of pairwise shared species.
matrix (or matrices) of the input 'startingmatrix' with an additional row of presence/absence data corresponding to the best scoring sample.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.