spSig: Randomize input network to calculate individual/species-level...

Description Usage Arguments Details Value References Examples

View source: R/spSig.R

Description

Repeatedly randomize pairwise interactions and determine the number of intransitive interactions each species is involved in.

Usage

1
2
spSig(disp.input, network.size, cutoff, conservative, write.wd, iterations,
  cores)

Arguments

disp.input

An edge-list-like data frame, formatted like the exInput data.

network.size

The subnetwork size (dyad, triad, quartet, etc.) at which to assess transitivity.

cutoff

The proportion of interactions a species needs to have won in order to be considered the winner.

conservative

TRUE or FALSE. Whether a tied interaction is set to a bidirectional edge or the edges are removed entirely.

write.wd

The path to the working directory where results will be written.

iterations

The number of times to randomize the pairwise interactions.

cores

The number of cores to employ for parallel processing. Set to 'seq' to run sequentially (i.e. not in parallel).

Details

Rather than combining this file with the boilDown() function, these are kept separate. Doing this facilitates multiple runs with the same parameters. Successive results can be combined with a simple cbind call, ALTHOUGH THE FIRST SPECIES COLUMN SHOULD ONLY BE INCLUDED ONCE.

Value

A data frame with the first column summarizing the species/individual in question, and subsequent columns detailing the per-iteration number of intransitive relationships that species/individual was involved in.

References

Miller, E. T., D. N. Bonter, C. Eldermire, B. G. Freeman, E. I. Greig, L. J. Harmon, C. Lisle, and W. M. Hochachka. 2017. Fighting over food unites the birds of North America in a continental dominance hierarchy. biorxiv https://doi.org/10.1101/104133

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
#load in the example data
data(exInput)

#before doing anything, remove any RDS files in the tempdir, because they can
#cause issues with this example
toDelete <- list.files(tempdir(), pattern=".RDS")
file.remove(paste(tempdir(), toDelete, sep="/"))

#subsample the data down and run a few iterations over it to illustrate function
exInput<-exInput[1:100,]
exInput[,1] <- as.factor(as.character(exInput[,1]))
exInput[,2] <- as.factor(as.character(exInput[,2]))

temp <- spSig(disp.input=exInput, network.size=3, cutoff=0.5,
  conservative=TRUE, write.wd=tempdir(), iterations=3, cores=4)

## End(Not run)

eliotmiller/networkTricks documentation built on Oct. 6, 2020, 4:23 p.m.