[GRASS-user] Using RStudio in a GRASS GIS session

Roger Bivand Roger.Bivand at nhh.no
Sun Apr 21 12:38:06 PDT 2024


Do read the guide please. You must give the full, absolute path to rstudio. This error message is from Windows, as rstudio.exe is not on your path within GRASS. Do also ask for local support, noboby here can see over your shoulder.

---
Roger Bivand
Emeritus Professor
Department of Economics
Norwegian School of Economics, Bergen, Norway

________________________________
Fra: sibylle.stoeckli at gmx.ch <sibylle.stoeckli at gmx.ch>
Sendt: søndag, april 21, 2024 9:28:32 p.m.
Til: Roger Bivand <Roger.Bivand at nhh.no>
Kopi: grass-user at lists.osgeo.org <grass-user at lists.osgeo.org>
Emne: RE: [GRASS-user] Using RStudio in a GRASS GIS session

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.


[cid:image001.png at 01DA9432.D8E8EBF0]

From: Roger Bivand <Roger.Bivand at nhh.no>
Sent: Sunday, April 21, 2024 9:17 PM
To: sibylle.stoeckli at gmx.ch
Cc: grass-user at 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 at gmx.ch<mailto:sibylle.stoeckli at gmx.ch> <sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>>
Sendt: søndag, april 21, 2024 8:40:05 p.m.
Til: Roger Bivand <Roger.Bivand at nhh.no<mailto:Roger.Bivand at nhh.no>>
Kopi: grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org> <grass-user at lists.osgeo.org<mailto:grass-user at 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


[cid:image002.png at 01DA9432.D8E8EBF0]

[cid:image003.png at 01DA9432.D8E8EBF0]

[cid:image004.png at 01DA9432.D8E8EBF0]

From: Roger Bivand <Roger.Bivand at nhh.no<mailto:Roger.Bivand at nhh.no>>
Sent: Saturday, April 20, 2024 2:43 PM
To: sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>
Cc: grass-user at lists.osgeo.org<mailto:grass-user at 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 at gmx.ch<mailto:sibylle.stoeckli at gmx.ch> <sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>>
Sendt: lørdag, april 20, 2024 1:10:29 p.m.
Til: Roger Bivand <Roger.Bivand at nhh.no<mailto:Roger.Bivand at nhh.no>>
Kopi: grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org> <grass-user at lists.osgeo.org<mailto:grass-user at 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.
[cid:image005.png at 01DA9432.D8E8EBF0]



Using the command line, I was able to produce a boxplot.
[cid:image006.png at 01DA9432.D8E8EBF0]

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 at nhh.no<mailto:Roger.Bivand at nhh.no>>
Sent: Saturday, April 20, 2024 8:09 AM
To: sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>
Cc: grass-user at lists.osgeo.org<mailto:grass-user at 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 at gmx.ch<mailto:sibylle.stoeckli at gmx.ch> <sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>>
Sendt: fredag, april 19, 2024 5:56:04 p.m.
Til: Roger Bivand <Roger.Bivand at nhh.no<mailto:Roger.Bivand at nhh.no>>
Kopi: grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org> <grass-user at lists.osgeo.org<mailto:grass-user at 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 at nhh.no<mailto:Roger.Bivand at nhh.no>>
Sent: Friday, April 19, 2024 4:31 PM
To: sibylle.stoeckli at gmx.ch<mailto:sibylle.stoeckli at gmx.ch>
Cc: grass-user at lists.osgeo.org<mailto:grass-user at 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://rsbivand.github.io/rgrass/articles/use.html>.
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<https://rsbivand.github.io/rgrass/articles/use.html>

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<https://stat.ethz.ch/pipermail/r-help/2024-April/479232.html> ?

--
Roger Bivand
Emeritus Professor
Norwegian School of Economics
Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway Roger.Bivand at nhh.no<mailto:Roger.Bivand at nhh.no>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 153561 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 28405 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 9856 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 33945 bytes
Desc: image004.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 34891 bytes
Desc: image005.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 236187 bytes
Desc: image006.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/4c093b81/attachment-0011.png>


More information about the grass-user mailing list