Skip to content

Commit

Permalink
Add polar coordinate example
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Dec 9, 2024
1 parent cbe79c1 commit 19663c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
convert_time <- function(x) {
if(!is.numeric(x)) return(x)

if(all(is.na(x))) return(x)

if (max(x) > 1e5) {
structure(x, class = c("POSIXct", "POSIXt"))
} else {
Expand Down
6 changes: 6 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,11 @@ pedestrian[with(pedestrian, Sensor == "Southern Cross Station" & Date < "2015-03
# coord_calendar(xlim = c(Sys.time(), Sys.Date() + lubridate::days(1)))
ggplot2::coord_trans(x = cal_trans_x(), xlim = as.POSIXct(c("2024-03-25 00:00:00", "2024-03-31 23:59:59"))) +
scale_x_datetime(date_breaks = "day", date_labels = "%a")
pedestrian[with(pedestrian, Sensor == "Southern Cross Station" & Date < "2015-03-01"),] |>
ggplot(aes(x = Date_Time, y = Count)) +
geom_path() +
ggplot2::scale_x_continuous(transform = cal_trans_x(), limits = as.POSIXct(c("2024-03-25 00:00:00", "2024-03-31 23:59:59"))) +
coord_polar()
```

0 comments on commit 19663c5

Please sign in to comment.