Learn R Programming

spider (version 1.2-0)

slideBoxplots: Boxplots across windows

Description

Calculates boxplots of genetic distances using sliding windows.

Usage

slideBoxplots(DNAbin, sppVector, width, interval = 1, method = "nonCon")

Arguments

DNAbin
A DNA alignment of class `DNAbin'.
sppVector
A species vector (see sppVector).
width
Width of windows.
interval
Distance between each window in number of base pairs. Default of 1. Giving the option of "codons" sets the size to 3.
method
Options of "overall", "interAll" or "nonCon" (the default).

Value

  • A list with
  • treeMeasuresLogical. Tree measures calculated? Always FALSE.
  • distMeasuresLogical. Distance measures calculated? Always FALSE.
  • bp_outIf method="overall", contains the boxplot objects of each window.
  • bp_InterSpp_outIf method!="overall", contains the boxplot objects of the interspecific distances of each window.
  • bp_IntraSpp_outIf method!="overall", contains the boxplot objects of the intraspecific distances of each window.
  • bp_range_outrange of y-axis values.
  • pos_outx-axis values.
  • boxplot_outLogical. Boxplots calculated? Always TRUE.
  • methodThe method used for calculating boxplots. "overall", "interAll" or "nonCon".

Details

Giving method="overall" calculates the boxplot for the distance matrix of each window.

Giving method="interAll" calculates boxplots for the inter- and intra-specific distances of each window, showing the result for ALL inter-specific distances.

Giving method="nonCon" calculates boxplots for the inter- and intra-specific distances of each window, showing the result for only the nearest-conspecific distances for each individual.

See Also

boxplot, plot.slidWin, slideAnalyses, slidingWindow.

Examples

Run this code
data(dolomedes)
doloDist <- dist.dna(dolomedes)
doloSpp <- substr(dimnames(dolomedes)[[1]], 1, 5)

doloNonCon <- slideBoxplots(dolomedes, doloSpp, 200, interval=10)
plot(doloNonCon)

doloOverall <- slideBoxplots(dolomedes, doloSpp, 200, interval=10, method="overall")
plot(doloOverall)

doloInterall <- slideBoxplots(dolomedes, doloSpp, 200, interval=10, method="interAll")
plot(doloInterall)

Run the code above in your browser using DataLab