Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-09 Thread Veronica Andreo
Hello Enrico, 2016-09-08 10:41 GMT-03:00 Enrico Schumann : > Hi Veronica, > > please see inline. > > On Thu, 08 Sep 2016, Veronica Andreo writes: > > > Hello Luisfo and Enrico, > > > > Thanks for your help! I've been testing both > > solutions... results differ for the same date (I > > changed b

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Enrico Schumann
Hi Veronica, please see inline. On Thu, 08 Sep 2016, Veronica Andreo writes: > Hello Luisfo and Enrico, > > Thanks for your help! I've been testing both > solutions... results differ for the same date (I > changed both functions to use ISO8601). And I added > contiguous dates, to see how they h

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Veronica Andreo
Hello Luisfo and Enrico, Thanks for your help! I've been testing both solutions... results differ for the same date (I changed both functions to use ISO8601). And I added contiguous dates, to see how they handle the start-end of the week. So, here the results: ### one example d <- c("2010-08-21"

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Luisfo via R-help
Dear Veronica, Here there's a way of doing what you requested. library("lubridate") # your date '2010-08-21' as Date object dd <- as.Date(strptime("2010-08-21", format="%Y-%m-%d", tz="GMT")) # take the first day of the year as Date object, i.e. 2010-01-01 in our example ref.date <- as.Date(strpt

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Enrico Schumann
On Thu, 08 Sep 2016, Veronica Andreo writes: > Hello list, > > Is there a quick way to get start and end date (%Y-%m-%d) from ISO > weeks if I only have dates? > > For example, I have this date in which some event happened: > "2010-08-21". Not only I want the ISO week, which I can obtain either >

[R] get start and end date of ISO weeks giving a date as input

2016-09-08 Thread Veronica Andreo
Hello list, Is there a quick way to get start and end date (%Y-%m-%d) from ISO weeks if I only have dates? For example, I have this date in which some event happened: "2010-08-21". Not only I want the ISO week, which I can obtain either with isoweek (lubridate) or ISOweek (ISOweek), but I want th