Upgrade to Pro — share decks privately, control downloads, hide ads and more …

前処理勉強会_発表資料_MITTI_20210724.pdf

mitti1210
July 21, 2021

 前処理勉強会_発表資料_MITTI_20210724.pdf

Rによるオープンデータ前処理勉強会(医療データ)の発表資料です。

勉強会はこちら
https://connpass.com/event/219249/

mitti1210

July 21, 2021
Tweet

More Decks by mitti1210

Other Decks in Science

Transcript

  1. ख࡞ۀͰͰ͖Δʁ 7 ෳ਺ྻ໊ ࡏӃ೔਺ ͍Βͳ͍ ϋΠϑϯ ͍Βͳ͍ ೥౓͕มΘΔͱ ૿͑ͨΓݮͬͨΓ͢Δ ೥౓͕มΘΔͱ

    පӃ໊͕มΘΔ͜ͱ͕͋Δ ೥౓͕มΘΔͱ ප໊มΘΔ͜ͱ͕͋Δ ԣྻɺॎߦ º೥ؒ ʢ༌݂Ҏ֎ͷ࠶ܝʣ Λআ͍ͨ਺͕߹ܭ ೥౓͕มΘΔͱ ൪߸ҧ͏͜ͱ͕͋Δ ௨൪ʹલͷ೥ͷࠂࣔ൪߸
  2. σʔλͷ੔ܗɿUJEZS 11 ࡶવσʔλ %>% pivot_longer ( col = c("6࣌", "12࣌",

    “18࣌”) , names_to = “࣌ࠁ” , values_to = “ఱؾ”)
  3. จࣈྻॲཧɿTUSJOHS 14 TUSJOHS ୅දతͳؔ਺ આ໌ ݕࡧ TUS@EFUFDU ͋Δจࣈྻؚ͕·Ε͍ͯͨΒ536& நग़ TUS@FYUSBDU

    TUS@FYUSBDU@BMM TUS@TVC ͋ΔύλʔϯʹҰக͢ΔจࣈྻΛநग़ ࠷ॳʢ࠷ޙʣ˓จࣈΛநग़ ஔ͖׵͑ TUS@SFQMBDF TUS@SFQMBDF@BMM ύλʔϯʹϚονͨ͠ՕॴΛஔ׵ Ճ޻ TUS@D จࣈྻΛ͚ͬͭ͘Δ https://kazutan.github.io/kazutanR/stringr-intro.html ͕ৄ͍͠Ͱ͢ʂ
  4. TUSJOHSͱਖ਼نදݱ 15 ྫʣ“MDC_02_8_07_2019.xlsx"ͱ͍͏ϑΝΠϧ໊͔Β৭ʑऔΓग़͍ͨ͠ str_extract(“จࣈྻ”, “৚݅” ) ৚݅ʹ͸৭ʑͳࢦఆ͕Ͱ͖Δ [ ] ͜ͷதʹ͋Δ਺஋ɾจࣈɾه߸

    \\d ਺஋ \\D จࣈ . ͳΜͰ΋O K * 0ճҎ্ͷ܁Γฦ͠ { } ׅހ಺ͷ਺͚ͩ܁Γฦ͠ ^ จࣈྻͷઌ಄ $ จࣈྻͷ࠷ޙ fi MFl.%$@@@@YMTY TUS@FYUSBDU fi MF z<aaE>\^z  TUS@FYUSBDU fi MF z.%$ <aaE>\^z  TUS@FYUSBDU fi MF l<>Y z  ਺஋4ܻ MDCɹ೚ҙͷ܁Γฦ͠ɹ਺஋4ܻ .(ه߸ͷυοτ)ɹ xɹɹɹ೚ҙͷ܁Γฦ͠
  5. SFBE@FYDFMͰಡΈࠐΉ 26 read_excel ( path=ϑΝΠϧͷύε , sheet=γʔτͷ໊લ͔˓൪໨ͷγʔτ, #ࢦఆ͠ͳ͚Ε͹1ຕ໨ͷγʔτ skip=ઌ಄ʹ͍Βͳ͍ߦ͕͋Ε͹ࢦఆ ,

    col_names=ྻ໊Λࢦఆ͍ͨ͠৔߹ʢFALSEʹ͢Δͱྻ໊ΛಡΈࠐ·ͳ͍ʣ , n_max=Կߦ໨·ͰಡΈࠐΉ͔ʁ ) ଓ͖͸σϞͰʂ
  6. ·ͣ͸ྻ໊͔Β 32 ෳ਺ྻ໊ ࡏӃ೔਺ ͍Βͳ͍ ϋΠϑϯ ͍Βͳ͍ ೥౓͕มΘΔͱ ૿͑ͨΓݮͬͨΓ͢Δ ೥౓͕มΘΔͱ

    පӃ໊͕มΘΔ͜ͱ͕͋Δ ೥౓͕มΘΔͱ ප໊มΘΔ͜ͱ͕͋Δ ԣྻɺॎߦ º೥ؒ ʢ༌݂Ҏ֎ͷ࠶ܝʣ Λআ͍ͨ਺͕߹ܭ ೥౓͕มΘΔͱ ൪߸ҧ͏͜ͱ͕͋Δ ௨൪ʹલͷ೥ͷࠂࣔ൪߸
  7. දه༳Εͷ֬ೝ 38 ࡏӃ೔਺ ͍Βͳ͍ ϋΠϑϯ ͍Βͳ͍ ೥౓͕มΘΔͱ ૿͑ͨΓݮͬͨΓ͢Δ ೥౓͕มΘΔͱ පӃ໊͕มΘΔ͜ͱ͕͋Δ

    ೥౓͕มΘΔͱ ප໊มΘΔ͜ͱ͕͋Δ ԣྻɺॎߦ º೥ؒ ʢ༌݂Ҏ֎ͷ࠶ܝʣ Λআ͍ͨ਺͕߹ܭ ೥౓͕มΘΔͱ ൪߸ҧ͏͜ͱ͕͋Δ ௨൪ʹલͷ೥ͷࠂࣔ൪߸
  8. දه༳ΕΛ୳͢ ˔֤೥ͷྻ໊Λऔಘ ˔TFUEJ ff Ͱยํʹ͔͠ͳ͍΋ͷΛ୳͢ TFUEJ ff " # 


    ▶︎ "ʹ͔͠ແ͍΋ͷΛநग़ TFUEJ ff # " 
 ▶︎ #ʹ͔͠ແ͍΋ͷΛநग़ 39
  9. ͍Βͳ͍ྻ 42 ࡏӃ೔਺ ͍Βͳ͍ ϋΠϑϯ ͍Βͳ͍ ೥౓͕มΘΔͱ පӃ໊͕มΘΔ͜ͱ͕͋Δ ԣྻɺॎߦ º೥ؒ

    ʢ༌݂Ҏ֎ͷ࠶ܝʣ Λআ͍ͨ਺͕߹ܭ ೥౓͕มΘΔͱ ൪߸ҧ͏͜ͱ͕͋Δ ௨൪ʹલͷ೥ͷࠂࣔ൪߸ ೥౓͕มΘΔͱ ප໊มΘΔ͜ͱ͕͋Δ ೥౓͕มΘΔͱ ૿͑ͨΓݮͬͨΓ͢Δ
  10. ϋΠϑϯΛফ͢ ▶︎ ਺஋σʔλʹม׵ 44 ϋΠϑϯ ͍Βͳ͍ ೥౓͕มΘΔͱ පӃ໊͕มΘΔ͜ͱ͕͋Δ ԣྻɺॎߦ º೥ؒ

    ೥౓͕มΘΔͱ ൪߸ҧ͏͜ͱ͕͋Δ ௨൪ʹલͷ೥ͷࠂࣔ൪߸ ೥౓͕มΘΔͱ ૿͑ͨΓݮͬͨΓ͢Δ ೥౓͕มΘΔͱ ප໊มΘΔ͜ͱ͕͋Δ