Questions tagged [summarytools]

The "summarytools" tag is intended to be used in questions related to the R package of the same name.

summarytools is an R package focused on descriptive statistics. Its four core functions respectively produce:

  • Frequency tables
  • Cross-tabulations
  • Univariate numerical statitics
  • Dataframe summaries which combine elements of frequencies and numerical statistics, as well as graphical representations, missing data information, and variable labels

Its results can be displayed in the R console, but they can as easily be displayed in html documents formatted using Bootstrap CSS.

References:
Official CRAN page
Master branch on GitHub
Development branch on GitHub
Reference Manual (pdf)

R Vignettes:
Introduction to summarytools
Recommendations for Using summarytools With Rmarkdown

44 questions
8
votes
2 answers

R, generate pretty plot by dfSummary

I have a problem using summarytools packet. There is tutorial:https://cran.r-project.org/web/packages/summarytools/vignettes/Introduction.html with pretty plots of data: My problem is that my code generate only TEXT GRAPH. This is chunk of code in…
CezarySzulc
  • 1,849
  • 1
  • 14
  • 30
3
votes
0 answers

SummaryTools dfSummary() not providing output, only HTML

Attempting to use SummaryTools on my work PC (Windows). I am trying to run dfSummary() but the only output i get is the HTML code in the console. I do not have issue using this library on my personal Mac, so i assume this might have something to do…
3
votes
2 answers

How to exclude cumulative and total proportions from tables generated with `freq` function in R?

I'm using the freq function from the summarytools package to create frequency tables in RStudio. It doesn't seem possible to turn off the cumulative and total percentage columns in the tables. For…
RobertF
  • 824
  • 2
  • 14
  • 40
3
votes
3 answers

R error when installing packages (summarytools)

edit: all screenshots are displayed I'm teaching stats in Rstudio and we're using the summarytools package. A few of my students are getting different error messages, with the same overall result that the package is not properly installed. Alex's…
Shawn Janzen
  • 369
  • 3
  • 15
2
votes
2 answers

How do I remove the header in RMarkdown for descr()?

I am trying to create a basic descriptive summary table in my RMarkdown pdf document. data(iris) library(summarytools) iris %>% group_by(Species) %>% descr(Sepal.Length, stats = "fivenum", headings = FALSE) I get the following…
hy9fesh
  • 589
  • 2
  • 15
2
votes
1 answer

Nesting ifelse inside summarytools

I'm helping a colleague with an error in her code. We want to obtain frequencies of units with valid values across 4 variables. She used ifelse to flag units meeting her criteria, then used summarytools::freq to obtain a summary frequency table. The…
2
votes
2 answers

Is there a way to display multiple tables in the RStudio Viewer?

If I run the following crosstab code, using the ctable function from the summarytools package: library(summarytools) data(mtcars) varlist <- names(mtcars[,3:5]) crosstables <- list(NULL) for (i in varlist){ crosstables[[i]] <- ctable(mtcars[[i]],…
RobertF
  • 824
  • 2
  • 14
  • 40
2
votes
2 answers

How to print.summarytools - with our without view() wrapper

I'm attempting to create a table (for inclusion into a MSFT Word table) like the one found here: https://github.com/dcomtois/summarytools 3 - descr() : Descriptive Univariate Stats However, descr(iris, style = "rmarkdown") style = "rmarkdown" is…
2
votes
1 answer

R - Setting the class of an object created with by()

First a little bit of context: In my package summarytools, I've defined a print method for objects of classs "summarytools". I have also created a function view() that handles objects created using by() or lapply() in such a way that the output…
Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61
2
votes
1 answer

Rmarkdown - printing a list of objects without showing those pesky [[indices]]

This will be a little wordy, as without proper context I cannot see how I can ask my question. Without going too much into details, in my summarytools package, I have dealt with by() objects by using a wrapper function for print.summarytools,…
Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61
2
votes
1 answer

Render HTML on Shiny tabpanel

The HTML output is created by summarytool::dfSummary function. summarytools summarytools uses Bootstrap’s stylesheets to generate standalone HTML documents that can be displayed in a Web Browser or in RStudio’s Viewer using the generic print()…
DRcod
  • 35
  • 7
1
vote
2 answers

Why does kable in R undo an summarytools frequency option to not display cumulative percentage?

I found an odd quirk or maybe an intentional feature and trying to find a more elegant solution. Any ideas are appreciated. Reproducible code example below, but I wasn't able to recreate the tables very well here with markdown. Situation: When I…
Shawn Janzen
  • 369
  • 3
  • 15
1
vote
1 answer

How to export summarytools object in R to png

I have the following line of code which uses summarytools package to generate and view a description table using stby and desc functions view(stby(meta.data$Age, meta.data$Diagnosis, descr, transpose = T, stats = c("mean", "sd"))) The…
1
vote
0 answers

Customize R summarytools function headings for freq & descr

Is it possible to customize the headings portion printed with the freq() and descr() functions in the summarytools R package? Ultimately, my aim here is to make headings above my freq() or descr() rmarkdown outputs. (I don't mean the # style…
Shawn Janzen
  • 369
  • 3
  • 15
1
vote
1 answer

Add variable labels using the summarytools freq package

I want to add variable labels to the frequency tables that I generated. But, I can't find that functionality in the summarytools documentation. Here is my code: the…
NewBee
  • 990
  • 1
  • 7
  • 26
1
2 3