Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
#前処理R ダウンロード
Search
ironwest
July 27, 2021
Programming
1
770
#前処理R ダウンロード
ironwest
July 27, 2021
Tweet
Share
Other Decks in Programming
See All in Programming
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
430
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
120
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
350
その「common」ディレクトリ、腐っていませんか?
kinocoboy2
1
100
Python’s True Superpower
hynek
0
180
CSC307 Lecture 12
javiergs
PRO
0
440
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.9k
Oxlint JS plugins
kazupon
1
1.1k
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.5k
AI巻き込み型コードレビューのススメ
nealle
2
2.1k
Sekiban + Microsoft Orleans のアクターをAWS対応しました / Sekiban + Microsoft Orleans actors are now supported on AWS.
tomohisa
0
120
CSC307 Lecture 10
javiergs
PRO
1
680
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
170
Paper Plane
katiecoart
PRO
0
47k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.4k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
490
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
130
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
sira's awesome portfolio website redesign presentation
elsirapls
0
160
Technical Leadership for Architectural Decision Making
baasie
2
260
Designing Experiences People Love
moore
144
24k
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に追加。(内容は保存す るエクセルファイルのパス)
ありがとうございました!