Skip to content

Instantly share code, notes, and snippets.

@kazutan
Created April 12, 2017 16:11
Show Gist options
  • Save kazutan/91454a8602a06cf358234885725e3f73 to your computer and use it in GitHub Desktop.
Save kazutan/91454a8602a06cf358234885725e3f73 to your computer and use it in GitHub Desktop.
datatableをlapplyで作成してcombining
---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(DT)
library(dplyr)
library(manipulateWidget)
wf <- function(x) {
datatable(
x, extensions = 'FixedColumns',
options = list(
dom = 't',
deferRender = TRUE,
scrollX = TRUE,
scrollY = 200,
scrollCollapse = TRUE
)
)
}
wl <- lapply(split(iris, iris[,5]), wf)
combineWidgets(
ncol = 2, colsize = c(2, 1),
wl[[1]],
combineWidgets(
ncol = 1,
wl[[2]],
wl[[3]]
)
)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment