こちらにあるSEIR モデルを Shiny で表示してみました。
感染症数理モデル;Sequential SEIR model
プログラムはこちらです。
SEIR.zip
Ubuntu 20.04 で確認しました。
R がインストールしてある状況で、
- ライブラリーのインストール
sudo apt install r-cran-desolve
- Shiny-Server のインストール
こちらの記事を参考にしました。
【R】Shiny-Serverのインストール
Download Shiny Server for Ubuntu 16.04 or later
Shiny-Server が動いていることの確認
sudo systemctl status shiny-server
http://localhost:3838/ にアクセス

http://localhost:3838/sample-apps/hello/ にアクセス

Shiny-Server の設定ファイル
```text:/etc/shiny-server/shiny-server.conf
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
- /opt/shiny-server/samples/sample-apps に SEIR.zip を解凍して置く
$ tree sample-apps/
sample-apps/
├── SEIR
│ ├── server.R
│ └── ui.R
├── hello
│ ├── server.R
│ └── ui.R
└── rmd
└── index.Rmd
-
http://localhost:3838/sample-apps/SEIR/ にアクセスして、Submit ボタンをクリック