amPlot | R Documentation |
amPlot computes a plot of the given data values (can be a vector, dataframe or formula).
amPlot(x, ...) ## Default S3 method: amPlot(x, ...) ## S3 method for class 'numeric' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, title = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'character' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, parseDates = FALSE, title = NULL, dataDateFormat, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'factor' amPlot( x, y, bullet = "round", type = "p", col = "gray", weights = NULL, precision = 2, parseDates = FALSE, dataDateFormat = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'data.frame' amPlot(x, columns, type = "l", precision = 2, xlab, ylab, fill_alphas = 0, ...) ## S3 method for class 'formula' amPlot(x, data, type = "p", fill_alphas = 0, xlab, ylab, main = "", ...)
x |
the coordinates of points in the plot : |
... |
see |
y |
|
bullet |
|
type |
|
col |
either a |
fill_alphas |
a |
weights |
|
precision |
|
title |
|
id |
|
error |
|
xlab |
|
ylab |
|
lty |
|
cex |
|
lwd |
|
xlim |
|
ylim |
|
parseDates |
|
dataDateFormat |
|
columns |
(optional) either a vector of |
data |
dataset |
main |
title |
Return an Amchart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: # 'numeric': amPlot(x = rnorm(100)) # add line chart <- amPlot(x = rnorm(100), type = 'sl', legend = T) amLines(chart, x = rnorm(100), type = "p") # 'character': start <- as.POSIXct('2015-01-01') end <- as.POSIXct('2015-12-31') date <- seq.POSIXt(from = start, to = end, by = 'day') date <- format(date) y <- rnorm(length(date)) amPlot(x = date, y = y, type = 'l', parseDates = TRUE, dataDateFormat = "YYYY-DD-MM") # notice that by default 'parseDates = FALSE' # 'data.frame' amPlot(iris, col = colnames(iris)[1:2], type = c("l", "st"), zoom = TRUE, legend = TRUE) # 'formula': amPlot(Petal.Length + Sepal.Length ~ Sepal.Width, data = iris, legend = TRUE, zoom = TRUE) ## End(Not run) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(data.table) iris <- as.data.table(get("iris", "package:datasets")) x <- rnorm(100) # Simple scatter plot with title and color # Also change type (set to "p" by default), avalaible "l", "sl", "st", "p", "b" amPlot(x = x, main = "Title", col = "lightblue", type = "b") x <- sort(rnorm(100)) y <- runif(100) weights <- runif(100, 0, 15) amPlot(x = x, y = y, weights = weights) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.