Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests

2018-08-10 Thread Zhian Kamvar
sage- > From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On > Behalf Of Zhian Kamvar > Sent: 10 August 2018 12:26 > To: Alexandre Courtiol > Cc: R-list Package Devel > Subject: Re: [R-pkg-devel] Printing examples conditionally on another > package in Suggests >

Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests

2018-08-10 Thread Georgi Boshnakov
Boshnakov -Original Message- From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On Behalf Of Zhian Kamvar Sent: 10 August 2018 12:26 To: Alexandre Courtiol Cc: R-list Package Devel Subject: Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests Than

Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests

2018-08-10 Thread Zhian Kamvar
Thanks, but my use of print here is really a toy example, not necessarily the end-goal. This strategy would fail if I were to attempt load a data set from some_package or use any functions from some_package. A more specific example of what I'm dealing with is here:

Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests

2018-08-10 Thread Alexandre Courtiol
Perhaps then something like: Print <- function(x) if (requireNamespace("some.package", quietly = TRUE)) print(x) Print("Hi") Print("Hello") Print("Goodbye") On Fri, 10 Aug 2018 at 12:33, Zhian Kamvar wrote: > Mainly, I would like to see the value printed after the print statement > like it

Re: [R-pkg-devel] Printing examples conditionally on another package in Suggests

2018-08-10 Thread Alexandre Courtiol
Hi Zhian, Could you please explain what behaviour you would like to obtain? I really don't understand what your problem is from your description... Alex On Fri, 10 Aug 2018 at 12:18, Zhian Kamvar wrote: > Hello, > > I know it's good practice to use > > if (require("some_package")) { > # some