Re: [R] Convert daily data to weekly data

2018-05-30 Thread Miluji Sb
Dear Jim, Thank you so much. The code works perfectly and is very fast for the large amounts of data that I am processing! Thanks again! Sincerely, Shouro On Tue, May 29, 2018 at 11:50 PM, jim holtman wrote: > Forgot the year if you also want to summarise by that. > > > > x <- structure(list

Re: [R] Convert daily data to weekly data

2018-05-29 Thread jim holtman
Forgot the year if you also want to summarise by that. > x <- structure(list(X1986.01.01.10.30.00 = c(16.8181762695312, 16.8181762695312, + 18.8294372558594, 16 [TRUNCATED] > library(tidyverse) > library(lubridate) > # convert to long form > x_

Re: [R] Convert daily data to weekly data

2018-05-29 Thread jim holtman
try this: > x <- structure(list(X1986.01.01.10.30.00 = c(16.8181762695312, 16.8181762695312, + 18.8294372558594, 16 [TRUNCATED] > library(tidyverse) > library(lubridate) > # convert to long form > x_long <- gather(x, key = 'date', value = "value

Re: [R] Convert daily data to weekly data

2018-05-29 Thread Miluji Sb
Dear Petr, Thanks for your reply and the solution. The example dataset contains data for the first six days of the year 1986. "X1986.01.01.10.30.00" is 01 January 1986 and the rest of the variable is redundant information. The last date is given as "X2016.12.31.10.30.00". I realized that I missed

Re: [R] Convert daily data to weekly data

2018-05-29 Thread PIKAL Petr
Hi Based on your explanation I would advice to use ?cut.POSIXt with breaks "week". However your data are rather strange, you have data frame with names which looks like dates names(test) [1] "X1986.01.01.10.30.00" "X1986.01.02.10.30.00" "X1986.01.03.10.30.00" [4] "X1986.01.04.10.30.00" "X1986.