OK, I'm still having issues with a related problem to the one I had before.

The R package pvclust produces a list object. One of the entries in it is
...$hclust$labels. I want to replace this with a list of my own and then
feed it inot another r package. In R I would do...

results=pvclust(mydata, method.hclust="complete", method.dist="euclidean",
nboot=100)
results$hclust$labels = seq(1,50)
sigresults = pvpick(results, alpha=0.68, pv="au", type="geq", max.only=TRUE)

In rpy I'm having problems doing this. Running the clustering is fine:

results = r.pvclust(data=mydata, method_hclust="complete",
method_dist="euclidean", nboot=100)

but I don't know how to get at the '$hclust$labels' entry inside the robj it
creates! I can convert "results" back to a python object, edit it, and then
convert it back into an R object to feed into pvpick, but when I try this
somthing isn't right about the conversion back and  it falls over. There
must be a way to edit the robj without requiring a conversion... This really
should be simple - I'm amazed that it isn't; or am I missing something.

Nick


2009/10/20 Nick Schurch <n.schu...@dundee.ac.uk>

> HI all,
>
> I'm having some problems understanding how to access data inside a
> dataframe with rpy.
>
> I have a dataframe called 'genedata' with columns like '$R', '$G' and
> '$Genes' and I want to be able to pass a specific column as a
> parameter to a new R function. I've had a look at the manual and I
> think I should be using something like
>
> selecteddata = r['$'](genedata, R)
>
> to pull out the specific data I want, but when I try this I get the
> following error
>
> rpy.RPy_TypeConversionException: cannot convert from type 'classobj'
>
> I've tried adding  '.as_py(CLASS_CONVERSION)' to the end of this but
> it still fails. Ultimately what I want to do is give this data to
> another command. In R I'd say:
>
> datanorm<-normalizeBetweenArrays(genes$R, method="quantile")
>
>
> so actually I don't really want to convert the robj to a python object
> - I just want to know how I can reference the data within the
> dataframe. Any help would be greatly appreciated.
>
> --
> Cheers,
>
> Nick Schurch
>
> Data Analysis Group (The Barton Group),
> School of Life Sciences,
> University of Dundee,
> Dow St,
> Dundee,
> DD1 5EH,
> Scotland,
> UK
>
> Tel: +44 1382 388707
> Fax: +44 1382 345 893
>



-- 
Cheers,

Nick Schurch

Data Analysis Group (The Barton Group),
School of Life Sciences,
University of Dundee,
Dow St,
Dundee,
DD1 5EH,
Scotland,
UK

Tel: +44 1382 388707
Fax: +44 1382 345 893
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to