BTW: you probably also want to use requireNamespace(..., quietly=TRUE)
otherwise if sort of defeats the purpose ...
On Sep 17, 2014, at 10:46 PM, Simon Urbanek wrote:
>
> On Sep 17, 2014, at 10:00 PM, Dario Strbenac
> wrote:
>
>> I have a simple function :
>>
>> f <- function()
>> {
>> if(
On Sep 17, 2014, at 10:00 PM, Dario Strbenac wrote:
> I have a simple function :
>
> f <- function()
> {
> if(requireNamespace("ggplot2"))
>qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
> else
>message("No graphics, just text.")
> }
>
> ggplot2 is in the Suggests fi
I have a simple function :
f <- function()
{
if(requireNamespace("ggplot2"))
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
else
message("No graphics, just text.")
}
ggplot2 is in the Suggests field of the DESCRIPTION file. When I load the
package, and run the functi