tpemartin / 110-1-r4ds-main

MIT License
3 stars 73 forks source link

Exercise 4.2 Tata corporate with head quarter in India Deli #32

Open tpemartin opened 2 years ago

tpemartin commented 2 years ago

Tata corporate with head quarter in India Deli has two subsidiaries overseas. One is in Mykonos, Greece, and the other is in Boston, USA. It has to deal with the following task constant: receive time information from both subsidiaries and collect them all together with India time zone expression.

Consider the following subsidiaries time information:

subsidiaries <- list()
subsidiaries$boston <- c("2020 Oct. 13 15:00:00", "2019 Apr. 10 09:30:00") # boston time zone
subsidiaries$mykonos <- c("14 Jan., 2021 03:27:00", "8 Aug., 2020 11:20:00") # mykonos time zone

Put all four time observation in one atomic vector with date/time class and expressed in Deli India time zone.

raychiu135 commented 2 years ago

https://github.com/raychiu135/110-1-r4ds-main/blob/b309570647949751e4f004dd1530ad7775401494/exercise_4.2.rmd#L2

Vincent23412 commented 2 years ago

https://github.com/Vincent23412/110-1-r4ds-main/blob/6073eb167a9d804bbf6184dbbbdf39ba2d6ddaba/20211120.Rmd#L86

410882009 commented 2 years ago

https://github.com/410882009/110-1-r4ds-main/blob/91b7830c9a9d586cda5e388c80cc6160b56f4e0d/exercises.Rmd#L217

tpemartin commented 2 years ago

@raychiu135, @Vincent23412, @410882009 Please check:

Parsing a date/time character vector without tz setting can yield wrong result.

Also make sure you choose the right tzone expression.

subsidiaries <- list()
subsidiaries$boston <- lubridate::ymd_hms(c("2020 Oct. 13 15:00:00", "2019 Apr. 10 09:30:00"),
  tz="America/New_York")# boston time zone
subsidiaries$mykonos <- lubridate::dmy_hms(c("14 Jan., 2021 03:27:00", "8 Aug., 2020 11:20:00"),
  tz="Europe/Athens") # mykonos time zone
lubridate::with_tz(
  c(
    subsidiaries$boston,
    subsidiaries$mykonos
  ),
  tz="Asia/Calcutta"
)
raychiu135 commented 2 years ago

https://github.com/raychiu135/110-1-r4ds-main/blob/4c09c554216edc40c85ddf5f3c229f59e9091c9a/exercise_4.2_2.rmd#L20

Jimmy885 commented 2 years ago

https://github.com/Jimmy885/110-1-r4ds-main/blob/b6a8eec9ec5d6faba357b995c4db7f9a3100a3b2/4.1%204.2.Rmd#L225

32119811 commented 2 years ago

https://github.com/32119811/110-1-r4ds-main/blob/cbe5f880a20ef1fe4feda4a33efff0846a495b9a/Exercise%204.2#L1

linttttt commented 2 years ago

https://github.com/linttttt/110-1-r4ds-main/blob/3f4e7a7b9a0242879d5d17eddb9be1ea8962ec99/studyCH4(2).Rmd#L72

ken9277 commented 2 years ago

https://github.com/ken9277/110-1-r4ds-main/blob/b3eab1d599d489c589deb0c06f40fb82fd66f59b/chapter4.1#L11

AmyChen20021003 commented 2 years ago

https://github.com/AmyChen20021003/110-1-r4ds-main/blob/1125c867c08650ca16090d94a0a87fe2f9486696/chapter4excerxise.Rmd#L15

Ann1892 commented 2 years ago

https://github.com/Ann1892/110-1-r4ds-main/blob/7b946b1baf72b85626a8c4fce596273bad59bd35/exercises%20fo%20lesson%204.Rmd#L41

yulin02 commented 2 years ago

https://github.com/yulin02/110-1-r4ds-main/blob/72030086f84132688cc885736faa0bbd25d5dcad/practice2#L1