threeaxes.plot: A function to plot 2 y axes

Description Usage Arguments Value Examples

Description

This function plot two response variables vs. same x axis (predictors)

Usage

1
2
3
4
5
6
7
8
threeaxes.plot(my.data = NULL, xvar, yvar1, yvar2,
  xlab = names(my.data[xvar]), y1lab = names(my.data[yvar1]),
  y2lab = names(my.data[yvar1]), pch1 = 21, col1 = 4, bg1 = "gray",
  pch2 = 22, col2 = 2, bg2 = "gray", main = "", cex.main = 1,
  cex.lab = 1, cex = 1, cex.axis = 1, type = "p", las1 = 1,
  las2 = 1, xlog = FALSE, y1log = FALSE, mar = c(5, 4, 3, 4),
  y2log = FALSE, eq.scale = TRUE, x0lim = NULL, y1lim = NULL,
  y2lim = NULL, ...)

Arguments

xvar

x variable, either column name or index value

yvar1

y variable, either column name or index value

yvar2

y2 variable, either column name or index value

xlab

axis 1 name

y1lab

axis 2 name

y2lab

axis 4 name

pch1

yvar1 sympbol

col1

yvar1 color

bg1

yvar1 symbol background

pch2

yvar2 sympbol

col2

yvar2 color

bg2

yvar2 symbol background

y1log

if true, yvar1 should be log transformed

y2log

if true, yvar2 should be log transformed

eq.scale

=T then y1 and y2 have same number of ticks and labels, if false, y2 scale itself.

x0lim

add extra values to make sure xlim fall into the self defined range

y1lim

add extra values to make sure y1lim fall into the self defined range

y2lim

add extra values to make sure y2lim fall into the self defined range

data

A input data frame, default to be NULL,

use

is.list(x) to check if x variable is a time object...

Value

Returns .

Examples

1
2
3
4
5
xvar =1:100; yvar1 = rnorm(100)+ 1:100; yvar2 = rlnorm(100) + 1:100 
par(mfrow=c(1,3))
threeaxes.plot(my.data = NULL, xvar, yvar1, yvar2, y2log =T, eq.scale =F) 
threeaxes.plot(my.data = NULL, xvar, yvar1, yvar2, y2log =T, eq.scale =T) 
threeaxes.plot(my.data = NULL, xvar, yvar1, yvar2, y2log =F, eq.scale =F) 

kevinlzheng/RegR documentation built on May 20, 2019, 9:07 a.m.