Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
tsibbleとtibbletimeの紹介
Search
t_usausausa
April 21, 2018
Technology
3.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
tsibbleとtibbletimeの紹介
第69回TokyoR LT資料
t_usausausa
April 21, 2018
More Decks by t_usausausa
See All by t_usausausa
Reticulate_and_RStudio.pdf
t_usausausa
0
670
Other Decks in Technology
See All in Technology
AI時代に顧客へ最速で価値を 届けるための試行錯誤 〜「AI × マネジメント」領域におけるmentoのケース〜
posterkeisuke
0
110
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
230
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1.1k
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
240
リージョンの壁を越える、 ちょっと変わったAWSサービスの話
falken
PRO
1
300
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.9k
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
130
作り直せるコードは迅速に 作り直せないDBは慎重に - AI時代のプロダクトエンジニアが「判断の不可逆性」で開発速度を変える話
kinosuke01
0
290
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
1.7k
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
460
クロスボーダーM&AのValue Upを支えるプロダクト開発。日米チームのハブになったプロダクトエンジニアの実践 / Product Engineering Conference 2026
genda
0
110
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
890
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
YesSQL, Process and Tooling at Scale
rocio
174
15k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
820
Designing for Timeless Needs
cassininazir
1
470
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
210
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
GraphQLとの向き合い方2022年版
quramy
50
15k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
[SF Ruby Conf 2025] Rails X
palkan
2
1.4k
Transcript
TSIBBLEと TIBBLETIMEの 紹介 第69回 TokyoR
自己紹介 ▪ twitter : @t_usausausa ▪ お仕事 : データアナリスト(高性能雑用係) ▪
言語 : R, Python, SQL
Dataframe型をts型に変換するのって めんどくさくないですか???
▪ Dataframe型からts型に変換したいモチベーション – ARIMAなどの時系列分析がしたい ▪ prophet, AnomalyDetectionでのお手軽時系列分析や rstanを使った状態空間モデルの話は置いておく – dygraphsでグリグリ動く時系列プロットがしたい
▪ いにしえの手法だと以下の通り – zoo型で読み込んでxts型に変換してマエショリし てts型に直して… – 正直やってられない – tidyな世界に生きたい
tidyな世界…つまりtidyverse!!! tibble型を継承した時系列の型があれ ば…
と思っていたらほぼ同時期に2個登場 した ◆tsibble ◆tibbletime
tsibble tibbletime 作者 Earo Wang [aut, cre], Di Cook [aut,
ths], Rob Hyndman [aut, ths] Davis Vaughan [aut, cre], Matt Dancho [aut] リリース時期 (0.1.0) 2018-01-09 2018-01-03 現在のバージョン 0.1.5 0.1.1 CRAN https://cran.r- project.org/web/packages/tsib ble/index.html https://cran.r- project.org/web/packages/tibb letime/index.html 独自クラスの型 tbl_ts tbl_time
tsibble tibbletime 独自クラスへの変換 ◦ ちょっとコツあり ◦ 欠損値補完 ◦ × %>%を使った集計処理
◦ ◦ ウィンドウを使った処理 ◦ ◦ 時間のフィルタリング ◦ ◦ 独自クラスから ts型への変換 ◦ × 機能面ではややtsibbleが優勢? だが前処理関連はtibbletimeに便利なものが揃っている
▪ ではtsibbleでdataframeからtsibble型を生成し、ts型 に変換してみます – tibbletimeは時間がないので割愛します
このような形式のdataframe型のデータを用意
tsibble型はindexの重複が許されない keyとindexでユニークかつ、keyを指定する必要がある
None
keyの指定があれば自動的に横持ちに変換してくれる
▪ 個人的にハマったところ – as.tsで変換できない ▪ tsibble型のindexの間隔が指定されていないと変換 できない
ここにindexの間隔が表示される (自動的に算出される)
自動的に算出できないと… よくわからないエラーで変換が できない
▪ 個人的にハマったところ ▪ tidyr::spreadで展開すると出力がおかしくなる…? – tsibble用のtidyrの関数が用意されていない – tibbletime用のtidyr関数は用意されている
▪ じゃあどっちを使えばいいのか、という話 – 結論としては用途で変えるべき – ts型に変換する場合はtsibble – 独自クラスで前処理やりたいならtibbletime
▪ tsibbleの作者いわく… ▪ (意訳) それぞれ別の目的で作ったのだから、2個あって もいいやん。将来的には1つにするのがベストなのかも しれないけど。
▪ 参考文献 – tsibble? or tibbletime?
enjoy!!!