<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Bernardo,</p>
    <p>The presented <font face="monospace">system()</font> command
      requires <font face="monospace">grass</font> to be in the
      system's PATH. An alternative is to use the R package <a
        moz-do-not-send="true"
        href="https://r-spatial.github.io/link2GI/">link2GI</a> to get
      the <font face="monospace">gisBase</font> argument of <font
        face="monospace">initGRASS()</font>; AFAIK it has been updated
      to also support GRASS 8.</p>
    <p>Possible approach copied from an R markdown document:<br>
    </p>
    <p><font face="monospace">gisbase_grass <- <br>
          if (interactive()) {<br>
            if (.Platform$OS.type == "windows")
        link2GI::paramGRASSw()$gisbase_GRASS[1] else {<br>
              link2GI::paramGRASSx()$gisbase_GRASS[1]<br>
            }<br>
          } else params$gisbase_grass</font></p>
    <p><br>
    </p>
    <p>Regards</p>
    <p>Floris<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Op 26/08/2022 om 13:09 schreef Roger
      Bivand:<br>
    </div>
    <blockquote type="cite"
cite="mid:OSWP279MB04713961BF3B1B488C8FF75BEE759@OSWP279MB0471.NORP279.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div style="color: rgb(33, 33, 33); background-color: rgb(255,
        255, 255);" dir="auto">
        Please also see </div>
      <div id="ms-outlook-mobile-signature" dir="auto">
        <div dir="auto"><a rel="noreferrer noopener"
            href="https://github.com/rsbivand/rgrass/issues/64"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/rsbivand/rgrass/issues/64</a> and
          perhaps give more context - is this the public github repo <br>
        </div>
        <div dir="auto" style="color: rgb(33, 33, 33); background-color:
          rgb(255, 255, 255);">
          <a rel="noreferrer noopener"
            href="https://github.com/NINAnor/oneimpact/"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/NINAnor/oneimpact/</a> ?<br>
        </div>
        <div dir="auto" style="color: rgb(33, 33, 33); background-color:
          rgb(255, 255, 255);">
          <br>
        </div>
        <div dir="auto" style="color: rgb(33, 33, 33); background-color:
          rgb(255, 255, 255);">
          Roger</div>
        <div dir="auto" style="color: rgb(33, 33, 33); background-color:
          rgb(255, 255, 255);">
          <br>
        </div>
        <div dir="auto">---</div>
        <div dir="auto">Roger Bivand</div>
        <div dir="auto">Emeritus Professor</div>
        <div dir="auto">Department of Economics</div>
        <div dir="auto">Norwegian School of Economics, Bergen, Norway</div>
      </div>
      <div id="mail-editor-reference-message-container" dir="auto"><br>
        <hr style="display:inline-block;width:98%" tabindex="-1">
        <div id="divRplyFwdMsg" style="font-size: 11pt;"><strong>Fra:</strong>
          grass-stats <a class="moz-txt-link-rfc2396E" href="mailto:grass-stats-bounces@lists.osgeo.org"><grass-stats-bounces@lists.osgeo.org></a> på
          vegne av Bernardo Santos via grass-stats
          <a class="moz-txt-link-rfc2396E" href="mailto:grass-stats@lists.osgeo.org"><grass-stats@lists.osgeo.org></a><br>
          <strong>Sendt:</strong> fredag 26. august 2022, 12:56<br>
          <strong>Til:</strong> <a class="moz-txt-link-abbreviated" href="mailto:grass-stats@lists.osgeo.org">grass-stats@lists.osgeo.org</a>
          <a class="moz-txt-link-rfc2396E" href="mailto:grass-stats@lists.osgeo.org"><grass-stats@lists.osgeo.org></a>; GRASS User List
          <a class="moz-txt-link-rfc2396E" href="mailto:grass-user@lists.osgeo.org"><grass-user@lists.osgeo.org></a><br>
          <strong>Emne:</strong> [GRASS-stats] Running r-grass examples
          when building a R package<br>
        </div>
        <br>
        <div class="yahoo-style-wrap" style="font-family:Helvetica
          Neue,Helvetica,Arial,sans-serif; font-size:16px">
          <div dir="ltr" data-setdir="false">Dear all,</div>
          <div dir="ltr" data-setdir="false"><br>
          </div>
          <div dir="ltr" data-setdir="false">I am building a R package
            and some of the functions use rgrass to connect to a GRASS
            project and run thingfs within GRASS.</div>
          <div dir="ltr" data-setdir="false">I have now set up a webpage
            for the package using pkgdown in integrated to Github
            actions. This means when I push new commits all the examples
            of R functions are run again and the webpage is updated with
            the results of the examples. Here is the webpage: <a
href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fninanor.github.io%2Foneimpact%2F&data=05%7C01%7Croger.bivand%40nhh.no%7C9ee806160e144928a19908da8751a4d1%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C637971081981258278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DGuKqYQDHFgwT3qY%2BjzglZF1mboRdv2fx7ETXdmYRJ0%3D&reserved=0"
              originalsrc="https://ninanor.github.io/oneimpact/"
shash="RRcSuEIrTaNBm2QPTTJRk9qXSrKESBZs2Xr8mDWi/Q6bBnsTgF+zs4Nbd1y1e46gWoVLauUMuAu4u3x3GGjO8nSP2rXHxwFudsegS584sVhfpjQZE0/4/kXcesqAy7K8nRGjSVx6bK/IAq5wKjFV4IipGk6rAPbICN59RNK3/zQ="
              rel="nofollow" target="_blank" moz-do-not-send="true">https://ninanor.github.io/oneimpact/</a></div>
          <div dir="ltr" data-setdir="false"><br>
          </div>
          <div dir="auto" data-setdir="false">All works fine, except the
            functions calling GRASS. When I run the examples form my
            local computer everything works, but in the Github actions
            it does not run, apparently because the command</div>
          <div dir="ltr" data-setdir="false"><br>
          </div>
          <div dir="ltr" data-setdir="false"><span>
              <pre class="ydpa6a6511esourceCode ydpa6a6511er" style="font-size:0.875em; direction:ltr; unicode-bidi:bidi-override; margin-top:0px; color:rgb(0,0,0); background-color:rgb(241,243,245); border:1px solid rgb(222,226,230)"><code style="font-size:inherit; direction:ltr; unicode-bidi:bidi-override; color:rgb(0,59,79); background:transparent; padding:0px"><span class="ydpa6a6511er-in"><span><span class="ydpa6a6511efu" style="color:rgb(71,88,171)"><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Frdrr.io%2Fr%2Fbase%2Fsystem.html&data=05%7C01%7Croger.bivand%40nhh.no%7C9ee806160e144928a19908da8751a4d1%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C637971081981258278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PWx9f7SSQY6EQn2nPNsCFAdIjT3hp3T6Kk7S9%2BAKnDs%3D&reserved=0" originalsrc="https://rdrr.io/r/base/system.html" shash="yBkaBOHqbwQIaLKGBxTuyTG3OCsWRNnwBZFausKWlngMm3+gSJCjoww7HN6dDX5onfNbuukQ96ogMzXnXT+dp2gcrA4JQvudoVIfRxuzo7eWtp5LRgrcWIsJ2zDquGpSbrkGYbULVkcoveGqjV+QFbN5EMDzUsi1k+MIiNSSOzg=" class="ydpa6a6511eexternal-link" rel="nofollow" target="_blank" style="color:inherit; text-decoration-line:underline; text-decoration-color:rgb(108,117,125)" moz-do-not-send="true">system</a></span><span class="ydpa6a6511eop" style="color:rgb(94,94,94)">(</span><span class="ydpa6a6511est" style="color:rgb(32,121,77)">"grass78 --config path"</span>, intern <span class="ydpa6a6511eop" style="color:rgb(94,94,94)">=</span> <span class="ydpa6a6511ecn" style="color:rgb(143,89,2)">T</span><span class="ydpa6a6511eop" style="color:rgb(94,94,94)">)</span></span></span></code></pre>
            </span>to find the GRASS folder and use within
            rgrass::initGRASS does not work, so the connection between R
            and GRASS do not exist.</div>
          <div dir="ltr" data-setdir="false"><br>
          </div>
          <div dir="ltr" data-setdir="false">Does someone in the group
            has experience with that and could help with hints to solve
            it?</div>
          <div dir="ltr" data-setdir="false">Is there a recommended way
            to make sure Github actions know where GRASS is and use it?</div>
          <div dir="ltr" data-setdir="false"><br>
          </div>
          <div dir="ltr" data-setdir="false">Best</div>
          <div dir="ltr" data-setdir="false">Bernardo</div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
grass-stats mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-stats@lists.osgeo.org">grass-stats@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-stats">https://lists.osgeo.org/mailman/listinfo/grass-stats</a>
</pre>
    </blockquote>
  </body>
</html>