Learn R Programming

metaplot (version 0.3.2)

scatter_data_frame: Scatterplot Function for Data Frame

Description

Scatterplot function for class 'data.frame'.

Usage

scatter_data_frame(x, yvar, xvar, groups = NULL, facets = NULL,
  log = FALSE, ylog = log, xlog = log, yref = NULL, xref = NULL,
  ylab = NULL, xlab = NULL, ysmooth = FALSE, xsmooth = FALSE,
  iso = FALSE, crit = 1.3, na.rm = TRUE, aspect = 1, auto.key = NULL,
  keycols = NULL, as.table = TRUE, prepanel = NULL, scales = NULL,
  panel = metapanel, colors = NULL, symbols = NULL, points = TRUE,
  lines = FALSE, main = getOption("metaplot_main", NULL),
  sub = getOption("metaplot_sub", NULL), ...)

Arguments

x

data.frame

yvar

character: y variable(s)

xvar

character: x variable

groups

optional grouping variable; ignored if more than one yvar

facets

optional conditioning variables

log

a default sharede by ylog and xlog

ylog

log transform y axis (guessed if NULL)

xlog

log transform x axis (guessed if NULL)

yref

reference line from y axis

xref

reference line from x axis

ylab

y axis label, constructed from attributes label and guide if available

xlab

x axis label, constructed from attributes label and guide if available

ysmooth

supply loess smooth of y on x

xsmooth

supply loess smmoth of x on y

iso

plot line of unity

crit

if ylog or xlog missing, log transform if mean/median ratio for non-missing values is greater than crit

na.rm

whether to remove data points with one or more missing coordinates

aspect

passed to xyplot

auto.key

passed to xyplot

keycols

number of auto.key columns

as.table

passed to xyplot

prepanel

passed to xyplot (guessed if NULL)

scales

passed to xyplot (guessed if NULL)

panel

name or definition of panel function

colors

replacements for default colors in group order

symbols

replacements for default symbols in group order

points

whether to plot points for each group: logical, or alpha values between 0 and 1

lines

whether to plot lines for each group: logical, or alpha values between 0 and 1

main

character, or a function of x, yvar, xvar, groups, facets, and log

sub

character, or a function of x, yvar, xvar, groups, facets, and log

...

passed to region

See Also

metapanel

Other bivariate plots: metaplot.data.frame, scatter.data.frame, scatter

Other scatter: metapanel, scatter.data.frame, scatter

Examples

Run this code
# NOT RUN {
library(magrittr)
library(dplyr)
attr(Theoph$conc,'label') <- 'theophylline concentration'
attr(Theoph$conc,'guide') <- 'mg/L'
attr(Theoph$Time,'label') <- 'time'
attr(Theoph$Time,'guide') <- 'h'
attr(Theoph$Subject,'guide') <- '////'
scatter_data_frame(Theoph, 'conc', 'Time')
scatter_data_frame(Theoph, 'conc','Time', 'Subject')
scatter_data_frame(Theoph, 'conc','Time', facets = 'Subject')
scatter_data_frame(Theoph %>% filter(conc > 0), 'conc','Time', 'Subject',ylog = TRUE, yref = 5)
scatter_data_frame(Theoph, 'conc','Time', 'Subject',ysmooth = TRUE)
scatter_data_frame(Theoph, 'conc','Time', 'Subject',ysmooth = TRUE,global = TRUE)
scatter_data_frame(Theoph, 'conc','Time', conf = TRUE, loc = 3, yref = 6)
scatter_data_frame(Theoph, 'conc','Time', conf = TRUE, loc = 3, yref = 6)
# }

Run the code above in your browser using DataLab