Skip to content

Show a dense preview of the DataFrame

Source code

Description

The formatting shows one line per column so that wide DataFrames display cleanly. Each line shows the column name, the data type, and the first few values.

Usage

<DataFrame>$glimpse(
  ...,
  max_items_per_column = 10,
  max_colname_length = 50,
  return_as_string = FALSE
)

Arguments

Ignored.
max_items_per_column Maximum number of items to show per column.
max_colname_length Maximum length of the displayed column names. Values that exceed this value are truncated with a trailing ellipsis.
return_as_string Logical (default FALSE). If TRUE, return the output as a string.

Value

DataFrame

Examples

library("polars")

as_polars_df(iris)$glimpse()
#> & Sepal.Length <f64> 5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, 5, 4.4, 4.9
#> & Sepal.Width  <f64> 3.5, 3, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1
#> & Petal.Length <f64> 1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5
#> & Petal.Width  <f64> 0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1
#> & Species      <cat> setosa, setosa, setosa, setosa, setosa, setosa, setosa, setosa, setosa, setosa