問題:
[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
新手(沒寫過程式,R 是我的第一次)
[問題敘述]:
想要寫自動化下載氣象局監測資料CSV檔的腳本,但光單純下載一個連結的CSV檔卻跟
單純連結手動點選下載的CSV檔內容不同
[程式範例]:
testurl =
"https://e-service.cwb.gov.tw/HistoryDataQuery/YearDataController.do?
command=viewMain&station=466950&stname=%25E5%25BD%25AD%25E4%25BD%25B3
%25E5%25B6%25BC&datepicker=2018"
download.file(url = testurl,destfile = "C:/DATA/4669502018.csv",method =
"curl")
[環境敘述]:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950
[2] LC_CTYPE=Chinese (Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.12 bitops_1.0-6 RSQLite_2.1.2
loaded via a namespace (and not attached):
[1] bit_1.1-14 compiler_3.6.1 backports_1.1.5 DBI_1.0.0
[5] tools_3.6.1 memoise_1.1.0 Rcpp_1.0.2 bit64_0.9-7
[9] vctrs_0.2.0 blob_1.2.0 zeallot_0.1.0 digest_0.6.21
[13] rlang_0.4.0
[關鍵字]:
氣象局