Skip to content

Commit 19663c5

Browse files
Add polar coordinate example
1 parent cbe79c1 commit 19663c5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

R/utils.R

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
convert_time <- function(x) {
2+
if(!is.numeric(x)) return(x)
3+
4+
if(all(is.na(x))) return(x)
5+
26
if (max(x) > 1e5) {
37
structure(x, class = c("POSIXct", "POSIXt"))
48
} else {

README.Rmd

+6
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,11 @@ pedestrian[with(pedestrian, Sensor == "Southern Cross Station" & Date < "2015-03
5555
# coord_calendar(xlim = c(Sys.time(), Sys.Date() + lubridate::days(1)))
5656
ggplot2::coord_trans(x = cal_trans_x(), xlim = as.POSIXct(c("2024-03-25 00:00:00", "2024-03-31 23:59:59"))) +
5757
scale_x_datetime(date_breaks = "day", date_labels = "%a")
58+
59+
pedestrian[with(pedestrian, Sensor == "Southern Cross Station" & Date < "2015-03-01"),] |>
60+
ggplot(aes(x = Date_Time, y = Count)) +
61+
geom_path() +
62+
ggplot2::scale_x_continuous(transform = cal_trans_x(), limits = as.POSIXct(c("2024-03-25 00:00:00", "2024-03-31 23:59:59"))) +
63+
coord_polar()
5864
```
5965

0 commit comments

Comments
 (0)