Hi Moritz, Your suggested edits to v.class.mlR.py worked (except you had one too many brackets on the end of each line, so I removed those). Once I updated and saved that script file, the error disappeared.
I have just reinstalled the module using g.extension and tried running v.class.mlR and I again have the original error regarding escaped slashes. Kind regards James On 25 May 2017 at 09:15, Moritz Lennert <mlenn...@club.worldonline.be> wrote: > Le Thu, 25 May 2017 00:25:57 +0200, > Markus Neteler <nete...@osgeo.org> a écrit : > > > On Wed, May 24, 2017 at 12:14 PM, James Duffy > > <james.philip.du...@gmail.com> wrote: > > ... > > > v.class.mlR --verbose segments_map=seg_stats_vec@MAP1 > > ... > > > My GRASS mapset is located in - C:\Sandbox\RGRASS\TEST\MAP1 > > > > > > Given that R takes paths with / rather than \, I think the issue > > > lies at the start of the R part of the script which reads: > > > > > > require(caret) > > > features <- > > > read.csv("C:\Sandbox\RGRASS\TEST\MAP1\.tmp/unknown\5636.0", > > > sep="|", header=TRUE, row.names=1) training <- > > > read.csv("C:\Sandbox\RGRASS\TEST\MAP1\.tmp/unknown\5636.1", > > > sep="|", header=TRUE, row.names=1) > > > > > > I have run v.class.mlR on an osgeolive build before, but not on > > > Windows. Is this a Windows specific issue that needs addressing? > > > > In the script I see things like > > reclass_files[classifier] = tmpfilename.replace("\\", > > "/") > > > > which is probably unhelpful on Windows. Not sure how to make that > > portable, though. > > I had forgotten that I had already done this elsewhere in the > module... ;-) > > It is actually there exactly for Windows: tempfile() creates a path > with \, but in R these have to either be escaped, or modified into / as > R (and I think Windows in general) can handle paths with forward > slashes. > > I had answered James, but I now notice that it was from a wrong > address, so the mail didn't get through to the list. > > I've now just comitted a fix using the same technique. > > James, can you just reinstall v.class.mlR and try again ? > > Moritz > -- *James Duffy* PhD Researcher Environment and Sustainability Institute Penryn Campus University of Exeter Penryn Cornwall TR10 9FE
_______________________________________________ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user