rAmCharts - introduction (original) (raw)

Use the Javascript features for your R charts

rAmCharts is an R package for interactive charts. It is based on the javascript library amcharts.js (https://amcharts.com). Currently it implements most of the functionnalities found in the distributions CHARTS and STOCK CHARTS. You’ll find the source code and bug reports on our github page, do not hesitate to send your bugs and your comments.

Based on htmlwidgets, it is compatible with shiny, R Markdown documents and RStudio viewer.

Installation

Package is on CRAN.

install.packages("rAmCharts")

# can have new features in developpement version 
devtools::install_github("datastorm-open/rAmCharts")

Prerequisite

For those who are not familiar with the ‘pipe style’ the following lines are equivalent:

head(x = get("iris", "package:datasets"), n = 3)
# or
get("iris", "package:datasets") %>>% head(n = 3)
# or
pipeline(
  get("iris", "package:datasets"),
  head(n = 3)
)
##   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1          5.1         3.5          1.4         0.2  setosa
## 2          4.9         3.0          1.4         0.2  setosa
## 3          4.7         3.2          1.3         0.2  setosa

Important notice

For all charts generated by R code you’ll see in this introduction, you see a call to the method plot(). It is only necessary for using the package in rmarkdown reports. For other use for instance in the R Studio viewer or shiny applications the method the plot is optionnal.

Find help