Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umxPlotFun

Easily plot functions in R


Description

Usage

umxPlotFun(
  fun = dnorm,
  min = -1,
  max = 5,
  xlab = NULL,
  ylab = NULL,
  title = NULL,
  p = NULL
)

Arguments

fun

Function to plot. Also takes strings like "sin(x) + sqrt(1/x)"

min

x-range min

max

x-range max

xlab

= Optional x axis label

ylab

= Optional y axis label

title

Optional title for the plot

p

Optional plot onto which to draw the function.

Details

Easily plot a function - like sin, using ggplot.

Value

  • A ggplot graph

See Also

Examples

## Not run: 
# Uses fonts not available on CRAN
umxPlotFun(sin, max= 2*pi)
umxPlotFun("sqrt(1/x)", max= 2*pi)
umxPlotFun(sin, max= 2*pi, ylab="Output of sin", title="My Big Graph")
p = umxPlotFun(function(x){x^2}, max= 100, title="Supply and demand")
umxPlotFun(function(x){100^2-x^2}, p = p)

# Controlling other plot features
umxPlotFun(c("sin(x)", "x^3")) + ylim(c(-1,5)) 

## End(Not run)

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.