In data lunedì 28 novembre 2011 14:51:29, Laurent Gautier ha scritto:
> > then it would not matter, however (at least IMO).
> Unless you have reason, you should avoid repeatedly calling "importr()"
I'll try to use the KISS approach you proposed for the matrix conversion (I
assume that similarly,
On 2011-11-28 14:36, Luca Beltrame wrote:
In data lunedì 28 novembre 2011 14:31:57, Laurent Gautier ha scritto:
def as_dataframe(m):
assert(isinstance(m, Matrix))
# since we did test that this is a Matrix
# we may as well skip R's dispatch system
res = base.as_data_frame
In data lunedì 28 novembre 2011 14:31:57, Laurent Gautier ha scritto:
> def as_dataframe(m):
> assert(isinstance(m, Matrix))
> # since we did test that this is a Matrix
> # we may as well skip R's dispatch system
> res = base.as_data_frame_matrix(m)
> return res
At least
On 2011-11-28 14:07, Luca Beltrame wrote:
In data sabato 26 novembre 2011 06:53:48, Laurent Gautier ha scritto:
Currently, the constructor to DataFrame accepts a "tlist" ("tagged
list") as a main parameter. The idea was to be relying on duck-typing,
Currently in fact I've been hitting some wal
In data sabato 26 novembre 2011 06:53:48, Laurent Gautier ha scritto:
> Currently, the constructor to DataFrame accepts a "tlist" ("tagged
> list") as a main parameter. The idea was to be relying on duck-typing,
Currently in fact I've been hitting some walls regarding that. I assume that
the low
On 2011-11-25 14:52, Luca Beltrame wrote:
I've been looking through the code and I have a couple of questions on design.
I wonder if
- it is preferable to hack in a special case of "tlist" being a Matrix in the
DataFrame constructor, e.g. if isinstance(tlist, Matrix);
- it is preferable (like I
I've been looking through the code and I have a couple of questions on design.
I wonder if
- it is preferable to hack in a special case of "tlist" being a Matrix in the
DataFrame constructor, e.g. if isinstance(tlist, Matrix);
- it is preferable (like I suggested at first) to have a separate pa
Hi Luca!
thats a good idea. If you could give feedback over yours code improvement,
I'll be glad.
It's a possibility with data.matrix
Cheers,
Arnaldo.
*Arnaldo D'Amaral Pereira Granja Russo*
Lab. de Estudos dos Oceanos e Clima
Instituto de Oceanografia
Universidade Federal do Rio Grande
e-mai
In data venerdì 25 novembre 2011 07:18:24, Laurent Gautier ha scritto:
> The "Python way" might be to add a switch in the constructors of the
> relevant classes (rpy2.robjects.vectors.Matrix and
> rpy2.robjects.vectors.DataFrame).
I was thinking of something like (for DataFrame):
def __init__(se
It could be added.
The "Python way" might be to add a switch in the constructors of the
relevant classes (rpy2.robjects.vectors.Matrix and
rpy2.robjects.vectors.DataFrame).
You could start by extending the current classes and implement a custom
constructor and see how it goes for you.
Bes
Hello,
R uses as.data.frame and as.matrix to easily move (compatible) data structures
from data.frame to matrix and vice versa. I was wondering if it would make
sense to have such a feature in rpy2, at least to swap between matrix and
data.frame.
Currently to do so it is needed to importr("bas
11 matches
Mail list logo