iNZightPlot: iNZight Plot

Description Usage Arguments Details Value Author(s)

View source: R/iNZightPlot.R

Description

A general plotting function that automatically detects variable type and draws the appropriate plot. It also provides facilities to add inference information to plots, colour- and size-by variables, and can handle survey data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
iNZightPlot(x, y = NULL, g1 = NULL, g1.level = NULL, g2 = NULL,
  g2.level = NULL, varnames = list(), colby = NULL, sizeby = NULL,
  symbolby = NULL, extra.vars, locate = NULL, locate.id = NULL,
  locate.col = NULL, locate.extreme = NULL, highlight = NULL,
  data = NULL, design = NULL, freq = NULL, missing.info = TRUE,
  xlab = varnames$x, ylab = varnames$y, new = TRUE,
  inzpars = inzpar(), layout.only = FALSE, plot = TRUE,
  xaxis = TRUE, yaxis = TRUE, xlim = NULL, ylim = NULL,
  zoombars = NULL, hide.legend = FALSE, df, env = parent.frame(),
  ...)

Arguments

x

a vector (numeric or factor), or the name of a column in the supplied data or design object

y

a vector (numeric or factor), or the name of a column in the supplied data or design object

g1

a vector (numeric or factor), or the name of a column in the supplied data or design object. This variable acts as a subsetting variable.

g1.level

the name (or numeric position) of the level of g1 that will be used instead of the entire data set

g2

a vector (numeric or factor), or the name of a column in the supplied data or design object. This variable acts as a subsetting variable, similar to g1

g2.level

same as g1.level, however takes the additional value "_MULTI", which produces a matrix of g1 by g2

varnames

a list of variable names, with the list named using the appropriate arguments (i.e., list(x = "height", g1 = "gender"))

colby

the name of a variable (numeric or factor) to colour points by. In the case of a numeric variable, a continuous colour scale is used, otherwise each level of the factor is assigned a colour

sizeby

the name of a (numeric) variable, which controls the size of points

symbolby

the name of a factor variable to code point symbols

extra.vars

the names of any additional variables to be passed through the internal functions to the create and plot methods.

locate

variable to label points

locate.id

id of points (row numbers) to label

locate.col

the colour to locate points if a variable is not specified

locate.extreme

numeric, the number of extreme points to label (using Mahalanobis' distance)

highlight

numeric vector consisting of the row numbers/IDs of points to highlight

data

the name of a data set

design

the name of a survey object, obtained from the survey package

freq

the name of a frequency variable if the data are frequencies

missing.info

logical, if TRUE, information regarding missingness is displayed in the plot

xlab

the text for the x-label

ylab

the text for the y-label

new

logical, used for compatibility

inzpars

allows specification of iNZight plotting parameters over multiple plots

layout.only

logical, if TRUE, only the layout is drawn (useful if a custom plot is to be drawn)

plot

logical, if FALSE, the plot is not drawn (used by summary)

xaxis

logical, whether or not to draw the x-axis

yaxis

logical, whether or not to draw the y-axis

xlim

specify the x limits of the plot

ylim

specify the y limits of the plot

zoombars

numeric, length 2; when drawing a bar plot, if the number of bars is too large, the user can specify a subset. The first value is the starting point (1 is the first bar, etc), while the second number is the number of bars to show.

hide.legend

logical, if TRUE, the legend will not be drawn

df

compatibility argument

env

compatibility argument

...

additional arguments, see inzpar

Details

Some details here ...

Value

An inzightplotoutput object, which contains the information displayed in the plot

Author(s)

Tom Elliott


iNZightVIT/iNZightPlots documentation built on May 17, 2019, 10:10 p.m.