Suppress Messages from zip in R -


i want suppress messages outputted zip command in r fail find right command so.

background, use zip-function within function, don't want user see information files (roughly 5.000, clutters console).

here have tried far, functions foo show either adding: hw.txt (stored 0%) or updating: hw.txt (stored 0%)

# create small file  writelines("hello world", "hw.txt") # use original command zip("zip.zip", "hw.txt")  # try different options of capturing/suppressing output!  # assignment foo1 <- function() <- zip("zip.zip", "hw.txt") foo1()  # capture.output foo2 <- function() <- capture.output(zip("zip.zip", "hw.txt")) foo2()  # suppressmessages foo3 <- function() suppressmessages(zip("zip.zip", "hw.txt")) foo3()  # invisible foo4 <- function() invisible(zip("zip.zip", "hw.txt")) foo4()  # sink foo5 <- function() {  sink(tempfile())  zip("zip.zip", "hw.txt")  sink() } foo5() 

are there other options suppress output of zip?

the answer depend on system code used on. on windows system, can use

zip("zip.zip", "hw.txt", flags="-q") 

and suppresses messages, depends on system uses handle zip files. since message coming zip program, must signal not output messages.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -