Suppress progress bar from a Freq command

Hi folks, new to this forum and to R, but ramping up quickly
I am using Rmarkdown….I am running a function that I found on the web as it gives exactly what I need for a frequency

freq2(as.data.frame(Survey_version))

it calls a function

freq2 <- function(data_frame)
{
df <- frequency::freq(data_frame)
lapply(df, function(x)
{
plot = FALSE
n <- suppressWarnings(as.numeric(x$Freq))
sum_all <- as.numeric(x$Freq[nrow(x)])
etc
etc

Output looks like this

Frequency of respondents completed survey 1 versus survey 2
| | | 0% | |==================================================================================================================================================================================================================================================================================================| 100%
$Survey_version:
Survey_version label Freq Percent Valid Percent Cumulative Percent
Valid Version 1 226 25.8 25.8 25.8
Version 2 651 74.2 74.2 100.0
Total 877 100.0 100.0
Missing 0 0.0
0 0.0
Total 877 100.0

I want to remove the progress bar before the output. I get it when I knit to word or HTML. I have tried every type of suppression I could find.
I have isolated (I think) that the Frequency::freq function is writing this, however I cannot pinpoint where it might be coming from or how to suppress…
Anyone know of a way to eliminate it?
Just adds to the file size needlessly.
My sincere thanks

Hi folks, I had a brainstorm and figured this one out, rechunked the code. Works like the charm.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.