library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
X <- read_csv("../HDB_data/@#CITYDATA/citydata 2019 - 2021/2019-09-01/lotadata_singapore_sg_2019_09_01_04000.csv",
              col_names = c("did", "type", "lon", "lat",
                            "ts")) %>%
  select(did, type, lon, lat, ts)
## Rows: 912381 Columns: 38
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (3): did, X11, X13
## dbl  (6): type, lon, lat, ts, X6, X12
## lgl (29): X7, X8, X9, X10, X14, X15, X16, X17, X18, X19, X20, X21, X22, X23,...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
X
P <- X %>%
  sample_n(100000) %>%
  ggplot(aes(x = lon, y = lat)) +
  geom_point(alpha = 0.1, size = 0.2) +
  theme_bw()

P

# ggsave("one_day_pings.pdf", P,
#        width = 20, height = 20)