dfplot: Plot a dataframe, multiple ys against one x

Description Usage Arguments Value Examples

View source: R/beginr.R

Description

Plot a dataframe, multiple ys against one x

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
dfplot(
  x,
  y,
  add = FALSE,
  xlab = "",
  ylab = "",
  myaxes = FALSE,
  xlim = NULL,
  ylim = NULL,
  mycol = NULL,
  mytype = "l",
  mypch = 20,
  mycex = 1,
  mylty = NULL,
  lwd = 1,
  xerror = NULL,
  yerror = NULL,
  mycolerrorbar = NULL,
  mylegend = NULL,
  mylegendcol = mycol,
  mylegendcex = 1,
  legendpos = "top"
)

Arguments

x

a vector

y

a vector or a dataframe with the same length as x

add

logical, whether to add this plot to the previous one

xlab

character

ylab

character

myaxes

logical, whether to display axes automatically

xlim

numeric

ylim

numeric

mycol

colours

mytype

character

mypch

numeric or character

mycex

numeric

mylty

numeric

lwd

numeric

xerror

errorbar, same dimension of x

yerror

same dimension of y

mycolerrorbar

error bar colours

mylegend

character

mylegendcol

colors

mylegendcex

numeric

legendpos

character

Value

a figure

Examples

1
2
3
4
x <- seq(0, 2 * pi, length.out = 100)
y <- data.frame(sin(x), cos(x))
yerror <- data.frame(abs(rnorm(100, sd = 0.3)), abs(rnorm(100, sd = 0.1)))
dfplot(x, y, yerror = yerror)

pzhaonet/beginr documentation built on March 27, 2021, 1:20 p.m.