Abstract {DescTools} | R Documentation |
Display Compact Abstract of a Data Frame
Description
Compactly display the content and structure of a data.frame
, including
variable labels. str()
is optimized for lists and its output is
relatively technical, when it comes to e.g. attributes. summary()
on
the other side already calculates some basic statistics.
Usage
Abstract(
x,
sep = ", ",
zero.form = ".",
maxlevels = 5,
trunc = TRUE,
list.len = 999
)
## S3 method for class 'abstract'
print(x, sep = NULL, width = NULL, trunc = NULL, print.gap = 2, ...)
Arguments
x |
a |
sep |
the separator for concatenating the levels of a factor |
zero.form |
a symbol to be used, when a variable has zero NAs. |
maxlevels |
(integer, |
trunc |
logical, defining if level names exceeding the column with
should be truncated. Default is |
list.len |
numeric; maximum number of list elements to display. |
width |
Console width. If |
print.gap |
(integer) Number of spaces between columns. |
... |
Further arguments to |
Details
The levels of a factor and describing variable labels (as created by
Label()
) will be wrapped within the columns.
The first 4 columns are printed with the needed fix width, the last 2
(Levels and Labels) are wrapped within the column. The width is calculated
depending on the width of the screen as given by getOption("width")
.
ToWord
has an interface for the class abstract
.
Value
an object of class abstract
, essentially a character matrix
with 5 or 6 columns containing:
a column number (
Nr
),the name of the column (
ColName
),the column class (
Class
),the number of NAs (
NAs
),the levels if the variable is a factor (
Levels
),(if there are any) descriptive labels for the column (
Labels
).
Author(s)
Andri Signorell andri@signorell.net
See Also
utils::str()
, base::summary()
, ColumnWrap()
, Desc()
Other Statistical summary functions:
Desc()
Examples
d.mydata <- d.pizza
# let's use some labels
Label(d.mydata) <- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam."
Label(d.mydata$temperature) <- "Amet, consetetur sadipscing elitr, sed diam nonumy "
Abstract(d.mydata)