Skip to contents

This function creates a HTML widget to display matrix or a data frame using ag-grid.

Usage

aggrid(
  data,
  rowSelection = c("multiple", "single"),
  suppressRowClickSelection = FALSE,
  selectedRows = NULL,
  checkboxSelection = FALSE,
  pagination = FALSE,
  paginationPageSize = 10,
  ...,
  theme = "ag-theme-balham",
  community = FALSE,
  use_cdn = FALSE,
  server = FALSE,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

data

data frame or matrix.

rowSelection

three options:multiple,single.

suppressRowClickSelection

When TRUE, disable row selection when clicking.

selectedRows

set default selectedRows rows.

checkboxSelection

Enable checkbox in first column?

pagination

Enable pagination allows?

paginationPageSize

default size is 10.

...

For more options, please see https://www.ag-grid.com/javascript-data-grid/grid-options

theme

Specify theme. Default is ag-theme-balham. please see https://www.ag-grid.com/example/?theme=ag-theme-alpine

community

Enable to use community?

use_cdn

Depends resource to use cdn?

server

server model

width, height

Width/Height in pixels (optional, defaults to automatic sizing)

elementId

An id for the widget (a random string by default).

Examples

aggrid(iris)
## use theme aggrid(iris, theme = "ag-theme-alpine")
## auto size columns aggrid(iris) |> auto_size_columns() #> Error in auto_size_columns(aggrid(iris)): could not find function "auto_size_columns" ## select row head(iris, n = 10) |> aggrid(checkboxSelection = T,selectedRows = 1:3)