Learn R Programming

fullfact (version 1.0)

boxMANA: Boxplot of resampled results

Description

A simple boxplot function for bootstrap and jackknife resampled results of additive genetic, non-additive genetic, and maternal variance components.

Usage

boxMANA(comp, type = "perc", ymax = NULL, ymin = NULL, yunit = NULL, leg = "topright", cex_ylab = 1, cex_yaxis = 1, cex_names = 1)

Arguments

comp
Data frame of bootstrap or jackknife resampling results.
type
Default is "perc" for percentage values of variance components. Other option is "raw" for raw values of variance components.
ymax
Maximum value of the y-axis.
ymin
Minimum value of the y-axis.
yunit
Unit increment of the y-axis.
leg
Position of the simple legend.
cex_ylab
Magnification of the y-axis label.
cex_yaxis
Magnification of the y-axis units.
cex_names
Optional magnification of trait labels.

Details

Plots an R boxplot. Uses an object produced by any of the bootstrap resampling functions, i.e. resampLmer, resampLmer2, resampLmer3, resampGlmer, resampGlmer2, and resampGlmer3. Or any of the jackknife resampling functions, i.e. JackLmer, JackLmer2, JackLmer3, JackGlmer, JackGlmer2, and JackGlmer3. Produces a simple legend.

Examples

Run this code

#Import bootstrap resampled data model results
data(chinook_bootL) #Chinook salmon offspring length

#Default plot
boxMANA(comp=chinook_bootL)
#Add plot modifications
boxMANA(comp=chinook_bootL,yunit=20,ymax=100,cex_ylab=1.3)

##Group length and survival together in the same plot
data(chinook_bootS) #Chinook salmon offspring survival
chinook_bootL$trait<- "length"
chinook_bootS$trait<- "survival"

colnames(chinook_bootL[,-2])
colnames(chinook_bootS)
#
comb_boot<- rbind(chinook_bootL[,-2],chinook_bootS) #remove 'tray'
comb_boot$trait<- as.factor(comb_boot$trait) #to form levels

#Default plot
boxMANA(comp=comb_boot)
#Add plot modifications
boxMANA(comp=comb_boot,yunit=20,ymax=100,cex_ylab=1.3)

Run the code above in your browser using DataLab