[R] Converting to XTS loses data.frame structure

R. Michael Weylandt michael.weylandt at gmail.com
Wed May 30 01:01:05 CEST 2012


Hi Steven,

I am the GSOC student in question and I think the best statement of
work is probably this one here on the GSOC-R Wiki (as well as for the
other projects):

http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2012:xts

If you log into Google Melange, my project proposal should publicly
visible and has a bit more detail on the scope of the project, but not
much more than the wiki has so it's probably not worth the work of
setting up an account.

If this is of interest to you, I'd invite you to follow my work on
R-Forge: http://r-forge.r-project.org/projects/xts/ My work is
currently in the xtsExtra package and will be moved into xts (regular)
once it's been thoroughly tested. The only thing currently in it is a
new take on plot.xts which should be much more flexible as regards
multivariate series, but things are changing quickly.

If you have a features you'd like to see added, please don't hesitate
to drop me an email and we can chat about them -- there's a pretty
good to do list in place already, but it can never hurt to see where
the community's interest lies.

Michael

On Tue, May 29, 2012 at 6:29 PM, steven mosher <moshersteven at gmail.com> wrote:
> is there a statement of work for the summer of code work.
> On May 29, 2012 12:19 PM, "Joshua Ulrich" <josh.m.ulrich at gmail.com> wrote:
>
>> On Tue, May 29, 2012 at 2:11 PM, Noah Silverman <noahsilverman at ucla.edu>
>> wrote:
>> > Hello,
>> >
>> > I noticed something odd when working with data frames and xts objects.
>> >
>> > If I read in a CSV file, R creates a nice data.frame.  This works well.
>> >
>> > If I then convert to an XTS object, I see that all the values in the
>> data are now quoted.  My data is a mix of numeric and character.  This is
>> usually seen when converting a data.frame to a matrix, as R will treat all
>> the data as the same class. (character)
>> >
>> > How can I ensure that R creates an XTS object that is still a data.frame
>> so that all the data are the correct type??
>> >
>> You can't.  xts/zoo objects are a matrix with an index attribute.
>> Since you can't mix types in a matrix, you can't mix types in an
>> xts/zoo object.  That said, part of the xts Google Summer of Code
>> project is to create an xts-like object that allows mixed types.
>>
>> Best,
>> --
>> Joshua Ulrich  |  FOSS Trading: www.fosstrading.com
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list