View source: R/loess_analysis.R
loessreg | R Documentation |
Fit a polynomial surface determined by one or more numerical predictors, using local fitting.
loessreg(
trat,
resp,
degree = 2,
sample.curve = 1000,
ylab = "Dependent",
xlab = "Independent",
theme = theme_classic(),
legend.position = "top",
error = "SE",
point = "all",
width.bar = NA,
scale = "none",
textsize = 12,
pointsize = 4.5,
linesize = 0.8,
linetype = 1,
pointshape = 21,
fillshape = "gray",
colorline = "black",
fontfamily = "sans"
)
trat |
Numeric vector with dependent variable. |
resp |
Numeric vector with independent variable. |
degree |
Degree polynomial (0,1 or 2) |
sample.curve |
Provide the number of observations to simulate curvature (default is 1000) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_bw()) |
legend.position |
legend position (default is c(0.3,0.8)) |
error |
Error bar (It can be SE - default, SD or FALSE) |
point |
defines whether you want to plot all points ("all") or only the mean ("mean") |
width.bar |
Bar width |
scale |
Sets x scale (default is none, can be "log") |
textsize |
Font size |
pointsize |
shape size |
linesize |
line size |
linetype |
line type |
pointshape |
format point (default is 21) |
fillshape |
Fill shape |
colorline |
Color lines |
fontfamily |
Font family |
The function returns a list containing the loess regression and graph using ggplot2.
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
loess
library(AgroReg)
data("aristolochia")
attach(aristolochia)
loessreg(trat,resp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.