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
660
地理空間データの機械学習への適用 / machine_learning_for_spatial_data
s_uryu
0
150
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
580
R言語入門 (R-4.3.3 2024年4月版) / introduction to r
s_uryu
8
6k
統・再現性・協力: 人為的過誤を防ぎ、未来へ進む策 / Integration, Reproducible, and Collaboration
s_uryu
1
670
Rによる大規模データの処理
s_uryu
2
2.3k
textlintr: Rユーザのためのtextlintによる校正
s_uryu
0
500
Rによるデータ可視化と地図表現
s_uryu
1
2.2k
データ分析入門 / tokupon-ds2022
s_uryu
4
5.6k
Other Decks in Research
See All in Research
論文読み会 SNLP2024 Instruction-tuned Language Models are Better Knowledge Learners. In: ACL 2024
s_mizuki_nlp
1
330
20240626_金沢大学_新機能集積回路設計特論_配布用 #makelsi
takasumasakazu
0
160
Streaming CityJSON datasets
hugoledoux
0
140
RSJ2024「基盤モデルの実ロボット応用」チュートリアルA(河原塚)
haraduka
2
610
Matching 2D Images in 3D: Metric Relative Pose from Metric Correspondences
sgk
1
300
129 2 th
0325
0
160
Practical The One Person Framework
asonas
0
1.1k
自動運転・AIシステムの問題を賢く探す・賢く直す / Smart Search & Repair Techniques for Automated Driving Systems and AI Systems
ishikawafyu
0
220
Weekly AI Agents News! 6月号 論文のアーカイブ
masatoto
1
180
marukotenant01/tenant-20240916
marketing2024
0
370
LLM based AI Agents Overview -What, Why, How-
masatoto
2
560
第 2 部 11 章「大規模言語モデルの研究開発から実運用に向けて」に向けて / MLOps Book Chapter 11
upura
0
320
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
41
2.1k
KATA
mclloyd
29
13k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How STYLIGHT went responsive
nonsquared
95
5.1k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
The Invisible Side of Design
smashingmag
297
50k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Music & Morning Musume
bryan
46
6.1k
Raft: Consensus for Rubyists
vanstee
136
6.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
The Language of Interfaces
destraynor
154
24k
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: