[Rpy] Linux import failure

2008-12-12 Thread Gary Strangman
Hi RPy gurus, I'm trying to upgrade to rpy2 and ran into the following trouble (CentOS5, R2.8.0). I got rpy2 to build without difficulty, and set RHOME appropriately (note, if it matters I have R and rpy installed in a non-standard site, as I don't have admin rights to put it in /usr/local).

Re: [Rpy] Linux import failure

2008-12-12 Thread Gary Strangman
fixed in svn and will be fixed in the next release. > > Laurent > > 2008/12/12 Gary Strangman : >> >> Hi RPy gurus, >> >> I'm trying to upgrade to rpy2 and ran into the following trouble (CentOS5, >> R2.8.0). I got rpy2 to build without difficulty, and se

[Rpy] Accessing lm() elements

2008-12-12 Thread Gary Strangman
Hi again, Forgive me if this is a completely silly question for rpy2. I'm trying to wean myself from rpy, but am confused by the new approach to conversion. If I fit a model and collect summary info as follows ... fit = robjects.r.lm(fmla,data) summary = robjects.r.summary(fit) ... the summar

Re: [Rpy] Accessing lm() elements

2008-12-12 Thread Gary Strangman
n Fri, 12 Dec 2008, laurent oget wrote: > I do std-error=r['$'](summary,'sigma') > I think r.names(summary) will give you the components. > > Laurent > > 2008/12/12 Gary Strangman : >> >> Hi again, >> >> Forgive me if this is a completely

Re: [Rpy] Accessing lm() elements

2008-12-13 Thread Gary Strangman
>> (Intercept) 10.9205792 2.9934159 3.6481997 0.001341692 >> prerbmt 0.4226101 0.1729016 2.4442236 0.022599474 >> mri -0.3495370 0.7497424 -0.4662095 0.645450898 >> >> ... and if I want the estimate for the 2nd coefficient ... >> > print summary[3][1] >> 0.4226101 > > You c

[Rpy] Dataframe conversion question

2008-12-13 Thread Gary Strangman
Hi again, I have a list-of-lists that I want to convert to an R dataframe. (In R, it should end up as 306 rows by 12 columns.) The rpy2 instructions suggested in this forum were basically: (1) convert my list of lists to a list of array.array()s, (2) convert each array.array() to an RVector, (

Re: [Rpy] Dataframe conversion question

2008-12-14 Thread Gary Strangman
13 Dec 2008, Marcos Silva wrote: > Well, I don't know RPy nor Python enought, and maybe I misunderstand your > data structure, but did you tried the RPy corresponding to the R > function"as.data.frame(dl)" > > Cheers > > > 2008/12/13 Gary Strangman > >>

Re: [Rpy] Dataframe conversion question

2008-12-14 Thread Gary Strangman
>> I have a list-of-lists that I want to convert to an R dataframe. (In R, it >> should end up as 306 rows by 12 columns.) The rpy2 instructions suggested >> in this forum were basically: (1) convert my list of lists to a list of >> array.array()s, (2) convert each array.array() to an RVector,

[Rpy] Specifying na.action?

2008-12-16 Thread Gary Strangman
Forgive this seemingly simple question for rpy2 ... how do you specify 'dotted' function arguments from python? I want to specify the na.action=na.omit for lme, but the python code below (which I though would be equivalent to that required by rpy) doesn't work for rpy2: R: > fit = lme(fmla,dat

Re: [Rpy] call for feedback: enhanced rpy2 api: 'rnumpy'

2009-03-23 Thread Gary Strangman
The rnumpy concept looks great, and addresses some annoyances I've encountered working at the interface between R and numpy. I hope to test rnumpy this week, but in the meantime ... the text suggests that R data frames can be manipulated/sliced using rnumpy. Can they be created directly as wel

[Rpy] Making dataframes ... fast

2009-09-28 Thread Gary Strangman
Hi all, I have a python list of lists (each sublist is a row of data), plus a list of column names. Something like this ... >>> d = [['S80', 'C', 137.5, 0], ['S82', 'C', 155.1, 1], ['S83', 'T', 11.96, 0], ['S84', 'T', 47,1]] ['S85', 'T', numpy.nan, 1]

Re: [Rpy] Making dataframes ... fast

2009-09-29 Thread Gary Strangman
t Gary On Tue, 29 Sep 2009, Laurent Gautier wrote: > Gary, > > Two things come to my mind: > > - Try having an initial Python data structure that requires less > transformations than your current one in order to become a DataFrame. > > - Use rpy2.rinterface when speed ma

Re: [Rpy] Making dataframes ... fast

2009-09-29 Thread Gary Strangman
Great. Thanks for the jump-start! On Tue, 29 Sep 2009, Laurent Gautier wrote: > Gary Strangman wrote: >> >> Hi Laurent, >> >> The only way to reduce the number of transformations is to add an >> equivalent number of columns to the dataframe (so that instea

Re: [Rpy] Making dataframes ... fast

2009-09-29 Thread Gary Strangman
disk hits each time I ran the thing, I worried about burning a hole in my disk. ;-) I'll try a few things and post any useful results ... Gary On Tue, 29 Sep 2009, Peter wrote: > On Tue, Sep 29, 2009 at 12:21 PM, Gary Strangman wrote: >> >> Hi Laurent, >> >

Re: [Rpy] Making dataframes ... fast

2009-09-29 Thread Gary Strangman
ad off to do some tinkering and profiling now. -best Gary On Tue, 29 Sep 2009, Nathaniel Smith wrote: > On Tue, Sep 29, 2009 at 4:21 AM, Gary Strangman > wrote: >> Without benchmarking, that seems mighty inefficient. Nathaniel Smith's >> rnumpy mostly allows t

[Rpy] na.action?

2009-09-29 Thread Gary Strangman
Hi again, What is the proper syntax to set parameters like na.action in R's lm() function? For example, if I create a dataframe with NAs and want them to be dealt with via R's na.exclude, how do I formulate the call? Things like the following fail: >>> from rpy2.robjects import * >>> f = r.fo

[Rpy] Windows installer for 2.1rc?

2010-04-09 Thread Gary Strangman
Has anyone out there buit a windows installer for rpy2.1rc that they might be able to share? -best Gary The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, pleas

[Rpy] rpy2-2.1rc and formulas

2010-04-14 Thread Gary Strangman
Does the following happen for anyone else? /space/nsg/8/users> python Python 2.6.3 (r263:75183, Oct 16 2009, 12:24:10) [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import rpy2.robjects >>> print rpy2.__version__ 2.1.0

[Rpy] rpy2-2.1 console capture

2010-04-17 Thread Gary Strangman
Hi rpy'ers, In the older versions of rpy(2?), I could redirect stdout to a file to capture all console output. This was adequate, though I got lots of extra info over and above what R would print for the same object. (For example, when printing the result of an lm() model fit, I'd get the enti

Re: [Rpy] rpy2-2.1rc and formulas

2010-04-18 Thread Gary Strangman
Done ... #36. On Wed, 14 Apr 2010, Gary Strangman wrote: > > Does the following happen for anyone else? > > /space/nsg/8/users> python > Python 2.6.3 (r263:75183, Oct 16 2009, 12:24:10) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2 > Type "help", "

Re: [Rpy] rpy2-2.1 console capture

2010-04-18 Thread Gary Strangman
>> In the older versions of rpy(2?), I could redirect stdout to a file to >> capture all console output. This was adequate, though I got lots of extra >> info over and above what R would print for the same object. (For example, >> when printing the result of an lm() model fit, I'd get the entire d

[Rpy] dataframe from structured numpy array

2010-04-23 Thread Gary Strangman
Hi all, I have a mixed-type structured numpy array (including columns of ints, floats and strings), sometimes with missing values. In rpy2-2.1, what is the recommended (including fastest and least memory-expensive) way to convert such a structure to an R dataframe? Here's where I've been: 1)

[Rpy] r.data_frame segfault

2006-10-10 Thread Gary Strangman
Does anyone have a guess why creating a data frame created from a python dictionary of lists would "occasionally" segfault? That is, given ... a = a list b = another list c = another list df = r.data_frame(a=a, b=b, c=c) has never failed me. However, if I create a dictionary first ... >>> dct