I am importing a package called "KernSmooth" and want the start up message not to show up ...
In my Description file:
Package: test
Title: Test
Author: Mike
Description: Test
Maintainer: Mike
Depends: R(>= 2.10.0)
Imports: KernSmooth
And my Namespace file:
import(KernSmooth)
But when I load the package I still get the start up message:
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
Is my only option not to import it in NAMESPACE and use
suppressMessages(require(KernSmooth))
within my R function to avoid the message?
You can create a .Rprofile file in the main directory of your R project, in which you tell to suppress messages in response of certain commands. Here it follows an example of .Rprofile that suppresses the startup messages for package(KernSmooth):
#This is the command you must put in your .Rprofile:
#obviously you can choose other packages instead of
#KernSmooth, as well as include other personal settings
suppressPackageStartupMessages(library(KernSmooth))
Now, every time you start your R session, you will not see the startup messages when you load package KernSmooth.
You can find more info on .Rprofile typing '?Startup' on your R console, or you can look at this discussion for .Rprofile examples: Expert R users, what's in your .Rprofile?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With