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
メールからの名刺情報抽出におけるLLM活用 / Use of LLM in extracting business card information from e-mails
sansan_randd
2
260
「並列化時代の乱数生成」
abap34
3
910
Practical The One Person Framework
asonas
1
1.8k
Introducing Research Units of Matsuo-Iwasawa Laboratory
matsuolab
0
1.3k
移動ビッグデータに基づく地理情報の埋め込みベクトル化
tam1110
0
160
Human-Informed Machine Learning Models and Interactions
hiromu1996
2
520
クロスセクター効果研究会 熊本都市交通リノベーション~「車1割削減、渋滞半減、公共交通2倍」の実現へ~
trafficbrain
0
290
CUNY DHI_Lightning Talks_2024
digitalfellow
0
130
[2024.08.30] Gemma-Ko, 오픈 언어모델에 한국어 입히기 @ 머신러닝부트캠프2024
beomi
0
800
Weekly AI Agents News! 9月号 論文のアーカイブ
masatoto
1
150
Weekly AI Agents News! 9月号 プロダクト/ニュースのアーカイブ
masatoto
2
170
KDD論文読み会2024: False Positive in A/B Tests
ryotoitoi
0
240
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Making the Leap to Tech Lead
cromwellryan
133
9k
The Pragmatic Product Professional
lauravandoore
32
6.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Rails Girls Zürich Keynote
gr2m
94
13k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
GraphQLとの向き合い方2022年版
quramy
44
13k
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: