Code Monkey home page Code Monkey logo

radarchart's Introduction

radarchart

Build Status AppVeyor Build Status CRAN Status codecov 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

radarchart's People

Contributors

adeelk93 avatar dougmet avatar grahamrp avatar shaneporter avatar timelyportfolio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.