Hi, all,

I 'm a newbie here. Sorry for bothering if the problem seems too simple. 
Anyway, I 'v searched in
many RPy documents but had no fortune on the "Vector slicing" topic. 

I wanna do some slicing on a R vector, the following is how I do:

>data                                     # r vector, length 1000, I want to 
>get a subset of 1:100 of it
>py_data = list(data)                # works fine, len(py_data) = 1000
>py_sub_data = py_data[0:100] # fine
>sub_data = r(py_sub_data)      # sub_data 's size = 1*1, it is the last 
>element of the data

and I also tried:
>sub_data = rpy2.robjects.RVector(py_sub_data)  # sub_data 's size is 1000*1, 
>it becomes a matrix!

Where is the problem? or any other better ways to do this? I know these codes 
really look ugly.

Thanks in advance!

2009-09-16 



Leio Wu 
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to