alan-turing-institute / DetectorChecker

Project to develop software to assess developing detector screen damage (Web App based on the original DetectorChecker package)
https://detectorchecker.azurewebsites.net
MIT License
0 stars 1 forks source link

Setting up detectorchecker for Ubuntu 18.04 (Bionic) #10

Open WilfridSKendall opened 6 years ago

WilfridSKendall commented 6 years ago

I'm having some trouble setting up the detectorchecker package! No doubt this is due to my failure to understand R well enough. On the other hand perhaps it is useful to figure out a way to make this happen. here is what I do so far:

Installing R 3.5.

Install R 3.5 by adding the line deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ to the end of /etc/apt/sources.list.

Now install R3.5 and various things from command line. (Not all of these may be required!) sudo apt remove --purge r-base sudo apt autoremove sudo apt update sudo apt install -y r-base sudo apt install devscripts liblapack-doc-man liblapack-doc liblzma-doc sudo apt install ncurses-doc readline-doc sudo apt install ess r-doc-info r-doc-pdf r-mathlib Somewhere I found a recommendation to install python-rsvg, but that's been deleted from Bionic.

I now install rstudio version 1.1.456.

Getting the detectorchecker package

Change to directory .../Package/detectorchecker and checkout travis_test branch git checkout travis_test

Double-click on detectorchecker.Rproj to load rstudio using package detectorchecker. Check packrat options ("Use packrat with this project", "Git ignore packrat library"). install packrat and testthat libraries.

A maze of twisty R packages, all alike ...

I now adopt the following procedure: keep installing and restarting, using rstudio to install R libraries, guided by package description and diagnostics. In order: h5 in fact web suggests I need libhdf5-dev, so sudo apt install libhdf5-dev. However I get recipe for target 'Attribute.o' failed. After looking at "How to use packrat" I tried to install the devtools library. This required httr which required curl which complained about absence of libcurl. OK, from command line, sudo apt get libcurl4-openssl-dev. This permitted installation of curl and httr and devtools linraries, but h5 still breaks. OK, guided by a hint from the web I installed Rcpp. Hurray, now h5 installs. tiff spatstat

Now detectorchecker builds. But when I test it, I get a complaint about roxygen2. This must be a packrat issue, I think, as roxygen2 appears to be available in the global library. When I try and install it, I get a complaint about stringi. OK, when i install stringi then 'roxygen2` installs.

Testing detectorcheckeragain, I get a complaint about absence of knitr. I install it. Now I get VignetteBuilder package not declared: ‘knitr’

Brian Ripley said in 2014: "As Sweave is the only engine supplied with the R distribution, the package providing any other engine must be specified in the ‘VignetteBuilder’ field of the package DESCRIPTION file, and also specified in the ‘Suggests’, ‘Imports’ or ‘Depends’ field (since its namespace must be available to build or check your package)." So I altered DESCRIPTION by adding knitr to the Imports list. Now I get warnings about NAMESPACE not being generated by roxygen2, and DESCRIPTION not referrring to a valid licence, but more seriously a slew of errors starting with create_ppp_edges_col: no visible global function definition for ‘ppp’ Puzzled: spatstat is required in DESCR|IPTION so what is going wrong?!

A hint suggests, "Consider adding importFrom("grDevices", "dev.off", "jpeg", "pdf") importFrom("graphics", "image", "plot", "points") importFrom("stats", "binomial", "glm") to your NAMESPACE file." But that doesn't seem to help.

WilfridSKendall commented 6 years ago

OK, I think I forgot something which I have now re-learned. I needed to look at branch tla_wp2_analysis not travis_test! (See first sentence of section "Getting the detectorchecker package".) If I do this then I still get some warnings when testing, but code appears to be passing tests now.

I spot two issues:

"Consider adding importFrom("grDevices", "dev.off", "jpeg", "pdf") importFrom("graphics", "arrows", "image", "par", "plot", "points", "title") importFrom("stats", "binomial", "chisq.test", "density", "glm") to your NAMESPACE file."

(not yet sure how to do above: roxygen2 overwrites it so I'd need to change something else!)

"Warning message: orientdist_vec.Rd is missing name/title. Skipping"