Hi Carson,

The following code worked to me:

import rpy2.robjects as ro
d_str = dict(x = ro.StrVector(["abc", "def", "ghi"]), y =
ro.StrVector(["yes", "no", "maybe"]))
dataf_str = ro.r['data.frame'](**d_str)
print dataf_str

Cheers


2008/12/14 Carson J.Q. Farmer <carson.far...@nuim.ie>

> Hi list,
>
> I'm wondering if anyone can tell me how to convert a dictionary of lists
> of strings, into an R data.frame using rpy2. I've seen lots of talk
> about converting lists of numeric values to data.frames using arrays,
> but I can't seem to get anything to work for strings.
>
> For example, the following works for integers,
>
> import array
> import rpy2.robjects as ro
>
> d = dict(x = array.array('i', [1,2]), y = array.array('i', [2,3]))
> dataf = ro.r['data.frame'](**d)
>
> but we can't create an array of strings in this way, or am I missing
> something obvious here?
>
> Any help is appreciated,
>
> Carson
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list
>



-- 
Marcos F. Silva
http://marcosfs2006.googlepages.com
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to