MyNixOS website logo
Description

Radar Chart from 'Chart.js'.

Create interactive radar charts using the 'Chart.js' 'JavaScript' library and the 'htmlwidgets' package. 'Chart.js' <http://www.chartjs.org/> is a lightweight library that supports several types of simple chart using the 'HTML5' canvas element. This package provides an R interface specifically to the radar chart, sometimes called a spider chart, for visualising multivariate data.

radarchart

Build Status AppVeyor Build Status CRAN Status CRAN RStudio mirror downloads Total CRAN downloads

An R implementation of the radar chart from the chart.js javascript library.

Installation

You can install from CRAN.

install.packages("radarchart")

To install the latest version direct from GitHub you'll need devtools installed. Assuming you have this run:

devtools::install_github("MangoTheCat/radarchart")

Or if you want to hack about with the code then clone the repository, change directory into it and run

devtools::install()

Note: htmlwidgets packages don't work well with devtools::load_all().

Usage

Once installed you can make a radar chart

library(radarchart)

labs <- c("Communicator", "Data Wangler", "Programmer",
          "Technologist",  "Modeller", "Visualizer")

scores <- list(
  "Rich" = c(9, 7, 4, 5, 3, 7),
  "Andy" = c(7, 6, 6, 2, 6, 9),
  "Aimee" = c(6, 5, 8, 4, 7, 6)
)

chartJSRadar(scores = scores, labs = labs, maxScale = 10)
Static image of example output

Static version. Real plots are interactive

Alternatively, you may supply a data frame and chartJSRadar will pickup the labels from the first column of the data. Also we're showing an option to display data set labels in the mouse over.

scores <- data.frame("Label"=c("Communicator", "Data Wangler", "Programmer",
                     "Technologist",  "Modeller", "Visualizer"),
                     "Rich" = c(9, 7, 4, 5, 3, 7),
                     "Andy" = c(7, 6, 6, 2, 6, 9),
                     "Aimee" = c(6, 5, 8, 4, 7, 6))

chartJSRadar(scores, maxScale = 10, showToolTipLabel=TRUE)
Static image of example output

Static version. Real plots are interactive

You can now also add a title

chartJSRadar(skills, main = "Data Science Radar")
Static image of example output

Static version. Real plots are interactive

Shiny

As it's based on htmlwidgets it's easy to use radarchart with Shiny. Just use the

chartJSRadarOutput("ID", width = "450", height = "300")

function in your ui.R and call chartJSRadar as normal in your server.R. A minimal example can be found in inst/shiny-examples/basic. You can run this with the runExampleApp function

runExampleApp("basic")

An "options" app is available to help construct more customised radar charts.

License

MIT © Mango Solutions, Nick Downie.

Metadata

Version

0.3.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows