Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
#前処理R ダウンロード
Search
ironwest
July 27, 2021
Programming
790
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
#前処理R ダウンロード
ironwest
July 27, 2021
Other Decks in Programming
See All in Programming
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
330
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
310
一人だけ、Kiroが静止する日
hideg
0
140
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
720
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
980
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
カツオ、ご期待ください
suneo3476
0
120
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.4k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
400
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
9k
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
540
It's Worth the Effort
3n
188
29k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Visualization
eitanlees
153
17k
A Tale of Four Properties
chriscoyier
163
24k
The Limits of Empathy - UXLibs8
cassininazir
1
690
Fireside Chat
paigeccino
43
4k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
A designer walks into a library…
pauljervisheath
211
25k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
Believing is Seeing
oripsolob
1
230
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Transcript
Rによるオープンデータ前処 理勉強会(医療データ) NDBオープンデータのファイルを大量ダウンロードする 西田典充
今回お話させていただく内容 →NDBオープンデータアプリの「データ取得」の話です!
NDBオープンデータアプリの作成手順 厚生労働省 NDBオープンデータ HP R URL情報 エクセルファイル Tidyデータ アプリ用データ ダウンロード
データクリーニング データ加工 Shinyアプリケーション
NDBオープンデータアプリの作成手順 厚生労働省 NDBオープンデータ HP R Tidyデータ アプリ用データ データクリーニング データ加工 Shinyアプリケーション
URL情報 エクセルファイル ダウンロード
スクリプトファイルの置き場所 https://github.com/ironwest/ndb_open_data
URL情報 エクセルファイル ダウンロード 52行!
read_html(<URL>)で、「xml_node」というオブジェクトが取得できます。
xml_node のイメージ
xml_nodeのイメージ
<HTML> <body> <div>内容</div> <div>内容</div> <div>内容</div> <div> <div> ・・・ <li>・・・ <a
href="....../00423234.xlsx">初再診料_性年齢別算定回数</a> </div> </div> </body> </HTML>
<a href="....../00423234.xlsx">初再診料_性年齢別算定回数</a> <a href="リンク先のアドレス">表示したいリンクの文字</a>
None
None
None
html_nodes(<xml_node>, "<目的のタグ>")
html_nodes(<xml_node>, "<目的のタグ>") html_text(<対象とするノードセット>) 対象とするノードセット
html_nodes(<xml_node>, "<目的のタグ>") html_attr(<対象とするノードセット> , "href") 対象とするノードセット
None
None
None
None
None
None
a b 1 A 2 B 3 C map2(a,b,func_example) func_example(1,A)
func_example(2,B) func_example(3,C) fe_res suji moji 1 A suji moji 1 B 2 B suji moji 1 C 2 C 3 C
None
None
None
None
None
None
保存したファイル 手作業で直したファイル
URL情報 エクセルファイル ダウンロード 62行!
None
None
None
None
エクセルファイルの保存先ディレクトリのパスを kaiとh3タグから作成 作成したパスが存在するなら何もせず、 存在しないならそのディレクトリを作成する 次にdata変数にあるh4タグの内容を一意な値で取り出す data/ndb/<kai>/<h3>/<h4>という名前のディレクトリが あったら何もしない。なければ作成 dl_to列をdata tibbleに追加。(内容は保存す るエクセルファイルのパス)
ありがとうございました!