Skip to contents

fn_Boxplot

Description

A very simple multiple boxplot with more than one level of factor is generated, but without any labels or marks on the X-axis.

A very simple multiple boxplots (more than one level of factor) is generated with no labels or marks for the X-axis. It serves as the basis for the figures that will be generated through the analysis, whether they are simple or complex.

It returns a simple boxplot that can be upgraded according to needs.

The function requires defining:

  • val: A column containing the numeric values.
  • fac: The factor column (grouping column).
  • df: The data frame containing the data.
  • yrange: A vector with the minimum and maximum values of the y-axis.

See also: boxplot from the package graphics (version 3.6.2)

fn_Boxplot

The function is included in the Repbio package Reproductive biology analysis.

#library(Repbio)

The function is detailed below.

fn_Boxplot <- function(val,fac,df,yrange){
  boxplot(val~fac,data=df,
          xlab="",
          ylab="",
          col="white",
          border="black",
          notch = FALSE,
          ylim= yrange,
          xaxt="n"
          )
} # End function

Examples

Falta detallar el ejemplo For example, in the tmp data frame, the variable to analyze is in the LT column and the factors in the Phases column.

#   val <- tmp$LT
#   fac <- as.factor(tmp$Phase)
#   df <- tmp
#   yrange <- c(20,300)
#
#   ejemplo <- fn_Boxplot(val,fac,df,yrange)

References

Salas‐Singh, C., Morales‐Bojórquez, E., & Aguirre‐Villaseñor, H. (2022). Reproductive biology of the bullseye puffer Sphoeroides annulatus: Gonadosomatic index and its suitability for estimating length at maturity. Journal of Fish Biology, 101(5), 1119-1133.https://doi.org/10.1111/jfb.15174