Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7036009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:22:21+00:00 2026-05-28T01:22:21+00:00

Many R packages I work with involve functions that give all their messages and

  • 0

Many R packages I work with involve functions that give all their messages and warnings through commands to print() calls rather than commands to message() or warning(). I’d like to be able to silence these functions progress indicators, etc, but the standard supressWarnings() or supressMessages doesn’t do it. Is there a way I can just suppressPrint?

For example:

silly_developer_function <- function(x){
   print("Thanks for using my function!!")
   if(is(x, "numeric"))
     print("warning, x should be a character")
   x
}

I’d like to have a simple function suppressPrint() that I could wrap around a call to this function that would suppress the warning and useless messages (but still print the return value).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:22:22+00:00Added an answer on May 28, 2026 at 1:22 am

    Well, those packages are buggy to start with. Use of print() for anything but side-effect in print implementations is a serious mistake.

    That said, you can simply use capture.output() to collect the output from such code instead of printing it. So for the above it would be

    capture.output(x <- silly_developer_function(...))
    print(x)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Terminology question ! In many graphics packages the user can draw a line between
Many times I have seen Visual Studio solutions which have multiple projects that share
Many applications have grids that display data from a database table one page at
Our SSIS pacakges a structured as one Control package and many child packages (about
The Visual Studio 2010 SDK ships with many assemblies like Microsoft.VisualStudio.Text.Data and Microsoft.VisualStudio.Text.UI that
I work in an Oracle shop. There's a toolset that consists of roughly 1000
I currently work on a Java web application that has relies on a permissions
I work in a project that uses Perl scripts on machines that are maintained
Hypothetically speaking, if my scientific work was leading toward the development of functions/modules/subroutines (on
I'm having this problem for a while now. I tried so many things that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.