hope this helps. spencer graves
Slim Shady wrote:
Consider this Java class:
class myClass {
final public static String[] testString () {
return new String[]{"my", "name", "is"} ;
}
final public static int[] testInt () {
return new int[]{5, 10, 15};
} final public static char[] testChar () {
return new char[]{'x', 'y', 'z'};
}
}
When invoked in R:
s <- .Java(className, "testString")[1] "list"
class(s)
length(s)[1] 3
s
[[1]] [1] "my"
[[2]] [1] "name"
[[3]] [1] "is"
c <- .Java(className, "testChar")[1] "character"
class(c)
length(c)[1] 1
c
[1] "X"
i <- .Java(className, "testInt")[1] "integer"
class(i)
length(i)[1] 3
i
[1] 5 10 15
Note that the conversion of testInt is just what I expected (and what I get in S-PLUS). The conversion of testChar is flat wrong because data is lost. The conversion of testString is problematic since I have to convert the list back using as.character (in S-PLUS this function returns character instaid of list and saves me the convertion from list to character) Is the convertion of char[] a bug? is there is a way to make the conversion of String[] returns a character class instaid of a list just like in the S-PLUS Java Connect?
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- Spencer Graves, PhD, Senior Development Engineer O: (408)938-4420; mobile: (408)655-4567
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
