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
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
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.5k
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
330
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
100
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
1B+ /day規模のログを管理する技術
broadleaf
0
140
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.3k
えっ!!コードを読まずに開発を!?
hananouchi
0
210
フィードバックで育てるAI開発
kotaminato
1
120
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.1k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
190
Between Models and Reality
mayunak
4
370
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
Site-Speed That Sticks
csswizardry
13
1.3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
Joys of Absence: A Defence of Solitary Play
codingconduct
1
410
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
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に追加。(内容は保存す るエクセルファイルのパス)
ありがとうございました!