Interactive pivot tables with R(转)
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(转)的更多相关文章
- 转 Refresh Excel Pivot Tables Automatically Using SSIS Script Task
Refresh Excel Pivot Tables Automatically Using SSIS Script Task https://www.mssqltips.com/sqlservert ...
- 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 ...
- Shiny for Interactive Application Development using R(转)
This slidify-based deck introduces the shiny package from R-Studio and walks one through the develop ...
- Beautiful and Powerful Correlation Tables in R
Another correlation function?! Yes, the correlation function from the psycho package. devtools::inst ...
- 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 ...
- Graphics for R
https://cran.r-project.org/web/views/Graphics.html CRAN Task View: Graphic Displays & Dynamic Gr ...
- R2—《R in Nutshell》 读书笔记(连载)
R in Nutshell 前言 例子(nutshell包) 本书中的例子包括在nutshell的R包中,使用数据,需加载nutshell包 install.packages("nutshe ...
- 10分钟学习pandas
10 Minutes to pandas This is a short introduction to pandas, geared mainly for new users. You can se ...
- 转: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? ...
随机推荐
- C++命名空间【转】
本讲基本要求 * 掌握:命名空间的作用及定义:如何使用命名空间. * 了解:使用早期的函数库 重点.难点 ◆命名空间的作用及定义:如何使用命名空间. 在学习本书前面各章时,读者 ...
- Git托管
前面的话 本文将主要介绍如何使用Github来托管Git服务 SSH 大多数Git服务器都会选择使用SSH公钥来进行授权.系统中的每个用户都必须提供一个公钥用于授权 首先先确认一下是否已经有一个公钥了 ...
- 微信小程序,前端大梦想(二)
微信小程序的视图与渲染 今天我们从四个方面来了解小程序: •组件的基本使用 •数据绑定 •渲染标签 •模板的使用 一.组件的基本使用: 微信小程序为我们的开发提供了丰富的UI组件 ...
- windows下用cordova构建android app
最近用到cordova打包apk,总结了下,写下来给大家分享. 一.前期准备工作: 1.安装node 6.2.0 *64 下载地址:链接:http://pan.baidu.com/s/1eS7Ts ...
- Java高级特性(基础)
1.StringBuffer.StringBuilder和String一样,也用来代表字符串.String类是不可变类,任何对String的改变都 会引发新的String对象的生成:StringBuf ...
- 【算法系列学习】SPFA邻接表最短路 [kuangbin带你飞]专题四 最短路练习 F - Wormholes
https://vjudge.net/contest/66569#problem/F 题意:判断图中是否存在负权回路 首先,介绍图的邻接表存储方式 数据结构:图的存储结构之邻接表 邻接表建图,类似于头 ...
- Vue 项目实战系列 (二)
上一章节我们已经把项目的初始化工作完成了,接下来我们再来进行具体的代码编写.这一节我们将完成如下的页面. 我们在src/目录下新建一个views文件夹,存放我们的主要页面文件.目录结构如下: cine ...
- Unity 总裁 John Riccitiello 发话:VR足以匹敌互联网
在2017年Vision Summit大会的开幕演讲中,Unity首席执行官John Riccitiello向观众通报了开发人员如何利用Oculus,HTC等品牌创造的机遇来打造虚拟现实(VR)行业, ...
- 当谈 SQL 优化时谈些什么?
欢迎大家关注腾讯云技术社区-博客园官方主页,我们将持续在博客园为大家推荐技术精品文章哦~ 作者:孙银行 背景 Mysql数据库作为数据持久化的存储系统,在实际业务中应用广泛.在应用也经常会因为SQL遇 ...
- httpd配置ResponseHeader
今天遇到一个问题:我把项目编译后的静态文件发布到开发机上,开发机使用httpd启的静态文件服务,页面的访问是在特制的壳浏览器里面,我更新了代码后,发现页面被缓存了,找到壳的RD联调了一下,发现我的主页 ...
