Closed nfarabullini closed 4 years ago
@vladdsm, you may want to first try the minimal example we propose above and then see if this approach indeed works for your case, we'll be happy to have your feedback!
@RolandASc, @nfarabullini, we can wait for some feedback and try this out more at our end, and then possibly decide if and how we can incorporate this into the package itself (README, vignette, GitHub Wiki, ...). We could also go for a light-weight approach and add short comment in the README referring to this issue, this is an approach I have seen in quite a few places.
unfortunately this minimal example did not work. At the moment of package installation there is an error: "problem with meld installation"
`Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified)
meld
installed in your system.
Check instructions in the package README
https://github.com/miraisolutions/compareWith#installation.
Error: loading failed
Execution halted
ERROR: loading failedthese are my steps to install meld and compareWith package in this branch
@vladdsm, Note that in the minimal example above it is important to run remotes::install_github("miraisolutions/compareWith")
from RStudio. Please make sure this is the case.
Then, if you still have issues, you can
xhost +
and re-attempt installing / using compareWith from RStudio. This is giving uncontrolled access to your graphic device, so you want to enable it just for this quick test and then run xhost -
to revert it. In our case (Ubuntu 18.04, all upgraded), this was not necessary but it might depend on the user setup of your machine.Note that the setup in your branch probably missing a few key points, I can try to give you a few hints once our minimal example works, to first rule out general problems with your specific setup.
Btw, what is your distro? hostnamectl
/ lsb_release -a
/ uname -a
@riccardoporreca I am closing this due to inactivity. It might still be a good idea to add a short section about this (with a link) in the README as you have suggested above
This is actually covered by https://mirai-solutions.ch/techguides/version-stable-r-development-with-docker.html
From @vladdsm
Instructions on how to install package when using RStudio docker to follow
In order for compareWith to launch Meld inside a containerized RStudio, we need to allow the graphical output from the Docker container to be displayed on the host machine graphical device.
Here is a working example on a Linux host machine (we use
rocker/verse
to leverage on many pre-installed packages, but the same works with any image fromrocker/rstudio
up in the Rocker stack). We use the simplest approach based on mapping theDISPLAY
environment variable and volume/tmp/.X11-unix
when creating the container:R and RStudio typically would not get the
DISPLAY
environment variable right, hence we need to add it toRenviron
Then we install Meld by running
It should then be possible to install compareWith inside RStudio via
and use the addins. This can be tested by checking out a project from GitHub, e.g.
usethis::create_from_github("miraisolutions/compareWith")
.There will most likely be many
dbus
,GLib
anddconf
warnings / errors displayed at the R console when running Meld, this is annoying but should not be problematic.The example above uses the simplest approach to graphical output from containers. See this Rocker issue, this SO answer and this article for some context and alternative, more advanced approaches, especially when user rights and security concerns might be an obstacle to the simplest one.
Cleanup