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
生成AIサービスを用いた研究活動の支援
s_uryu
0
110
R研究集会(2024)のご案内
s_uryu
1
600
生成AIを用いたサービスの紹介
s_uryu
1
50
生成AIの基礎的事項と社会に与える影響
s_uryu
0
30
Rの機械学習フレームワークの紹介〜tidymodelsを中心に〜 / machine_learning_with_r2024
s_uryu
0
890
地理空間データの機械学習への適用 / machine_learning_for_spatial_data
s_uryu
0
250
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
670
R言語入門 (R-4.3.3 2024年4月版) / introduction to r
s_uryu
7
6.4k
統・再現性・協力: 人為的過誤を防ぎ、未来へ進む策 / Integration, Reproducible, and Collaboration
s_uryu
1
740
Other Decks in Research
See All in Research
資産間の相関関係を頑健に評価する指標を用いたファクターアローケーション戦略の構築
nomamist
0
170
Remote Sensing Vision-Language Foundation Models without Annotations via Ground Remote Alignment
satai
3
180
アプリケーションから知るモデルマージ
maguro27
0
300
ソフトウェア研究における脅威モデリング
laysakura
0
2k
Mathematics in the Age of AI and the 4 Generation University
hachama
0
140
[輪講] Transformer Layers as Painters
nk35jk
4
720
Dynamic World, Near real-time global 10 m land use land cover mapping
satai
3
100
地理空間情報と自然言語処理:「地球の歩き方旅行記データセット」の高付加価値化を通じて
hiroki13
1
220
NLP2025 WS Shared Task 文法誤り訂正部門 ehiMetrick
sugiyamaseiji
0
150
Introduction of NII S. Koyama's Lab (AY2025)
skoyamalab
0
170
o1 pro mode の調査レポート
smorce
0
150
請求書仕分け自動化での物体検知モデル活用 / Utilization of Object Detection Models in Automated Invoice Sorting
sansan_randd
0
150
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
29
2k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Facilitating Awesome Meetings
lara
53
6.3k
Music & Morning Musume
bryan
46
6.4k
Writing Fast Ruby
sferik
628
61k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
Faster Mobile Websites
deanohume
306
31k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
Statistics for Hackers
jakevdp
798
220k
The Pragmatic Product Professional
lauravandoore
33
6.5k
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: