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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ironwest
July 27, 2021
Programming
780
1
Share
#前処理R ダウンロード
ironwest
July 27, 2021
Other Decks in Programming
See All in Programming
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
260
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
710
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
190
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
280
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
Cloudflare で始める Data Platform
ta93abe
0
160
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
390
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
49
Six Lessons from altMBA
skipperchong
29
4.2k
Optimizing for Happiness
mojombo
378
71k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
300
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
310
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
370
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に追加。(内容は保存す るエクセルファイルのパス)
ありがとうございました!