Shiny: Render R Plots into Interactive HTML
RStudio

Shiny: Render R Plots into Interactive HTML

Following strong, long-standing recommendations from friends (Chris Meaney) and colleagues (Anna Nicanorova), I recently had the pleasure of building an interactive HTML interface using the R Shiny package for a commercial project.

The concept is brilliant. Shiny enables you to output any of your favourite R graphics from a web browser so that you can easily share visualisations of your data or results, such as this plot of film ratings with Oscar winners shown in gold:

The Shiny developers, RStudio, provide a set of "control widgets" you can add to the output HTML so that viewers of your output can adjust parameters of the plot. In the film ratings example above, this includes:

  • a slide to select a "minimum number of reviews" threshold,
  • a double-sided slider to choose a range of release years, and
  • a drop-down box to select film genre.

Here are some of the most widely useful control widgets:

As a frequent R programmer, I found the implementation of Shiny to be straightforward. You need to get used to working simultaneously with two separate R files (server.R for backend calculations and ui.R for the user interface), familiarise yourself with the available control widgets, and discover reactive functions (reactivity enables the graphics to respond to live user input), but the well-produced tutorials make this process easy and fun.

RStudio provide a gallery full of beautiful examples (including their underlying code), but another one of my favourites is this map of the United States that has demographic data you can explore by postal (ZIP) code:

If you're looking to provide someone, perhaps a client, with an enjoyable way to explore their own data or to share the results of your work for them, I can now corroborate Shiny as a great way to do it! It could also make for a fun way to tell a data story during a presentation.

要查看或添加评论,请登录

Jon Krohn的更多文章

  • A Data Science Approach to Maximizing Data Scientist Salary

    A Data Science Approach to Maximizing Data Scientist Salary

    I recently had the honor of speaking to the New York chapter of Women in Machine Learning and Data Science about the…

    1 条评论
  • How to Transition from Academia to Data Science

    How to Transition from Academia to Data Science

    On Friday, October 9th, I had the honor of sitting on a great panel to discuss how academic scientists can transition…

    3 条评论
  • "What is Code?"

    "What is Code?"

    Recently, the number of cell phones on the planet exceeded the number of humans, penetrating markets that include even…

  • The First Self-Aware Machines

    The First Self-Aware Machines

    A robot has demonstrated self-awareness. Is Homo sapiens now on the verge of extinction? Big names like Hawking, Musk…

  • Genomics: Imminent, Positive, Disruptive Tech

    Genomics: Imminent, Positive, Disruptive Tech

    The complexity of life is beautiful; the biology of the human body alone is astounding. We have cells that form hard…

    2 条评论
  • The Neurophysiology of Happiness

    The Neurophysiology of Happiness

    As recently as two decades ago, academic psychologists predominantly took for granted that baseline happiness in adults…

    2 条评论
  • MLConf: The Machine Learning Conference 2015

    MLConf: The Machine Learning Conference 2015

    MLConf, the Machine Learning Conference, was hosted on Friday at the 230 Fifth rooftop nightclub in New York. Despite…

    1 条评论
  • Your Future Self's Aspirations for You

    Your Future Self's Aspirations for You

    My brilliant friend, machine vision engineer Alex Flint, early this morning offered an anthropological thought…

    2 条评论
  • What Consumers Want: It's Immaterial

    What Consumers Want: It's Immaterial

    Perhaps the most fundamental tenet of a business is anticipating what your consumer desires. Convincing prospective…

  • Zero to One: Peter Thiel's Call for Innovation

    Zero to One: Peter Thiel's Call for Innovation

    Zero to One, published in September, is perhaps the most fascinating book I've ever read. It has certainly had a…

    3 条评论

社区洞察

其他会员也浏览了