Learn R Programming

metaplot (version 0.3.2)

scatter.data.frame: Scatterplot Method for Data Frame

Description

Scatterplot method for class 'data.frame'. Parses arguments and generates the call: fun(x, yvar, xvar, groups, facets, ...).

Usage

# S3 method for data.frame
scatter(x, ..., fun = getOption("metaplot_scatter",
  "scatter_data_frame"))

Arguments

x

data.frame

...

passed to fun

fun

function to draw the plot

See Also

scatter_data_frame

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(Theoph,conc, Time)
scatter(Theoph, conc, Time, Subject) # Subject as groups
scatter(Theoph, conc, Time, , Subject) # Subject as facet
scatter(Theoph %>% filter(conc > 0), conc, Time, Subject, ylog = TRUE, yref = 5)
scatter(Theoph, conc, Time, Subject, ysmooth = TRUE)
scatter(Theoph, conc, Time, conf = TRUE, loc = 3, yref = 6)
scatter(Theoph, conc, Time, conf = TRUE, loc = 3, yref = 6, global = TRUE)
# }
# NOT RUN {
\dontshow{
attr(Theoph,'title') <- 'Theophylline'
scatter(Theoph, conc, Time, main = function(x,...)attr(x,'title'))
scatter(Theoph, conc, Time, sub= function(x,...)attr(x,'title'))
options(metaplot_main = function(x,...)attr(x,'title'))
scatter(Theoph, conc, Time)
}
# }

Run the code above in your browser using DataLab