Re: [Rd] Can't Find Function After requireNamespace

2014-09-17 Thread Simon Urbanek
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(

Re: [Rd] Can't Find Function After requireNamespace

2014-09-17 Thread Simon Urbanek
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

[Rd] Can't Find Function After requireNamespace

2014-09-17 Thread Dario Strbenac
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