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

sibylle.stoeckli at gmx.ch sibylle.stoeckli at gmx.ch
Sun Apr 21 11:40:00 PDT 2024


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 at nhh.no> 
Sent: Saturday, April 20, 2024 2:43 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

 

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.



 

 

 

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 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.g
ithub.io%2Frgrass%2Farticles%2Fuse.html
<https://rsbivand.github.io/rgrass/articles/use.html>
&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C3
3a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645818206%7CUnknown%7CTWF
pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
7C0%7C%7C%7C&sdata=3fLYSzCE3uRNBetqb69RxZz%2FzLiv%2F1LuBFkdb%2B19nsA%3D&rese
rved=0.
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Frsbivand.g
ithub.io%2Frgrass%2Farticles%2Fuse.html
<https://rsbivand.github.io/rgrass/articles/use.html>
&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C3
3a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645826443%7CUnknown%7CTWF
pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%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
<https://stat.ethz.ch/pipermail/r-help/2024-April/479232.html>
&data=05%7C02%7CRoger.Bivand%40nhh.no%7C04d6d2c547b14550ec5f08dc608936de%7C3
3a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638491389645832105%7CUnknown%7CTWF
pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%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 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/0c3b756f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 28405 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/0c3b756f/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 9856 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/0c3b756f/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 33945 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/0c3b756f/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 34891 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/0c3b756f/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 236187 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240421/0c3b756f/attachment-0009.png>


More information about the grass-user mailing list