This function creates a latex table or data frame with the basic statistics of a data frame.
stats_df(
data,
missingval = -999,
ret = "tbl",
capt = "Statistics data frame",
align = "p{2cm}p{1cm}p{1cm}p{4cm}p{1.7cm}p{1.7cm}p{0.8cm}p{1.3cm}",
size = "\\footnotesize",
...
)either tex code for table a data frame
a data frame for which the overview should be created
numeric with the value that indicates missing values, if NULL no missings will be recorded
a character vector to define what kind of output should be returned (either "dfrm", "tbl", "file")
character with the caption of the table (not used in case data frame is returned)
alignment of the table passed to general_tbl (not used in case data frame is returned)
character with font size as for the table general_tbl
additional arguments passed to general_tbl
Richard Hooijmaijers
This function can be used to create a table with basic statistics of a data frame. The function will list the min, max, number of NA/missing values, number of unique categories and type of variable of all data items within a data frame. In case a data item has less than 10 unique categories, it will list the unique values. The main reason to use this function is to create a structured table with statistics of a data frame to be included in documentation.