0

I want to load data which is embedded in an R package. I use GWmodel package and want to load LondonHP data. But when i try to load the data using RCaller in Java, the xml return is :

<?xml version="1.0"?> <root> </root>

This is my code to load the data :

code.R_require("GWmodel"); code.addRCode("data(LondonHP)"); caller.setRCode(code); caller.runAndReturnResult("londonhp");

Can you guys give me solution to my problem?

www
  • 38,575
  • 12
  • 48
  • 84

1 Answers1

0

We can see in R console that the londonhp object is in type of S4 :

> typeof(londonhp)
[1] "S4"

So, it has some slots :

> slotNames(londonhp)
[1] "data"        "coords.nrs"  "coords"      "bbox"        "proj4string"

You can access its elements using the @ operator:

> londonhp@data

So you need to handle londonhp@data, not londonhp itself.

jbytecode
  • 681
  • 12
  • 29