Learn R Programming

rlc

This package is an R wrapper for the JavaScript linked-charts library. rlc is an easy to use instrument for interactive data visualisation. It allows to open interactive charts either in the RStudio Viewer or in the default browser window and on the fly process information about user's action (clicking, hovering with mouse, selecting points) in the running R session. This makes it easy to link the charts so that clicks on one of them change the state of the others.

Installation

rlc can be installed from CRAN:

install.package("rlc")

You can also install the latest developmental version from GitHub:

install.packages("devtools")
devtools::install_github("anders-biostat/rlc")

Types of charts

Currently supported types of charts are:

  • lc_heatmap - heatmap
  • lc_scatter - scatter plot
  • lc_beeswarm - bee swarm plot (either vertical or horizontal)
  • lc_line - lines, defined by sets of X and Y coordinates
  • lc_path - lines, defined by sets of X and Y coordinates in a given order
  • lc_abLine - lines, defined by slope (a) and intercept (b) values
  • lc_vLine - vertical lines
  • lc_hLine - horizontal lines
  • lc_dens - density plot
  • lc_hist - histogram
  • lc_bars - bar chart

Other elements

  • lc_colourSlider - an additional element to interactively change a continuous colour scale of any other chart.
  • lc_html - customary HTML code to be inserted in the web page.
  • lc_input - five types of HTML <input> tag: text, radio, checkbox, range and button.
  • lc_image - adds a static plot or any image to the web page.

Examples

To see how it works, have a look at these tutorials.

Copy Link

Version

Install

install.packages('rlc')

Monthly Downloads

216

Version

0.5.0

License

GPL-3

Maintainer

Svetlana Ovchinnikova

Last Published

December 16th, 2023

Functions in rlc (0.5.0)

lc_scatter

Visualize a set of points
lc_html

Add HTML code to the page
lc_input

Add input forms to the page
listen

Listen to the server
mark

Mark elements of a chart
removeChart

Remove chart from the page
openPage

Open a new empty page
lc_line

Lines and ribbons
lc_image

Add static plot or custom image to the page
listCharts

List all existing charts and layers
updateCharts

Update a chart
setProperties

Set properties of the chart
removeLayer

Remove a layer from a chart
getPage

Get the currently running app
dat

Link data to the chart
lc_heatmap

Create a heatmap
LCApp

LCApp class
lc_hist

Histograms and density plots
closePage

Stop server
getMarked

Get currently marked elements
lc_bars

Create a barplot
chartEvent

Trigger an event
lc_colourSlider

Add a colour slider