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
800
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
Railsバージョンを4倍にした話
optim
0
520
R8 の設定見直しでアプリサイズ削減
andpad
0
220
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
730
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Workers Cache を知る
syumai
0
370
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
🇪🇸 React Alicante 2026 (Workshop)
ythecombinator
PRO
0
100
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
120
パスワード再設定メールのURLについて知っておこう
uyuki234
0
170
AmebaブログはKMPから卒業します
kmars0605
0
210
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Git: the NoSQL Database
bkeepers
PRO
433
67k
A Modern Web Designer's Workflow
chriscoyier
699
190k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Agile that works and the tools we love
rasmusluckow
331
22k
Building Adaptive Systems
keathley
44
3.3k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
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に追加。(内容は保存す るエクセルファイルのパス)
ありがとうございました!