On 12/02/11 16:42, Pascal Grandeau wrote:
> Good morning,
>
> I get a problem with RPy 1.0.3 (I installed it with
> rpy-1.0.3.win32-py2.7-R.2.12.1.exe) when I try the statsmodels example :
> here is the code and the error
>
> from rpy import r
> import scikits.statsmodels as sm
>
> data=sm.datasets.longley.Load()
> y,x=data.endog,sm.add_constant(data.exog)
>
> frame=r.data_frame(y=y,x=x)
>
> Traceback (most recent call last):
>     File "<interactive input>", line 1, in<module>
> RPy_RException: Erreur dans function (..., row.names = NULL, check.rows
> = FALSE, check.names = TRUE,  :
>     les arguments impliquent des nombres de lignes différents : 16, 7
>
> x.shape
> (16, 7)
> y.shape
> (16,)
>
> So, x and y have the same number of rows and I do not understand why I
> have the message that arguments have differents rows numbers (16,7) ?
>
> Can you explain me where is the problem ?

R stores arrays in column-major order, and this is propagated to 
data.frames. data.frames are nothing else but R lists with the 
constraint that length for elements in the list must be equal.



> Thank you very much.
>
> Pascal Grandeau
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to