# # This example shows how we can use a Java class # to perform computations and get the results back # to R. This particular case is a class (StatDataURL) # that reads the contents of a URL line-by-line # and provides a mechanism for returning those # lines as an array of Java Strings. This is # automatically converted to a character vector. library(SJava) # Put the correct path here. .JavaInit(classPath=c(paste(Sys.getenv("OMEGA_HOME"), "..", "..", sep = .Platform$file.sep), system.file("org", "omegahat", "Jars", "ROmegahatExamples.jar", package = "SJava" ))) u <- .JNew("org.omegahat.S.Java.Examples.StatDataURL", "http://www.omegahat.org/Scripts/AwtButton") els <- paste(u$getContents(),collapse="\n")