-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linkGRASS(): suggestion to let 'g.gui' work #24
Comments
Pretty cool idea. I'd never think about that way around probably because I'm not really native to the r community so I always start GRASS or SAGA outside of R or rstudio. I will check it under Windows and I will also look how the Linux flavours deal with it. It maybe take some time because the lectures are running.... |
Well I spent quite a bit of effort to get it working under |
An extension to this idea is launching the GRASS-terminal in Linux right from R (below it is the gnome-terminal, but it could be extended). mapset_path <-
system("g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET sep='/'",
intern = TRUE)
system(paste0("gnome-terminal --working-directory=",
mapset_path,
" -- grass --text .")
) |
Because of recent changes in if (.Platform$OS.type == "unix") {
Sys.setenv(GRASS_PYTHON = system("which python3", intern = TRUE))
} And yet again, it works 😄 Note however that some Ubuntu version dependency may be at stake for this code. I believe that |
uuh great thanks for this findings... |
FYI, and perhaps you can use the idea. Some time ago (using the CRAN version) I noticed that
g.gui
did not work from R, usingsystem()
orexecGRASS()
. At least in Linux (Mint) it seems that this can be solved by setting an environment variableGRASS_PYTHON
:Maybe you can manage to set this with
link2GI
, cross-platform? Being able to open the GUI from R seems an interesting feature; it comes in handy to do some quick inspections.EDIT: the above code won't run anymore as intended, when using recent
reticulate
. See below for an update.The text was updated successfully, but these errors were encountered: