Plot populations values against species values. The objectif is to see the contribution of intra-specific vs inter-specific variation to trait gradient.
plotSpVar(traits = NULL, ind.plot = NULL, sp = NULL, variable = NULL,
col.ind = rgb(0.5, 0.5, 0.5, 0.5), col.pop = NULL, col.sp = NULL,
col.site = NULL, resume = FALSE, p.val = 0.05, min.ind.signif = 10,
multipanel = TRUE, col.nonsignif.lm = rgb(0, 0, 0, 0.5),
col.signif.lm = rgb(1, 0.1, 0.1, 0.8), silent = FALSE)
Individual Matrix of traits with traits in columns.
Factor defining the name of the plot in which the individual is.
Factor defining the species which the individual belong to.
A matrix of variables corresponding to each site (in rows) and each trait (in columns). If you want to plot all traits against one variable, variable can be a vector of numerical values.
Color for individual values.
Color for populational mean values.
Color for species mean values.
Color for sites mean values.
Logical, if TRUE plot a simple form of the plot.
Choosen p.value to print significant linear relationship using linear model. Argument past to the lm funtion internally.
Minimum individual to print significant linear relationship.
Logical value. If TRUE divides the device to shown several traits graphics in the same device.
Color for non significant linear relationship.
Color for significant linear relationship.
Logical value, if resume = FALSE do not print warning argument.
None; used for the side-effect of producing a plot.
# NOT RUN {
data(finch.ind)
#Random variable for this example
variable <- c(1,5,15,6,3,25)
plotSpVar(traits.finch, ind.plot.finch, sp.finch, variable,
silent = TRUE)
#If we change the value of the threshold
#(alpha = 10% instead of 5%
#and the minimum individual to represent significativity
#fixed to 3 instead of 10 by default)
#we can see some significant relationships.
plotSpVar(traits.finch, ind.plot.finch, sp.finch, variable,
p.val = 0.1, min.ind.signif = 3, silent = TRUE)
#For a more simple figure, add the option resume = TRUE.
#Again if we change the value of the threshold
#(alpha = 10% instead of 5%
#and the minimum individual to represent significativity
# fixed to 3 instead of 10 by default)
#we can see some significant relationships.
plotSpVar(traits.finch, ind.plot.finch, sp.finch, variable,
silent = TRUE, resume = TRUE, col.pop = "grey")
plotSpVar(traits.finch, ind.plot.finch, sp.finch, variable,
silent = TRUE, resume = TRUE, col.pop = "grey", col.sp = "black")
plotSpVar(traits.finch, ind.plot.finch, sp.finch, variable,
silent = TRUE, resume = TRUE, col.pop = "grey", col.sp = "black",
p.val = 0.1, min.ind.signif = 3)
# }
Run the code above in your browser using DataLab