From 7473eedb7855596242138a588f596a43d95fc4f1 Mon Sep 17 00:00:00 2001 From: RFlx Date: Mon, 26 Feb 2024 11:26:32 +0000 Subject: [PATCH] od data for Lisbon update for od2net --- code/test-code/od_data_lisbon.R | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/test-code/od_data_lisbon.R b/code/test-code/od_data_lisbon.R index 062320e..0f30cbd 100644 --- a/code/test-code/od_data_lisbon.R +++ b/code/test-code/od_data_lisbon.R @@ -13,10 +13,26 @@ TRIPSmode_Lisbon = TRIPSmode_Lisbon |> saveRDS(TRIPSmode_Lisbon, "TRIPSmode_Lisbon.Rds") piggyback::pb_upload("TRIPSmode_Lisbon.Rds") + +TRIPSmode_Lisbon = TRIPSmode_Lisbon |> + sf::st_drop_geometry() |> + select(DICOFREor11, DICOFREde11, Total) |> + rename(from = DICOFREor11, to = DICOFREde11, count = Total) |> + mutate(count = round(count)) + +write.csv(TRIPSmode_Lisbon, "od.csv", row.names = FALSE) +piggyback::pb_upload("od.csv") + # zones data ZONESgeo_Lisbon = readRDS(url("https://github.com/U-Shift/biclar/releases/download/0.0.1/FREGUESIASgeo.Rds")) ZONESgeo_Lisbon = ZONESgeo_Lisbon |> - filter(Concelho == "Lisboa") + filter(Concelho == "Lisboa") |> + select(Dicofre, geom) |> + rename(name = Dicofre) saveRDS(ZONESgeo_Lisbon, "ZONESgeo_Lisbon.Rds") piggyback::pb_upload("ZONESgeo_Lisbon.Rds") +sf::st_write(ZONESgeo_Lisbon, "zones.geojson") +piggyback::pb_upload("zones.geojson") + +