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? ...
随机推荐
- 2017.3.12 H5学习的第一周
本周我开始了H5的学习,在这一周里我们从html的基本标签开始一直讲到了才算css的用法,接下来我将记录下来本周我学到的H5的内容. 首先是声明文档,声明文档类型是HTML5文件,它在HTML文档必不 ...
- mac的终端为什么会显示git:(master),如何取消掉?
今天在终端误操作,在主目录下执行git init命令,结果杯具了, 总是出现这个提示. 各种搜索解决方案,终于退出了. 方法如下: 删掉.git目录: rm -rf ~/.git
- 《Python自然语言处理》第二章 学习笔记
import nltk from nltk.book import * nltk.corpus.gutenberg.fileids() emma = nltk.corpus.gutenberg.wor ...
- Webdriver API之元素定位
Webdriver提供了8种元素定位方法:id.name.class name.tag name.link text.partial link text.xpath.css selector 一.以上 ...
- 使用 Http 的 Get 方式读取网络数据
作为移动平台的应用,一定避免不了与网络交换数据,不论是读取网页数据,还是调用API接口,都必须掌握Http通信技术 代码如下: package zw1; import java.io.Buffered ...
- node.js系列(实例):原生node.js+formidable模块实现简单的文件上传
/** * 原生node.js结合formidable模块实现图片上传改名 * @Author:Ghost * @Date:2016/07/15 * @description: * 1.引入模块htt ...
- 兼容IE6/7/8/9的css3插件
<!DOCTYPE html><html><head> <meta charset="UTF-8" /> <tit ...
- 对象Equals相等性比较的通用实现
最近编码的过程中,使用了对象本地内存缓存,缓存用了Dictionary<string,object>, ConcurrentDictionary<string,oject>,还 ...
- myeclipse中文乱码
解决myeclipse中乱码问题. 改变整个Eclipse工作空间的编码格式 window->preferences->General->workspace中 把text file ...
- mui开发app之js将base64转图片文件
之前我已经做过一个利用cropper裁剪并且制作头像的功能.如何在mui app中实现相册或相机获取图片后裁剪做头像请看另一篇博客:mui开发app之cropper裁剪后上传头像的实现 但是当时裁剪后 ...