[R-sig-Geo] RE: Using SJava?

Roger Bivand Roger.Bivand at nhh.no
Mon Apr 5 21:36:37 CEST 2004


On Mon, 5 Apr 2004 Benjamin.STABLER at odot.state.or.us wrote:

> Hopefully, I'm not too late on this one....when you initialize the JVM you
> need to set the class path as follows:
> 
> .JavaInit(config=javaConfig(classPath="StringDirectoryPathReference"))
> 
> or
> 
> .JavaInit(config=javaConfig(classPath=c("String1", "String2")))
> 
> for example:
> 
> .JavaInit(config=javaConfig(classPath="C:\javastuff"))
> 
> where javastuff contains my class files.  You need to specify the jar file
> name if you are trying to include class files within jars.  I have used it
> with some classes that I wrote.  

Yes, and Sys.putenv("CLASSPATH"="String1") can be used too, but what do 
you put in .Java() to get into your own jars? Are there escaping issues in 
the path to the jars? (backslash twice? forwardslash?) Could we put up 
some jars and some instructions for use on a website? Frank Hardisty sent 
me an example off-list that works from the command line but which I can't 
find from within R/SJava (Windows XP, the SJava examples that I've tried 
work for me). 

The idea would be to see if GeoTools2 can be reached from within R, 
because it could provide (another) way to import/export multiple GIS 
formats.

Roger

> 
> I too am excited about linking Java and R, as there is so much useful code
> in the Java community.
> 
> Benjamin Stabler
> Transportation Planning Analysis Unit
> Oregon Department of Transportation
> 555 13th Street NE, Suite 2
> Salem, OR 97301  Ph: 503-986-4104
> 
> 
> >Message: 5
> >Date: Fri, 2 Apr 2004 20:56:50 +0200 (CEST)
> >From: Roger Bivand <Roger.Bivand at nhh.no>
> >Subject: [R-sig-Geo] Using SJava?
> >To: r-sig-geo at stat.math.ethz.ch
> >Cc: Frank Hardisty <HardistF at gwm.sc.edu>
> >Message-ID: <Pine.LNX.4.44.0404022042580.28093-100000 at reclus.nhh.no>
> >Content-Type: TEXT/PLAIN;	charset=US-ASCII
> >
> >Is anyone on this list using SJava or any R/Java connection? 
> >Not only is
> >the JTS Topology Suite that Tim just mentioned interesting, 
> >but so is the
> >upcoming GeoTools2 at http://www.geotools.org/. Both are 
> >likely to be used 
> >quite a lot, and thus probably well-maintained.
> >
> >At the recent Association of American Geographers meeting, 
> >Frank Hardisty
> >asked me about this, and while I was able to install SJava (from
> >http://www.stats.ox.ac.uk/pub/RWin) on a Win XP laptop, we 
> >were not able
> >to see how to get Java within R to see GeoTools in its 
> >classpath.  Both of
> >these Java resources are potentially useful, and R opinions 
> >two or three
> >years ago, that Java is slow, may need revision given increased machine
> >capacity. I feel we could benefit from mobilizing Java insight 
> >(but I feel
> >personally Java-challenged!).
> >
> >I believe that Duncan Temple-Lang was playing with/working on object 
> >discovery - this could be very relevant in terms of matching 
> >R-internal 
> >object representations with those in existing software that we 
> >could - if 
> >SJava worked - link to. I also think that we could ask him for 
> >advice if 
> >we discussed it first here. What do others think?
> >
> >-- 
> >Roger Bivand
> >Economic Geography Section, Department of Economics, Norwegian 
> >School of
> >Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
> >Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
> >e-mail: Roger.Bivand at nhh.no
> >
> >
> >
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list