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
TokyoR#84_Rexams
Search
nonki1974
April 04, 2020
Technology
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TokyoR#84_Rexams
nonki1974
April 04, 2020
More Decks by nonki1974
See All by nonki1974
GTFS with Tidytransit package
nonki1974
0
350
都道府県別焼き鳥屋ランキングの作成
nonki1974
1
940
Introduction to R
nonki1974
0
400
Introduction to dplyr
nonki1974
0
570
Introduction to ggplot2
nonki1974
1
560
Analyzing PSB tracks with R
nonki1974
0
630
introduction to fukuoka.R @ Fukuoka.LT
nonki1974
0
85
所要時間のヒートマップを作成する
nonki1974
0
610
gtfsr package @ fukuoka.R #11
nonki1974
0
370
Other Decks in Technology
See All in Technology
ScotSecure West 2026 - Glasgow
raybugg
0
170
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
12
7.2k
あけおめLINE 傾向とその対策
nasa9084
0
330
Why Agent Cost Needs Observability
nttcom
0
160
Lambda MicroVMsは常駐サーバーの代わりに なるか? Kiro Crew を動かして検証してみた / Kiro Crew on Lambda MicroVMs
k_adachi_01
2
210
地方移住と都心キャリアの両立は「金・時間・人」のリソースをフル活用すれば実現できる!〜Snowflake女子会 vol.8
snowwmn0824
0
110
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
290
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
290
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
5
1.1k
AIは推し活である。
kurazuuuuuu
1
970
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
1
370
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
600
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
430
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
560
Everyday Curiosity
cassininazir
0
330
Odyssey Design
rkendrick25
PRO
2
820
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Building Applications with DynamoDB
mza
96
7.2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Transcript
オンラインテストの作成 with R/exams @nonki1974 Tokyo.R #84
こんにちは
moodle Learning Management System(LMS) スライド、レジュメの配布 アンケート、出欠確認、URL、ページ作成 小テスト
小テスト(計算問題の作成) {a}はワイルドカードデータセット → 出題のたびに値が変わる
小テスト(解答の設定)
小テスト(値生成ルール設定)
小テスト(プレビュー)
統計の授業で使ってみよう!
・・・・ 階乗や組み合わせの関数がない・・・!
Rで問題を作る:examsパッケージ
Rで問題を作る:examsパッケージ Rmarkdownで問題&解答を作成 Moodleにインポート Moodle XMLフォーマットに出力 1 2 3
フォーマット ```{r echo = FALSE, results='hide'} # 問題中のパラメータ設定など a <-
round(runif(1, 1, 10), 2) b <- round(runif(1, 1, 10), 2) res <- a + b ``` Question ======== 以下の値を求めなさい。 $$ `r a` + `r b` $$ Solution ======== 答えは $$ `r a` + `r b` = `r res` $$ Meta-information ================ extype: num exsolution: `r fmt(res)` exname: 足し算のテスト extol: 0.01
とりあえずの確認 library(exams) exams2html("add_ex.Rmd")
結果
Moodle XMLフォーマットに出力 # add_ex.xmlが生成される exams2moodle(file = "add_ex.Rmd", n = 10,
name = "add_ex")
Moodleにインポート → プレビュー
実戦投入 ```{r echo = FALSE, results = "hide"} lambda <-
sample(seq(0.1, 5, 0.1), 1) x <- ceiling(lambda) res <- c(dpois(x, lambda), 1-dpois(0, lambda)) ``` Question ======== ある店舗の1分間あたりの来客数$X$は,$¥lambda=`r lambda`$の ポアソン分布に従うと仮定する。このとき,以下の確率を求めな さい。 Answerlist ---------- * 1分間にちょうど`r x`人の来客がある確率 * 1分間に少なくとも1人以上の来客がある確率 Solution ======== 1分間にちょうど`r x`人の来客がある確率は, ¥begin{align} P(X = `r ceiling(x)`) &= ¥frac{`r lambda`^`r x`}{`r x`!}e^ {-`r lambda`} ¥¥ &= `r fmt(res[1])` ¥end{align} 1分間に少なくとも1人以上の来客がある確率は, ¥begin{align} P(X¥geqq 1) &= 1 - P(X = 0) ¥¥ &= 1 - e^{-`r lambda`} ¥¥ &= 1 - `r exp(-lambda)` ¥¥ &= `r fmt(res[2])` ¥end{align} となる. Answerlist ---------- * 1分間にちょうど`r x`人の来客がある確率は `r fmt(res[1])`. * 1分間に少なくとも1人以上の来客がある確率は `r fmt(res[2])`. Meta-information ================ extype: cloze exclozetype: num|num exsolution: `r fmt(res[1])`|`r fmt(res[2])` exname: poisson_ex_word extol: 0.01
こんな感じ
未解決 Windows環境では×(UTF-8保存でもダメ) 日本語PDFは×
Enjoy!