View source: R/assignNetworkMembership.R
assignNetworkMembership | R Documentation |
This function assigns network membership to units in an adaptive cluster sample; if units are neighbors, they are assigned the same network ID.
assignNetworkMembership(popdata, plot.size = 1)
popdata |
A data frame providing information about the population to be sampled. Required columns include geographic coordinate columns |
plot.size |
The length and width of plots, in coordinate units. Defaults to 1. |
Returns the popdata data.frame with a new column for Network ID as well as a column for m, the number of units in each network.
saubyadaptiveACSampling
data(Thompson1990Fig1Pop) # plot species abundance library(magrittr) library(ggplot2) library(dplyr) dat <- Thompson1990Fig1Pop %>% filter(y_value > 0) ggplot(dat, aes(x,y, size=y_value)) + geom_point() # assign network membership of units containing the species of interest P_networks <- assignNetworkMembership(Thompson1990Fig1Pop %>% filter(y_value > 0)) # plot networks ggplot( data=P_networks, aes(x,y, size=y_value, shape=factor(NetworkID)) ) + geom_point() # coordinates should be given as x and y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.