statar (version 0.1.1)

graph: Experimental function to graph a dataset

Description

Experimental function to graph a dataset

Usage

graph(x, ..., along_with = NULL, by = NULL, w = NULL, reorder = TRUE,
  winsorize = TRUE, facet = FALSE, verbose = FALSE, type = if
  (is.null(substitute(along_with))) {     "density" } else {     "lm" })

graph_(x, ..., .dots, along_with = NULL, by = NULL, w = NULL, reorder = TRUE, winsorize = TRUE, facet = FALSE, verbose = FALSE, type = if (is.null(along_with)) { "density" } else { "lm" })

Arguments

x
A data.table.
...
Variables to include. Defaults to all non-grouping variables. See the select documentation.
along_with
A variable that specifies the x axis. Should be specified when "type" is "line", "lm" or "loeless".
by
Groups within which variables should be ploted.
w
Weights (experimental)
reorder
Should the category with the most count be printed first?
winsorize
Should variables winsorized?
facet
Should different groups graphed in different windows?
verbose
Should warnings (regarding missing values, outliers, etc) be printed?
type
type of graph among "density", "boxplot", "line", "lm", "loess"
.dots
Used to work around non-standard evaluation.

Examples

Run this code
library(data.table)
N <- 100
DT <- data.table(
  id = sample(c("id1","id2","id3"), N, TRUE),
  v1 = sample(c(1:5), N, TRUE),
  v2 = rnorm(N, sd = 20),
  v3 = sample(runif(100, max=100), N, TRUE)
)
DT[, v4 := v3 + rnorm(N, sd = 20)]
graph(DT, by = id)
graph(DT, by = id, facet = TRUE)
graph(DT, by = id, type = "boxplot")
graph(DT, v3, v4, along_with = v2, by = id, type = "loess")

Run the code above in your browser using DataCamp Workspace