GRASS GIS 7.0 (stable) and R integration issue

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GRASS GIS 7.0 (stable) and R integration issue

andy-1@ukr.net
This post has NOT been accepted by the mailing list yet.
Dear ALL

I installed new GRASS GIS 7.0 (stable) and R (last versions + all packages were updated).  
Then started R (also tried Rstudio) from GRASS  as it is recommended here:

https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7

R started, but when I tried to load libraries I got the following error and nothing works:

-------------
> library(rgrass7)
Loading required package: sp
Loading required package: XML
Error : .onAttach failed in attachNamespace() for 'rgrass7', details:
call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
error: missing value where TRUE/FALSE needed
Error: package or namespace load failed for ‘rgrass7’
> library(rgdal)
rgdal: version: 1.1-10, (SVN revision 622)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
Path to GDAL shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
Path to PROJ.4 shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/proj
Linking to sp version: 1.2-3
> G <- gmeta()
Error: could not find function "gmeta"
-----------

However if I just start R alone (not from GRASS) the packages are loaded normally  without errors (of course if I start R not from Grass I can't use Grass data).

I tried older versions: Grass 6.4.2 works with R fine, but not  GRASS 7. Tried on 3 different PCs. Same problem.

Could you please help to fix it?


Thank you.
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: GRASS GIS 7.0 (stable) and R integration issue

Helmut Kudrnovsky
[also here: you have to be subscribed to be able to post on this ML ]

andy-1@ukr.net wrote
Dear ALL

I installed new GRASS GIS 7.0 (stable) and R (last versions + all packages were updated).  
Then started R (also tried Rstudio) from GRASS  as it is recommended here:

https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7

R started, but when I tried to load libraries I got the following error and nothing works:

-------------
> library(rgrass7)
Loading required package: sp
Loading required package: XML
Error : .onAttach failed in attachNamespace() for 'rgrass7', details:
call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
error: missing value where TRUE/FALSE needed
Error: package or namespace load failed for ‘rgrass7’
> library(rgdal)
rgdal: version: 1.1-10, (SVN revision 622)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
Path to GDAL shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
Path to PROJ.4 shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/proj
Linking to sp version: 1.2-3
> G <- gmeta()
Error: could not find function "gmeta"
-----------

However if I just start R alone (not from GRASS) the packages are loaded normally  without errors (of course if I start R not from Grass I can't use Grass data).

I tried older versions: Grass 6.4.2 works with R fine, but not  GRASS 7. Tried on 3 different PCs. Same problem.

Could you please help to fix it?


Thank you.
Andrew
after starting R in winGRASS and before library("rgrass7") , could you do:

sessionInfo()

have you installed any GRASS addons? if yes, which one?

the addons are installed in C:\Users\yourusername\AppData\Roaming\GRASS7

if you have installed some GRASS addons, could you delete the addons folder in the C:\Users\yourusername\AppData\Roaming\GRASS7

then restart winGRASS (without any addons installed) and R and try to do library("rgrass7") again and report the results.
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: GRASS GIS 7.0 (stable) and R integration issue

Roger Bivand
Hi,

Thanks for helping resolve this.

I have 3 addons seen in Settings -> Addon extensions -> Manage ...

I reinstalled them, so for example .../bin/r.flip.exe has current time. In
R GUI:

> parseGRASS("r.flip")
Command: r.flip
Extension: .exe
Description: Flips an image.
Keywords: Flips an image.
Parameters:
   name: input, type: string, required: yes, multiple: no
   keydesc: name, keydesc_count: 1
[Name of input raster map]
   name: output, type: string, required: yes, multiple: no
   keydesc: name, keydesc_count: 1
[Name for output raster map]
Flags:
   name: w [East-West flip] {FALSE}
   name: b [Both N-S and E-W flip] {FALSE}
   name: overwrite [Allow output files to overwrite existing files] {FALSE}
   name: help [Print usage summary] {FALSE}
   name: verbose [Verbose module output] {FALSE}
   name: quiet [Quiet module output] {FALSE}
>

and

> Sys.getenv("PATH")
[1] "C:\\Program Files\\GRASS GIS
7.0.4\\Python27\\lib\\site-packages\\numpy\\core;C:\\Program Files\\GRASS
GIS 7.0.4\\gui\\scripts;C:\\Program Files\\GRASS GIS
7.0.4\\lib;C:\\Program Files\\GRASS GIS
7.0.4\\bin;C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons\\bin;C:\\Program
Files\\GRASS GIS 7.0.4\\extrabin;C:\\Program Files\\GRASS GIS
7.0.4\\bin;c:\\Rtools\\bin;C:\\WINDOWS\\SYSTEM32;C:\\WINDOWS;C:\\WINDOWS\\SYSTEM32\\WBEM;C:\\WINDOWS\\SYSTEM32\\WINDOWSPOWERSHELL\\V1.0\\;C:\\PROGRAM
FILES\\INTEL\\WIFI\\BIN\\;C:\\PROGRAM FILES\\COMMON
FILES\\INTEL\\WIRELESSCOMMON\\;C:\\PROGRAM
FILES\\MATLAB\\R2011B\\BIN;;C:\\PROGRAM FILES
(X86)\\INTEL\\SERVICES\\IPT\\;C:\\PROGRAM FILES (X86)\\LENOVO\\ACCESS
CONNECTIONS\\;C:\\Program Files\\ThinkPad\\Bluetooth
Software\\;C:\\Program Files\\ThinkPad\\Bluetooth
Software\\syswow64;C:\\Rtools\\bin;C:\\Rtools\\gcc-4.6.3\\bin;C:\\Program
Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common
Files\\Intel\\WirelessCommon\\;C:\\Program Files\\RStudio\\bin;C:\\Program
Files\\R\\R-3.3.1\\bin\\x64"
>

and directly:

> Sys.getenv("GRASS_ADDON_BASE")
[1] "C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons"
>

If I remove this folder, the:

> library(rgrass7)
Loading required package: sp
Loading required package: XML
Error : .onAttach failed in attachNamespace() for 'rgrass7', details:
   call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
   error: missing value where TRUE/FALSE needed
Error: package or namespace load failed for ‘rgrass7’
>

error becomes replicable. I'll report back when I've fixed it; the
workaround is to install any extension before starting R in GRASS.

Roger

On Tue, 4 Oct 2016, Helmut Kudrnovsky wrote:

> [also here: you have to be subscribed to be able to post on this ML ]
>
>
> [hidden email] wrote
>> Dear ALL
>>
>> I installed new GRASS GIS 7.0 (stable) and R (last versions + all packages
>> were updated).
>> Then started R (also tried Rstudio) from GRASS  as it is recommended here:
>>
>> https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7
>>
>> R started, but when I tried to load libraries I got the following error
>> and nothing works:
>>
>> -------------
>>> library(rgrass7)
>> Loading required package: sp
>> Loading required package: XML
>> Error : .onAttach failed in attachNamespace() for &apos;rgrass7&apos;,
>> details:
>> call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>> error: missing value where TRUE/FALSE needed
>> Error: package or namespace load failed for ‘rgrass7’
>>> library(rgdal)
>> rgdal: version: 1.1-10, (SVN revision 622)
>> Geospatial Data Abstraction Library extensions to R successfully loaded
>> Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
>> Path to GDAL shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/gdal
>> Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
>> Path to PROJ.4 shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/proj
>> Linking to sp version: 1.2-3
>>> G <- gmeta()
>> Error: could not find function "gmeta"
>> -----------
>>
>> However if I just start R alone (not from GRASS) the packages are loaded
>> normally  without errors (of course if I start R not from Grass I can't
>> use Grass data).
>>
>> I tried older versions: Grass 6.4.2 works with R fine, but not  GRASS 7.
>> Tried on 3 different PCs. Same problem.
>>
>> Could you please help to fix it?
>>
>>
>> Thank you.
>> Andrew
>
> after starting R in winGRASS and before library("rgrass7") , could you do:
>
> sessionInfo()
>
> have you installed any GRASS addons? if yes, which one?
>
> the addons are installed in C:\Users\yourusername\AppData\Roaming\GRASS7
>
> if you have installed some GRASS addons, could you delete the addons folder
> in the C:\Users\yourusername\AppData\Roaming\GRASS7
>
> then restart winGRASS (without any addons installed) and R and try to do
> library("rgrass7") again and report the results.
>
>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-tp5281770p5289300.html
> Sent from the Grass - Stats mailing list archive at Nabble.com.
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: GRASS GIS 7.0 (stable) and R integration issue

Roger Bivand
I've put a Windows binary and source of rgrass7_0.1-9 on:

http://spatial.nhh.no/R/rgrass7/

which I believe resolves the issue. Please test and report back (on list,
subscribe first, then reply or post). Please also check with addons
present to be sure that the fix works both with and without addons.

Roger


On Thu, 6 Oct 2016, Roger Bivand wrote:

> Hi,
>
> Thanks for helping resolve this.
>
> I have 3 addons seen in Settings -> Addon extensions -> Manage ...
>
> I reinstalled them, so for example .../bin/r.flip.exe has current time. In R
> GUI:
>
>>  parseGRASS("r.flip")
> Command: r.flip
> Extension: .exe
> Description: Flips an image.
> Keywords: Flips an image.
> Parameters:
>   name: input, type: string, required: yes, multiple: no
>   keydesc: name, keydesc_count: 1
> [Name of input raster map]
>   name: output, type: string, required: yes, multiple: no
>   keydesc: name, keydesc_count: 1
> [Name for output raster map]
> Flags:
>  name:  w [East-West flip] {FALSE}
>  name:  b [Both N-S and E-W flip] {FALSE}
>  name:  overwrite [Allow output files to overwrite existing files] {FALSE}
>  name:  help [Print usage summary] {FALSE}
>  name:  verbose [Verbose module output] {FALSE}
>  name:  quiet [Quiet module output] {FALSE}
>>
>
> and
>
>>  Sys.getenv("PATH")
> [1] "C:\\Program Files\\GRASS GIS
> 7.0.4\\Python27\\lib\\site-packages\\numpy\\core;C:\\Program Files\\GRASS GIS
> 7.0.4\\gui\\scripts;C:\\Program Files\\GRASS GIS 7.0.4\\lib;C:\\Program
> Files\\GRASS GIS
> 7.0.4\\bin;C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons\\bin;C:\\Program
> Files\\GRASS GIS 7.0.4\\extrabin;C:\\Program Files\\GRASS GIS
> 7.0.4\\bin;c:\\Rtools\\bin;C:\\WINDOWS\\SYSTEM32;C:\\WINDOWS;C:\\WINDOWS\\SYSTEM32\\WBEM;C:\\WINDOWS\\SYSTEM32\\WINDOWSPOWERSHELL\\V1.0\\;C:\\PROGRAM
> FILES\\INTEL\\WIFI\\BIN\\;C:\\PROGRAM FILES\\COMMON
> FILES\\INTEL\\WIRELESSCOMMON\\;C:\\PROGRAM
> FILES\\MATLAB\\R2011B\\BIN;;C:\\PROGRAM FILES
> (X86)\\INTEL\\SERVICES\\IPT\\;C:\\PROGRAM FILES (X86)\\LENOVO\\ACCESS
> CONNECTIONS\\;C:\\Program Files\\ThinkPad\\Bluetooth Software\\;C:\\Program
> Files\\ThinkPad\\Bluetooth
> Software\\syswow64;C:\\Rtools\\bin;C:\\Rtools\\gcc-4.6.3\\bin;C:\\Program
> Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common
> Files\\Intel\\WirelessCommon\\;C:\\Program Files\\RStudio\\bin;C:\\Program
> Files\\R\\R-3.3.1\\bin\\x64"
>>
>
> and directly:
>
>>  Sys.getenv("GRASS_ADDON_BASE")
> [1] "C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons"
>>
>
> If I remove this folder, the:
>
>>  library(rgrass7)
> Loading required package: sp
> Loading required package: XML
> Error : .onAttach failed in attachNamespace() for 'rgrass7', details:
>   call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>   error: missing value where TRUE/FALSE needed
> Error: package or namespace load failed for ‘rgrass7’
>>
>
> error becomes replicable. I'll report back when I've fixed it; the workaround
> is to install any extension before starting R in GRASS.
>
> Roger
>
> On Tue, 4 Oct 2016, Helmut Kudrnovsky wrote:
>
>>  [also here: you have to be subscribed to be able to post on this ML ]
>>
>>
>>  [hidden email] wrote
>> >  Dear ALL
>> >
>> >  I installed new GRASS GIS 7.0 (stable) and R (last versions + all
>> >  packages
>> >  were updated). Then started R (also tried Rstudio) from GRASS  as it is
>> >  recommended here:
>> >
>> >  https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7
>> >
>> >  R started, but when I tried to load libraries I got the following error
>> >  and nothing works:
>> >
>> >  -------------
>> > >  library(rgrass7)
>> >  Loading required package: sp
>> >  Loading required package: XML
>> >  Error : .onAttach failed in attachNamespace() for &apos;rgrass7&apos;,
>> >  details:
>> >  call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>> >  error: missing value where TRUE/FALSE needed
>> >  Error: package or namespace load failed for ‘rgrass7’
>> > >  library(rgdal)
>> >  rgdal: version: 1.1-10, (SVN revision 622)
>> >  Geospatial Data Abstraction Library extensions to R successfully loaded
>> >  Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
>> >  Path to GDAL shared files: C:/Users/Andriy/R/win-library/3.3/rgdal/gdal
>> >  Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
>> >  Path to PROJ.4 shared files:
>> >  C:/Users/Andriy/R/win-library/3.3/rgdal/proj
>> >  Linking to sp version: 1.2-3
>> > >  G <- gmeta()
>> >  Error: could not find function "gmeta"
>> >  -----------
>> >
>> >  However if I just start R alone (not from GRASS) the packages are loaded
>> >  normally  without errors (of course if I start R not from Grass I can't
>> >  use Grass data).
>> >
>> >  I tried older versions: Grass 6.4.2 works with R fine, but not  GRASS 7.
>> >  Tried on 3 different PCs. Same problem.
>> >
>> >  Could you please help to fix it?
>> >
>> >
>> >  Thank you.
>> >  Andrew
>>
>>  after starting R in winGRASS and before library("rgrass7") , could you do:
>>
>>  sessionInfo()
>>
>>  have you installed any GRASS addons? if yes, which one?
>>
>>  the addons are installed in C:\Users\yourusername\AppData\Roaming\GRASS7
>>
>>  if you have installed some GRASS addons, could you delete the addons
>>  folder
>>  in the C:\Users\yourusername\AppData\Roaming\GRASS7
>>
>>  then restart winGRASS (without any addons installed) and R and try to do
>>  library("rgrass7") again and report the results.
>>
>>
>>
>>  -----
>>  best regards
>>  Helmut
>>  --
>>  View this message in context:
>>  http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-tp5281770p5289300.html
>>  Sent from the Grass - Stats mailing list archive at Nabble.com.
>>  _______________________________________________
>>  grass-stats mailing list
>>  [hidden email]
>>  http://lists.osgeo.org/mailman/listinfo/grass-stats
>
>
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: GRASS GIS 7.0 (stable) and R integration issue

Jesse Whittington-2
Hi Roger,

I successfully loaded rgrass7 both with and without extensions
installed in grass.  I was then able to run a suite of grass commands
from R.  Thank-you for the fix!

I started R started from an existing grass project.
> Grass 7.0.4 (winGrass stand alone binary, WinGRASS-7.0.4-1-Setup-x86_64.exe)
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1

Jesse Whittington
Wildlife Ecologist
Banff National Park


On Thu, Oct 6, 2016 at 5:03 AM, Roger Bivand <[hidden email]> wrote:

> I've put a Windows binary and source of rgrass7_0.1-9 on:
>
> http://spatial.nhh.no/R/rgrass7/
>
> which I believe resolves the issue. Please test and report back (on list,
> subscribe first, then reply or post). Please also check with addons present
> to be sure that the fix works both with and without addons.
>
> Roger
>
>
> On Thu, 6 Oct 2016, Roger Bivand wrote:
>
>> Hi,
>>
>> Thanks for helping resolve this.
>>
>> I have 3 addons seen in Settings -> Addon extensions -> Manage ...
>>
>> I reinstalled them, so for example .../bin/r.flip.exe has current time. In
>> R GUI:
>>
>>>  parseGRASS("r.flip")
>>
>> Command: r.flip
>> Extension: .exe
>> Description: Flips an image.
>> Keywords: Flips an image.
>> Parameters:
>>   name: input, type: string, required: yes, multiple: no
>>   keydesc: name, keydesc_count: 1
>> [Name of input raster map]
>>   name: output, type: string, required: yes, multiple: no
>>   keydesc: name, keydesc_count: 1
>> [Name for output raster map]
>> Flags:
>>  name:  w [East-West flip] {FALSE}
>>  name:  b [Both N-S and E-W flip] {FALSE}
>>  name:  overwrite [Allow output files to overwrite existing files] {FALSE}
>>  name:  help [Print usage summary] {FALSE}
>>  name:  verbose [Verbose module output] {FALSE}
>>  name:  quiet [Quiet module output] {FALSE}
>>>
>>>
>>
>> and
>>
>>>  Sys.getenv("PATH")
>>
>> [1] "C:\\Program Files\\GRASS GIS
>> 7.0.4\\Python27\\lib\\site-packages\\numpy\\core;C:\\Program Files\\GRASS
>> GIS 7.0.4\\gui\\scripts;C:\\Program Files\\GRASS GIS 7.0.4\\lib;C:\\Program
>> Files\\GRASS GIS
>> 7.0.4\\bin;C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons\\bin;C:\\Program
>> Files\\GRASS GIS 7.0.4\\extrabin;C:\\Program Files\\GRASS GIS
>> 7.0.4\\bin;c:\\Rtools\\bin;C:\\WINDOWS\\SYSTEM32;C:\\WINDOWS;C:\\WINDOWS\\SYSTEM32\\WBEM;C:\\WINDOWS\\SYSTEM32\\WINDOWSPOWERSHELL\\V1.0\\;C:\\PROGRAM
>> FILES\\INTEL\\WIFI\\BIN\\;C:\\PROGRAM FILES\\COMMON
>> FILES\\INTEL\\WIRELESSCOMMON\\;C:\\PROGRAM
>> FILES\\MATLAB\\R2011B\\BIN;;C:\\PROGRAM FILES
>> (X86)\\INTEL\\SERVICES\\IPT\\;C:\\PROGRAM FILES (X86)\\LENOVO\\ACCESS
>> CONNECTIONS\\;C:\\Program Files\\ThinkPad\\Bluetooth Software\\;C:\\Program
>> Files\\ThinkPad\\Bluetooth
>> Software\\syswow64;C:\\Rtools\\bin;C:\\Rtools\\gcc-4.6.3\\bin;C:\\Program
>> Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common
>> Files\\Intel\\WirelessCommon\\;C:\\Program Files\\RStudio\\bin;C:\\Program
>> Files\\R\\R-3.3.1\\bin\\x64"
>>>
>>>
>>
>> and directly:
>>
>>>  Sys.getenv("GRASS_ADDON_BASE")
>>
>> [1] "C:\\Users\\rsb\\AppData\\Roaming\\GRASS7\\addons"
>>>
>>>
>>
>> If I remove this folder, the:
>>
>>>  library(rgrass7)
>>
>> Loading required package: sp
>> Loading required package: XML
>> Error : .onAttach failed in attachNamespace() for 'rgrass7', details:
>>   call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>>   error: missing value where TRUE/FALSE needed
>> Error: package or namespace load failed for ‘rgrass7’
>>>
>>>
>>
>> error becomes replicable. I'll report back when I've fixed it; the
>> workaround is to install any extension before starting R in GRASS.
>>
>> Roger
>>
>> On Tue, 4 Oct 2016, Helmut Kudrnovsky wrote:
>>
>>>  [also here: you have to be subscribed to be able to post on this ML ]
>>>
>>>
>>>  [hidden email] wrote
>>> >  Dear ALL
>>> > >  I installed new GRASS GIS 7.0 (stable) and R (last versions + all >
>>> > > packages
>>> >  were updated). Then started R (also tried Rstudio) from GRASS  as it
>>> > is >  recommended here:
>>> > >  https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7
>>> > >  R started, but when I tried to load libraries I got the following
>>> > > error
>>> >  and nothing works:
>>> > >  -------------
>>> > >  library(rgrass7)
>>> >  Loading required package: sp
>>> >  Loading required package: XML
>>> >  Error : .onAttach failed in attachNamespace() for &apos;rgrass7&apos;,
>>> >  details:
>>> >  call: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>>> >  error: missing value where TRUE/FALSE needed
>>> >  Error: package or namespace load failed for ‘rgrass7’
>>> > >  library(rgdal)
>>> >  rgdal: version: 1.1-10, (SVN revision 622)
>>> >  Geospatial Data Abstraction Library extensions to R successfully
>>> > loaded
>>> >  Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
>>> >  Path to GDAL shared files:
>>> > C:/Users/Andriy/R/win-library/3.3/rgdal/gdal
>>> >  Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION:
>>> > 492]
>>> >  Path to PROJ.4 shared files: >
>>> > C:/Users/Andriy/R/win-library/3.3/rgdal/proj
>>> >  Linking to sp version: 1.2-3
>>> > >  G <- gmeta()
>>> >  Error: could not find function "gmeta"
>>> >  -----------
>>> > >  However if I just start R alone (not from GRASS) the packages are
>>> > > loaded
>>> >  normally  without errors (of course if I start R not from Grass I
>>> > can't
>>> >  use Grass data).
>>> > >  I tried older versions: Grass 6.4.2 works with R fine, but not
>>> > > GRASS 7.
>>> >  Tried on 3 different PCs. Same problem.
>>> > >  Could you please help to fix it?
>>> > > >  Thank you.
>>> >  Andrew
>>>
>>>  after starting R in winGRASS and before library("rgrass7") , could you
>>> do:
>>>  sessionInfo()
>>>  have you installed any GRASS addons? if yes, which one?
>>>  the addons are installed in C:\Users\yourusername\AppData\Roaming\GRASS7
>>>
>>>  if you have installed some GRASS addons, could you delete the addons
>>>  folder
>>>  in the C:\Users\yourusername\AppData\Roaming\GRASS7
>>>
>>>  then restart winGRASS (without any addons installed) and R and try to do
>>>  library("rgrass7") again and report the results.
>>>
>>>
>>>  -----
>>>  best regards
>>>  Helmut
>>>  --
>>>  View this message in context:
>>>
>>> http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-tp5281770p5289300.html
>>>  Sent from the Grass - Stats mailing list archive at Nabble.com.
>>>  _______________________________________________
>>>  grass-stats mailing list
>>>  [hidden email]
>>>  http://lists.osgeo.org/mailman/listinfo/grass-stats
>>
>>
>>
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; fax +47 55 95 91 00
> e-mail: [hidden email]
> http://orcid.org/0000-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
> http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Reply | Threaded
Open this post in threaded view
|

Re: GRASS GIS 7.0 (stable) and R integration issue

Helmut Kudrnovsky
In reply to this post by Roger Bivand
>I've put a Windows binary and source of rgrass7_0.1-9 on:
>
>http://spatial.nhh.no/R/rgrass7/
>
>which I believe resolves the issue. Please test and report back (on list,
>subscribe first, then reply or post). Please also check with addons
>present to be sure that the fix works both with and without addons.

tested here with:

System Info                                                                    
GRASS Version: 7.3.svn                                                          
GRASS SVN revision: r69683                                                      
Build date: 2016-10-07                                                          
Build platform: x86_64-w64-mingw32                                              
GDAL: 2.1.1                                                                    
PROJ.4: 4.9.3                                                                  
GEOS: 3.5.0                                                                    
SQLite: 3.14.1                                                                  
Python: 2.7.5                                                                  
wxPython: 2.8.12.1                                                              
Platform: Windows-8-6.2.9200 (OSGeo4W)

-----------------------------
with addons:

C:\>set PATH=%PATH%;"C:\Program Files\R\R-3.3.1\bin\x64"
C:\>R
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
[...]
> library("rgrass7")
Lade n├Âtiges Paket: sp
Lade n├Âtiges Paket: XML
GRASS GIS interface loaded with GRASS version: GRASS 7.3.svn (2016)
and location: nc_spm_08_grass7
[...]
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgrass7_0.1-9 XML_3.98-1.4  sp_1.2-3

loaded via a namespace (and not attached):
[1] grid_3.3.1      lattice_0.20-34
[...]
> parseGRASS("r.flip")
Command: r.flip
Extension: .exe
Description: Flips an image.
Keywords: Flips an image.
Parameters:
  name: input, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name der Eingabe-Rasterkarte]
  name: output, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name der Ausgabe-Rasterkarte]
Flags:
  name: w [East-West flip] {FALSE}
  name: b [Both N-S and E-W flip] {FALSE}
  name: overwrite [Ausgabedateien d├╝rfen bereits existierende Dateien ├╝berschreiben.] {FALSE}
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}
[...]
> parseGRASS("r.northerness.easterness")
Command: r.northerness.easterness
Extension: .bat
Description: Calculation of northerness, easterness and the interaction between northerness and slope
Keywords: Raster, Gelände, aspect, slope, sun
Parameters:
  name: elevation, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name of elevation raster map]
Flags:
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}

-----------------------------  

without addons:
 
C:\>set PATH=%PATH%;"C:\Program Files\R\R-3.3.1\bin\x64"
C:\>R
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
[...]
> library("rgrass7")
Lade n├Âtiges Paket: sp
Lade n├Âtiges Paket: XML
GRASS GIS interface loaded with GRASS version: GRASS 7.3.svn (2016)
and location: nc_spm_08_grass7
[...]
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgrass7_0.1-9 XML_3.98-1.4  sp_1.2-3

loaded via a namespace (and not attached):
[1] grid_3.3.1      lattice_0.20-34
[...]
> parseGRASS("r.region")
Command: r.region
Extension: .exe
Description: Setzt die Begrenzungs-Definition (boundary) f├╝r eine Rasterkarte.
Keywords: Raster, Metadaten
Parameters:
  name: map, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name of raster map to change]
  name: region, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region von benannter Region.]
  name: raster, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region angepasst an diese Rasterkarte.]
  name: vector, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region angepasst an diese Vektorkarte.]
  name: n, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die n├Ârdliche Grenze.]
  name: s, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die s├╝dliche Grenze.]
  name: e, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die ├Âstliche Grenze.]
  name: w, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die westliche Grenze.]
  name: align, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Rasterkarte, an die angepasst werden soll.]
Flags:
  name: c [├£bernehme von der aktuellen Region.] {FALSE}
  name: d [├£bernehme von der Standard-Region.] {FALSE}
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}
[...]
> parseGRASS("r.northerness.easterness") # GRASS addon
Error in system(cmd0, intern = TRUE) :
  'r.northerness.easterness.exe' not found
Fehler in parseGRASS("r.northerness.easterness") :
  r.northerness.easterness not found
-----------------------------

the issue seems to be fixed;

thanks!
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re[2]: GRASS GIS 7.0 (stable) and R integration issue

andy-1@ukr.net
This post has NOT been accepted by the mailing list yet.
Thank you all. Works for me as well.
Much appreciated.
Best regards,
Andrew


--- Оригінальне повідомлення ---
Від кого: "Helmut Kudrnovsky [via OSGeo.org]" <[hidden email]>
Дата: 8 жовтня 2016, 04:50:01

>I've put a Windows binary and source of rgrass7_0.1-9 on:
>
>http://spatial.nhh.no/R/rgrass7/
>
>which I believe resolves the issue. Please test and report back (on list,
>subscribe first, then reply or post). Please also check with addons
>present to be sure that the fix works both with and without addons.

tested here with:

System Info                                                                    
GRASS Version: 7.3.svn                                                          
GRASS SVN revision: r69683                                                      
Build date: 2016-10-07                                                          
Build platform: x86_64-w64-mingw32                                              
GDAL: 2.1.1                                                                    
PROJ.4: 4.9.3                                                                  
GEOS: 3.5.0                                                                    
SQLite: 3.14.1                                                                  
Python: 2.7.5                                                                  
wxPython: 2.8.12.1                                                              
Platform: Windows-8-6.2.9200 (OSGeo4W)

-----------------------------
with addons:

C:\>set PATH=%PATH%;"C:\Program Files\R\R-3.3.1\bin\x64"
C:\>R
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
[...]
> library("rgrass7")
Lade n├Âtiges Paket: sp
Lade n├Âtiges Paket: XML
GRASS GIS interface loaded with GRASS version: GRASS 7.3.svn (2016)
and location: nc_spm_08_grass7
[...]
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgrass7_0.1-9 XML_3.98-1.4  sp_1.2-3

loaded via a namespace (and not attached):
[1] grid_3.3.1      lattice_0.20-34
[...]
> parseGRASS("r.flip")
Command: r.flip
Extension: .exe
Description: Flips an image.
Keywords: Flips an image.
Parameters:
  name: input, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name der Eingabe-Rasterkarte]
  name: output, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name der Ausgabe-Rasterkarte]
Flags:
  name: w [East-West flip] {FALSE}
  name: b [Both N-S and E-W flip] {FALSE}
  name: overwrite [Ausgabedateien d├╝rfen bereits existierende Dateien ├╝berschreiben.] {FALSE}
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}
[...]
> parseGRASS("r.northerness.easterness")
Command: r.northerness.easterness
Extension: .bat
Description: Calculation of northerness, easterness and the interaction between northerness and slope
Keywords: Raster, Gelände, aspect, slope, sun
Parameters:
  name: elevation, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name of elevation raster map]
Flags:
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}

-----------------------------  

without addons:
 
C:\>set PATH=%PATH%;"C:\Program Files\R\R-3.3.1\bin\x64"
C:\>R
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
[...]
> library("rgrass7")
Lade n├Âtiges Paket: sp
Lade n├Âtiges Paket: XML
GRASS GIS interface loaded with GRASS version: GRASS 7.3.svn (2016)
and location: nc_spm_08_grass7
[...]
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgrass7_0.1-9 XML_3.98-1.4  sp_1.2-3

loaded via a namespace (and not attached):
[1] grid_3.3.1      lattice_0.20-34
[...]
> parseGRASS("r.region")
Command: r.region
Extension: .exe
Description: Setzt die Begrenzungs-Definition (boundary) f├╝r eine Rasterkarte.
Keywords: Raster, Metadaten
Parameters:
  name: map, type: string, required: yes, multiple: no
  keydesc: name, keydesc_count: 1
[Name of raster map to change]
  name: region, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region von benannter Region.]
  name: raster, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region angepasst an diese Rasterkarte.]
  name: vector, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Setze Region angepasst an diese Vektorkarte.]
  name: n, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die n├Ârdliche Grenze.]
  name: s, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die s├╝dliche Grenze.]
  name: e, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die ├Âstliche Grenze.]
  name: w, type: string, required: no, multiple: no
  keydesc: value, keydesc_count: 1
[Wert f├╝r die westliche Grenze.]
  name: align, type: string, required: no, multiple: no
  keydesc: name, keydesc_count: 1
[Rasterkarte, an die angepasst werden soll.]
Flags:
  name: c [├£bernehme von der aktuellen Region.] {FALSE}
  name: d [├£bernehme von der Standard-Region.] {FALSE}
  name: help [Print usage summary] {FALSE}
  name: verbose [Ausf├╝hrlicher Ausgabemodus] {FALSE}
  name: quiet [Schweigsamer Ausgabemodus] {FALSE}
[...]
> parseGRASS("r.northerness.easterness") # GRASS addon
Error in system(cmd0, intern = TRUE) :
  'r.northerness.easterness.exe' not found
Fehler in parseGRASS("r.northerness.easterness") :
  r.northerness.easterness not found
-----------------------------

the issue seems to be fixed;

thanks!

best regards
Helmut



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-tp5281770p5289824.html
To unsubscribe from GRASS GIS 7.0 (stable) and R integration issue, click here.
NAML