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
OSSベースでのRパッケージ開発のすすめ / rjpusers2021rpkgdev
Search
Uryu Shinya
December 18, 2021
Research
0
1.1k
OSSベースでのRパッケージ開発のすすめ / rjpusers2021rpkgdev
2021年12月18日開催「2021年度 データ解析環境Rの整備と利用」
https://rjpusers.connpass.com/event/233211/
Uryu Shinya
December 18, 2021
Tweet
Share
More Decks by Uryu Shinya
See All by Uryu Shinya
Rの機械学習フレームワークの紹介〜tidymodelsを中心に〜 / machine_learning_with_r2024
s_uryu
0
690
地理空間データの機械学習への適用 / machine_learning_for_spatial_data
s_uryu
0
170
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
600
R言語入門 (R-4.3.3 2024年4月版) / introduction to r
s_uryu
8
6.1k
統・再現性・協力: 人為的過誤を防ぎ、未来へ進む策 / Integration, Reproducible, and Collaboration
s_uryu
1
680
Rによる大規模データの処理
s_uryu
2
2.4k
textlintr: Rユーザのためのtextlintによる校正
s_uryu
0
510
Rによるデータ可視化と地図表現
s_uryu
1
2.2k
データ分析入門 / tokupon-ds2022
s_uryu
4
5.6k
Other Decks in Research
See All in Research
Zipf 白色化:タイプとトークンの区別がもたらす良質な埋め込み空間と損失関数
eumesy
PRO
6
690
Global Evidence Summit (GES) 参加報告
daimoriwaki
0
150
非ガウス性と非線形性に基づく統計的因果探索
sshimizu2006
0
360
Geospecific View Generation - Geometry-Context Aware High-resolution Ground View Inference from Satellite Views
satai
1
100
2024/10/30 産総研AIセミナー発表資料
keisuke198619
1
330
VisFocus: Prompt-Guided Vision Encoders for OCR-Free Dense Document Understanding
sansan_randd
1
240
TransformerによるBEV Perception
hf149
1
430
文献紹介:A Multidimensional Framework for Evaluating Lexical Semantic Change with Social Science Applications
a1da4
1
220
Language is primarily a tool for communication rather than thought
ryou0634
4
740
The Fellowship of Trust in AI
tomzimmermann
0
130
第 2 部 11 章「大規模言語モデルの研究開発から実運用に向けて」に向けて / MLOps Book Chapter 11
upura
0
390
[2024.08.30] Gemma-Ko, 오픈 언어모델에 한국어 입히기 @ 머신러닝부트캠프2024
beomi
0
720
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Practical Orchestrator
shlominoach
186
10k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Typedesign – Prime Four
hannesfritz
40
2.4k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Side Projects
sachag
452
42k
Transcript
044ϕʔεͰͷ ύοέʔδ ։ൃͷ͢͢Ί ӝੜਅʢಙౡେֶσβΠϯܕ"*ڭҭݚڀηϯλʔʣ σʔλղੳڥ3ͷඋͱར༻ !V@SJCP
ӝੜਅ 6SZV4IJOZB ࣗݾհ V@SJCP ಙౡେֶσβΠϯܕ"*ڭҭݚڀηϯλʔ ॿڭʢ݄ʙʣ VSJCP 3ݚڀूձॳൃදʢ-5Λআ͘ʣ ۭؒੳʢ؍ޫܦࡁɺӸֶʣ
jpmesh ɹύοέʔδհ jpndistrict ʙ ssrn
fgdr zipangu sudachir tabularmaps kuniezu oEmbed colorinfo washoku jmastats textlintr sealr easyestat ma ff census wakatimer CRANొޙɺআ CRANొࡁΈ jpops kuniumi r2hue
5PLVTIJNB3اըத ࠂɾએ ٬һ।ڭत ಙౡɾ࢛ࠃΛ3ɺσʔλαΠΤϯεͰΓ্͍͛ͨ ಙౡେֶڭһɺֶੜ ݝ֎ͷؔऀɺࢢຽ גࣜձࣾϗΫιΤϜ ڠྗاۀ
044Ͱύοέʔδ։ൃΛ࢝ΊΑ͏
ύοέʔδʁ
ύοέʔδ3ͷػೳ֦ு $3"/ 5IF$PNQSFIFOTJWF3"SDIJWF/FUXPSL ύοέʔδʜ ݄࣌ Ϣʔβ͕ར༻Մೳͳػೳ ʢσʔληοτɺσʔλಡΈࠐΈɺՃɺՄࢹԽɺ౷ܭॲཧͳͲͳͲʣ Λఏڙ
install.packages("jpmesh") library(jpmesh) jpmesh::as_meshcode("5033")
044Ͱύοέʔδ։ൃΛקΊΔཧ༝ ղܾɺػೳՃͷΛ্ ։ൃҙཉͷҡ࣋ ίϛϡχςΟɺݚڀͷߩݙ ⁞
⁞ίϛϡχςΟɺݚڀͷߩݙ > R is free software distributed under a GNU-style
copyleft. IUUQTTWOSQSPKFDUPSH3 IUUQTCVHTSQSPKFDUPSH IUUQTHJUIVCDPNSTUVEJPSTUVEJP 044Ͱ͋Δ͜ͱ3ίϛϡχςΟͷจԽͱͯ͠ී௨
จʹؔ͢ΔҰ࿈ͷίʔυΛެ։ IUUQTHJUIVCDPNOJFTDPOTQMBOFOWDG ,VCP 5 7FSÍTTJNP % 6SZV 4FUBM8IBUEFUFSNJOFTUIFTVDDFTTBOEGBJMVSFPGFOWJSPONFOUBMDSPXEGVOEJOH "NCJP
IUUQTEPJPSHT จͷ࠶ݱੑΛอূɺޙܧͷਓʑͷͨΊʹ͓ͯ͘͠
ղܾɺػೳՃͷΛ্ ֎ͷۭؾʹ৮ΕΔ͜ͱͰࢥΘ͵ʮԽֶԠʯΛى͔͜͢ IUUQTHJUIVCDPNVSJCP[JQBOHVHSBQITDPOUSJCVUPST ϦϨʔͷΠϝʔδ 044 ݸਓ͘͘ Θ͔ΒΜʜ ։ൃ͕Լ͢Δظؒ ʮͭ·͖ͮʯʹର͢Δऑ͞ Θ͔ΒΜʜ
ͤͯʂ
։ൃҙཉͷҡ࣋ ͜·ΊͳΞτϓοτ͕ηʔϒϙΠϯτͱͳΔ ֎෦ൃදɾࠂ ڏແײ (JU)VC(JU-BCͰͷެ։ ࠳ં͢ΔڪΕ ݽಠ ࣗ༝ʹ ͖ͳͷΛ 5X
JUUFS ˠ$3"/ొͤͣʹར༻ͯ͠Β͑Δ 5PLZP3ͳͲͷίϛϡχςΟ ϒ ϩ ά ϑΟʔυόοΫΛಘ͍͢ 044 ݸਓ͘͘
044Ͱ։ൃதͷ3ύοέʔδͷհ
Ϟνϕʔγϣϯ 3ݴޠͷڵຯ "1*Λར༻ͯ͠Έ͍ͨ ཧۭؒσʔλͷॲཧΛ ຊޠपΓͷʹ ࣗͷ͖ͳ͜ͱΛ͍ͨ͠ ॳظ தظ ݱࡏ ָʹ͍ͨ͠
ରԠ͍ͨ͠ ٕज़తͳؔ৺
KQNFTI ඪ४ҬϝογϡΛѻ͏ ,VCP 5 6SZV 4FUBM .PCJMFQIPOFOFUXPSLEBUBSFWFBMOBUJPOXJEFFDPOPNJDWBMVFPGDPBTUBMUPVSJTNVOEFSDMJNBUFDIBOHF 5PVSJTN.BOBHFNFOU
IUUQTEPJPSHKUPVSNBO library(jpmesh) meshcode(5133) # 80km #> <meshcode[1]> #> [1] 5133 meshcode(5133778300, .type = "subdivision") #> <subdiv_meshcode[1]> #> [1] 5133778300 mesh_to_coords(51337783) #> # A tibble: 1 × 5 #> meshcode lng_center lat_center lng_error lat_error #> <meshcode> <dbl> <dbl> <dbl> <dbl> #> 1 51337783 134. 34.7 0.00625 0.00417 coords_to_mesh(133, 34) #> <meshcode[1]> #> [1] 51330000 # Scale down mesh_convert("52350432", 0.500) #> <meshcode[4]> #> [1] 523504321 523504322 523504323 523504324 # Find out neighborhood meshes meshcode(5133) %>% neighbor_mesh(contains = TRUE) #> <meshcode[9]> #> [1] 5032 5033 5034 5132 5133 5134 5232 5233 5234
GHES ࠃཧӃ͕ఏڙ͢Δج൫ਤใͷॲཧ 3ͱ%ϓϦϯλʔͰീϲַͷϛχνϡΞΛ࡞Δɻ IUUQTCMPHIPYPNDPNFOUSZ ར༻ࣄྫ ߟݹֶͷͨΊͷ3Ͱ(*4ʔϥελฤ IUUQTRJJUBDPNJTIJJKVOQFJJUFNTBCDCFFECGCCB library(fgdr) # جຊ߲
read_fgd("FG-GML-523346-AdmPt-20180701-0001.xml") # ඪߴϞσϧ read_fgd_dem("FG-GML-5135-63-00-DEM5A-20161001.xml", resolution = 5, return_class = "data.table")
[JQBOHV ຊޠपΓͷΛղܾ͢ΔศརͳػೳΛఏڙ IUUQTHJUIVCDPNVSJCP[JQBOHVJTTVFT library(zipangu) convert_jyear("R3") #> [1] 2021 convert_jdate("ྩ̏12݄18") #>
[1] "2021-12-18" # ॕͷఆ #ʢఱߖੜɺΦϦϯϐοΫؔͷΧϨϯμʔͷมߋʹରԠʣ is_jholiday("2018-12-24") #> [1] TRUE is_jholiday("2021-12-24") #> [1] FALSE is_jholiday("2022-01-10") #> [1] TRUE kansuji2arabic(c("Ұ", "ඦ")) #> [1] "1" "100" # ฦΓΛ kansuji2arabic(c("Ұ", "ඦ"), convert = FALSE) #> [1] 1 100 # Nipponύοέʔδʹͳ͔ͬͨؔ separate_address("౦ژઍా۠େखொҰஸ") #> $prefecture #> [1] "౦ژ" #> #> $city #> [1] "ઍా۠" #> #> $street #> [1] "େखொҰஸ" harmonize_prefecture_name( c("౦ژ", "ւಓ", "ԭೄ"), to = "long") #> [1] "౦ژ" "ւಓ" "ԭೄݝ"
KNBTUBUT ෩ ؾிͷσʔλΛऔಘɾܗͯ͠ఏڙ # σʔλϕʔε Ϧετ read_eqdb_csv(path = "ݯɾϦετ.csv") #>
#> ͷ֓ཁ #> x ൃੜ࣌: 2021-11-09 01:14:57 #> x ԝ໊: ౡݝத௨Γ #> • Ң: 37°03.7′N #> • ܦ: 140°35.0′E #> ! ਂ͞: 6 km #> ! Ϛάχνϡʔυ: 4.9 #> ! ࠷େ: ̐ #> # A tibble: 472 × 4 #> ಓݝ ؍ଌ໊ ؾிͷ؍ଌ #> <chr> <chr> <chr> <lgl> #> 1 ౡݝ 4 ݹ఼ொদԣ TRUE #> 2 ౡݝ 4 ݹ఼ொদ৽܂ݪ FALSE #> 3 ౡݝ 3 ఱӫଜԼদຊ FALSE #> 4 ౡݝ 3 ୨ொ୨தډ TRUE #> 5 ౡݝ 3 伸ଜࡔத FALSE #> 6 ౡݝ 3 ੴொٱอ FALSE #> 7 ౡݝ 3 ۄଜখߴ FALSE #> 8 ౡݝ 3 ઙொઙ FALSE #> 9 ౡݝ 3 ͍Θ͖ࢢࡾொ TRUE #> 10 ౡݝ 2 ܊ࢁࢢே TRUE #> # … with 462 more rows library(jmastats) # ؾσʔλ jma_collect(item = "hourly", block_no = 47646, year = 2021, month = 11, day = 27) # ۙͷؾ؍ଌͷݕࡧ nearest_station(longitude = 140.112, latitude = 36.083) #> Simple feature collection with 1 feature and 5 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: 140.125 ymin: 36.05667 xmax: 140.125 ymax: 36.05667 #> Geodetic CRS: WGS 84 #> # A tibble: 1 × 6 #> area station_no station_name block_no distance geometry #> <chr> <int> <chr> <chr> [m] <POINT [°]> #> 1 Ἒ 40336 ͭ͘ 47646 3153. (140.125 36.05667) ைҐ
044Ͱͷ։ൃʹΑΔ෭࡞༻ ৽͍ٕ͠ज़ɺύοέʔδʹ৮ΕΔ TVEBDIJSʜSFUJDVMBUF 1ZUIPO GHESʜTUBST UFSSB ৽ػೳͷఏҊɺղܾࡦͷΞΠσΞɺڠྗऀ [JQBOHVʜΩϟογϡɺϕΫτϧԽɺࣈͷॲཧ 044ɾ5XJUUFS ύοέʔδ։ൃ
UFYUMJOUSʜ+BWB4DSJQU KNBTUBUTʜைҐදɺσʔλϕʔε Ͱ͖ͨΑʔ ͷͮ͘Γͷָ͠͞ ♥ ⭐ XBTIPLVʜSFDJQFT WDUST
ύοέʔδ։ൃʹΉਓͨͪ
ݚڀऀʹקΊ͍ͨύοέʔδͷछྨ छྨ ֶज़ݚڀͷଆ໘ ඞཁͳٕज़ྗ ύοέʔδྫ ղੳख๏ͷ࣮ ଟ͍ গͳ͍ʙଟ͍ TVEBDIJS TTSO
XBTIPLV σʔλܗɾՃ ී௨ ී௨ʙଟ͍ KQNFTI GHES [JQBOHV ՄࢹԽ গͳ͍ ଟ͍ UBCVMBNBQT Γޱଟ༷ɻ՝ʹదͨ͠ύοέʔδͷछྨ͕͋Δ
ݚڀ׆ಈͱͯ͠ͷධՁ 3ύοέʔδͷ։ൃɺཧΛஂମͰӡӦ IUUQTHJUIVCDPNPQFOKPVSOBMTKPTTSFWJFXT IUUQTHJUIVCDPNSPQFOTDJ S0QFO4DJ (JU)VCJTTVFTͰͷϨϏϡʔΛ௨ͯ͠%0*͕༩͑ΒΕΔ ݚڀ༻ιϑτΣΞͷͨΊͷΦʔϓϯΞΫηεδϟʔφϧ 5IF+PVSOBMPG0QFO4PVSDF4PGUXBSF +044 ϨϏϡʔ৹ࠪ͋Γ
;FOPEP IUUQT[FOPEPPSH (JU)VCϦϙδτϦͱඥ͚ͯ %0*Λൃߦ KQNFTIͷྫ
Βͳ͍༷ɺศརͳUJQT ύοέʔδͷ࡞Γํʁ ใΛΔͨΊʹ(JU)VC͕༗ޮ ͿΒͬ͘΅ͬ͘͢ɺͳཁૉଟʑʜ IUUQTSQLHTPSH ʮݟΑ͏ݟਅࣅʯઓུ 31BDLBHFT 044Ͱͳ͍ͱ͞Βʹ໎ࢠʹͳΓ͍͢ ຊޠͰಘΒΕΔใ͔ͳΓগͳ͍ 1SBDUJDBM31BDLBHF%FWFMPQNFOU
+BQBOFTF IUUQTCPPLEPXOPSHZVUBOOJIJMBUJPOQSBDUJDBMSQBDLBHFEFWFMPQNFOUKB
Ұॹʹ։ൃɺϊϋͷڞ༗ ͜ΜͳύοέʔδΛ࡞Γ͍ͨ ࣗΘ͔Βͳ͔ͬͨˍࠓΘ͔ΒΜ ٕज़తͳҙຯͰղܾͰ͖ͳ͍ ΞυϗοΫͳݟʹͱͲΊͳ͍ धཁΛर͑Δମ੍࡞͍͖͍ͬͯͨ 5PLVTIJNB3ʢίϛϡχςΟʣͰࢧԉɾܧঝͰ͖ΔΑ͏ʹ
·ͱΊ 044Ͱͷύοέʔδ։ൃָ͍͠ɺ ࠃͰͷࣄྫ͕·ͩΓͳ͍ɻ ίϛϡχςΟͷߩݙɺݚڀ׆ಈͷҰͱͯ͠ ⁞ ύοέʔδ։ൃΛ࢝ΊΑ͏ ʢ૯߹తʹʣҰਓͰͷ࡞ۀΑΓෛ୲͕গͳ͍ 5PLVTIJNB3ͳͲͰύοέʔδ։ൃͷٕೳशಘΛࢦ͢
ΈΜͳͰݟΛڞ༗͠Α͏
&/+0: