---Chris Burke wrote:
> Sherlock, Ric wrote:
> > I have been investigating interfacing J and R using Rserve.
> > <http://www.jsoftware.com/jwiki/Interfaces/R/Rserve>
> > 
> > I am interested in how best to go about working with the 
> Attribute lists
> > returned by the interface. 
> 
> When I first looked at this, I stopped here, because I was 
> not sure of 
> the exact representation of attributes. I had expected them 
> to be a pair:
> 
>     value;`name
> 
> where `name is the attribute name, and value is the value, 
> which itself 
> may be an attribute or attribute list.
> 
> Your first example matches this. The second example does not, 
> since the 
> attribute is a 3 item list.
> 
> Do you know of an exact definition of attributes?

Having a brief look at this under XP where the structures work OK, it
looks something like this to me:

If Rget returns a structure rather than simple data, it is in the form
of a 2 item boxed list, the 1st box contains the attributes of the data
in the 2nd box.

The box containing the attributes contains a list of 2 or 3 boxed items.
The last item contains the attribute name and the first one contains the
attribute value(s).

If a middle boxed item exists, it is also a list of 2 or 3 boxed items,
the last is the attribute name, the first is the value and the middle
one if it exists is a 2 or 3 item boxed list ... etc.

These commands seem to produce structures that conform to the above
description.
  Rget 'cars'
  Rget 'OrchardSprays'
  Rget 'lm(dist ~ speed, data=cars)'

A portion of the structure produced by the last command seems to be an
exception though which suggests that my description above is not
completely accurate.
Rget '(lm(dist ~ speed, data=cars)$qr)$qr'
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to