Title: | Ordinated Diet Breadth |
---|---|
Description: | Calculates ordinated diet breadth with some plotting functions. |
Authors: | James Fordyce |
Maintainer: | James A. Fordyce <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0 |
Built: | 2025-02-23 03:30:26 UTC |
Source: | https://github.com/cran/ordiBreadth |
Calculates ordinated diet breadth and provides plotting functions.
Package: | ordiBreadth |
Type: | Package |
Version: | 1.0 |
Date: | 2015-08-07 |
License: | GPL 3.0 |
Users provide a matrix of host associations, where rows are consumers (e.g., heribivores) and columns are resources (e.g., plants). The function ordi.breadth calculates the ordinated breadth for all consumers in the matrix and summary.hbreadth summarizes the output and dist.group.plot can be used for visualization.
James Fordyce
Maintainer: James Fordyce <[email protected]>
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
This function plots the ordination and shows the centroid for a focal herbivore
dist.group.plot(specialization, id, cex = 1, PCoA = c(1, 2), seg.col = "pink", seg.wd = 2, seg.lty = 1, pt.col = "red", pt.pch = 19, pt.cex = 1.5, x.lim = NULL, y.lim = NULL, plant.plot = "all.names", rel.pch = 19, rel.cex = 1.5, rel.col = "red", nrel.pch = 19, nrel.cex = 1.5, nrel.col = "red", verbose = TRUE, scaled = TRUE)
dist.group.plot(specialization, id, cex = 1, PCoA = c(1, 2), seg.col = "pink", seg.wd = 2, seg.lty = 1, pt.col = "red", pt.pch = 19, pt.cex = 1.5, x.lim = NULL, y.lim = NULL, plant.plot = "all.names", rel.pch = 19, rel.cex = 1.5, rel.col = "red", nrel.pch = 19, nrel.cex = 1.5, nrel.col = "red", verbose = TRUE, scaled = TRUE)
specialization |
The object created by the function |
id |
A numeric indicating which species of herbivore to plot from list |
cex |
A numeric indicating the font size for diet item names. |
PCoA |
A vector length two indicated which two PCo axes to plot. |
seg.col |
The color of segments joining diet items to centroid. |
seg.wd |
A value indicating the line width of segments joining diet items to centroid. |
seg.lty |
A value indicating the line type of segments joining diet items to centroid. |
pt.col |
The color of centroid plotting character. |
pt.pch |
A value indicating the plotting character for centroid. |
pt.cex |
A value indicating the character expansion for centroid plotting character. |
x.lim |
A vector length two indicating the min and max of x axis. |
y.lim |
A vector length two indicating the min and max of y axis. |
plant.plot |
A value taking on "all.names", "relevent", or "points". 'all.names' plots the names of host plants, 'relevent' plots only the names of host plants used by focale herbivore (indicated by argument id), 'points' points all host plants as points. |
rel.pch |
A value indicating the plotting character for host plants used by herbivore. |
rel.cex |
A value indicating the character expansion for host plants used by herbivore. |
rel.col |
A value indicating the color for host plants used by herbivore. |
nrel.pch |
A value indicating the plotting character for host plants not used by herbivore. |
nrel.cex |
A value indicating the character expansion for host plants not used by herbivore. |
nrel.col |
A value indicating the color for host plants not used by herbivore. |
verbose |
A logical indicating whether information on taxonomic and ordinated host breadth is included in plot. |
scaled |
A logical indicating whether to return scaled ordinated host breadth. |
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) dist.group.plot(specialization=x,id=7,cex=1) dist.group.plot(specialization=x,id=10,cex=1,pt.cex=0.75,plant.plot="points",nrel.pch=1, nrel.col="black",nrel.cex=0.75)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) dist.group.plot(specialization=x,id=7,cex=1) dist.group.plot(specialization=x,id=10,cex=1,pt.cex=0.75,plant.plot="points",nrel.pch=1, nrel.col="black",nrel.cex=0.75)
Plots the profile plot of distance from herbivore centroid to host plants calculated by excluding the focal herbivore. Useful for exploratory data analysis.
focal.profPlot(dat, focal.bug, dist.method = "jaccard", col = c("black", "red"))
focal.profPlot(dat, focal.bug, dist.method = "jaccard", col = c("black", "red"))
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
focal.bug |
A value indicating which herbivore is the focal herbivore. |
dist.method |
Dissimilarity index passed on to vegdist in the vegan package. |
col |
A vector length 2 indicating colors for plotting. First color is for non-diet items, second color is for diet items. |
A profile plot
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") focal.profPlot(dat,4)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") focal.profPlot(dat,4)
Calculates the diet breadth of a hypothetical herbivore placed in ordination space.
hyp.ordi.breadth(dat, grouping, dist.method = "jaccard", distance = FALSE)
hyp.ordi.breadth(dat, grouping, dist.method = "jaccard", distance = FALSE)
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
grouping |
a vector of ones and zeros or TRUE and FALSE indicting diet items of hypothetical herbivore |
dist.method |
Dissimilarity index passed on to vegdist in the vegan package |
distance |
a logical indicating whether to return distance of hypothetical herbivore centroid to plants used in PCoA space and the coordinates of the centroid in PCoA space |
tot.breadth |
Ordinated host breadth of hypothetical herbivore |
distances |
Distance from centroid to diet items in PCoA space |
centroid |
Coordinates of the centroid of hypothetical herbivore |
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") group<-c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE) hyp.ordi.breadth(dat,group) hyp.ordi.breadth(dat,group,distance=TRUE) group<-c(1,1,1,1,1,1,1,1,1,1) hyp.ordi.breadth(dat,group)#extreme generalist hyp.ordi.breadth(dat,group,distance=TRUE)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") group<-c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE) hyp.ordi.breadth(dat,group) hyp.ordi.breadth(dat,group,distance=TRUE) group<-c(1,1,1,1,1,1,1,1,1,1) hyp.ordi.breadth(dat,group)#extreme generalist hyp.ordi.breadth(dat,group,distance=TRUE)
This function calculates the null expectation of host breadth if herbivores sample diet items randomly.
null.breadth(dat, dist.method = "jaccard", rep = 100, quantiles = c(0.025, 0.975), scaled = FALSE)
null.breadth(dat, dist.method = "jaccard", rep = 100, quantiles = c(0.025, 0.975), scaled = FALSE)
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
dist.method |
Dissimilarity index passed on to |
rep |
The number of permutations to generate a null distribution |
quantiles |
A vector length of two indicating the lower and upper quantiles to report for the null distribution. |
scaled |
A logical indicating whether to report the scaled ordinated host breadth. |
An array show the lower and upper quantiles of the null distribution for each taxonomic richness
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") null.breadth(dat)
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") null.breadth(dat)
This function calculates the null expectation of ordinated host breadth for each herbivore individually. The ordination for each herbivore is based on PCoA where the focal herbivore is not included.
null.breadth.focal(dat, dis.method = "jaccard", reps = 100)
null.breadth.focal(dat, dis.method = "jaccard", reps = 100)
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
dis.method |
Dissimilarity index passed on to vegdist in the vegan package. |
reps |
The number of permutations to generate a null distribution. |
In situations where the focal herbivore is the only species using a particular diet item, that diet item is not included in the ordination. This is the modified plant richness.
A list containing the following:
species |
Name of herbivore species (row name of |
)
observed.breadth |
Ordinated diet breadth |
scale.factor |
Ordinated diet breadth of most extreme generalist herbivore based on ordination |
observed.breadth.scaled |
Scaled ordinated diet breadth |
totalplantrichness |
Taxonomic diet richness of focal species |
modplantrichness |
Modified taxonomic diet richness of focal species (see details) |
null |
A vector of null ordinated diet values |
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") null.breadth.focal(dat)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") null.breadth.focal(dat)
Summarizes results contained in object created by null.breadth.focal
null.breadth.focal.summary(null.breadth.focal.out, quantiles = c(0.025, 0.975), round = 5, scaled = FALSE)
null.breadth.focal.summary(null.breadth.focal.out, quantiles = c(0.025, 0.975), round = 5, scaled = FALSE)
null.breadth.focal.out |
Object created by |
quantiles |
A vector length of two indicating the lower and upper quantiles to report for the null distribution. |
round |
A value indicating the number of digits to round results |
scaled |
Logical indicating whether to return scaled ordinated host breadth. |
Returns a dataframe of summarized results.
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-null.breadth.focal(dat) null.breadth.focal.summary(x)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-null.breadth.focal(dat) null.breadth.focal.summary(x)
This function calculates ordinated diet breadth
ordi.breadth(dat, dist.method = "jaccard")
ordi.breadth(dat, dist.method = "jaccard")
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
dist.method |
Dissimilarity index passed on to vegdist in the vegan package. |
A list containing the following
species |
A vector of the herbivore species names (row names of |
eig |
The eigen values for each of the PCo axes |
tot.breadth |
A vector of the raw ordinated host breadth for each species |
scaled.breadth |
A vector of the scaled ordinated host breadth for each species |
distances |
A list of vectors giving the distance of each diet item from the centroid of each herbivore |
group.vectors |
A matrix of logicals indicating diet items (columns) for each herbivore (rows) |
centroids.group |
A matrix giving the centroid on PCo (columns) for each herbivore (rows) |
plants.ord |
A matrix of the coordinates for each plant in PCoA space |
dist.method |
Dissimilarity index used for PCoA |
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
summaryhbreadth
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") ordi.breadth(dat)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") ordi.breadth(dat)
This function computes the ordinated host breadth based on ordination where each herbivore is excluded from the ordination.
ordi.focal.drop(dat, dist.method = "jaccard")
ordi.focal.drop(dat, dist.method = "jaccard")
dat |
A matrix of diet associations. Rows are herbivores and columns are diet items. |
dist.method |
Dissimilarity index passed on to vegdist in the vegan package. |
A list containing the following:
species |
Name of herbivore species (row name of |
ODB |
Ordinated diet breadth |
ODB.scaled |
Scaled ordinated diet breadth |
focal.distances |
Distance to each diet item from herbivore centroid based on ordination excluding focal herbivore |
focal.breadth |
Ordinated diet breadth of herbivore based on ordination where focal herbivore is excluded |
focal.scale.factor |
The ordinated diet breadth of an extreme generalist in the ordinated space when focal herbivore is excluded from the ordination |
focal.scale.breadth |
Scaled ordinated diet breadth of herbivore based on ordination where focal herbivore is excluded |
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") ordi.focal.drop(dat)
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") ordi.focal.drop(dat)
Plots the profile plot of distance from herbivore centroid to host plants. Useful for exploratory data analysis.
profPlot(specialization, id, col = c("black", "red"))
profPlot(specialization, id, col = c("black", "red"))
specialization |
The object created by the function |
id |
A numeric identifying which species of herbivore to plot from list |
col |
A vector length 2 indicating colors for plotting. First color is for non-diet items, second color is for diet items. |
A profile plot
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) profPlot(x,5)#profile plot for species 5
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) profPlot(x,5)#profile plot for species 5
This function summarizes the ordinated host breadth from the object created by ordi.breadth
.
summaryhbreadth(specialization, round = 5, do.order = FALSE, by = "Richness")
summaryhbreadth(specialization, round = 5, do.order = FALSE, by = "Richness")
specialization |
The object created by the function |
round |
The number of digits to round results |
do.order |
Logical indicating whether to sort results |
by |
Indicate which column to sort results by. Can be "Herbivore","Richness","Breadth", or "ScaledBreadth" |
A dataframe showing result summary
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
ordi.breadth
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) summaryhbreadth(x)
testdata<- c( 0,0,0,0,1,0,0,0,0,0,#1 0,0,0,0,0,0,1,1,0,0,#2 1,1,1,0,0,0,0,0,0,0,#3 0,0,0,0,1,1,0,1,0,1,#4 1,1,1,0,0,0,1,0,0,0,#4 1,1,0,0,1,0,1,0,0,0,#4 0,0,0,1,0,0,1,0,1,1,#4 1,0,1,0,1,1,0,0,0,1, #5 1,1,0,0,1,0,0,1,1,1,#6 1,1,1,0,1,1,0,1,1,1) #8 dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.breadth(dat) summaryhbreadth(x)
Summarizes object provided by ordi.focal.drop
summaryordi(ordi.out, round = 5)
summaryordi(ordi.out, round = 5)
ordi.out |
Object provided by |
round |
The number of digits to round results. |
A dataframe showing result summary
James Fordyce
Fordyce, J.A., C.C. Nice, C.A. Hamm, & M.L. Forister. Quantifying diet breadth through ordination of host association. Ecology
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.focal.drop(dat) summaryordi(x)
testdata<- c( 0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,1,1,0,0, 1,1,1,0,0,0,0,0,0,0, 0,0,0,0,1,1,0,1,0,1, 1,1,1,0,0,0,1,0,0,0, 1,1,0,0,1,0,1,0,0,0, 0,0,0,1,0,0,1,0,1,1, 1,0,1,0,1,1,0,0,0,1, 1,1,0,0,1,0,0,1,1,1, 1,1,1,0,1,1,0,1,1,1) dat<-array(dim=c(10,10),data=testdata) dat<-t(dat) colnames(dat)<-paste("",LETTERS[1:10],sep="") rownames(dat)<-paste("bug",1:10,sep="") x<-ordi.focal.drop(dat) summaryordi(x)