r-causal / causal-inference-in-R

Causal Inference in R: A book!
https://www.r-causal.org/
165 stars 42 forks source link

light edits chapter 6 #198

Closed tgerke closed 7 months ago

tgerke commented 8 months ago

There is one odd thing that's happening on my end: park closing time is coming in as seconds and not a date/time format.

> parks_metadata_raw |> select(mkclose)
# A tibble: 2,079 × 1
   mkclose   
   <hms>     
 1 90000 secs
 2 90000 secs
 3 90000 secs

Then, things like hour(park_close) (line 367) don't work. Seems weird though since that chunk produces an appropriate plot in the currently rendered version of the book. Any ideas?

malcolmbarrett commented 8 months ago

Hmm I see them correctly as time objects, both with parks_metadata_raw and actually data like seven_dwarfs_train_2018 |> select(park_close)

tgerke commented 8 months ago

what the heck!? Here's MWE in a clean session:

> pak::pkg_install("LucyMcGowan/touringplans")

ℹ No downloads are needed
✔ 1 pkg: kept 1 [774ms]
> touringplans::parks_metadata_raw |> dplyr::select(mkclose)
# A tibble: 2,079 × 1
   mkclose   
   <hms>     
 1 90000 secs
 2 90000 secs
 3 90000 secs
 4 86400 secs
 5 82800 secs
 6 75600 secs
 7 75600 secs
 8 75600 secs
 9 75600 secs
10 82800 secs
# ℹ 2,069 more rows
# ℹ Use `print(n = ...)` to see more rows

@LucyMcGowan any clue what's going on here?

malcolmbarrett commented 7 months ago

covered that in an issue in touringplans