plot_arrange: Merge multiple curves into a single graph

View source: R/plot_arrange.R

plot_arrangeR Documentation

Merge multiple curves into a single graph

Description

Merge multiple curves into a single graph

Usage

plot_arrange(
  plots,
  point = "mean",
  theme = theme_classic(),
  legend.title = NULL,
  legend.position = "top",
  trat = NA,
  gray = FALSE,
  ylab = "Dependent",
  xlab = "Independent",
  widthbar = 0,
  pointsize = 4.5,
  linesize = 0.8,
  textsize = 12,
  legendsize = 12,
  legendtitlesize = 12,
  fontfamily = "sans"
)

Arguments

plots

list with objects of type analysis.

point

defines whether you want to plot all points ("all") or only the mean ("mean")

theme

ggplot2 theme (default is theme_classic())

legend.title

caption title

legend.position

legend position (default is c(0.3,0.8))

trat

name of the curves

gray

gray scale (default is FALSE)

ylab

Variable response name (Accepts the expression() function)

xlab

treatments name (Accepts the expression() function)

widthbar

bar width (default is 0.3)

pointsize

shape size

linesize

line size

textsize

Font size

legendsize

Legend size text

legendtitlesize

Title legend size

fontfamily

font family

Value

The function returns a graph joining the outputs of the functions LM_model, LL_model, BC_model, CD_model, loess_model, normal_model, piecewise_model and N_model

Author(s)

Gabriel Danilo Shimizu

Examples

library(AgroReg)
library(ggplot2)
data("aristolochia")
attach(aristolochia)
a=LM(trat,resp)
b=LL(trat,resp,npar = "LL.3")
plot_arrange(list(a,b))

models <- c("LM1", "LL3")
r <- lapply(models, function(x) {
r <- with(granada, regression(time, WL, model = x))
})
plot_arrange(r,trat=models,ylab="WL (%)",xlab="Time (Minutes)")

models = c("asymptotic_neg", "biexponential", "LL4", "BC4", "CD5", "linear.linear",
           "linear.plateau", "quadratic.plateau", "mitscherlich", "MM2")
m = lapply(models, function(x) {
           m = with(granada, regression(time, WL, model = x))})
           plot_arrange(m, trat = paste("(",models,")"))

AgroReg documentation built on May 29, 2024, 9:13 a.m.