amBoxplot: Plotting boxplot using rAmCharts

Description Usage Arguments Value References See Also Examples

View source: R/chart_amBoxplot.R

Description

amBoxplot computes a boxplot of the given data values. Can be a vector, a data.frame, or a matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
amBoxplot(object, ...)

## Default S3 method:
amBoxplot(
  object,
  xlab = NULL,
  ylab = NULL,
  ylim = NULL,
  names = NULL,
  col = "#1e90ff",
  horiz = FALSE,
  ...
)

## S3 method for class 'data.frame'
amBoxplot(
  object,
  id = NULL,
  xlab = NULL,
  ylab = NULL,
  ylim = NULL,
  col = NULL,
  horiz = FALSE,
  ...
)

## S3 method for class 'matrix'
amBoxplot(
  object,
  use.cols = TRUE,
  xlab = NULL,
  ylab = NULL,
  ylim = NULL,
  col = NULL,
  horiz = FALSE,
  ...
)

## S3 method for class 'formula'
amBoxplot(
  object,
  data = NULL,
  id = NULL,
  xlab = NULL,
  ylab = NULL,
  ylim = NULL,
  col = NULL,
  horiz = FALSE,
  ...
)

Arguments

object

a vector, data.frame, a matrix, or a formula.

...

see amOptions for more options.

xlab, ylab

character, labels of the axis.

ylim

numeric, y values range with sensible defaults.

names

character, name on x-axis, if object is a vector.

col

character, color(s) to be used to fill the boxplot.

horiz

logical, TRUE to rotate chart.

id

character, column name of id to identify outliers, if object is a dataframe.

use.cols

logical, for matrix only. Set to TRUE to display boxplot based on columns.

data

data.frame, from which the variables in formula should be taken.

Value

An object of class AmChart.

References

See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI

See Also

amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Not run: 
# 'numeric' (default)
amBoxplot(rnorm(100))

# 'formula'
amBoxplot(count ~ spray, data = InsectSprays)

# 'formula', two group
data <- InsectSprays
data$group <- c("H", "F")
amBoxplot(count ~ spray + group, data = data, col = c("purple", "darkblue"))

# 'matrix'
x <- matrix(nrow = 10, ncol = 5, rnorm(50))
amBoxplot(x)

# 'data.frame'
amBoxplot(iris[, 1:4])


## End(Not run)
# Other examples available which can be time consuming depending on your configuration.


don <- data.frame(a = 1:10, b = 1:5)
amBoxplot(don, ylim = c(0,15))


# --- matrix
x <- matrix(nrow = 10, ncol = 5, rnorm(50))

amBoxplot(x) # on columns
colnames(x) <- LETTERS[1:5]
amBoxplot(x) # with names
amBoxplot(x, use.cols = FALSE, col = c("blue", "red"))

# Parameter for amOptions
amBoxplot(x, export = TRUE, exportFormat = "SVG")


# --- Formula
(obj <- amBoxplot(count ~ spray, data = InsectSprays))

# Adding parameters
amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50),
          xlab = "spray", col = c("darkblue", "gray"))

# Transpose
amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50), xlab = "spray", horiz = FALSE)

# Using a custom colum to identify outliers
InsectSprays$id <- paste0("ID : ", 1:nrow(InsectSprays))
amBoxplot(count ~ spray, data = InsectSprays, id = "id")

# Parameter for amOptions
amBoxplot(count ~ spray, data = InsectSprays, main = "amcharts")

rAmCharts documentation built on Dec. 6, 2019, 5:11 p.m.