Re: [R-pkg-devel] how to make "r-release-osx-x86_64-mavericks" machine support rgl 3D plots

2015-10-08 Thread Duncan Murdoch
On 08/10/2015 4:41 PM, Dr Gregory Jefferis wrote:
> Dear Duncan,
> 
> Could I just revive this one more time
> 
> On 16 Aug 2015, at 17:21, Duncan Murdoch wrote:
> 
>> It is harder for you to implement this yourself, because CRAN frowns 
>> on
>> tests that try to detect whether they're running under CRAN or not.
>>
>> You could put in "if (interactive())" checks around your displays.  If
>> you want to check whether the rgl calls are okay, you could do 
>> something
>> like this:
>>
>> library(rgl)
>> options(rgl.useNULL = TRUE)
> 
> I have a package which imports rgl i.e. rgl is loaded on package 
> startup. A number of examples (not tests) use rgl features and I do not 
> want these to be run on CRAN.
> 
> Is there a way to configure rgl.useNULL to handle this situation?
> 

I don't think so, but I don't think you really want that.

options(rgl.useNULL = TRUE)

doesn't stop rgl from running, it just stops it from trying to display
anything.  So you could put code like

if (!interactive())
  options(rgl.useNULL = TRUE)

into your .onLoad function for your package, and it wouldn't try to open
a display on CRAN, or anywhere else that wasn't interactive.

Duncan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make "r-release-osx-x86_64-mavericks" machine support rgl 3D plots

2015-10-08 Thread Dr Gregory Jefferis

Dear Duncan,

Could I just revive this one more time

On 16 Aug 2015, at 17:21, Duncan Murdoch wrote:

It is harder for you to implement this yourself, because CRAN frowns 
on

tests that try to detect whether they're running under CRAN or not.

You could put in "if (interactive())" checks around your displays.  If
you want to check whether the rgl calls are okay, you could do 
something

like this:

library(rgl)
options(rgl.useNULL = TRUE)


I have a package which imports rgl i.e. rgl is loaded on package 
startup. A number of examples (not tests) use rgl features and I do not 
want these to be run on CRAN.


Is there a way to configure rgl.useNULL to handle this situation?

Many thanks,

Greg.

--
Gregory Jefferis, PhD
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make "r-release-osx-x86_64-mavericks" machine support rgl 3D plots

2015-10-08 Thread Duncan Murdoch
On 08/10/2015 7:55 PM, Ott Toomet wrote:
> Alternatively, you can exclude selected tests from being included in the
> package.  Most of the tests I do are not necessary to run on CRAN, these
> are not system dependent while still time consuming.  To run these just
> on my PC in enough.  So I use .Rbuildignore to exclude those.

Another way to achieve something similar is to put some tests in another
directory besides "tests" (e.g. inst/slowtests), and use the --test-dir
argument to R CMD check to run those.  This way other people can run
your tests if they want to.

Duncan Murdoch

> 
> Cheers,
> Ott
> 
> On Thu, Oct 8, 2015 at 2:10 PM, Duncan Murdoch  > wrote:
> 
> On 08/10/2015 4:41 PM, Dr Gregory Jefferis wrote:
> > Dear Duncan,
> >
> > Could I just revive this one more time
> >
> > On 16 Aug 2015, at 17:21, Duncan Murdoch wrote:
> >
> >> It is harder for you to implement this yourself, because CRAN frowns
> >> on
> >> tests that try to detect whether they're running under CRAN or not.
> >>
> >> You could put in "if (interactive())" checks around your displays.  If
> >> you want to check whether the rgl calls are okay, you could do
> >> something
> >> like this:
> >>
> >> library(rgl)
> >> options(rgl.useNULL = TRUE)
> >
> > I have a package which imports rgl i.e. rgl is loaded on package
> > startup. A number of examples (not tests) use rgl features and I do not
> > want these to be run on CRAN.
> >
> > Is there a way to configure rgl.useNULL to handle this situation?
> >
> 
> I don't think so, but I don't think you really want that.
> 
> options(rgl.useNULL = TRUE)
> 
> doesn't stop rgl from running, it just stops it from trying to display
> anything.  So you could put code like
> 
> if (!interactive())
>   options(rgl.useNULL = TRUE)
> 
> into your .onLoad function for your package, and it wouldn't try to open
> a display on CRAN, or anywhere else that wasn't interactive.
> 
> Duncan
> 
> __
> R-package-devel@r-project.org 
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> 
> 
> 
> -- 
> Ott Toomet
> 
> Visiting Researcher
> School of Information
> Mary Gates Hall, Suite 310
> University of Washington
> Seattle, WA 98195
>

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make "r-release-osx-x86_64-mavericks" machine support rgl 3D plots

2015-10-08 Thread Ott Toomet
Alternatively, you can exclude selected tests from being included in the
package.  Most of the tests I do are not necessary to run on CRAN, these
are not system dependent while still time consuming.  To run these just on
my PC in enough.  So I use .Rbuildignore to exclude those.

Cheers,
Ott

On Thu, Oct 8, 2015 at 2:10 PM, Duncan Murdoch 
wrote:

> On 08/10/2015 4:41 PM, Dr Gregory Jefferis wrote:
> > Dear Duncan,
> >
> > Could I just revive this one more time
> >
> > On 16 Aug 2015, at 17:21, Duncan Murdoch wrote:
> >
> >> It is harder for you to implement this yourself, because CRAN frowns
> >> on
> >> tests that try to detect whether they're running under CRAN or not.
> >>
> >> You could put in "if (interactive())" checks around your displays.  If
> >> you want to check whether the rgl calls are okay, you could do
> >> something
> >> like this:
> >>
> >> library(rgl)
> >> options(rgl.useNULL = TRUE)
> >
> > I have a package which imports rgl i.e. rgl is loaded on package
> > startup. A number of examples (not tests) use rgl features and I do not
> > want these to be run on CRAN.
> >
> > Is there a way to configure rgl.useNULL to handle this situation?
> >
>
> I don't think so, but I don't think you really want that.
>
> options(rgl.useNULL = TRUE)
>
> doesn't stop rgl from running, it just stops it from trying to display
> anything.  So you could put code like
>
> if (!interactive())
>   options(rgl.useNULL = TRUE)
>
> into your .onLoad function for your package, and it wouldn't try to open
> a display on CRAN, or anywhere else that wasn't interactive.
>
> Duncan
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



-- 
Ott Toomet

Visiting Researcher
School of Information
Mary Gates Hall, Suite 310
University of Washington
Seattle, WA 98195

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-17 Thread Hadley Wickham
 | Check DetailsVersion: 1.8.3
 | Check: tests
 | Result: ERROR
 | Running the tests in ‘tests/stdUsage.R’ failed.
 | Last 13 lines of output:
 |   plot(ffTest42,col=Col,plot_GOF=TRUE,speed=T)
 |  [1] compute goodness-of-fit with leave-one-out k-nearest 
 neighbor(guassian kernel), kknn package
 |  
 |   #if ever needed, k-nearest neighbor parameters for goodness-of-fit 
 can be access through convolute_ff
 |   #a new fit will be calculated and added to forstFloor object as 
 ffTest42$FCfit
 |   ffTest42 = 
 convolute_ff(ffTest42,userArgs.kknn=alist(kernel=epanechnikov,kmax=5))
 |   plot(ffTest42,col=Col,plot_GOF=TRUE)
 |  
 |   #in 3D the interaction between X3 and X reveals itself completely
 |   
 show3d(ffTest42,3:4,col=Col,plot.rgl=list(size=5),sortByImportance=FALSE)
 |  Error in rgl.open(useNULL) : rgl.open failed
 |  Calls: show3d ... plot3d.default - next3d - .check3d - open3d - 
 rgl.open
 |  Execution halted
 | Flavor: r-release-osx-x86_64-mavericks


 Yes, I see lots of that on Linux too as the tests run 'headless' without a
 controlling terminal.

 A while ago I added support in rgl to run on headless machines.  Set the
 environment variable RGL_USE_NULL=TRUE before loading rgl, and should
 never try to call X11 (or whatever graphics system you're using).
 (It's also possible to use options(rgl.useNULL = TRUE) within R.  That's
 no help to you, but is useful when embedding rgl plots in knitr documents.)

Oh that's great! I have a related problem to Dirk - except I run R CMD
check on my local machine, so while the checks are running, RGL
windows randomly pop up over the course of hours.

Hadley

-- 
http://had.co.nz/

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-16 Thread Dr Gregory Jefferis

Dear Duncan,

On 12 Aug 2015, at 14:07, Duncan Murdoch wrote:

A while ago I added support in rgl to run on headless machines.  Set 
the

environment variable RGL_USE_NULL=TRUE before loading rgl, and should
never try to call X11 (or whatever graphics system you're using).
(It's also possible to use options(rgl.useNULL = TRUE) within R.  
That's
no help to you, but is useful when embedding rgl plots in knitr 
documents.)


Could I just check if this approach can be used to suppress example code 
including rgl calls when it is running on CRAN as part of R CMD check? I 
have a package that does not build on r-release-osx-x86_64-mavericks 
because there appears to be a problem with rgl and the examples fail:


https://www.r-project.org/nosvn/R.check/r-release-osx-x86_64-mavericks/nat-00check.html

Of course I could put all the examples inside dontrun blocks, but I do 
prefer to have them run.


Many thanks for any suggestions,

Greg.

--
Gregory Jefferis, PhD   Tel: +44 1223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-16 Thread Dr Gregory Jefferis

On 12 Aug 2015, at 23:30, Søren Havelund Welling wrote:


I placed in top of all test scripts:
if(!interactive()) Sys.setenv(RGL_USE_NULL=TRUE) #disable RGL for 
headless machines


System environment variables are inherited, so I think you should be 
able to do this once in your master test script e.g. test-all.r. The 
exception that I've noticed is that if you are using Rstudio + devtools 
+ testthat, the Test Package menu item seems to ignore test-all.r.


Best,

Greg.

--
Gregory Jefferis, PhD   Tel: +44 1223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-12 Thread Dirk Eddelbuettel

On 12 August 2015 at 09:07, Duncan Murdoch wrote:
| On 12/08/2015 8:26 AM, Dirk Eddelbuettel wrote:
|  I frequently tests against all reverse dependencies against some of my
|  packages, ie Rcpp, RcppArmadillo, ... and packages using rgl generally fail
|  during these tests.

[...]
 
| A while ago I added support in rgl to run on headless machines.  Set the
| environment variable RGL_USE_NULL=TRUE before loading rgl, and should
| never try to call X11 (or whatever graphics system you're using).
| (It's also possible to use options(rgl.useNULL = TRUE) within R.  That's
| no help to you, but is useful when embedding rgl plots in knitr documents.)

Next time someone complains that whining doesn't help, I'll send them to
this thread.   Setting 

   Sys.setenv(RGL_USE_NULL=TRUE)   # Duncan Murdoch on r-package-devel 
on 12 Aug 2015

works wonderfully.  I should have whined earlier ...

Thanks, Duncan!

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-12 Thread Søren Havelund Welling
I placed in top of all test scripts:
if(!interactive()) Sys.setenv(RGL_USE_NULL=TRUE) #disable RGL for headless 
machines

on 3)
I guess I could build and test the github version of package on travis.ci in a 
OSX environment

Many thanks for the help
PS What happens when you squeeze grapes? -they wine a lot


From: Dirk Eddelbuettel [e...@debian.org]
Sent: Wednesday, August 12, 2015 5:48 PM
To: Duncan Murdoch
Cc: Dirk Eddelbuettel; Søren Havelund Welling; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine 
support rgl 3D plots

On 12 August 2015 at 09:07, Duncan Murdoch wrote:
| On 12/08/2015 8:26 AM, Dirk Eddelbuettel wrote:
|  I frequently tests against all reverse dependencies against some of my
|  packages, ie Rcpp, RcppArmadillo, ... and packages using rgl generally fail
|  during these tests.

[...]

| A while ago I added support in rgl to run on headless machines.  Set the
| environment variable RGL_USE_NULL=TRUE before loading rgl, and should
| never try to call X11 (or whatever graphics system you're using).
| (It's also possible to use options(rgl.useNULL = TRUE) within R.  That's
| no help to you, but is useful when embedding rgl plots in knitr documents.)

Next time someone complains that whining doesn't help, I'll send them to
this thread.   Setting

   Sys.setenv(RGL_USE_NULL=TRUE)   # Duncan Murdoch on r-package-devel 
on 12 Aug 2015

works wonderfully.  I should have whined earlier ...

Thanks, Duncan!

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] how to make r-release-osx-x86_64-mavericks machine support rgl 3D plots

2015-08-12 Thread Dirk Eddelbuettel

Hi Søren,

On 12 August 2015 at 11:44, Søren Havelund Welling wrote:
| Dear all
| 
| I have a package(forestFloor) which produces an test error when built on the 
r-release-osx-x86_64-mavericks machine. I'm quite sure it's due to Xquartz(or 
similar) graphical resources have to be installed for 3D plotting. I tried with 
no luck, to screen the source code of ~15 other packages importing rgl to get 
some inspiration. Most packages did not run any rgl examples or tests.
| 
| See the error message below
| 
| Questions:
| 1. I there a fix for r-release-osx-x86_64-mavericks machine? Could I e.g. 
specify Xquartz to be installed?
| 2. Should I in general just assume no OSX user has installed Xquartz and link 
to a OSX install-guide from source in description file?
| 3.  Can I in general test builds on r-release-osx-x86_64-mavericks machine 
somehow without spamming CRAN with submissions?


I don't know about 1) to 3) but may I plead with you to not run rgl code
during R CMD check?

I frequently tests against all reverse dependencies against some of my
packages, ie Rcpp, RcppArmadillo, ... and packages using rgl generally fail
during these tests.

A simple wrapper like

  if (interactive()) {
  # do something
  }

can help in demos or examples. 

| Thanks in advance
| Soren H Welling
| 
| Check DetailsVersion: 1.8.3 
| Check: tests 
| Result: ERROR 
| Running the tests in ‘tests/stdUsage.R’ failed.
| Last 13 lines of output:
|   plot(ffTest42,col=Col,plot_GOF=TRUE,speed=T) 
|  [1] compute goodness-of-fit with leave-one-out k-nearest 
neighbor(guassian kernel), kknn package
|   
|   #if ever needed, k-nearest neighbor parameters for goodness-of-fit can 
be access through convolute_ff
|   #a new fit will be calculated and added to forstFloor object as 
ffTest42$FCfit
|   ffTest42 = 
convolute_ff(ffTest42,userArgs.kknn=alist(kernel=epanechnikov,kmax=5))
|   plot(ffTest42,col=Col,plot_GOF=TRUE)
|   
|   #in 3D the interaction between X3 and X reveals itself completely
|   
show3d(ffTest42,3:4,col=Col,plot.rgl=list(size=5),sortByImportance=FALSE) 
|  Error in rgl.open(useNULL) : rgl.open failed
|  Calls: show3d ... plot3d.default - next3d - .check3d - open3d - 
rgl.open
|  Execution halted 
| Flavor: r-release-osx-x86_64-mavericks


Yes, I see lots of that on Linux too as the tests run 'headless' without a
controlling terminal.

Dirk
 __
| R-package-devel@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel