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
44
R研究集会(2024)のご案内
s_uryu
1
480
生成AIを用いたサービスの紹介
s_uryu
0
12
生成AIの基礎的事項と社会に与える影響
s_uryu
0
7
Rの機械学習フレームワークの紹介〜tidymodelsを中心に〜 / machine_learning_with_r2024
s_uryu
0
730
地理空間データの機械学習への適用 / machine_learning_for_spatial_data
s_uryu
0
190
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
620
R言語入門 (R-4.3.3 2024年4月版) / introduction to r
s_uryu
8
6.2k
統・再現性・協力: 人為的過誤を防ぎ、未来へ進む策 / Integration, Reproducible, and Collaboration
s_uryu
1
700
Other Decks in Research
See All in Research
文化が形作る音楽推薦の消費と、その逆
kuri8ive
0
200
渋谷Well-beingアンケート調査結果
shibuyasmartcityassociation
0
300
Weekly AI Agents News! 9月号 論文のアーカイブ
masatoto
1
150
PetiteSRE_GenAIEraにおけるインフラのあり方観察
ichichi
0
200
アプリケーションから知るモデルマージ
maguro27
0
170
Human-Informed Machine Learning Models and Interactions
hiromu1996
2
520
Geospecific View Generation - Geometry-Context Aware High-resolution Ground View Inference from Satellite Views
satai
2
130
The many faces of AI and the role of mathematics
gpeyre
1
1.4k
言語と数理の交差点:テキストの埋め込みと構造のモデル化 (IBIS 2024 チュートリアル)
yukiar
4
920
The Relevance of UX for Conversion and Monetisation
itasohaakhib1
0
110
第79回 産総研人工知能セミナー 発表資料
agiats
2
170
データサイエンティストをめぐる環境の違い 2024年版〈一般ビジネスパーソン調査の国際比較〉
datascientistsociety
PRO
0
780
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Building Adaptive Systems
keathley
38
2.3k
Building Your Own Lightsaber
phodgson
103
6.1k
We Have a Design System, Now What?
morganepeng
51
7.3k
How to train your dragon (web standard)
notwaldorf
88
5.7k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Done Done
chrislema
181
16k
Being A Developer After 40
akosma
87
590k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
RailsConf 2023
tenderlove
29
940
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: