Laurent <lgautier <at> gmail.com> writes:
> > print [x for x in df.rx2('a')]    # question 1
> >
> > Question 1: What I want is to see three text strings (the dates
> > starting with "Mar"). Instead, what I see is [1, 2, 3]. I can't
> > manipulate [1, 2, 3]. How do I get the text strings back out
> > instead of [1, 2, 3]? (And what are [1, 2, 3] - a factorvector
> > kind of representation?)
> 
> Yes. By default R converts vectors of strings into factors when 
> constructing a data.frame. The way to avoid it is to wrap the vector 
> into a call to "base.I()" (not my choice, that's the way it is in R)

What if we constructed the data.frame using from_csvfile? If I'm making
a df from vectors, I can do this as I create the df, but if I'm reading
it from a csv file, it seems harder. Unless you mean call it when you
get it out of the dataframe? This doesn't work either:

print [x for x in base.I(df.rx2('a'))]  # same result

JDO


------------------------------------------------------------------------------

_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to