Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-10-01 Thread Veronica Andreo
Thanks much, Roger!! (sorry for the delay in reacting ;))

El vie., 28 sept. 2018 a las 10:25, Roger Bivand ()
escribió:

> Package rgrass7_0.1-12.tar.gz is on its way to CRAN, with work-around for
> OSGeo4W no write access console startup directory.
>
> Roger
>
> On Tue, 25 Sep 2018, Roger Bivand wrote:
>
> > On Tue, 25 Sep 2018, Veronica Andreo wrote:
> >
> >>  Hi Roger,
> >>
> >>  [...]
> >>
> >>>  It should work even in a directory without write permission - now it
> >>>  tests
> >>>  first rather than failing. Probably the default should be to use a
> >>>  temporary file for GISRC anyway, but ten years ago that seemed
> >>>  challenging.
> 
> >  I also corrected the PROJ shared files location for GRASS (I hope).
> I
> >>>  can
> >  provide a Windows binary package
> >  off-list if need be.
> >
>   How to find/test for the location of PROJ shared files?
> 
> >>>  You don't need to, it's just to do with correcting a carry-over from
> file
> >>>  organization in GRASS 6 that had not been correct for GRASS 7 when
> >>>  setting up environment variables for GRASS.
> >>>
> >  Please let me know if this gets things working.
> >
> >  I'm also concerned to know how rgrass7 should be maintained going
> >>>  forward?
> >  Should it be on github/r-spatial ? Should it migrate to sf/raster
> >>>  classes?
> >
> 
>   IMHO, moving to sf/raster classes seems reasonable. However, if it is
>   too
>   much of a hassle or there's no consensus, going from sp to sf is just
>   one
>   line in R once a GRASS vector has been read in and, for the raster
> data,
> >>>  as
>   well.
> >>>
> >>>  I already have a trial sf/raster github repo, but the recent edits are
> >>>  not
> >>>  present there. It only uses sf for vector, but is stuck with sp/raster
> >>>  for
> >>>  raster, so was waiting for stars or similar to provide something
> newer.
> >>>
> >>
> >>  star given :)
> >>  Didn't know about this repo. I think github/r-spatial is also probably
> the
> >>  better place to hold the official rgrass7 in the (near?) future
> >
> > Yes, but until we know whether getClass("Raster") in the raster Package
> is a
> > stable target match for GRASS raster layers (as sp::SpatialGridDataFrame
> has
> > been), we don't know how to drop the sp dependency. raster still depends
> on
> > sp and suggests rgdal; it now also suggests sf, so maybe in a little
> while an
> > R/GRASS interface could be just sf/rgdal-based. To support existing
> > workflows, a legacy mode would be needed, I think. So rgrass7 would load
> in
> > legacy mode, but pivot to sf/raster if legacy mode was set FALSE? The
> > r-spatial/stars project is making some progress as Edzer described in
> > Pruchonice, but is split between local arrays and/or cloud-based
> > representations. When stars reaches a sweet spot, rgrass7 can follow it
> for
> > the R-side representation.
> >
> > Best wishes,
> >
> > Roger
> >
> >>
> >>  Cheers,
> >>  Vero
> >>
> >
> >
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
> http://orcid.org/-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0J=en
>
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-28 Thread Roger Bivand
Package rgrass7_0.1-12.tar.gz is on its way to CRAN, with work-around for 
OSGeo4W no write access console startup directory.


Roger

On Tue, 25 Sep 2018, Roger Bivand wrote:


On Tue, 25 Sep 2018, Veronica Andreo wrote:


 Hi Roger,

 [...]


 It should work even in a directory without write permission - now it
 tests
 first rather than failing. Probably the default should be to use a
 temporary file for GISRC anyway, but ten years ago that seemed
 challenging.



 I also corrected the PROJ shared files location for GRASS (I hope). I

 can

 provide a Windows binary package
 off-list if need be.


 How to find/test for the location of PROJ shared files?


 You don't need to, it's just to do with correcting a carry-over from file
 organization in GRASS 6 that had not been correct for GRASS 7 when
 setting up environment variables for GRASS.


 Please let me know if this gets things working.

 I'm also concerned to know how rgrass7 should be maintained going

 forward?

 Should it be on github/r-spatial ? Should it migrate to sf/raster

 classes?




 IMHO, moving to sf/raster classes seems reasonable. However, if it is
 too
 much of a hassle or there's no consensus, going from sp to sf is just
 one
 line in R once a GRASS vector has been read in and, for the raster data,

 as

 well.


 I already have a trial sf/raster github repo, but the recent edits are
 not
 present there. It only uses sf for vector, but is stuck with sp/raster
 for
 raster, so was waiting for stars or similar to provide something newer.



 star given :)
 Didn't know about this repo. I think github/r-spatial is also probably the
 better place to hold the official rgrass7 in the (near?) future


Yes, but until we know whether getClass("Raster") in the raster Package is a 
stable target match for GRASS raster layers (as sp::SpatialGridDataFrame has 
been), we don't know how to drop the sp dependency. raster still depends on 
sp and suggests rgdal; it now also suggests sf, so maybe in a little while an 
R/GRASS interface could be just sf/rgdal-based. To support existing 
workflows, a legacy mode would be needed, I think. So rgrass7 would load in 
legacy mode, but pivot to sf/raster if legacy mode was set FALSE? The 
r-spatial/stars project is making some progress as Edzer described in 
Pruchonice, but is split between local arrays and/or cloud-based 
representations. When stars reaches a sweet spot, rgrass7 can follow it for 
the R-side representation.


Best wishes,

Roger



 Cheers,
 Vero






--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
http://orcid.org/-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0J=en
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-25 Thread Roger Bivand

On Tue, 25 Sep 2018, Veronica Andreo wrote:


Hi Roger,

[...]


It should work even in a directory without write permission - now it tests
first rather than failing. Probably the default should be to use a
temporary file for GISRC anyway, but ten years ago that seemed
challenging.



I also corrected the PROJ shared files location for GRASS (I hope). I

can

provide a Windows binary package
off-list if need be.


How to find/test for the location of PROJ shared files?


You don't need to, it's just to do with correcting a carry-over from file
organization in GRASS 6 that had not been correct for GRASS 7 when
setting up environment variables for GRASS.


Please let me know if this gets things working.

I'm also concerned to know how rgrass7 should be maintained going

forward?

Should it be on github/r-spatial ? Should it migrate to sf/raster

classes?




IMHO, moving to sf/raster classes seems reasonable. However, if it is too
much of a hassle or there's no consensus, going from sp to sf is just one
line in R once a GRASS vector has been read in and, for the raster data,

as

well.


I already have a trial sf/raster github repo, but the recent edits are not
present there. It only uses sf for vector, but is stuck with sp/raster for
raster, so was waiting for stars or similar to provide something newer.



star given :)
Didn't know about this repo. I think github/r-spatial is also probably the
better place to hold the official rgrass7 in the (near?) future


Yes, but until we know whether getClass("Raster") in the raster Package is 
a stable target match for GRASS raster layers (as sp::SpatialGridDataFrame 
has been), we don't know how to drop the sp dependency. raster still 
depends on sp and suggests rgdal; it now also suggests sf, so maybe in a 
little while an R/GRASS interface could be just sf/rgdal-based. To support 
existing workflows, a legacy mode would be needed, I think. So rgrass7 
would load in legacy mode, but pivot to sf/raster if legacy mode was set 
FALSE? The r-spatial/stars project is making some progress as Edzer 
described in Pruchonice, but is split between local arrays and/or 
cloud-based representations. When stars reaches a sweet spot, rgrass7 can 
follow it for the R-side representation.


Best wishes,

Roger



Cheers,
Vero



--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
http://orcid.org/-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0J=en
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-24 Thread Veronica Andreo
Hi Roger,

[...]

> It should work even in a directory without write permission - now it tests
> first rather than failing. Probably the default should be to use a
> temporary file for GISRC anyway, but ten years ago that seemed
> challenging.
> >
> >> I also corrected the PROJ shared files location for GRASS (I hope). I
> can
> >> provide a Windows binary package
> >> off-list if need be.
> >>
> > How to find/test for the location of PROJ shared files?
> >
> You don't need to, it's just to do with correcting a carry-over from file
> organization in GRASS 6 that had not been correct for GRASS 7 when
> setting up environment variables for GRASS.
>
> >> Please let me know if this gets things working.
> >>
> >> I'm also concerned to know how rgrass7 should be maintained going
> forward?
> >> Should it be on github/r-spatial ? Should it migrate to sf/raster
> classes?
> >>
> >
> > IMHO, moving to sf/raster classes seems reasonable. However, if it is too
> > much of a hassle or there's no consensus, going from sp to sf is just one
> > line in R once a GRASS vector has been read in and, for the raster data,
> as
> > well.
>
> I already have a trial sf/raster github repo, but the recent edits are not
> present there. It only uses sf for vector, but is stuck with sp/raster for
> raster, so was waiting for stars or similar to provide something newer.
>

star given :)
Didn't know about this repo. I think github/r-spatial is also probably the
better place to hold the official rgrass7 in the (near?) future

Cheers,
Vero
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-24 Thread Roger Bivand

On Mon, 24 Sep 2018, Veronica Andreo wrote:


El lun., 24 sep. 2018 6:24, Roger Bivand  escribió:


On Sun, 23 Sep 2018, Helmut Kudrnovsky wrote:


I could reproduce the problem after starting the OSGeo4W console from

the

desktop shortcut icon.

The problem seems to be that OSGeo4W's console starts in a directory for
which the user does not have write access (for me from a desktop

shortcut

C:\Users\Public\Desktop\OSGeo4W). Because rgrass7::initGRASS() needs to
write a GISRC file in the working directory, it needs write access.

When I

changed working directory to one to which I did have write access, the
current CRAN binary rgrass7 loaded correctly under OSGeo4W for a
throw-away location. I haven't yet tried with a pre-existing location.

Could you check and see whether this seems reasonable?

If so, I'll add a check for write access in the working directory to

give

a more sensible error message.




Committed in r65 on https://r-forge.r-project.org/projects/spgrass/; the
change tests whether the working directory is writable, and if not puts
the temporary GISRC in an R temporary file. I checked Vero's scenario of
using initGRASS under OSGeo4W with an existing location (screenshot
attached) from the OSGeo4W console.



This is great! I could only test now, and after changing to a folder with
writing permission, all works perfectly!
Thanks so much, Roger and Helli :)


It should work even in a directory without write permission - now it tests 
first rather than failing. Probably the default should be to use a 
temporary file for GISRC anyway, but ten years ago that seemed 
challenging.






I also corrected the PROJ shared files location for GRASS (I hope). I can
provide a Windows binary package
off-list if need be.



How to find/test for the location of PROJ shared files?



You don't need to, it's just to do with correcting a carry-over from file 
organization in GRASS 6 that had not been correct for GRASS 7 when 
setting up environment variables for GRASS.





Please let me know if this gets things working.

I'm also concerned to know how rgrass7 should be maintained going forward?
Should it be on github/r-spatial ? Should it migrate to sf/raster classes?



IMHO, moving to sf/raster classes seems reasonable. However, if it is too
much of a hassle or there's no consensus, going from sp to sf is just one
line in R once a GRASS vector has been read in and, for the raster data, as
well.



I already have a trial sf/raster github repo, but the recent edits are not 
present there. It only uses sf for vector, but is stuck with sp/raster for 
raster, so was waiting for stars or similar to provide something newer. 
I'll try to combine the two at some stage, but not soon.


Best wishes,

Roger


Thanks again!

Best,
Vero



--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
http://orcid.org/-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0J=en___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-24 Thread Helmut Kudrnovsky

>How to find/test for the location of PROJ shared files?

see

https://r-forge.r-project.org/scm/viewvc.php/pkg/rgrass7/R/initGRASS.R?root=spgrass=55=64

for a diff



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-24 Thread Veronica Andreo
El lun., 24 sep. 2018 6:24, Roger Bivand  escribió:

> On Sun, 23 Sep 2018, Helmut Kudrnovsky wrote:
>
> >> I could reproduce the problem after starting the OSGeo4W console from
> the
> >> desktop shortcut icon.
> >>
> >> The problem seems to be that OSGeo4W's console starts in a directory for
> >> which the user does not have write access (for me from a desktop
> shortcut
> >> C:\Users\Public\Desktop\OSGeo4W). Because rgrass7::initGRASS() needs to
> >> write a GISRC file in the working directory, it needs write access.
> When I
> >> changed working directory to one to which I did have write access, the
> >> current CRAN binary rgrass7 loaded correctly under OSGeo4W for a
> >> throw-away location. I haven't yet tried with a pre-existing location.
> >>
> >> Could you check and see whether this seems reasonable?
> >>
> >> If so, I'll add a check for write access in the working directory to
> give
> >> a more sensible error message.
> >
>
> Committed in r65 on https://r-forge.r-project.org/projects/spgrass/; the
> change tests whether the working directory is writable, and if not puts
> the temporary GISRC in an R temporary file. I checked Vero's scenario of
> using initGRASS under OSGeo4W with an existing location (screenshot
> attached) from the OSGeo4W console.


This is great! I could only test now, and after changing to a folder with
writing permission, all works perfectly!
Thanks so much, Roger and Helli :)


> I also corrected the PROJ shared files location for GRASS (I hope). I can
> provide a Windows binary package
> off-list if need be.
>

How to find/test for the location of PROJ shared files?


> Please let me know if this gets things working.
>
> I'm also concerned to know how rgrass7 should be maintained going forward?
> Should it be on github/r-spatial ? Should it migrate to sf/raster classes?
>

IMHO, moving to sf/raster classes seems reasonable. However, if it is too
much of a hassle or there's no consensus, going from sp to sf is just one
line in R once a GRASS vector has been read in and, for the raster data, as
well.

Thanks again!

Best,
Vero
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-23 Thread Helmut Kudrnovsky
>I could reproduce the problem after starting the OSGeo4W console from the
>desktop shortcut icon.
>
>The problem seems to be that OSGeo4W's console starts in a directory for
>which the user does not have write access (for me from a desktop shortcut
>C:\Users\Public\Desktop\OSGeo4W). Because rgrass7::initGRASS() needs to
>write a GISRC file in the working directory, it needs write access. When I
>changed working directory to one to which I did have write access, the
>current CRAN binary rgrass7 loaded correctly under OSGeo4W for a
>throw-away location. I haven't yet tried with a pre-existing location.
>
>Could you check and see whether this seems reasonable?
>
>If so, I'll add a check for write access in the working directory to give
>a more sensible error message.

tested here with an existing location while changed the working directory to
writable directory:

--
run o-help for a list of available commands
C:\>d:

D:\>cd temp

D:\temp>cd testR

D:\temp\testR>R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 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.

> library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)
> initGRASS(gisBase = "C:/OSGeo4W64/apps/grass/grass-7.4.1",
+ gisDbase = "D:/grassdata/", location = "nc_spm_08_grass7",
+ mapset = "user1", SG="elevation")
gisdbaseD:/grassdata/
locationnc_spm_08_grass7
mapset  user1
rows474
columns 526
north   228527.2
south   215018.2
west629980
east644971
nsres   28.5
ewres   28.5
projection  +proj=lcc +lat_1=36.16 +lat_2=34.34
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1
Warnmeldung:
In dir.create(gisDbase) : 'D:\grassdata' existiert bereits
> g <- gmeta()
> g
gisdbaseD:/grassdata/
locationnc_spm_08_grass7
mapset  user1
rows474
columns 526
north   228527.2
south   215018.2
west629980
east644971
nsres   28.5
ewres   28.5
projection  +proj=lcc +lat_1=36.16 +lat_2=34.34
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1
>
-

yes, the issue is that OSGeo4W's console starts in a directory for
which the user does not have write access.

changing to a directory with write access starting grass from R works as
expected.

I'll change the wiki accordingly.

>If so, I'll add a check for write access in the working directory to give
>a more sensible error message.

that would be helpful.




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-23 Thread Roger Bivand

On Wed, 19 Sep 2018, Veronica Andreo wrote:


Hello Roger,

Thanks for coming back to this thread. The course, I'll teach starts on
October 22. So, we have 4+ weeks :)


I could reproduce the problem after starting the OSGeo4W console from the 
desktop shortcut icon.


The problem seems to be that OSGeo4W's console starts in a directory for 
which the user does not have write access (for me from a desktop shortcut 
C:\Users\Public\Desktop\OSGeo4W). Because rgrass7::initGRASS() needs to 
write a GISRC file in the working directory, it needs write access. When I 
changed working directory to one to which I did have write access, the 
current CRAN binary rgrass7 loaded correctly under OSGeo4W for a 
throw-away location. I haven't yet tried with a pre-existing location.


Could you check and see whether this seems reasonable?

If so, I'll add a check for write access in the working directory to give 
a more sensible error message.


Best wishes,

Roger



Let me know how I can help with testing.
Thanks again

Vero

El mié., 19 sep. 2018 16:31, Roger Bivand  escribió:


Sorry for the delay, now have access to an old laptop with Windows. When
do you need this resolved?

Roger

Roger Bivand
Norwegian School of Economics
Bergen, Norway



Fra: Veronica Andreo
Sendt: mandag 17. september, 02.20
Emne: Re: [GRASS-stats] Error when starting grass from R (grass installed
thru osgeo4w)
Til: Helmut Kudrnovsky
Kopi: grass-stats@lists.osgeo.org


Hi again,

So, I tested as suggested:
1. Open R console within OSGeo4W Shell,
2. library(rgrass7)
3. initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
= 'user1', SG='elevation')

and I now get:
unused argument (gisDbase = 'C:/Users/RETA/Documents/grassdata')

anything else to test/set?

best,
Vero


El dom., 16 sept. 2018 a las 23:15, Helmut Kudrnovsky ()
escribió:


OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I

don't
have access. Does usability >include initGRASS()? This would be most
fragile
because environment variables are being set, and >condition on Windows and
OSGeo4W.

R within a GRASS session works quite well so far.

did a fresh svn up of

svn://r-forge.r-project.org/svnroot/spgrass

and quickly screened pkg\rgrass7\R\initGRASS.R:

e.g.

Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
"\\proj", sep=""))

AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
PROJSHARE files; instead it uses the PROJ files itself; that's for all
platforms (linux, MacOS, MS Windows, ...).

e.g. in OSGeo4W 64bit it's defined as:

SET OSGEO4W_ROOT=C:\OSGeo4W64
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

only in the standalone installer, it's still defined as:

set GRASS_PROJSHARE=%GISBASE%\share\proj

because it's bundled in the installer.

e.g.

Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
Sys.getenv("PATH"), sep=""))

there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
dependencies etc are living e.g. in
C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...

I'm not sure about this one:

[...]
Sys.setenv(GISBASE=gisBase)
if (missing(home)) home <- Sys.getenv("USERPROFILE")
[...]
Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))

in winGRASS (standalone, OSGeo4W), the rc file lives in
C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%

and it seems around these lines:

[...]
Sys.setenv(GISRC="junk")
cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
cat("LOCATION_NAME: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
cat("MAPSET: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe
-g",
shQuote(Sys.getenv("GISRC"))), intern=TRUE),
Sys.getenv("GISRC"))
[...]

initGRASS gets in trouble in OSGeo4W.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://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; e-mail: roger.biv...@nhh.no
http://orcid.org/-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0J=en___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-19 Thread Veronica Andreo
Hello Roger,

Thanks for coming back to this thread. The course, I'll teach starts on
October 22. So, we have 4+ weeks :)

Let me know how I can help with testing.
Thanks again

Vero

El mié., 19 sep. 2018 16:31, Roger Bivand  escribió:

> Sorry for the delay, now have access to an old laptop with Windows. When
> do you need this resolved?
>
> Roger
>
> Roger Bivand
> Norwegian School of Economics
> Bergen, Norway
>
>
>
> Fra: Veronica Andreo
> Sendt: mandag 17. september, 02.20
> Emne: Re: [GRASS-stats] Error when starting grass from R (grass installed
> thru osgeo4w)
> Til: Helmut Kudrnovsky
> Kopi: grass-stats@lists.osgeo.org
>
>
> Hi again,
>
> So, I tested as suggested:
> 1. Open R console within OSGeo4W Shell,
> 2. library(rgrass7)
> 3. initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
> 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
> = 'user1', SG='elevation')
>
> and I now get:
> unused argument (gisDbase = 'C:/Users/RETA/Documents/grassdata')
>
> anything else to test/set?
>
> best,
> Vero
>
>
> El dom., 16 sept. 2018 a las 23:15, Helmut Kudrnovsky ()
> escribió:
>
> >OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I
> don't
> have access. Does usability >include initGRASS()? This would be most
> fragile
> because environment variables are being set, and >condition on Windows and
> OSGeo4W.
>
> R within a GRASS session works quite well so far.
>
> did a fresh svn up of
>
> svn://r-forge.r-project.org/svnroot/spgrass
>
> and quickly screened pkg\rgrass7\R\initGRASS.R:
>
> e.g.
>
> Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
> "\\proj", sep=""))
>
> AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
> PROJSHARE files; instead it uses the PROJ files itself; that's for all
> platforms (linux, MacOS, MS Windows, ...).
>
> e.g. in OSGeo4W 64bit it's defined as:
>
> SET OSGEO4W_ROOT=C:\OSGeo4W64
> set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
>
> only in the standalone installer, it's still defined as:
>
> set GRASS_PROJSHARE=%GISBASE%\share\proj
>
> because it's bundled in the installer.
>
> e.g.
>
> Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
> Sys.getenv("PATH"), sep=""))
>
> there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
> dependencies etc are living e.g. in
> C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...
>
> I'm not sure about this one:
>
> [...]
> Sys.setenv(GISBASE=gisBase)
> if (missing(home)) home <- Sys.getenv("USERPROFILE")
> [...]
> Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))
>
> in winGRASS (standalone, OSGeo4W), the rc file lives in
> C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%
>
> and it seems around these lines:
>
> [...]
> Sys.setenv(GISRC="junk")
> cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
> cat("LOCATION_NAME: ", "\n", file=Sys.getenv("GISRC"),
> append=TRUE)
> cat("MAPSET: ", "\n", file=Sys.getenv("GISRC"),
> append=TRUE)
> gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe
> -g",
> shQuote(Sys.getenv("GISRC"))), intern=TRUE),
> Sys.getenv("GISRC"))
> [...]
>
> initGRASS gets in trouble in OSGeo4W.
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
> ___
> grass-stats mailing list
> grass-stats@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-stats
>
>
>
>
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-19 Thread Roger Bivand
Sorry for the delay, now have access to an old laptop with Windows. When do you 
need this resolved?

Roger

Roger Bivand
Norwegian School of Economics
Bergen, Norway



Fra: Veronica Andreo
Sendt: mandag 17. september, 02.20
Emne: Re: [GRASS-stats] Error when starting grass from R (grass installed thru 
osgeo4w)
Til: Helmut Kudrnovsky
Kopi: grass-stats@lists.osgeo.org


Hi again,

So, I tested as suggested:
1. Open R console within OSGeo4W Shell,
2. library(rgrass7)
3. initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase = 
'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset = 
'user1', SG='elevation')

and I now get:
unused argument (gisDbase = 'C:/Users/RETA/Documents/grassdata')

anything else to test/set?

best,
Vero


El dom., 16 sept. 2018 a las 23:15, Helmut Kudrnovsky 
(mailto:hel...@web.de>>) escribió:
>OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I don't
have access. Does usability >include initGRASS()? This would be most fragile
because environment variables are being set, and >condition on Windows and
OSGeo4W.

R within a GRASS session works quite well so far.

did a fresh svn up of

svn://r-forge.r-project.org/svnroot/spgrass<http://r-forge.r-project.org/svnroot/spgrass>

and quickly screened pkg\rgrass7\R\initGRASS.R:

e.g.

Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
"\\proj", sep=""))

AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
PROJSHARE files; instead it uses the PROJ files itself; that's for all
platforms (linux, MacOS, MS Windows, ...).

e.g. in OSGeo4W 64bit it's defined as:

SET OSGEO4W_ROOT=C:\OSGeo4W64
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

only in the standalone installer, it's still defined as:

set GRASS_PROJSHARE=%GISBASE%\share\proj

because it's bundled in the installer.

e.g.

Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
Sys.getenv("PATH"), sep=""))

there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
dependencies etc are living e.g. in
C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...

I'm not sure about this one:

[...]
Sys.setenv(GISBASE=gisBase)
if (missing(home)) home <- Sys.getenv("USERPROFILE")
[...]
Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))

in winGRASS (standalone, OSGeo4W), the rc file lives in
C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%

and it seems around these lines:

[...]
Sys.setenv(GISRC="junk")
cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
cat("LOCATION_NAME: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
cat("MAPSET: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe -g",
shQuote(Sys.getenv("GISRC"))), intern=TRUE),
Sys.getenv("GISRC"))
[...]

initGRASS gets in trouble in OSGeo4W.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org<mailto:grass-stats@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-stats


___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Veronica Andreo
Hi again,

So, I tested as suggested:
1. Open R console within OSGeo4W Shell,
2. library(rgrass7)
3. initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
= 'user1', SG='elevation')

and I now get:
unused argument (gisDbase = 'C:/Users/RETA/Documents/grassdata')

anything else to test/set?

best,
Vero


El dom., 16 sept. 2018 a las 23:15, Helmut Kudrnovsky ()
escribió:

> >OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I
> don't
> have access. Does usability >include initGRASS()? This would be most
> fragile
> because environment variables are being set, and >condition on Windows and
> OSGeo4W.
>
> R within a GRASS session works quite well so far.
>
> did a fresh svn up of
>
> svn://r-forge.r-project.org/svnroot/spgrass
>
> and quickly screened pkg\rgrass7\R\initGRASS.R:
>
> e.g.
>
> Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
> "\\proj", sep=""))
>
> AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
> PROJSHARE files; instead it uses the PROJ files itself; that's for all
> platforms (linux, MacOS, MS Windows, ...).
>
> e.g. in OSGeo4W 64bit it's defined as:
>
> SET OSGEO4W_ROOT=C:\OSGeo4W64
> set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
>
> only in the standalone installer, it's still defined as:
>
> set GRASS_PROJSHARE=%GISBASE%\share\proj
>
> because it's bundled in the installer.
>
> e.g.
>
> Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
> Sys.getenv("PATH"), sep=""))
>
> there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
> dependencies etc are living e.g. in
> C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...
>
> I'm not sure about this one:
>
> [...]
> Sys.setenv(GISBASE=gisBase)
> if (missing(home)) home <- Sys.getenv("USERPROFILE")
> [...]
> Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))
>
> in winGRASS (standalone, OSGeo4W), the rc file lives in
> C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%
>
> and it seems around these lines:
>
> [...]
> Sys.setenv(GISRC="junk")
> cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
> cat("LOCATION_NAME: ", "\n", file=Sys.getenv("GISRC"),
> append=TRUE)
> cat("MAPSET: ", "\n", file=Sys.getenv("GISRC"),
> append=TRUE)
> gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe
> -g",
> shQuote(Sys.getenv("GISRC"))), intern=TRUE),
> Sys.getenv("GISRC"))
> [...]
>
> initGRASS gets in trouble in OSGeo4W.
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
> ___
> grass-stats mailing list
> grass-stats@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-stats
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Helmut Kudrnovsky
>OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I don't
have access. Does usability >include initGRASS()? This would be most fragile
because environment variables are being set, and >condition on Windows and
OSGeo4W.

R within a GRASS session works quite well so far.

did a fresh svn up of 

svn://r-forge.r-project.org/svnroot/spgrass

and quickly screened pkg\rgrass7\R\initGRASS.R:

e.g.

Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
"\\proj", sep=""))

AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
PROJSHARE files; instead it uses the PROJ files itself; that's for all
platforms (linux, MacOS, MS Windows, ...).

e.g. in OSGeo4W 64bit it's defined as:

SET OSGEO4W_ROOT=C:\OSGeo4W64
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

only in the standalone installer, it's still defined as:

set GRASS_PROJSHARE=%GISBASE%\share\proj

because it's bundled in the installer.

e.g.

Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
Sys.getenv("PATH"), sep=""))

there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
dependencies etc are living e.g. in 
C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...

I'm not sure about this one:

[...]
Sys.setenv(GISBASE=gisBase)
if (missing(home)) home <- Sys.getenv("USERPROFILE")
[...]
Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))

in winGRASS (standalone, OSGeo4W), the rc file lives in
C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%

and it seems around these lines:

[...]
Sys.setenv(GISRC="junk")
cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
cat("LOCATION_NAME: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
cat("MAPSET: ", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe -g",
shQuote(Sys.getenv("GISRC"))), intern=TRUE),
Sys.getenv("GISRC"))
[...]

initGRASS gets in trouble in OSGeo4W.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Veronica Andreo
Perfect, will test and report back in case of any issue.
Thanks, Helli :)

El dom., 16 sept. 2018 a las 17:00, Helmut Kudrnovsky ()
escribió:

> >Should I open R from OSGeo4W command console and then init grass there? Is
> that the workflow?
>
> Yes, that's the workflow.
>
> because environment variables for e.g. gdal, proj4 etc have to be set. And
> that's nicely done in the OSGeo4W command line
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
> ___
> grass-stats mailing list
> grass-stats@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-stats
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Helmut Kudrnovsky
>Should I open R from OSGeo4W command console and then init grass there? Is
that the workflow?

Yes, that's the workflow.

because environment variables for e.g. gdal, proj4 etc have to be set. And
that's nicely done in the OSGeo4W command line



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Roger Bivand
Sorry, no idea. Testing was from R for Windows using initGRASS(), but a long 
time ago. Starting R from within GRASS, picking up the environment variables 
already created during GRASS startup msy be less fragile, as you are using an 
existing location.

Roger

Roger Bivand
Norwegian School of Economics
Bergen, Norway




On Sun, Sep 16, 2018 at 4:43 PM +0200, "Veronica Andreo" 
mailto:veroand...@gmail.com>> wrote:

Hi Helli, Roger

No, I just opened R console (installed outside OSGeo4W) and from there, I tried 
to init grass.
Should I open R from OSGeo4W command console and then init grass there? Is that 
the workflow?

best,
Vero

El dom., 16 sept. 2018 a las 16:25, Helmut Kudrnovsky 
(mailto:hel...@web.de>>) escribió:
Veronica Andreo wrote
> Hello,
>
> I am preparing a one week GRASS GIS course and I mostly expect Windows
> users, so I recommend to install from OSGeo4W that allows to easily
> install
> also QGIS, msys (to get nice bash tricks) and other libraries that are
> then
> needed for some grass add-ons.
>
> The last day of the course, I'll show the connection with R. Now, starting
> R within a grass session works as expected. But I get errors when trying
> to
> initialize GRASS (installed from OSGeo4W) from R console. I am following
> the instructions in the wiki [0]
>
> First, I had to change the slashes from windows type, to linux type
> (because I got:
> Error: '\O' in an unrecognized escape in character string ""C:\O").
>
> After that, I get the following:
>
>> initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
> 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
> = 'user1', SG='elevation')
> Error in if (!compatible) { : argumento tiene longitud cero
> Además: Warning messages:
> 1: In system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("GISRC"))), :
> comando ejecutado 'g.dirseps.exe -g "junk"' tiene estatus 309
> 2: In system(paste("g.dirseps.exe -g", shQuote(gisDbase)), intern = TRUE)
> :
> comando ejecutado 'g.dirseps.exe -g "C:/Users/RETA/Documents/grassdata"'
> tiene estatus 309
> 3: In dir.create(loc_path) :
> cannot create dir 'NA\nc_spm_08_grass7', reason 'No such file or
> directory'
> 4: In dir.create(paste(loc_path, "PERMANENT", sep = "/")) :
> cannot create dir 'NA\nc_spm_08_grass7\PERMANENT', reason 'No such file or
> directory'
> 5: In dir.create(paste(loc_path, mapset, sep = "/")) :
> cannot create dir 'NA\nc_spm_08_grass7\user1', reason 'No such file or
> directory'
> 6: In system(paste("g.version", get("addEXE", envir = .GRASS_CACHE), :
> comando ejecutado 'g.version.exe' tiene estatus 309
>
> Any hints? I also attach a screenshot with the message that appears (I
> cannot copy/paste the text in that message)
>
> Thanks much in advance!
> Vero
>
> [0] https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R
>
> ___
> grass-stats mailing list

> grass-stats@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-stats
>
> Rgui_2018-09-13_22-19-45.png (73K)
> http://osgeo-org.1560.x6.nabble.com/attachment/5378245/0/Rgui_2018-09-13_22-19-45.png;

it's a missing dll.

Are you invoking R from inside the OSGeo4W command console?



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Roger Bivand
OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I don't 
have access. Does usability include initGRASS()? This would be most fragile 
because environment variables are being set, and condition on Windows and 
OSGeo4W.

Roger


Fra: Helmut Kudrnovsky
Sendt: søndag 16. september, 16.37
Emne: Re: [GRASS-stats] Error when starting grass from R (grassinstalledthru 
osgeo4w)
Til: grass-stats@lists.osgeo.org


Roger Bivand wrote > Note that rgrass7 has not been tested on OSGeo4W for many 
years, so the > logic differences from Windows may no longer hold. Using Live 
has often > been a better choice, but as I never use QGIS, I've no experience. 
Reports > on issues with OSGei4W welcome. > > Roger > > Roger Bivand > 
Norwegian School of Economics > Bergen, Norway > > > > Fra: Helmut Kudrnovsky > 
Sendt: søndag 16. september, 16.26 > Emne: Re: [GRASS-stats] Error when 
starting grass from R (grass > installedthru osgeo4w) > Til: > 
grass-stats@.osgeo > > > Veronica Andreo wrote > Hello, > > I am preparing a 
one week GRASS GIS > course and I mostly expect Windows > users, so I recommend 
to install from > OSGeo4W that allows to easily > install > also QGIS, msys (to 
get nice > bash tricks) and other libraries that are > then > needed for some 
grass > add-ons. > > The last day of the course, I'll show the connection with 
R. > Now, starting > R within a grass session works as expected. But I get > 
errors when trying > to > initialize GRASS (installed from OSGeo4W) from R > 
console. I am following > the instructions in the wiki [0] > > First, I > had 
to change the slashes from windows type, to linux type > (because I > got: > 
Error: '\O' in an unrecognized escape in character string ""C:\O"). > > > After 
that, I get the following: > >> initGRASS(gisBase = > 
'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase = > > 
'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset > > 
= 'user1', SG='elevation') > Error in if (!compatible) { : argumento > tiene 
longitud cero > Además: Warning messages: > 1: In > system(paste("g.dirseps.exe 
-g", shQuote(Sys.getenv("GISRC"))), : > > comando ejecutado 'g.dirseps.exe -g 
"junk"' tiene estatus 309 > 2: In > system(paste("g.dirseps.exe -g", 
shQuote(gisDbase)), intern = TRUE) > : > > comando ejecutado 'g.dirseps.exe -g 
"C:/Users/RETA/Documents/grassdata"' > > tiene estatus 309 > 3: In 
dir.create(loc_path) : > cannot create dir > 'NA\nc_spm_08_grass7', reason 'No 
such file or > directory' > 4: In > dir.create(paste(loc_path, "PERMANENT", sep 
= "/")) : > cannot create dir > 'NA\nc_spm_08_grass7\PERMANENT', reason 'No 
such file or > directory' > 5: > In dir.create(paste(loc_path, mapset, sep = 
"/")) : > cannot create dir > 'NA\nc_spm_08_grass7\user1', reason 'No such file 
or > directory' > 6: In > system(paste("g.version", get("addEXE", envir = 
.GRASS_CACHE), : > comando > ejecutado 'g.version.exe' tiene estatus 309 > > 
Any hints? I also attach a > screenshot with the message that appears (I > 
cannot copy/paste the text > in that message) > > Thanks much in advance! > 
Vero > > [0] > 
https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R > > > 
___ > grass-stats mailing list > > 
grass-stats@.osgeo > > https://lists.osgeo.org/mailman/listinfo/grass-stats > > 
> Rgui_2018-09-13_22-19-45.png (73K) > > 

 > it's a missing dll. Are you invoking R from inside the OSGeo4W command > 
console? - best regards Helmut -- Sent from: > 
http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html > 
___ grass-stats mailing list > 
grass-stats@.osgeo > https://lists.osgeo.org/mailman/listinfo/grass-stats > > > 
___ > grass-stats mailing list > 
grass-stats@.osgeo > https://lists.osgeo.org/mailman/listinfo/grass-stats 
Working for years now winGRASS-R only in OSGeo4w, I would call it well tested. 
- best regards Helmut -- Sent from: 
http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html 
___ grass-stats mailing list 
grass-stats@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-stats

___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Veronica Andreo
Hi Helli, Roger

No, I just opened R console (installed outside OSGeo4W) and from there, I
tried to init grass.
Should I open R from OSGeo4W command console and then init grass there? Is
that the workflow?

best,
Vero

El dom., 16 sept. 2018 a las 16:25, Helmut Kudrnovsky ()
escribió:

> Veronica Andreo wrote
> > Hello,
> >
> > I am preparing a one week GRASS GIS course and I mostly expect Windows
> > users, so I recommend to install from OSGeo4W that allows to easily
> > install
> > also QGIS, msys (to get nice bash tricks) and other libraries that are
> > then
> > needed for some grass add-ons.
> >
> > The last day of the course, I'll show the connection with R. Now,
> starting
> > R within a grass session works as expected. But I get errors when trying
> > to
> > initialize GRASS (installed from OSGeo4W) from R console. I am following
> > the instructions in the wiki [0]
> >
> > First, I had to change the slashes from windows type, to linux type
> > (because I got:
> > Error: '\O' in an unrecognized escape in character string ""C:\O").
> >
> > After that, I get the following:
> >
> >> initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
> > 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7',
> mapset
> > = 'user1', SG='elevation')
> > Error in if (!compatible) { : argumento tiene longitud cero
> > Además: Warning messages:
> > 1: In system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("GISRC"))), :
> > comando ejecutado 'g.dirseps.exe -g "junk"' tiene estatus 309
> > 2: In system(paste("g.dirseps.exe -g", shQuote(gisDbase)), intern = TRUE)
> > :
> > comando ejecutado 'g.dirseps.exe -g "C:/Users/RETA/Documents/grassdata"'
> > tiene estatus 309
> > 3: In dir.create(loc_path) :
> > cannot create dir 'NA\nc_spm_08_grass7', reason 'No such file or
> > directory'
> > 4: In dir.create(paste(loc_path, "PERMANENT", sep = "/")) :
> > cannot create dir 'NA\nc_spm_08_grass7\PERMANENT', reason 'No such file
> or
> > directory'
> > 5: In dir.create(paste(loc_path, mapset, sep = "/")) :
> > cannot create dir 'NA\nc_spm_08_grass7\user1', reason 'No such file or
> > directory'
> > 6: In system(paste("g.version", get("addEXE", envir = .GRASS_CACHE), :
> > comando ejecutado 'g.version.exe' tiene estatus 309
> >
> > Any hints? I also attach a screenshot with the message that appears (I
> > cannot copy/paste the text in that message)
> >
> > Thanks much in advance!
> > Vero
> >
> > [0] https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R
> >
> > ___
> > grass-stats mailing list
>
> > grass-stats@.osgeo
>
> > https://lists.osgeo.org/mailman/listinfo/grass-stats
> >
> > Rgui_2018-09-13_22-19-45.png (73K)
> > 
> http://osgeo-org.1560.x6.nabble.com/attachment/5378245/0/Rgui_2018-09-13_22-19-45.png
> ;
>
> it's a missing dll.
>
> Are you invoking R from inside the OSGeo4W command console?
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
> ___
> grass-stats mailing list
> grass-stats@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-stats
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Helmut Kudrnovsky
Roger Bivand wrote
> Note that rgrass7 has not been tested on OSGeo4W for many years, so the
> logic differences from Windows may no longer hold. Using Live has often
> been a better choice, but as I never use QGIS, I've no experience. Reports
> on issues with OSGei4W welcome.
> 
> Roger
> 
> Roger Bivand
> Norwegian School of Economics
> Bergen, Norway
> 
> 
> 
> Fra: Helmut Kudrnovsky
> Sendt: søndag 16. september, 16.26
> Emne: Re: [GRASS-stats] Error when starting grass from R (grass
> installedthru osgeo4w)
> Til: 

> grass-stats@.osgeo

> 
> 
> Veronica Andreo wrote > Hello, > > I am preparing a one week GRASS GIS
> course and I mostly expect Windows > users, so I recommend to install from
> OSGeo4W that allows to easily > install > also QGIS, msys (to get nice
> bash tricks) and other libraries that are > then > needed for some grass
> add-ons. > > The last day of the course, I'll show the connection with R.
> Now, starting > R within a grass session works as expected. But I get
> errors when trying > to > initialize GRASS (installed from OSGeo4W) from R
> console. I am following > the instructions in the wiki [0] > > First, I
> had to change the slashes from windows type, to linux type > (because I
> got: > Error: '\O' in an unrecognized escape in character string ""C:\O").
> > > After that, I get the following: > >> initGRASS(gisBase =
> 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase = >
> 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
> > = 'user1', SG='elevation') > Error in if (!compatible) { : argumento
> tiene longitud cero > Además: Warning messages: > 1: In
> system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("GISRC"))), : >
> comando ejecutado 'g.dirseps.exe -g "junk"' tiene estatus 309 > 2: In
> system(paste("g.dirseps.exe -g", shQuote(gisDbase)), intern = TRUE) > : >
> comando ejecutado 'g.dirseps.exe -g "C:/Users/RETA/Documents/grassdata"' >
> tiene estatus 309 > 3: In dir.create(loc_path) : > cannot create dir
> 'NA\nc_spm_08_grass7', reason 'No such file or > directory' > 4: In
> dir.create(paste(loc_path, "PERMANENT", sep = "/")) : > cannot create dir
> 'NA\nc_spm_08_grass7\PERMANENT', reason 'No such file or > directory' > 5:
> In dir.create(paste(loc_path, mapset, sep = "/")) : > cannot create dir
> 'NA\nc_spm_08_grass7\user1', reason 'No such file or > directory' > 6: In
> system(paste("g.version", get("addEXE", envir = .GRASS_CACHE), : > comando
> ejecutado 'g.version.exe' tiene estatus 309 > > Any hints? I also attach a
> screenshot with the message that appears (I > cannot copy/paste the text
> in that message) > > Thanks much in advance! > Vero > > [0]
> https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R > >
> ___ > grass-stats mailing list
> > grass-stats@.osgeo >
> https://lists.osgeo.org/mailman/listinfo/grass-stats > >
> Rgui_2018-09-13_22-19-45.png (73K) >
> http://osgeo-org.1560.x6.nabble.com/attachment/5378245/0/Rgui_2018-09-13_22-19-45.png;
> it's a missing dll. Are you invoking R from inside the OSGeo4W command
> console? - best regards Helmut -- Sent from:
> http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
> ___ grass-stats mailing list 

> grass-stats@.osgeo

>  https://lists.osgeo.org/mailman/listinfo/grass-stats
> 
> 
> ___
> grass-stats mailing list

> grass-stats@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-stats

Working for years now winGRASS-R only in OSGeo4w, I would call it well
tested.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Roger Bivand
Note that rgrass7 has not been tested on OSGeo4W for many years, so the logic 
differences from Windows may no longer hold. Using Live has often been a better 
choice, but as I never use QGIS, I've no experience. Reports on issues with 
OSGei4W welcome.

Roger

Roger Bivand
Norwegian School of Economics
Bergen, Norway



Fra: Helmut Kudrnovsky
Sendt: søndag 16. september, 16.26
Emne: Re: [GRASS-stats] Error when starting grass from R (grass installedthru 
osgeo4w)
Til: grass-stats@lists.osgeo.org


Veronica Andreo wrote > Hello, > > I am preparing a one week GRASS GIS course 
and I mostly expect Windows > users, so I recommend to install from OSGeo4W 
that allows to easily > install > also QGIS, msys (to get nice bash tricks) and 
other libraries that are > then > needed for some grass add-ons. > > The last 
day of the course, I'll show the connection with R. Now, starting > R within a 
grass session works as expected. But I get errors when trying > to > initialize 
GRASS (installed from OSGeo4W) from R console. I am following > the 
instructions in the wiki [0] > > First, I had to change the slashes from 
windows type, to linux type > (because I got: > Error: '\O' in an unrecognized 
escape in character string ""C:\O"). > > After that, I get the following: > >> 
initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase = > 
'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset > = 
'user1', SG='elevation') > Error in if (!compatible) { : argumento tiene 
longitud cero > Además: Warning messages: > 1: In system(paste("g.dirseps.exe 
-g", shQuote(Sys.getenv("GISRC"))), : > comando ejecutado 'g.dirseps.exe -g 
"junk"' tiene estatus 309 > 2: In system(paste("g.dirseps.exe -g", 
shQuote(gisDbase)), intern = TRUE) > : > comando ejecutado 'g.dirseps.exe -g 
"C:/Users/RETA/Documents/grassdata"' > tiene estatus 309 > 3: In 
dir.create(loc_path) : > cannot create dir 'NA\nc_spm_08_grass7', reason 'No 
such file or > directory' > 4: In dir.create(paste(loc_path, "PERMANENT", sep = 
"/")) : > cannot create dir 'NA\nc_spm_08_grass7\PERMANENT', reason 'No such 
file or > directory' > 5: In dir.create(paste(loc_path, mapset, sep = "/")) : > 
cannot create dir 'NA\nc_spm_08_grass7\user1', reason 'No such file or > 
directory' > 6: In system(paste("g.version", get("addEXE", envir = 
.GRASS_CACHE), : > comando ejecutado 'g.version.exe' tiene estatus 309 > > Any 
hints? I also attach a screenshot with the message that appears (I > cannot 
copy/paste the text in that message) > > Thanks much in advance! > Vero > > [0] 
https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R > > 
___ > grass-stats mailing list > 
grass-stats@.osgeo > https://lists.osgeo.org/mailman/listinfo/grass-stats > > 
Rgui_2018-09-13_22-19-45.png (73K) > 

 it's a missing dll. Are you invoking R from inside the OSGeo4W command 
console? - best regards Helmut -- Sent from: 
http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html 
___ grass-stats mailing list 
grass-stats@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-stats

___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats

Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)

2018-09-16 Thread Helmut Kudrnovsky
Veronica Andreo wrote
> Hello,
> 
> I am preparing a one week GRASS GIS course and I mostly expect Windows
> users, so I recommend to install from OSGeo4W that allows to easily
> install
> also QGIS, msys (to get nice bash tricks) and other libraries that are
> then
> needed for some grass add-ons.
> 
> The last day of the course, I'll show the connection with R. Now, starting
> R within a grass session works as expected. But I get errors when trying
> to
> initialize GRASS (installed from OSGeo4W) from R console. I am following
> the instructions in the wiki [0]
> 
> First, I had to change the slashes from windows type, to linux type
> (because I got:
> Error: '\O' in an unrecognized escape in character string ""C:\O").
> 
> After that, I get the following:
> 
>> initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase =
> 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset
> = 'user1', SG='elevation')
> Error in if (!compatible) { : argumento tiene longitud cero
> Además: Warning messages:
> 1: In system(paste("g.dirseps.exe -g", shQuote(Sys.getenv("GISRC"))), :
> comando ejecutado 'g.dirseps.exe -g "junk"' tiene estatus 309
> 2: In system(paste("g.dirseps.exe -g", shQuote(gisDbase)), intern = TRUE)
> :
> comando ejecutado 'g.dirseps.exe -g "C:/Users/RETA/Documents/grassdata"'
> tiene estatus 309
> 3: In dir.create(loc_path) :
> cannot create dir 'NA\nc_spm_08_grass7', reason 'No such file or
> directory'
> 4: In dir.create(paste(loc_path, "PERMANENT", sep = "/")) :
> cannot create dir 'NA\nc_spm_08_grass7\PERMANENT', reason 'No such file or
> directory'
> 5: In dir.create(paste(loc_path, mapset, sep = "/")) :
> cannot create dir 'NA\nc_spm_08_grass7\user1', reason 'No such file or
> directory'
> 6: In system(paste("g.version", get("addEXE", envir = .GRASS_CACHE), :
> comando ejecutado 'g.version.exe' tiene estatus 309
> 
> Any hints? I also attach a screenshot with the message that appears (I
> cannot copy/paste the text in that message)
> 
> Thanks much in advance!
> Vero
> 
> [0] https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7#GRASS_within_R
> 
> ___
> grass-stats mailing list

> grass-stats@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-stats
> 
> Rgui_2018-09-13_22-19-45.png (73K)
> http://osgeo-org.1560.x6.nabble.com/attachment/5378245/0/Rgui_2018-09-13_22-19-45.png;

it's a missing dll.

Are you invoking R from inside the OSGeo4W command console?



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
___
grass-stats mailing list
grass-stats@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-stats