I love interactive pivot tables. That is the number one reason why I keep using spreadsheet software. The ability to look at data quickly in lots of different ways, without a single line of code helps me to get an understanding of the data really fast.

Perhaps I can do the same now in R as well. At yesterday's LondonR meeting Enzo Martogliopresented briefly his rpivotTable package. Enzo builds on Nicolas Kruchten's PivotTable.jsJavaScript library that provides drag'n'drop functionality and wraps it with htmlwidget into R. The result is an interactive pivot table rendered in either your default browser or the viewer pane of RStudio with one line of code:

## Install packages
library(devtools)
install_github("ramnathv/htmlwidgets")
install_github("smartinsightsfromdata/rpivotTable")
## Load rpivotTable
library(rpivotTable)
data(mtcars)
## One line to create pivot table
rpivotTable(mtcars, rows="gear", col="cyl", aggregatorName="Average",
vals="mpg", rendererName="Treemap")

The following animated Gif from Nicolas' project page gives an idea of the interactive functionality of PivotTable.js.

Example of PivotTable.js Source: Nicolas Kruchten

Session Info

R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.2 (Yosemite) locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages:
[1] stats graphics grDevices utils
[5] datasets methods base other attached packages:
[1] rpivotTable_0.1.3.4 loaded via a namespace (and not attached):
[1] digest_0.6.8 htmltools_0.2.6
[3] htmlwidgets_0.3.2 RJSONIO_1.3-0
[5] tools_3.1.3 yaml_2.1.13
转自:http://www.magesblog.com/2015/03/pivot-tables-with-r.html

Interactive pivot tables with R(转)的更多相关文章

  1. 转 Refresh Excel Pivot Tables Automatically Using SSIS Script Task

    Refresh Excel Pivot Tables Automatically Using SSIS Script Task https://www.mssqltips.com/sqlservert ...

  2. Find modern, interactive web-based charts for R at the htmlwidgets gallery

    While R's base graphics library is almost limitlessly flexible when it comes to create static graphi ...

  3. Shiny for Interactive Application Development using R(转)

    This slidify-based deck introduces the shiny package from R-Studio and walks one through the develop ...

  4. Beautiful and Powerful Correlation Tables in R

    Another correlation function?! Yes, the correlation function from the psycho package. devtools::inst ...

  5. The leaflet package for online mapping in R(转)

    It has been possible for some years to launch a web map from within R. A number of packages for doin ...

  6. Graphics for R

    https://cran.r-project.org/web/views/Graphics.html CRAN Task View: Graphic Displays & Dynamic Gr ...

  7. R2—《R in Nutshell》 读书笔记(连载)

    R in Nutshell 前言 例子(nutshell包) 本书中的例子包括在nutshell的R包中,使用数据,需加载nutshell包 install.packages("nutshe ...

  8. 10分钟学习pandas

    10 Minutes to pandas This is a short introduction to pandas, geared mainly for new users. You can se ...

  9. 转:Busy Developers' Guide to HSSF and XSSF Features

    Busy Developers' Guide to Features Want to use HSSF and XSSF read and write spreadsheets in a hurry? ...

随机推荐

  1. 看Lucene源码必须知道的基本规则和算法

    上中学的时候写作文,最喜欢的季节我都是写冬天.虽然是因为写冬天的人比较少,那时确实也是对其他季节没有什么特殊的偏好,反而一到冬天,自己皮肤会变得特别白.但是冬天啊,看到的只有四季常青盆栽:瓜栗(就是发 ...

  2. 用java写的一个简易记事本

    import java.awt.*; import java.awt.event.*; import java.io.*; public class NoteDemo { private Frame ...

  3. JavaScript定时器分析

    一.事件循环 JavaScript是单线程,同一个时间只能做一件事情,所以执行任务需要排队.如果前一个耗时很长,那么下一个只能等待. 1)两种任务 为了更好的处理任务,JavaScript语言的设计者 ...

  4. iOS开发tips-神奇的UITableView

    概述 UITableView是iOS开发中使用频率最高的UI控件,在前面的文章中对于UITableView的具体用法有详细的描述,今天主要看一些UITableView开发中的常见一些坑,这些坑或许不深 ...

  5. WPF中button按钮同时点击多次触发click解决方法

    DateTime lastClick = DateTime.Now; object obj = new object(); ; private void Button_Click(object sen ...

  6. 一条SQL搞定信息增益的计算

    欢迎大家关注腾讯云技术社区-博客园官方主页,我们将持续在博客园为大家推荐技术精品文章哦~ 周东谕,2011年加入腾讯,现任职于腾讯互娱运营部数据中心,主要从事游戏相关的数据分析和挖掘工作. 信息增益原 ...

  7. Python -堆的实现

    最小(大)堆是按完全二叉树的排序顺序的方式排布堆中元素的,并且满足:ai  >a(2i+1)  and ai>a(2i+2)( ai  <a(2i+1)  and ai<a(2 ...

  8. 是什么让spring 5放弃了使用Guava Cache?

    一路走来,Spring社区从刚开始的核心模块一直发展到现在,最近Sping5也完成了M5的发布, 相信不久之后第一个RELEASE版本也会发布.里面有很多特性是和即将要发布的JAVA 9息息相关的.今 ...

  9. 1.6 OWIN集成

    OWIN集成 安装 使用 如果在应用程序里既使用ASP.NET MVC也使用ASP.NET Web API,需要在工程里安装Abp.Owin包. 安装 添加Abp.Owin包到主工程里(一般是web工 ...

  10. SQL生成一年每一天的时间列表的几种方法

    工作好几年了,一直没有写博客,准备捡起来...   以下脚本适用环境:SQL SERVER (starting with 2012)   1.构建序列:   /*1-1:利用交叉连接,推荐下列这种写法 ...