[R] Time intervals is converted into seconds after converting list of dfs into a single Df.

Patrick (Malone Quantitative) m@|one @end|ng |rom m@|onequ@nt|t@t|ve@com
Tue Dec 24 18:01:59 CET 2019


You didn't provide a reproducible example for testing (or post in
plain text), but lubridate has an as.interval() function. You'll need
to be able to extract the start time, though, for use in the function.

On Tue, Dec 24, 2019 at 11:54 AM Allaisone 1 <Allaisone1 using hotmail.com> wrote:
>
>
> Hi dear group ,
>
> I have list of datframes with similar column names. I want to rebind all dataframes so I have a single dataframe. One of the column's in each df is of 'interval' time class which was generated from 'lubridate' package.
>
> The problem is that when I convert the list of dfs into a single df using any of the below codes :
>
> Library(plyr)
> MySingleDf <- ldply(MyListOfDfs, data.frame)
> Or
> MySingleDf <- ldply(MyListOfDfs, rbind)
> Or
> MySingleDf <- rebind. fill (MyListOfDfs)
>
> What heppens is that  time intervals which looks like : 2010-4-5 UTC--2011-7-9 UTC is converted into a single numeric value which seems to be the difference between the 2 dates in seconds.
>
> When I use :
> MySingleDf <- do.call ("rbind",MyListOfDfs)
>
> The code is freezes and it shows like of the data are being analysed but no result. I have used this code previously for the same purpose but with another datse and it works perfectly.
>
> What I want to see is that time intervals are shown as they are but not converted into seconds.
>
> Could you please suggest any alternative syntax or modifications to my codes ?
>
> Thank you so much in advance
>
> Regards
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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