Thank Roger
Yes. But still the same error even if GRASS GIS is working and RStudio installed.
The command "rstudio" is either misspelled or
could not be found.

From: Roger Bivand Roger.Bivand@nhh.no
Sent: Sunday, April 21, 2024 9:17 PM
To: sibylle.stoeckli@gmx.ch
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Using RStudio in a GRASS GIS session
Rtools is only needed for installation of source packages on Windows. It is spuriously sometimes required by rstudio. Since installing source packages is irrelevant here, maybe drop rstudio?
Roger Bivand
Emeritus Professor
Department of Economics
Norwegian School of Economics, Bergen, Norway
Fra: sibylle.stoeckli@gmx.ch <sibylle.stoeckli@gmx.ch>
Sendt: søndag, april 21, 2024 8:40:05 p.m.
Til: Roger Bivand <Roger.Bivand@nhh.no>
Kopi: grass-user@lists.osgeo.org <grass-user@lists.osgeo.org>
Emne: RE: [GRASS-user] Using RStudio in a GRASS GIS session
Thanks Roger,
Thanks a lot.
I tried to use R within a GRASS session following the instructions. Hmm the problem seems to be the rtools42 (rtools not being detected), however the path is correct.
Kind regards
Sibylle



From: Roger Bivand <Roger.Bivand@nhh.no>
Sent: Saturday, April 20, 2024 2:43 PM
To: sibylle.stoeckli@gmx.ch
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Using RStudio in a GRASS GIS session
Enter:
library(rgrass)
at the R prompt in rstudio, not at the GRASS console prompt; it is an R command.
The error message:
Der Befehl “library” ist entweder falsch geschrieben oder konnte nicht gefunden werden.
comes from Windows, not GRASS or R.
Roger Bivand
Emeritus Professor
Department of Economics
Norwegian School of Economics, Bergen, Norway
Fra: sibylle.stoeckli@gmx.ch <sibylle.stoeckli@gmx.ch>
Sendt: lørdag, april 20, 2024 1:10:29 p.m.
Til: Roger Bivand <Roger.Bivand@nhh.no>
Kopi: grass-user@lists.osgeo.org <grass-user@lists.osgeo.org>
Emne: RE: [GRASS-user] Using RStudio in a GRASS GIS session
Dear Roger
Dear community
May aim is to use RStudio in a GRASS GIS session, to visualize raster and vector data: e.g. a boxplot of a species raster file or boxplot of a species raster file differentiated for different regions (vector file).
Similar in
https://ecodiv.earth/post/drawing-boxplots-of-raster-values/
Because of my name with “ö” I changed the location to C:/GrassGIS: this seems to be the solution for the error when staring GRASS. No warming anymore.

Using the command line, I was able to produce a boxplot.

I am more comfortable in R, so I tried starting R inside the GRASS console (as suggested for windows) following the code here:
https://rsbivand.github.io/rgrass/articles/use.html
However, I am still struggling around with the error
The command "library" is either misspelled or
could not be found.
library(rgrass)
Der Befehl “library” ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
(Sat Apr 20 12:57:24 2024) Command ended with non-zero return code 1 (0 sec)
Kind regards
Sibylle
From: Roger Bivand <Roger.Bivand@nhh.no>
Sent: Saturday, April 20, 2024 8:09 AM
To: sibylle.stoeckli@gmx.ch
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Using RStudio in a GRASS GIS session
First tell us exactly what you do. Do you start GRASS first (how was GRASS installed, which version?), then what? The first message suggests a failed GRASS installation. Can you use GRASS at all? Try to run any regular example on the data in your location in GRASS to check that GRASS works before anything else.
Roger Bivand
Emeritus Professor
Department of Economics
Norwegian School of Economics, Bergen, Norway
Fra: sibylle.stoeckli@gmx.ch <sibylle.stoeckli@gmx.ch>
Sendt: fredag, april 19, 2024 5:56:04 p.m.
Til: Roger Bivand <Roger.Bivand@nhh.no>
Kopi: grass-user@lists.osgeo.org <grass-user@lists.osgeo.org>
Emne: RE: [GRASS-user] Using RStudio in a GRASS GIS session
Dear community
Dear Roger
I suppose it is my name
Here the output from the console:
C:\Users\Sibylle Stöckli>
C:\Users\Sibylle Stöckli>
ERROR: Unable to read WIND file: not enough values to unpack (expected 2,
got 1)
library(rgrass)
Der Befehl “library” ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Kind regards
Sibylle
-----Original Message-----
From: Roger Bivand <Roger.Bivand@nhh.no>
Sent: Friday, April 19, 2024 4:31 PM
To: sibylle.stoeckli@gmx.ch
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Using RStudio in a GRASS GIS session
Please see: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Frsbivand.github.io%2Frgrass%2Farticles%2Fuse.html&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645818206%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3fLYSzCE3uRNBetqb69RxZz%2FzLiv%2F1LuBFkdb%2B19nsA%3D&reserved=0.
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Frsbivand.github.io%2Frgrass%2Farticles%2Fuse.html&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645826443%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=zM%2Fia4%2BGNTgKd%2Bjxo3HVJnDgt02JrI9CSyx%2F1AtwK%2FU%3D&reserved=0
Do you have a GRASS location and wish to use R on the data in that location?
Then start GRASS first and start rstudio from inside GRASS.
The error messages suggest that something is missing in your installation.
Is your query related to
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fpipermail%2Fr-help%2F2024-April%2F479232.html&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645832105%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=i1bTT5y7lmJcG1MtEniurDJsEYbK63t0UB%2BSagiLmMM%3D&reserved=0 ?
–
Roger Bivand
Emeritus Professor
Norwegian School of Economics
Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway Roger.Bivand@nhh.no