Comments (23)
What's the right way to do this properly?
R is just an admin's nightmare at getting things properly installed.
from minc-vm.
from minc-vm.
devtools::install_github("Mouse-Imaging-Centre/RMINC")
from minc-vm.
That will not install dependencies.
from minc-vm.
yes it will. For some reason lmerTest
gets left behind, but I think that can be fixed with:
devtools::install_github("Mouse-Imaging-Centre/RMINC"
, dependencies = c("Suggests", "Imports", "Depends", "LinkingTo"))
from minc-vm.
Okay, so we're back to what I'm doing, that's equivalent to dependencies=TRUE.
It seems it doesn't accept the "repo =" option, even though the docs say that will be passed forward into the install command.
I'm now testing a version where I set the global R repo option instead.
from minc-vm.
As a side question, how the heck do I force R to error on any failure, instead of continuing on in the script, making debugging incredibly difficult?
from minc-vm.
I think using Rscript instead of R will work this way.
from minc-vm.
options(error = browser())
Is this helpful?
from minc-vm.
RMINC has to come from github, it's not on CRAN. That's why that is failing. Dependencies = TRUE is the default as far as I know, you really need the "Suggests"
from minc-vm.
And yeah, don't use R
, use Rscript -e
, you're opening R in interactive mode which doesn't bubble errors to end the program.
from minc-vm.
The original line of code is using install_url pointing to the release tarball on github.
I think the main issue here is that the R script always succeeds and never stops on error so I don't even know it went wrong.
I'll try Rscript -e
from minc-vm.
Current failure mode:
mincvm-virtualbox: Downloading package from url: https://github.com/Mouse-Imaging-Centre/RMINC/releases/download/v1.5.2.0/RMINC_1.5.2.0.tar.gz
mincvm-virtualbox: Installation failed: error setting certificate verify locations:
mincvm-virtualbox: CAfile: microsoft-r-cacert.pem
mincvm-virtualbox: CApath: none
mincvm-virtualbox: Downloading package from url: https://github.com/BIC-MNI/mni.cortical.statistics/archive/ver-0_9_5.tar.gz
mincvm-virtualbox: Installation failed: error setting certificate verify locations:
mincvm-virtualbox: CAfile: microsoft-r-cacert.pem
mincvm-virtualbox: CApath: none
And Rscript happily continues on, and exits successfully. So, again I have a VM build without RMINC.
from minc-vm.
Well that's a pain, devtools
doesn't throw an error when install fails (we're all learning together), so you need to wrap it:
r <- devtools::install_github(...)
if(!r) stop("RMINC installed failed, drat")
from minc-vm.
Worth a bug report to devtools
?
from minc-vm.
Ehhh, returning the success state of the install is valid. I wonder if it has a strictness argument...
from minc-vm.
After much hackery, it finally works and builds again.
Still doesn't throw errors when R goes bad, even after wrapping things and upgrading warnings to errors. I'll just have to be very careful reading the logs.
from minc-vm.
https://github.com/CobraLab/MINC-VM/blob/master/provision.sh#L165
This isn't quite right I don't think. It doesn't throw a warning when it fails, it just returns FALSE
. You need to translate that into an error:
stopifnot(
install_url("$RMINC", dependencies=TRUE, upgrade_dependencies=FALSE)
)
or if you want a more descriptive error
r <- install_url("$RMINC", dependencies=TRUE, upgrade_dependencies=FALSE)
if(!r) stop("Failed to install RMINC")
from minc-vm.
I based the wrapping on https://stackoverflow.com/a/26245048/4130016.
Maybe I should wrap that again with stopifnot as well?
from minc-vm.
that is for install.packages
which does throw warnings, devtools::install*
does not. Really all you need is the code I posted above, no handlers necessary.
That SO answer is bad for other reasons too, tryCatch
solves the problem more cleanly.
from minc-vm.
Am I doing something wrong?
cat <<-EOF | Rscript --vanilla -
r = getOption("repos")
r["CRAN"] = 'http://cloud.r-project.org/'
options(repos = r)
rm(r)
library(devtools)
stopifnot((install_url("$RMINC", dependencies=TRUE, upgrade_dependencies=FALSE))
stopifnot((install_url("$mni_cortical_statistics", dependencies=TRUE, upgrade_dependencies=FALSE))
EOF
mincvm-virtualbox: Error: unexpected symbol in:
mincvm-virtualbox: "stopifnot((install_url("https://github.com/Mouse-Imaging-Centre/RMINC/releases/download/v1.5.2.0/RMINC_1.5.2.0.tar.gz", dependencies=TRUE, upgrade_dependencies=FALSE))
mincvm-virtualbox: stopifnot"
from minc-vm.
nevermind... unbalanced parenthesis...
from minc-vm.
that's usually the source of unexpected symbol, pleased it's working now 🙂
from minc-vm.
Related Issues (20)
- Add updated Display HOT 1
- Add parallel as default HOT 1
- Add pydpiper testing HOT 15
- Cannot login to the VM using guest Session HOT 6
- Hosting is decomissioned/registration-walled? HOT 3
- brain-view2 Broken? HOT 4
- Fix generate_deformation_fields
- Install gawk
- rstudio has undeclared dependency on libxkbcommon-x11-0
- Install bc
- Add some resources to quarantine_path
- ITKSnap and RStudio HOT 21
- $ANTSPATH is unset HOT 4
- Add tidyverse to R packages HOT 1
- Error when opening MINC files using display HOT 2
- Copy paste HOT 2
- VBox guest addition 6.1.4 bug HOT 1
- Minc commands issue HOT 8
- internet application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minc-vm.