本家様 https://posit.co/ 昔はhttps://rstudio.com/
だったのだが、変わったみたい
Rの被せものなRStudio Desktop よくrstudio とのみいいますが、正式にはRStudio Desktopみたい
Rを使うならRStudio Desktop経由で使った方が断然楽
ってまずはその「R」のインストールが必要でそれは R参照で
自身のホームディレクトリにインストールして使うなら「Zip/Tarballs」版を入手します
https://posit.co/download/rstudio-desktop/から「Zip/Tarballs」欄に移って
ubuntu18.04LTS、ubutu20.04LTSは「Ubuntu 18+/Debian 10+」の「RSTUDIO-2022.07.2-576-AMD64-DEBIAN.TAR.GZ」をクリック
RHEL7系(CentOS7)やRHEL8系(RockyLinuxら)は「Fedora 19/Red Hat 7」の「RSTUDIO-2022.07.2-576-X86_64-FEDORA.TAR.GZ」をクリックしてインストールバイナリを入手します
インストール先がubuntu20.04なので「rstudio-2022.07.2-576-amd64-debian.tar.gz」(184MB)を取得
saber@ubuntu:~$ cat /etc/os-release |grep VERSION=
VERSION="20.04.5 LTS (Focal Fossa)"
saber@ubuntu:~$ wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2022.07.2-576-amd64-debian.tar.gz
(インストール先は$HOME/appsの中)
saber@ubuntu:~$ mkdir apps
saber@ubuntu:~$ tar -xf rstudio-2022.07.2-576-amd64-debian.tar.gz -C ./apps
(パス設定)
saber@ubuntu:~$ export PATH=$HOME/apps/rstudio-2022.07.2+576/bin:$PATH
っで実行してみる
saber@ubuntu:~$ module load R
saber@ubuntu:~$ which R
/apps/R-4.2.2/bin/R
saber@ubuntu:~$ rstudio
暫くすると画面が表示されます
ユーザ自身がRStudioをダウンロードして利用されるのもいいのですが、10人、20人とダウンロードされるとストレージも肥大します
共有の場所に置くものありかなと思います
なら提供されているrpmファイルで入れてしまうのも手なのですが、RStudioのバージョンが選べない.
RStudioが最新になってrpmでインストールすると前のバージョンが消えてしまう.
新しいバージョンは前のバージョンの上位互換がなされていると思うので、どんどん更新しても宜しいと思いますが、インターフェイスが前の方がいいとかで残した方がいいときもある.
なのでrpmではいれず、tar.gzを使って /apps にいれます
root@ubuntu:~# wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2022.07.2-576-amd64-debian.tar.gz
root@ubuntu:~# mkdir /apps
root@ubuntu:~# tar -xf rstudio-2022.07.2-576-amd64-debian.tar.gz -C /apps
あとはEnvironmentModulesを設定します
root@ubuntu:~# mkdir /apps/modulefiles/RStudio
root@ubuntu:~# vi /apps/modulefiles/RStudio/2022.07.2-576
#%Module1.0
#module load R
set RS /apps/rstudio-2022.07.2+576
prepend-path PATH $RS/bin
root@ubuntu:~#
root@ubuntu:~#
(RStudio既定のバージョンを指定)
root@ubuntu:~# vi /apps/modulefiles/RStudio/.version
#%Module1.0
set ModulesVersion 2022.07.2-576
root@ubuntu:~#
使う際はまずRを呼び出して、RStudioも読み込む. EnvironmentModulesのRStudio内に「module load R」とか書けばいいのでしょうが、、お好みで.
RStudioDesktopを実行したら下記のようねメッセージが表示される. 恐らくSSHらでリモートマシンにログインされてRStudioを起動されたと思います
X11を通すためにも「ssh <マシン名> -X」とかいれてリモートアクセスすれば解消されるかと 「ssh <マシン名> -XY」でもいいのかも
saber@ubuntu:~$ rstudio
(略
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
saber@ubuntu:~$
RStudioDesktopを実行して画面は表示されるが、何も映っていない.
その際は「~/.config/RStudio/desktop.ini」に下記を加える. 「~/.config/RStudio/desktop.ini」は「RStudio Desktop」(rstudio)を起動したときに作られる
[General]
cookies=@Invalid()
desktop.renderingEngine=software
*multi-user.targetではだめみたい. graphical.target で稼働が必要みたい
https://github.com/rstudio/rstudio/issues/13959
(GL関係のエラーメッセージが表示されたら下記で実行します)
rstudio --use-gl=angle