ying_dt: Show data frame in Viewer, adapted from yingtools2

Description Usage Arguments Details Value Author(s) Examples

View source: R/dt_viewer.R

Description

Use to peruse a dataframe within RStudio. Utilizes DT package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ying_dt(
  data,
  fontsize = 15,
  pageLength = Inf,
  maxchars = 250,
  maxrows = 500,
  rownames = FALSE,
  escape = FALSE,
  class = "compact cell-border stripe",
  whiteSpace = "pre-wrap"
)

Arguments

data

dataframe to be viewed.

fontsize

numeric controlling font size in the table, measured in px. Default is 11.

pageLength

number of rows to display per page (Default Inf, show all rows)

maxchars

max number of characters before adding an ellipsis .... Default is 250.

maxrows

numeric controlling max number of rows to display. The purpose is to prevent DT from handling excessively large data frames. Default is 1000.

rownames

whether or not to show row names (passed directly to DT::datatable).

escape

whether to escape HTML entities in the table (passed directly to DT::datatable).

class

the CSS class(es) of the table (passed directly to DT::datatable).

whiteSpace

CSS property sets how white space inside an element is handled. Default is "pre-wrap".

Details

If data frame is grouped (i.e. group_by in dplyr), the rows will be sorted and shaded by group.

Value

A javascript-style datatable, which displays in the Rstudio viewer.

Author(s)

Zhonghui Gai

Examples

1
2
3
groutable(data = iris, variable = 5)  |> extract_groutable ()  |> ying_dt()
kableExtra::kable_styling(kableExtra::kable(groutable(data = iris, variable = 5)  |>
extract_groutable (), "html"))

ZhonghuiGai/groutable documentation built on Jan. 1, 2022, 9:12 p.m.