rgrass7 is not loading

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

rgrass7 is not loading

mappy87

Dear grass users,

 

since today I’ve the following problem:

 

starting rgrass7 package in R in the grass7 console I get the following error message:

 

> library(rgrass7)

Lade nÂtiges Paket: sp

Lade nÂtiges Paket: XML

Error : .onAttach in attachNamespace() f├╝r 'rgrass7' fehlgeschlagen, Details:

  Aufruf: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >

  Fehler: Fehlender Wert, wo TRUE/FALSE nÂtig ist

Fehler: Laden von Paket oder Namensraum f├╝r 'rgrass7' fehlgeschlagen

 

I tried the following options:

 

New installation of GRASS7 and R

Updated all packages in R

Installed the package rgrass7 on both sides, in an single R Session and also in the R Session inside the GRASS console,

 

But nothing works.

 

Is it possible to fix this?

Is there a way to set the namespaces for R or to repair them?

 

By the way: The same problem seems to be at v.krige in the GUI. I never get this addon to work and need to use the kriging interpolation methods.

 

 

Thank you for your help,

 

kind regards, Norbert Zirps.

 

 

 

 

Norbert  Zirps

Reichenstraße 14

02625 Bautzen

mobil 015774938930

 


_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Reply | Threaded
Open this post in threaded view
|

Re: rgrass7 is not loading

Roger Bivand
On Mon, 19 Sep 2016, Norbert Zirps wrote:

> Dear grass users,
> since today I’ve the following problem:

First problem, unkown OS. Guess Windows (CP1252??) from the odd characters
in your email, unkown version. Unknown R version and unkown rgrass7
version. No other reports of issues that are known. Are you using OSGeo4W
GRASS or native GRASS? That shouldn't matter, rgrass7 will load with no
GRASS present.

Roger

> starting rgrass7 package in R in the grass7 console I get the following error message:
>> library(rgrass7)
> Lade n├Âtiges Paket: sp
> Lade n├Âtiges Paket: XML
> Error : .onAttach in attachNamespace() f├╝r 'rgrass7' fehlgeschlagen,
> Details:
>  Aufruf: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>  Fehler: Fehlender Wert, wo TRUE/FALSE n├Âtig ist
> Fehler: Laden von Paket oder Namensraum f├╝r 'rgrass7' fehlgeschlagen
> I tried the following options:
> New installation of GRASS7 and R
> Updated all packages in R
> Installed the package rgrass7 on both sides, in an single R Session and also in the R Session inside the GRASS console,
> But nothing works.
> Is it possible to fix this?
> Is there a way to set the namespaces for R or to repair them?
> By the way: The same problem seems to be at v.krige in the GUI. I never get this addon to work and need to use the kriging interpolation methods.
> Thank you for your help,
>
>
>
> kind regards, Norbert Zirps.
>
>
>
>
>
>
>
>
>
> Norbert  Zirps
>
> Reichenstraße 14
>
> 02625 Bautzen
>
> mobil 015774938930
>
>
>
>
--
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: rgrass7 is not loading

Roger Bivand
The OP replied off-list 20/9 that:

"I'm working on win7 home professional.

It's the latest r version (3.3.0) and native grass 7.0.4.

The rgrass7 package is the latest, downloaded yesterday. In  the single r session it works and reports that grass is not running.

But if i start it in the grass session i get this error.

It seems that there are any old grass r bindings which uses the namespaces needed from the package.

Until yesterday it worked fine...

I searched for this issue, founded similar reports, but no solutions. Am"

Using Windows 7 Enterprise and R 3.3.0 and R 3.3.1, GRASS 7.0.4, and rgrass7 0.1-7 and 0.1-8, I see no issues and cannot reproduce it. Could other users of Windows (I am not a Windows user) please report whether this loading error is specific to the OP (and another person who contacted me offlist). Do not write to me offlist, only the list collectively is likely to resolve this.

Roger
 
--
Roger Bivand
Norwegian School of Economics
Helleveien 30, 5045 Bergen, Norway
[hidden email]


________________________________________
Fra: grass-stats [[hidden email]] på vegne av Roger Bivand [[hidden email]]
Sendt: 19. september 2016 9:53
Til: Norbert Zirps
Kopi: [hidden email]
Emne: Re: [GRASS-stats] rgrass7 is not loading

On Mon, 19 Sep 2016, Norbert Zirps wrote:

> Dear grass users,
> since today I’ve the following problem:

First problem, unkown OS. Guess Windows (CP1252??) from the odd characters
in your email, unkown version. Unknown R version and unkown rgrass7
version. No other reports of issues that are known. Are you using OSGeo4W
GRASS or native GRASS? That shouldn't matter, rgrass7 will load with no
GRASS present.

Roger

> starting rgrass7 package in R in the grass7 console I get the following error message:
>> library(rgrass7)
> Lade n├Âtiges Paket: sp
> Lade n├Âtiges Paket: XML
> Error : .onAttach in attachNamespace() f├╝r 'rgrass7' fehlgeschlagen,
> Details:
>  Aufruf: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>  Fehler: Fehlender Wert, wo TRUE/FALSE n├Âtig ist
> Fehler: Laden von Paket oder Namensraum f├╝r 'rgrass7' fehlgeschlagen
> I tried the following options:
> New installation of GRASS7 and R
> Updated all packages in R
> Installed the package rgrass7 on both sides, in an single R Session and also in the R Session inside the GRASS console,
> But nothing works.
> Is it possible to fix this?
> Is there a way to set the namespaces for R or to repair them?
> By the way: The same problem seems to be at v.krige in the GUI. I never get this addon to work and need to use the kriging interpolation methods.
> Thank you for your help,
>
>
>
> kind regards, Norbert Zirps.
>
>
>
>
>
>
>
>
>
> Norbert  Zirps
>
> Reichenstraße 14
>
> 02625 Bautzen
>
> mobil 015774938930
>
>
>
>

--
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: rgrass7 is not loading

Helmut Kudrnovsky
>The OP replied off-list 20/9 that:
>
>"I'm working on win7 home professional.
>
>It's the latest r version (3.3.0) and native grass 7.0.4.
>
>The rgrass7 package is the latest, downloaded yesterday. In  the single r session it works and reports that grass is not running.
>
>But if i start it in the grass session i get this error.
>
>It seems that there are any old grass r bindings which uses the namespaces needed from the package.
>
>Until yesterday it worked fine...
>
>I searched for this issue, founded similar reports, but no solutions. Am"
>
>Using Windows 7 Enterprise and R 3.3.0 and R 3.3.1, GRASS 7.0.4, and rgrass7 0.1-7 and 0.1-8, I see no issues and cannot reproduce it. Could other users of Windows (I am not a Windows user) please report whether this loading error is specific to the OP (and another person who contacted me offlist). Do not write to me offlist, only the list collectively is likely to resolve this.

tested here on a win 10 64-bit box, and osgeo4w-winGRASS7.0.5; following steps for testing:

- start a osgeo4w-winGRASS7.0.5-session

- adding R to %PATH%:

C:\>set PATH=%PATH%;"C:\Program Files\R\R-3.3.1\bin"

C:\>echo %PATH%
C:\OSGEO4~1\apps\grass\grass-7.0.5\lib;C:\OSGEO4~1\apps\grass\grass-7.0.5\bin;C:\Users\hkmyr\AppData\Roaming\GRASS7\addons\bin;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\WBem;C:\OSGEO4~1\apps\msys\bin;"C:\Program Files\R\R-3.3.1\bin"

- following library versions are installed:

install.packages("sp") # sp_1.2-3
install.packages("rgdal") # rgdal_1.1-10
install.packages("rgrass7") # rgrass7_0.1-8

- then typing R in the osgeo4w-windows console:

C:\>R

R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' f├╝r Details dazu.

R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
Tippen Sie 'contributors()' f├╝r mehr Information und 'citation()',
um zu erfahren, wie R oder R packages in Publikationen zitiert werden k├Ânnen.

Tippen Sie 'demo()' f├╝r einige Demos, 'help()' f├╝r on-line Hilfe, oder
'help.start()' f├╝r eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.

Beim Start - Warnmeldungen:
1: Setting LC_CTYPE=de_AT.cp1252 failed
2: Setting LC_COLLATE=de_AT.cp1252 failed
3: Setting LC_TIME=de_AT.cp1252 failed
4: Setting LC_MONETARY=de_AT.cp1252 failed
>

- and loading rgrass7:

> library("rgrass7")
Lade n├Âtiges Paket: sp
Lade n├Âtiges Paket: XML
GRASS GIS interface loaded with GRASS version: GRASS 7.0.5 (2016)
and location: nc_spm_08_grass7

beside some locale setting issues,  library("rgrass7") works here on my side.

I've tested it on a few 32bit/64bit win7/win8/win10-boxes, no issues so far here in testing on my side.

taken from the mentioned error report:
> Error : .onAttach in attachNamespace() f├╝r 'rgrass7' fehlgeschlagen,
> Details:
>  Aufruf: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>  Fehler: Fehlender Wert, wo TRUE/FALSE n├Âtig ist

what can be the reason of such an attachNamespace() issue?

two installed rgrass7 packages (with and without admin rights)?
locale issue?
path issue?

anything else to test?
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: rgrass7 is not loading

Helmut Kudrnovsky
Helmut Kudrnovsky wrote
what can be the reason of such an attachNamespace() issue?

two installed rgrass7 packages (with and without admin rights)?
locale issue?
path issue?

anything else to test?
maybe .Rprofile file that is loading it already at Startup?
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: rgrass7 is not loading

benhemingway
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Roger Bivand
I am having the same problem.

Windows 10 Home 64 bit. Native GRASS 7.0.4 R 3.3.1

When I try to load the rgrass7 library from within GRASS i get:

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'

When I try and load it from within R i get:

Loading required package: sp
Loading required package: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)


-Ben
Reply | Threaded
Open this post in threaded view
|

Re: rgrass7 is not loading

Helmut Kudrnovsky
In reply to this post by Roger Bivand
>Using Windows 7 Enterprise and R 3.3.0 and R 3.3.1, GRASS 7.0.4, and rgrass7 0.1-7 and 0.1-8, I see no >issues and cannot reproduce it. Could other users of Windows (I am not a Windows user) please report >whether this loading error is specific to the OP (and another person who contacted me offlist). Do not >write to me offlist, only the list collectively is likely to resolve this.

[snip]

> Error : .onAttach in attachNamespace() f├╝r 'rgrass7' fehlgeschlagen,
> Details:
>  Aufruf: if (class(t0) != "try-error" && is.character(t0) && nchar(t0) >
>  Fehler: Fehlender Wert, wo TRUE/FALSE n├Âtig ist

looking at the error, it seems to come from:

https://r-forge.r-project.org/scm/viewvc.php/pkg/rgrass7/R/xml1.R?view=markup&root=spgrass

[...]
if (nchar(Sys.getenv("GRASS_ADDON_BASE")) > 0) {
                t0 <- try(sub(".bat", "",
                   list.files(paste(Sys.getenv("GRASS_ADDON_BASE"),
                       "bin", sep="/"), pattern=".bat$")), silent=TRUE)
                if (class(t0) != "try-error" && is.character(t0) &&
                   nchar(t0) > 0)
                   WN_bat <- c(WN_bat, t0)
[...]

could it be that (some) addons raises this issue?




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

Re: rgrass7 is not loading

Helmut Kudrnovsky
In reply to this post by benhemingway
[you have to be subscribed to post in this ML]

benhemingway wrote
I am having the same problem.

Windows 10 Home 64 bit. Native GRASS 7.0.4 R 3.3.1

When I try to load the rgrass7 library from within GRASS i get:

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'

When I try and load it from within R i get:

Loading required package: sp
Loading required package: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

-Ben
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