Generate a list with four elements, a data base with the significance tests of association of each interaction (in rows) and three matrices of interaction of positive, negative and neutral interactions, from a study site (for a single sites)

sign_net(inter_data, cover_data, site, type)

Arguments

inter_data

data frame with at least four columns: Study_site (unique name of the study site), Recruit (species of the recruit), Canopy (species of the canopy, or "Open"), and Frequency (number of recruits of that species observed under that canopy species in any plot, with "Open" representing recruits observed without a canopy species).

cover_data

data frame with at least five columns: Study_site (unique name of the study site), Plot (unique name of each plot within a study site), Canopy (species of the canopy), Cover (percentage of cover of that species in that plot), and Sampled_distance_or_area (total area of that plot or length in the case of transects).

site

is the name of the Study_site

type

is a character that identifies which hypothesis is being tested with three options:

  1. "by_pairwise_interaction": whether the number of recuits of each recruit species under each canopy species is significantly different from the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively.

  2. "by_recruit_sp": whether the number of recuits of each recruit species under any canopy species (all together) is significantly different from the number observed in the open, considering the percentage of cover of all canopy species together and open area (i.e.bare ground), respectively.

  3. "by_canopy_sp": whether the number of recuits of any recruit species (all together) under a given canopy species is significantly different from the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively

Value

a list with four elements. The first element data frame with the same structure as the input with three additional columns: int_p (p-value of the binomial test of association), int_sign (the sign of the association, being Posive (or Negative) if the association is stronger (or weaker) than expected by the percentage cover of Canopy and Open, and Neutral if there is not enought power to conduct the test, stdres (standarized resdual quantifying the difference between the observed and expected values), and testability (indicating whether the sample size allow to conduct or not the test being Non-testable those rows in which int_sign = Neutral). The second, third and fourth elements of teh list are the matrices of only positive, negative and neutral ( testable) associations based on the database generated in the first element of the list.

Examples

if (FALSE) { # interactive()

sign_vest <- sign_net(RecruitNet, CanopyCover, "Ventisquero", "by_pairwise_interaction" )
}