Skip to content

R scripts for commutag sidewalk project

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

CommuSidewalk/commusidewalk-data

Repository files navigation

commusidewalk-data

以R做平安走路許願帳戶的資料處理。

下載最新檔案請 點我

⚠️目前檔案已經沒有在更新了。

使用說明

檔案樹概觀

.
├── commusidewalk.Rproj
├── data
│   └── .gitignore      (1)
├── main.R
├── NAMESPACE
├── output              (2)
│   ├── cleansed.csv
│   ├── rank.csv
│   └── village.csv
├── R                   (3)
│   ├── 1_download.R
│   ├── 2_cleaning.R
│   ├── 3_rank.R
│   ├── 4_village_classification.R
│   ├── csv_to_postgresql.R
│   ├── output.R
│   ├── rank_lookup.R
│   ├── scripts
│   │   └── run_all.R
│   ├── testtest.R
│   ├── utils
│   │   └── village_shp_downloader.R
│   └── write_to_db.R
├── README.adoc
├── README.md
├── renv
│   ├── activate.R
│   ├── settings.dcf
│   ├── settings.json
│   └── staging
├── renv.lock
├── run_all.R
├── run-all.raku
└── tests
    ├── testthat
    │   └── test-3_rank.R
    └── testthat.R
  1. 儲存各階段script執行結果

  2. 輸出結果資料夾,village.csv為適合 commusidewalk-app 使用的版本

  3. R scripts,編號為執行順序,其餘為測試或其他util script。

安裝套件

install.packages('renv')   # 安裝renv
renv::restore()            # 安裝專案所需套件

輸出csv

產生資料非常簡便,只需執行以下run_all.R

Rscript run_all.R          # 執行所有編號scripts,輸出csv至output folder

輸出檔案分別有:

  • cleansed.csv

    json轉為二維資料(csv)

  • rank.csv

    根據 評分公式 計算人行道分數

  • village.csv

    根據 村里界圖資 為資料點分派所屬縣市、鄉鎮、村里

關於資料庫

目前未使用,但write_to_db.R等與資料庫有關的script應該是可是用。

About

R scripts for commutag sidewalk project

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages