Docker容器嵌入式开发:在Ubuntu上配置RStudio与R语言、可视化操作

目录

  • 一、dirmngr工具
  • 二、R环境安装与配置
  • 三、验证是否安装成功
  • 四、安装Rstudio
  • 五、可视化操作
  • 参考

以上是在Ubuntu 18.04上安装最新版本的R语言环境的步骤摘要。首先,通过添加CRAN镜像源并安装GPG密钥来配置软件源。然后,更新软件包列表并通过apt安装R语言。最后,可选地安装RStudio作为集成开发环境。验证安装的方法包括启动R并检查版本号,运行简单的R命令来确认功能正常,然后退出R。

一、dirmngr工具

dirmngr 是一个用于管理密钥和证书的工具,主要用于 GnuPG(GNU Privacy Guard)加密软件套件中。它是 GnuPG 中的一个独立的组件,负责处理密钥服务器的请求以及密钥和证书的管理。

dirmngr 主要的功能包括:

密钥管理:dirmngr 负责管理密钥环和密钥服务器之间的通信。它可以从密钥服务器上检索公钥、验证公钥的有效性,并将公钥导入到本地的密钥环中。

证书管理:除了密钥管理外,dirmngr 也可以处理 X.509 数字证书。它可以与证书颁发机构(CA)进行通信,验证证书的有效性,并确保它们的链完整性。

密钥服务器通信:dirmngr 能够与密钥服务器进行安全通信,例如通过 HTTP 或 LDAP 协议。它可以向密钥服务器发送请求以搜索、获取或删除公钥。

CRL(证书吊销列表)检查:dirmngr 还负责检查证书吊销列表以确保证书的有效性。它会定期检查 CA 发布的 CRL 并更新本地的列表。

安装方法:
安装 dirmngr:在终端中运行以下命令安装 dirmngr:

sudo apt-get install dirmngr

启动 dirmngr 服务:运行以下命令以启动 dirmngr 服务:

sudo systemctl start dirmngr

操作记录:

udo apt-get install dirmngr
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dirmngr is already the newest version (2.2.4-1ubuntu1.6).
dirmngr set to manually installed.
The following packages were automatically installed and are no longer required:gyp libjs-async libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-matchnode-block-stream node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-datanode-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-hosted-git-info node-inflight node-inherits node-ininode-is-builtin-module node-isexe node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-noptnode-normalize-package-data node-npmlog node-once node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimrafnode-semver node-sha node-slide node-spdx-correct node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-licensenode-which node-wrappy node-yallist
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
(tfv1) root@98031e181845:/data/myapp2024/myBigDataApplicationDevelopment# sudo systemctl start dirmngr
System has not been booted with systemd as init system (PID 1). Can't operate.
(tfv1) root@98031e181845:/data/myapp2024/myBigDataApplicationDevelopment# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
Executing: /tmp/apt-key-gpghome.D2zcggo6wW/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
gpg: key 51716619E084DAB9: public key "Michael Rutter <marutter@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

二、R环境安装与配置

再次尝试添加密钥:运行你之前的添加密钥命令:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9

如果这些步骤仍然无法解决问题,可能是由于网络或密钥服务器方面的问题。你可以尝试等待一段时间后再次尝试,或者尝试使用其他密钥服务器。

添加CRAN镜像源:打开终端,并输入以下命令添加CRAN镜像源。这里以添加Cloudflare提供的CRAN镜像源为例,你也可以选择其他镜像源。

sudo sh -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" >> /etc/apt/sources.list'

更新软件包列表:运行以下命令以更新软件包列表。

sudo apt update

安装R语言:最新版本的R语言已经添加到了CRAN镜像源中,现在可以通过以下命令安装R语言。

sudo apt install r-base

这将安装R语言的基本环境。如果你需要安装R的开发环境或其他扩展包,可以在安装完基本环境后再进行安装。

操作记录:

sudo sh -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" >> /etc/apt/sources.list'
(tfv1) root@98031e181845:/data/myapp2024/myBigDataApplicationDevelopment# sudo apt update
Get:1 file:/var/nv-tensorrt-repo-ubuntu1804-cuda11.1-trt7.2.3.4-ga-20210226  InRelease
Ign:1 file:/var/nv-tensorrt-repo-ubuntu1804-cuda11.1-trt7.2.3.4-ga-20210226  InRelease
Get:2 file:/var/nv-tensorrt-repo-ubuntu1804-cuda11.1-trt7.2.3.4-ga-20210226  Release [569 B]
Get:2 file:/var/nv-tensorrt-repo-ubuntu1804-cuda11.1-trt7.2.3.4-ga-20210226  Release [569 B]
Get:3 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]
Get:4 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]                                                
Get:5 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                     
Get:6 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]                                                                                                           
Get:8 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [83.3 kB]                                                                                                         
Hit:9 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease                                                                                                               
Get:12 http://mirrors.aliyun.com/ubuntu bionic/universe Sources [11.5 MB]                                                                                                           
Get:13 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease [15.4 kB]                                                                                                 
Hit:10 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  InRelease                                                                                         
Get:14 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease [3,626 B]                                                                                              
Ign:15 https://dl.bintray.com/sbt/debian  InRelease                                                                                                                                 
Ign:11 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease                                                                       
Get:16 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages [136 kB]                                                              
Hit:18 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease                                 
Err:19 https://dl.bintray.com/sbt/debian  Release                                                               404  Not Found [IP: 18.232.172.199 443]
Hit:20 https://dl.yarnpkg.com/debian stable InRelease                                                           
Hit:17 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release                             
Get:21 http://mirrors.aliyun.com/ubuntu bionic/main Sources [1,063 kB]                                                            
Get:23 http://mirrors.aliyun.com/ubuntu bionic/restricted Sources [5,823 B]           
Get:24 http://mirrors.aliyun.com/ubuntu bionic/multiverse Sources [216 kB]
Get:25 http://mirrors.aliyun.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Get:26 http://mirrors.aliyun.com/ubuntu bionic amd64 Contents (deb) [39.5 MB]
Get:27 http://mirrors.aliyun.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:28 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:29 http://mirrors.aliyun.com/ubuntu bionic/multiverse amd64 Packages [186 kB]                                                                                                   
Get:30 http://mirrors.aliyun.com/ubuntu bionic-security/main Sources [379 kB]                                                                                                       
Get:31 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse Sources [13.8 kB]                                                                                                
Get:32 http://mirrors.aliyun.com/ubuntu bionic-security/restricted Sources [38.8 kB]                                                                                                
Get:33 http://mirrors.aliyun.com/ubuntu bionic-security/universe Sources [420 kB]                                                                                                   
Get:34 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 Packages [3,373 kB]                                                                                              
Get:35 http://mirrors.aliyun.com/ubuntu bionic-security amd64 Contents (deb) [228 MB]                                                                                               
Get:36 http://mirrors.aliyun.com/ubuntu bionic-security/restricted amd64 Packages [1,688 kB]                                                                                        
Get:37 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 Packages [1,637 kB]                                                                                          
Get:38 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse amd64 Packages [23.8 kB]                                                                                         
Get:39 http://mirrors.aliyun.com/ubuntu bionic-updates/main Sources [684 kB]                                                                                                        
Get:40 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse Sources [21.7 kB]                                                                                                 
Get:41 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted Sources [42.3 kB]                                                                                                 
Get:42 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Sources [650 kB]                                                                                                    
Get:43 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 Packages [3,786 kB]                                                                                               
Get:44 http://mirrors.aliyun.com/ubuntu bionic-updates amd64 Contents (deb) [240 MB]                                                                                                
Get:45 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted amd64 Packages [1,728 kB]                                                                                         
Get:46 http://mirrors.aliyun.com/ubuntu bionic-updates/universe amd64 Packages [2,411 kB]                                                                                           
Get:47 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse amd64 Packages [30.8 kB]                                                                                          
Get:48 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe Sources [7,042 B]                                                                                                  
Get:49 http://mirrors.aliyun.com/ubuntu bionic-proposed/restricted Sources [8,548 B]                                                                                                
Get:50 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Sources [79.1 kB]                                                                                                      
Get:51 http://mirrors.aliyun.com/ubuntu bionic-proposed/main amd64 Packages [169 kB]                                                                                                
Get:52 http://mirrors.aliyun.com/ubuntu bionic-proposed amd64 Contents (deb) [6,563 kB]                                                                                             
Get:53 http://mirrors.aliyun.com/ubuntu bionic-proposed/restricted amd64 Packages [150 kB]                                                                                          
Get:54 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe amd64 Packages [11.1 kB]                                                                                           
Get:55 http://mirrors.aliyun.com/ubuntu bionic-backports/main Sources [11.9 kB]                                                                                                     
Get:56 http://mirrors.aliyun.com/ubuntu bionic-backports/universe Sources [7,127 B]                                                                                                 
Get:57 http://mirrors.aliyun.com/ubuntu bionic-backports/main amd64 Packages [64.0 kB]                                                                                              
Get:58 http://mirrors.aliyun.com/ubuntu bionic-backports amd64 Contents (deb) [798 kB]                                                                                              
Get:59 http://mirrors.aliyun.com/ubuntu bionic-backports/universe amd64 Packages [20.6 kB]                                                                                          
Reading package lists... Done                                                                                                                                                       
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-amd64) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-all) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
E: The repository 'https://dl.bintray.com/sbt/debian  Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-amd64) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-all) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
(tfv1) root@98031e181845:/data/myapp2024/myBigDataApplicationDevelopment# sudo apt install r-base
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:gyp libjs-async libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-matchnode-block-stream node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-datanode-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-hosted-git-info node-inflight node-inherits node-ininode-is-builtin-module node-isexe node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-noptnode-normalize-package-data node-npmlog node-once node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimrafnode-semver node-sha node-slide node-spdx-correct node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-licensenode-which node-wrappy node-yallist
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:bzip2-doc libbz2-dev libfile-basedir-perl libfile-desktopentry-perl libfile-mimeinfo-perl libipc-system-simple-perl libnet-dbus-perl libpaper-utils libpaper1 libpcre2-16-0libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpcre2-posix0 libreadline-dev libtie-ixhash-perl libx11-protocol-perl libxml-twig-perl libxml-xpathengine-perl r-base-core r-base-devr-base-html r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlmer-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-doc-html r-recommended x11-xserver-utils xdg-utils
Suggested packages:readline-doc libunicode-map8-perl libunicode-string-perl xml-twig-tools elpa-ess r-doc-info | r-doc-pdf r-mathlib texlive-base texlive-latex-base texlive-plain-generictexlive-fonts-recommended texlive-fonts-extra texlive-extra-utils texlive-latex-recommended texlive-latex-extra mozilla | www-browser nickle cairo-5c xorg-docs-core
The following NEW packages will be installed:bzip2-doc libbz2-dev libfile-basedir-perl libfile-desktopentry-perl libfile-mimeinfo-perl libipc-system-simple-perl libnet-dbus-perl libpaper-utils libpaper1 libpcre2-16-0libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpcre2-posix0 libreadline-dev libtie-ixhash-perl libx11-protocol-perl libxml-twig-perl libxml-xpathengine-perl r-base r-base-corer-base-dev r-base-html r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlmer-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-doc-html r-recommended x11-xserver-utils xdg-utils
0 upgraded, 42 newly installed, 0 to remove and 106 not upgraded.
Need to get 50.6 MB of archives.
After this operation, 84.8 MB of additional disk space will be used.
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-amd64) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
W: Target Contents-deb (Contents-all) is configured multiple times in /etc/apt/sources.list:11 and /etc/apt/sources.list:12
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 bzip2-doc all 1.0.6-8.1ubuntu0.2 [294 kB]
Get:2 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 libbz2-dev amd64 1.0.6-8.1ubuntu0.2 [30.0 kB]
Get:3 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-base-core 4.3.3-1.1804.0 [26.9 MB]
Get:4 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libipc-system-simple-perl all 1.25-4 [22.5 kB]
Get:5 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libfile-basedir-perl all 0.07-1 [16.9 kB]
Get:6 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libfile-desktopentry-perl all 0.22-1 [18.2 kB]
Get:7 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libfile-mimeinfo-perl all 0.28-1 [41.4 kB]
Get:8 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libxml-twig-perl all 1:3.50-1 [156 kB]
Get:9 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libnet-dbus-perl amd64 1.1.0-4build2 [176 kB]
Get:10 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libpaper1 amd64 1.1.24+nmu5ubuntu1 [13.6 kB]
Get:11 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libpaper-utils amd64 1.1.24+nmu5ubuntu1 [8,170 B]
Get:12 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libpcre2-16-0 amd64 10.31-2 [169 kB]
Get:13 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libpcre2-32-0 amd64 10.31-2 [160 kB]
Get:14 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libpcre2-8-0 amd64 10.31-2 [179 kB]
Get:15 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libpcre2-posix0 amd64 10.31-2 [5,788 B]
Get:16 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libpcre2-dev amd64 10.31-2 [627 kB]
Get:17 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libreadline-dev amd64 7.0-3 [133 kB]
Get:18 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-boot 1.3-30-1.1804.0 [620 kB]
Get:19 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libtie-ixhash-perl all 1.23-2 [11.2 kB]
Get:20 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libx11-protocol-perl all 0.56-7 [149 kB]
Get:21 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-cluster 2.1.6-1.1804.0 [554 kB]
Get:22 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libxml-xpathengine-perl all 0.14-1 [31.8 kB]
Get:23 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 xdg-utils all 1.1.2-1ubuntu2.5 [60.4 kB]
Get:24 http://mirrors.aliyun.com/ubuntu bionic/main amd64 x11-xserver-utils amd64 7.7+7build1 [159 kB]
Get:25 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-foreign 0.8.86-1.1804.0 [238 kB]
Get:26 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-kernsmooth 2.23-22-1cran1.1804.0 [90.3 kB]
Get:27 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-lattice 0.22-5-1.1804.0 [1,348 kB]                                                                        
Get:28 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-nlme 3.1.163-1.1804.0 [2,268 kB]                                                                          
Get:29 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-matrix 1.6-5-1.1804.0 [3,765 kB]                                                                          
Get:30 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-mgcv 1.9-1-1.1804.0 [3,180 kB]                                                                            
Get:31 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-rpart 4.1.23-1cran1.1804.0 [683 kB]                                                                       
Get:32 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-survival 3.5-8-1.1804.0 [6,146 kB]                                                                        
Get:33 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-mass 7.3-60-2.1804.0 [1,119 kB]                                                                           
Get:34 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-class 7.3-22-2.1804.0 [88.2 kB]                                                                           
Get:35 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-nnet 7.3-19-2.1804.0 [112 kB]                                                                             
Get:36 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-spatial 7.3-11-2.1804.1 [128 kB]                                                                          
Get:37 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-cran-codetools 0.2-19-1cran1.1804.0 [90.7 kB]                                                                  
Get:38 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-recommended 4.3.3-1.1804.0 [2,784 B]                                                                           
Get:39 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-base 4.3.3-1.1804.0 [46.2 kB]                                                                                  
Get:40 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-base-dev 4.3.3-1.1804.0 [4,512 B]                                                                              
Get:41 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-base-html 4.3.3-1.1804.0 [94.3 kB]                                                                             
Get:42 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ r-doc-html 4.3.3-1.1804.0 [595 kB]                                                                               
Fetched 50.6 MB in 14s (3,688 kB/s)                                                                                                                                                 
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package bzip2-doc.
(Reading database ... 127271 files and directories currently installed.)
Preparing to unpack .../00-bzip2-doc_1.0.6-8.1ubuntu0.2_all.deb ...
Unpacking bzip2-doc (1.0.6-8.1ubuntu0.2) ...
Selecting previously unselected package libbz2-dev:amd64.
Preparing to unpack .../01-libbz2-dev_1.0.6-8.1ubuntu0.2_amd64.deb ...
Unpacking libbz2-dev:amd64 (1.0.6-8.1ubuntu0.2) ...
Selecting previously unselected package libipc-system-simple-perl.
Preparing to unpack .../02-libipc-system-simple-perl_1.25-4_all.deb ...
Unpacking libipc-system-simple-perl (1.25-4) ...
Selecting previously unselected package libfile-basedir-perl.
Preparing to unpack .../03-libfile-basedir-perl_0.07-1_all.deb ...
Unpacking libfile-basedir-perl (0.07-1) ...
Selecting previously unselected package libfile-desktopentry-perl.
Preparing to unpack .../04-libfile-desktopentry-perl_0.22-1_all.deb ...
Unpacking libfile-desktopentry-perl (0.22-1) ...
Selecting previously unselected package libfile-mimeinfo-perl.
Preparing to unpack .../05-libfile-mimeinfo-perl_0.28-1_all.deb ...
Unpacking libfile-mimeinfo-perl (0.28-1) ...
Selecting previously unselected package libxml-twig-perl.
Preparing to unpack .../06-libxml-twig-perl_1%3a3.50-1_all.deb ...
Unpacking libxml-twig-perl (1:3.50-1) ...
Selecting previously unselected package libnet-dbus-perl.
Preparing to unpack .../07-libnet-dbus-perl_1.1.0-4build2_amd64.deb ...
Unpacking libnet-dbus-perl (1.1.0-4build2) ...
Selecting previously unselected package libpaper1:amd64.
Preparing to unpack .../08-libpaper1_1.1.24+nmu5ubuntu1_amd64.deb ...
Unpacking libpaper1:amd64 (1.1.24+nmu5ubuntu1) ...
Selecting previously unselected package libpaper-utils.
Preparing to unpack .../09-libpaper-utils_1.1.24+nmu5ubuntu1_amd64.deb ...
Unpacking libpaper-utils (1.1.24+nmu5ubuntu1) ...
Selecting previously unselected package libpcre2-16-0:amd64.
Preparing to unpack .../10-libpcre2-16-0_10.31-2_amd64.deb ...
Unpacking libpcre2-16-0:amd64 (10.31-2) ...
Selecting previously unselected package libpcre2-32-0:amd64.
Preparing to unpack .../11-libpcre2-32-0_10.31-2_amd64.deb ...
Unpacking libpcre2-32-0:amd64 (10.31-2) ...
Selecting previously unselected package libpcre2-8-0:amd64.
Preparing to unpack .../12-libpcre2-8-0_10.31-2_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.31-2) ...
Selecting previously unselected package libpcre2-posix0:amd64.
Preparing to unpack .../13-libpcre2-posix0_10.31-2_amd64.deb ...
Unpacking libpcre2-posix0:amd64 (10.31-2) ...
Selecting previously unselected package libpcre2-dev:amd64.
Preparing to unpack .../14-libpcre2-dev_10.31-2_amd64.deb ...
Unpacking libpcre2-dev:amd64 (10.31-2) ...
Selecting previously unselected package libreadline-dev:amd64.
Preparing to unpack .../15-libreadline-dev_7.0-3_amd64.deb ...
Unpacking libreadline-dev:amd64 (7.0-3) ...
Selecting previously unselected package libtie-ixhash-perl.
Preparing to unpack .../16-libtie-ixhash-perl_1.23-2_all.deb ...
Unpacking libtie-ixhash-perl (1.23-2) ...
Selecting previously unselected package libx11-protocol-perl.
Preparing to unpack .../17-libx11-protocol-perl_0.56-7_all.deb ...
Unpacking libx11-protocol-perl (0.56-7) ...
Selecting previously unselected package libxml-xpathengine-perl.
Preparing to unpack .../18-libxml-xpathengine-perl_0.14-1_all.deb ...
Unpacking libxml-xpathengine-perl (0.14-1) ...
Selecting previously unselected package xdg-utils.
Preparing to unpack .../19-xdg-utils_1.1.2-1ubuntu2.5_all.deb ...
Unpacking xdg-utils (1.1.2-1ubuntu2.5) ...
Selecting previously unselected package r-base-core.
Preparing to unpack .../20-r-base-core_4.3.3-1.1804.0_amd64.deb ...
Unpacking r-base-core (4.3.3-1.1804.0) ...
Selecting previously unselected package r-cran-boot.
Preparing to unpack .../21-r-cran-boot_1.3-30-1.1804.0_all.deb ...
Unpacking r-cran-boot (1.3-30-1.1804.0) ...
Selecting previously unselected package r-cran-cluster.
Preparing to unpack .../22-r-cran-cluster_2.1.6-1.1804.0_amd64.deb ...
Unpacking r-cran-cluster (2.1.6-1.1804.0) ...
Selecting previously unselected package r-cran-foreign.
Preparing to unpack .../23-r-cran-foreign_0.8.86-1.1804.0_amd64.deb ...
Unpacking r-cran-foreign (0.8.86-1.1804.0) ...
Selecting previously unselected package r-cran-kernsmooth.
Preparing to unpack .../24-r-cran-kernsmooth_2.23-22-1cran1.1804.0_amd64.deb ...
Unpacking r-cran-kernsmooth (2.23-22-1cran1.1804.0) ...
Selecting previously unselected package r-cran-lattice.
Preparing to unpack .../25-r-cran-lattice_0.22-5-1.1804.0_amd64.deb ...
Unpacking r-cran-lattice (0.22-5-1.1804.0) ...
Selecting previously unselected package r-cran-nlme.
Preparing to unpack .../26-r-cran-nlme_3.1.163-1.1804.0_amd64.deb ...
Unpacking r-cran-nlme (3.1.163-1.1804.0) ...
Selecting previously unselected package r-cran-matrix.
Preparing to unpack .../27-r-cran-matrix_1.6-5-1.1804.0_amd64.deb ...
Unpacking r-cran-matrix (1.6-5-1.1804.0) ...
Selecting previously unselected package r-cran-mgcv.
Preparing to unpack .../28-r-cran-mgcv_1.9-1-1.1804.0_amd64.deb ...
Unpacking r-cran-mgcv (1.9-1-1.1804.0) ...
Selecting previously unselected package r-cran-rpart.
Preparing to unpack .../29-r-cran-rpart_4.1.23-1cran1.1804.0_amd64.deb ...
Unpacking r-cran-rpart (4.1.23-1cran1.1804.0) ...
Selecting previously unselected package r-cran-survival.
Preparing to unpack .../30-r-cran-survival_3.5-8-1.1804.0_amd64.deb ...
Unpacking r-cran-survival (3.5-8-1.1804.0) ...
Selecting previously unselected package r-cran-mass.
Preparing to unpack .../31-r-cran-mass_7.3-60-2.1804.0_amd64.deb ...
Unpacking r-cran-mass (7.3-60-2.1804.0) ...
Selecting previously unselected package r-cran-class.
Preparing to unpack .../32-r-cran-class_7.3-22-2.1804.0_amd64.deb ...
Unpacking r-cran-class (7.3-22-2.1804.0) ...
Selecting previously unselected package r-cran-nnet.
Preparing to unpack .../33-r-cran-nnet_7.3-19-2.1804.0_amd64.deb ...
Unpacking r-cran-nnet (7.3-19-2.1804.0) ...
Selecting previously unselected package r-cran-spatial.
Preparing to unpack .../34-r-cran-spatial_7.3-11-2.1804.1_amd64.deb ...
Unpacking r-cran-spatial (7.3-11-2.1804.1) ...
Selecting previously unselected package r-cran-codetools.
Preparing to unpack .../35-r-cran-codetools_0.2-19-1cran1.1804.0_all.deb ...
Unpacking r-cran-codetools (0.2-19-1cran1.1804.0) ...
Selecting previously unselected package r-recommended.
Preparing to unpack .../36-r-recommended_4.3.3-1.1804.0_all.deb ...
Unpacking r-recommended (4.3.3-1.1804.0) ...
Selecting previously unselected package r-base.
Preparing to unpack .../37-r-base_4.3.3-1.1804.0_all.deb ...
Unpacking r-base (4.3.3-1.1804.0) ...
Selecting previously unselected package r-base-dev.
Preparing to unpack .../38-r-base-dev_4.3.3-1.1804.0_all.deb ...
Unpacking r-base-dev (4.3.3-1.1804.0) ...
Selecting previously unselected package r-base-html.
Preparing to unpack .../39-r-base-html_4.3.3-1.1804.0_all.deb ...
Unpacking r-base-html (4.3.3-1.1804.0) ...
Selecting previously unselected package r-doc-html.
Preparing to unpack .../40-r-doc-html_4.3.3-1.1804.0_all.deb ...
Unpacking r-doc-html (4.3.3-1.1804.0) ...
Selecting previously unselected package x11-xserver-utils.
Preparing to unpack .../41-x11-xserver-utils_7.7+7build1_amd64.deb ...
Unpacking x11-xserver-utils (7.7+7build1) ...
Setting up libpaper1:amd64 (1.1.24+nmu5ubuntu1) ...Creating config file /etc/papersize with new version
Setting up r-cran-boot (1.3-30-1.1804.0) ...
Setting up libpaper-utils (1.1.24+nmu5ubuntu1) ...
Setting up libbz2-dev:amd64 (1.0.6-8.1ubuntu0.2) ...
Setting up libxml-twig-perl (1:3.50-1) ...
Setting up libipc-system-simple-perl (1.25-4) ...
Setting up libfile-basedir-perl (0.07-1) ...
Setting up r-cran-lattice (0.22-5-1.1804.0) ...
Setting up r-cran-nlme (3.1.163-1.1804.0) ...
Setting up r-cran-foreign (0.8.86-1.1804.0) ...
Setting up libtie-ixhash-perl (1.23-2) ...
Setting up libnet-dbus-perl (1.1.0-4build2) ...
Setting up libfile-desktopentry-perl (0.22-1) ...
Setting up bzip2-doc (1.0.6-8.1ubuntu0.2) ...
Setting up libreadline-dev:amd64 (7.0-3) ...
Setting up x11-xserver-utils (7.7+7build1) ...
Setting up libx11-protocol-perl (0.56-7) ...
Setting up libxml-xpathengine-perl (0.14-1) ...
Setting up libpcre2-8-0:amd64 (10.31-2) ...
Setting up libpcre2-32-0:amd64 (10.31-2) ...
Setting up xdg-utils (1.1.2-1ubuntu2.5) ...
Setting up libfile-mimeinfo-perl (0.28-1) ...
Setting up libpcre2-16-0:amd64 (10.31-2) ...
Setting up r-cran-cluster (2.1.6-1.1804.0) ...
Setting up r-doc-html (4.3.3-1.1804.0) ...
Setting up r-cran-matrix (1.6-5-1.1804.0) ...
Setting up r-base-core (4.3.3-1.1804.0) ...Creating config file /etc/R/Renviron with new version
Setting up r-cran-kernsmooth (2.23-22-1cran1.1804.0) ...
Setting up r-cran-nnet (7.3-19-2.1804.0) ...
Setting up r-cran-mgcv (1.9-1-1.1804.0) ...
Setting up r-cran-rpart (4.1.23-1cran1.1804.0) ...
Setting up r-base-html (4.3.3-1.1804.0) ...
Setting up r-cran-spatial (7.3-11-2.1804.1) ...
Setting up libpcre2-posix0:amd64 (10.31-2) ...
Setting up r-cran-mass (7.3-60-2.1804.0) ...
Setting up r-cran-survival (3.5-8-1.1804.0) ...
Setting up r-cran-codetools (0.2-19-1cran1.1804.0) ...
Setting up r-cran-class (7.3-22-2.1804.0) ...
Setting up libpcre2-dev:amd64 (10.31-2) ...
Setting up r-recommended (4.3.3-1.1804.0) ...
Setting up r-base-dev (4.3.3-1.1804.0) ...
Setting up r-base (4.3.3-1.1804.0) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for tex-common (6.09) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcudadebugger.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcudadebugger.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcudadebugger.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.515.105.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.535.154.05 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.535.129.03 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-pkcs11.so.535.161.07 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcudadebugger.so.525.125.06 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.515.65.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.455.45.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.460.73.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.455.45.01 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.460.73.01 is empty, not checked.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

三、验证是否安装成功

要验证 R 是否成功安装,你可以通过以下步骤在终端中进行验证:

启动 R:在终端中输入以下命令启动 R:

R

检查版本号:一旦 R 启动,你将看到 R 的命令行界面。在命令行界面中,输入以下命令以检查 R 的版本号:

sessionInfo()

这将显示有关你安装的 R 版本的详细信息,包括 R 的版本号、操作系统信息等。

运行简单的 R 命令:你可以尝试运行一些简单的 R 命令来验证 R 是否能够正常工作。例如,你可以尝试计算一些简单的数学运算,如:

2 + 2

如果 R 成功安装并正常工作,你应该会得到正确的结果,即 4。

退出 R:完成验证后,你可以输入以下命令退出 R:
R

quit()

按下回车键即可退出 R。

操作记录:

(tfv1) root@98031e181845:/data/myapp2024/myBigDataApplicationDevelopment# RR version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.Natural language support but running in an English localeR is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.> sessionInfo()
Warning: Your system is mis-configured: ‘/etc/localtime’ is not a symlink
Warning: It is strongly recommended to set envionment variable TZ to ‘localtime’ (or equivalent)
R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTSMatrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so;  LAPACK version 3.7.1locale:[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       time zone: localtime
tzcode source: system (glibc)attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     loaded via a namespace (and not attached):
[1] compiler_4.3.3

以上操作补充说明:已经成功地启动了 R 会话,并且显示了一些有关你系统配置的警告信息。R 提示你的系统时间配置存在问题,并建议你将环境变量 TZ 设置为 ‘localtime’。这可以通过设置环境变量来解决,例如:

export TZ=localtime

你可以将上述命令添加到你的 ~/.bashrc 文件中,以便每次登录时都自动设置。

此外,R 还显示了会话信息,其中包含了 R 的版本信息、操作系统信息、已加载的基础包等。

看起来一切都正常运行,你现在可以开始在 R 中进行编程和数据分析了。如果你有任何进一步的问题或需要帮助,请随时告诉我。

四、安装Rstudio

接下来安装Rstudio:

1)sudo apt-get install gdebi-core

2)wget https://download2.rstudio.org/rstudio-server-1.1.456-amd64.deb

3)sudo gdebi rstudio-server-1.1.456-amd64.deb

4)然后输入http://你的服务器ip:8787进行登录。你的IP地址获取方式:终端输入ifconfig -a命令
5)其中inet:后面即为IP地址。在显示的界面上登录即可。

6)若还有问题sudo rstudio-server verify-installation命令查看。

操作记录:

wget https://download2.rstudio.org/rstudio-server-1.1.456-amd64.deb
--2024-04-18 00:07:51--  https://download2.rstudio.org/rstudio-server-1.1.456-amd64.deb
Resolving download2.rstudio.org (download2.rstudio.org)... 3.164.143.18, 3.164.143.42, 3.164.143.9, ...
Connecting to download2.rstudio.org (download2.rstudio.org)|3.164.143.18|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 63553606 (61M) [application/x-deb]
Saving to: ‘rstudio-server-1.1.456-amd64.deb’rstudio-server-1.1.456-amd64.deb              100%[==============================================================================================>]  60.61M  6.44MB/s    in 15s     2024-04-18 00:08:07 (4.09 MB/s) - ‘rstudio-server-1.1.456-amd64.deb’ saved [63553606/63553606](tfv1) root@98031e181845:/data/myapp2024/myR# ls
rstudio-server-1.1.456-amd64.deb
(tfv1) root@98031e181845:/data/myapp2024/myR# sudo gdebi rstudio-server-1.1.456-amd64.deb
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... DoneRStudio ServerRStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, and workspace management.
Do you want to install the software package? [y/N]:y
Selecting previously unselected package rstudio-server.
(Reading database ... 130110 files and directories currently installed.)
Preparing to unpack rstudio-server-1.1.456-amd64.deb ...
Unpacking rstudio-server (1.1.456) ...
Setting up rstudio-server (1.1.456) ...
groupadd: group 'rstudio-server' already exists

补充说明ubuntu22.04安装方法:

sudo apt install r-base-core
sudo apt-get install gdebi-core
sudo wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.02.3-492-amd64.deb
sudo gdebi rstudio-server-2022.02.3-492-amd64.deb

登录测试:本机IP:8787

或者127.0.0.1:8787

在这里插入图片描述

五、可视化操作

当你已经成功配置了 RStudio Server 并安装了 R 语言环境后,你可以使用各种 R 语言的数据可视化库来创建图表和可视化效果。下面是一个简单的示例,演示如何使用 ggplot2 包创建一个散点图:

首先,确保你已经安装了 ggplot2 包。如果没有安装,可以使用以下命令在 RStudio 中安装:

install.packages("ggplot2")

创建示例数据集。我们使用内置的 mtcars 数据集,它包含了32种不同汽车的性能数据。

# 加载 mtcars 数据集
data(mtcars)

使用 ggplot2 创建一个散点图。以下是一个简单的示例,绘制了汽车的里程数(mpg)和排气量(disp)之间的关系:

library(ggplot2)
# 创建散点图
ggplot(mtcars, aes(x = mpg, y = disp)) +geom_point() +labs(title = "汽车里程数与排气量关系", x = "里程数 (mpg)", y = "排气量 (disp)")

这段代码会生成一个散点图,其中 x 轴表示汽车的里程数(mpg),y 轴表示汽车的排气量(disp)。每个点代表一个汽车,其位置由 mpg 和 disp 决定。

在这里插入图片描述

也可以使用:加载一个示例数据集。R 语言内置了一些示例数据集,其中之一是 iris 数据集,包含了鸢尾花的花萼和花瓣的尺寸以及它们的类别。

# 加载 iris 数据集
data(iris)

接下来,让我们使用 ggplot2 包来绘制一个简单的散点图,展示鸢尾花花瓣长度和宽度之间的关系,并根据鸢尾花的种类进行着色。

# 加载 ggplot2 包
library(ggplot2)# 创建散点图
ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Species)) +geom_point() +labs(title = "鸢尾花花瓣长度与宽度关系", x = "花瓣长度", y = "花瓣宽度") +theme_minimal()

这段代码将创建一个散点图,横坐标为花瓣长度,纵坐标为花瓣宽度,不同种类的鸢尾花将以不同的颜色显示。你可以在 RStudio 中运行这些代码,并观察生成的可视化图形。

在这里插入图片描述

参考:https://www.cnblogs.com/liujiaxin2018/p/16373801.html

参考

https://blog.csdn.net/qq_43126480/article/details/1030579275
https://www.cnblogs.com/djx571/p/9372011.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/265.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SQL --索引

索引 INDEX 伪列 伪装起来的列&#xff0c;不容易被看见&#xff0c;要特意查询才能看见 ROWNUM&#xff1a; 是对查询结果自动生成的一组连续的自然数序号。 SELECT emp.*,ROWNUM FROM emp例题&#xff1a;查询emp表中&#xff0c;前三个员工 SELECT * FROM * from emp w…

【创建型模式】建造者模式

一、建造者模式概述 建造者模式定义&#xff1a;将一个复杂对象的构建与它的表示分离&#xff0c;使得同样的构建过程可以创建不同得表示。(对象创建型模式)。 建造者模式分析&#xff1a; 1.将客户端与包含多个部件得复杂对象得创建过程分离&#xff0c;客户端无需知道复杂对象…

【unity】【C#】游戏音乐播放和发布

今天我们来认识一下有关 unity 音乐的一些知识 我们先创建 AudioClips 文件夹&#xff0c;这个文件夹通常就是 unity 中存放音乐的文件夹&#xff0c;然后拖进音乐文件进去 这里为大家提供了两个音乐&#xff0c;有需要可以自取 百度网盘&#xff1a;https://pan.baidu.com/s…

RIP最短路实验(华为)

思科设备参考&#xff1a;RIP最短路实验&#xff08;思科&#xff09; 一&#xff0c;技术简介 RIP&#xff08;Routing Information Protocol&#xff0c;路由信息协议&#xff09;是一种基于距离矢量的内部网关协议&#xff0c;工作原理是每个路由器周期性地向邻居路由器发…

React Ant Design 简单实现如何选中图片

效果&#xff1a; 代码&#xff1a; 定义的初始值和方法 const [selected, setSelected] useState(0); // 表示当前选中的图片索引const handleClick (index) > {if (selected index) {setSelected(null); // 如果点击的是已选中的图片&#xff0c;则取消选中状态} else…

JVM虚拟机(十)Java内存泄漏的排查思路

目录 一、可能产生内存泄露的地方二、复现堆内存泄漏三、如何排查堆内存问题&#xff1f;3.1 获取对内存快照 dump3.2 使用 Visual VM 去分析 dump 文件3.3 定位内存溢出问题 一、可能产生内存泄露的地方 在进行排查 Java 的内存泄漏问题之前&#xff0c;首先我们要知道哪里可…

【任务调度】Apache DolphinScheduler快速入门

Apache DolphinScheduler基本概念 概念&#xff1a;分布式、去中心化、易扩展的可视化DAG工作流任务调度系统。 作用&#xff1a;解决数据处理流程中错综复杂的依赖关系&#xff0c;使调度系统在数据处理流程中开箱即用。Apache DolphinScheduler是一款开源的调度工具&#xff…

windows下python opencv ffmpeg读取摄像头实现rtsp推流 拉流

windows下python opencv ffmpeg读取摄像头实现rtsp推流 拉流 整体流程1.下载所需文件1. 1下载rtsp推流服务器1.2 下载ffmpeg2. 开启RTSP服务器3. opencv 读取摄像头并调用ffmpeg进行推流4. opencv进行拉流整体流程 1.下载所需文件 1. 1下载rtsp推流服务器 下载 RTSP服务器 下…

jenkins 部署 vue 项目

jenkins 部署 vue 项目 环境 系统&#xff1a;CentOS7.9 Jenkins&#xff1a;最新LTS版本 nginx: 1.24.x gitLab: 打包机&#xff1a;jenkins所在服务器 目标机器&#xff1a;nginx所在服务器 jenkins部署配置 关键脚本 #node -v #已经安装node_module就无需执行install安…

虚拟现实(VR)开发框架

虚拟现实&#xff08;VR&#xff09;开发框架为开发者提供了构建VR应用程序所需的基本工具和功能。它们通常包括3D引擎、场景图、输入系统、音频系统和网络功能。下面是一些流行的VR开发框架。北京木奇移动技术有限公司&#xff0c;专业的软件外包开发公司&#xff0c;欢迎交流…

怎样实现opc采集数据后传给web后端

现在很多老工厂要进行数字化改造&#xff0c;现场生产的各种数据需要传到web后端&#xff0c;很多工厂现场原有的自动监控系统已经采集了现场的各种数据&#xff0c;只是没有形成联网。如果前端自动化系统全部废除&#xff0c;重新做数字化控制系统&#xff0c;成本投入太大&am…

hexo实现个人博客及涉及的技术学习

一、背景 最近,一直想做一个属于自己的网站.可以从零开始搭建一个网站,顺便可以把日常中学到的技术用于实战,还可以顺便记录自己的所思所感,记录成长的过程. 方案 一开始的方案是从零开始,模仿常见个人博客的设计,基于vueSpringbootMySQL的去实现网站. 新建项目之后,发现vu…

线上线下交友社区系统 可打包小程序 支持二开 源码交付!

社交网络的普及&#xff0c;人们交友的方式发生了巨大的变化。过去&#xff0c;我们主要通过线下的方式来结识新朋友&#xff0c;比如在学校、工作场所、社交活动或者兴趣小组中。然而&#xff0c;随着移动端软件的发展&#xff0c;线上交友也逐渐变得流行。 方便性&#xff1a…

deepspeed笔记

文章目录 一、deepspeed是什么&#xff1f;二、能训多大的模型&#xff0c;耗时如何&#xff1f;三、RLHF训练流程四、通信策略 一、deepspeed是什么&#xff1f; 传统的深度学习&#xff0c;模型训练并行&#xff0c;是将模型参数复制多份到多张GPU上&#xff0c;只将数据拆分…

java可盈保险合同管理系统的设计与实现(springboot+mysql源码+文档)

风定落花生&#xff0c;歌声逐流水&#xff0c;大家好我是风歌&#xff0c;混迹在java圈的辛苦码农。今天要和大家聊的是一款基于springboot的可盈保险合同管理系统。项目源码以及部署相关请联系风歌&#xff0c;文末附上联系信息 。 项目简介&#xff1a; 基于Spring Boot的…

[蓝桥杯 | 暴搜] 学会暴搜之路

虽然会调侃蓝桥杯是暴力求解的&#xff0c;但是本弱弱不会搜&#xff0c;不知道如何搜&#xff0c;于是写下这篇碎碎念&#xff0c;记录看到过的&#xff0c;惊艳自己的暴搜。 小总结 题目特征&#xff1a;很复杂的排列组合 说是暴力&#xff0c;其实就是枚举罢了&#xff0…

CTF中常见的四种python逆向

说在前面&#xff1a; 什么是pyc文件&#xff1f; pyc是一种二进制文件&#xff0c;是由py文件经过编译后&#xff0c;生成的文件&#xff0c;是一种byte code&#xff0c;py文件变成pyc文件后&#xff0c;加载的速度有所提高&#xff0c; pyc 文件是 Python 编译过的字节码文…

大屏数字字体+渐变色

vue数据大屏使用数字字体_vue数字字体-CSDN博客 用css实现文字字体颜色渐变的三种方法_css 字体颜色渐变-CSDN博客

OpenHarmony多媒体-ijkplayer

简介 ijkplayer是OpenHarmony环境下可用的一款基于FFmpeg的视频播放器。 演示 编译运行 1、通过IDE工具下载依赖SDK&#xff0c;Tools->SDK Manager->OpenHarmony SDK 把native选项勾上下载&#xff0c;API版本>9 2、开发板选择RK3568&#xff0c;ROM下载地址. 选择…

美女视频素材无水印哪里找?四个顶级资源站点

寻找高质量的美女视频素材无水印对于制作引人注目的视频内容至关重要。如果你正困惑于“美女视频素材无水印哪里找”&#xff0c;以下是四个提供优秀无水印美女视频素材的网站&#xff0c;可以满足你的各种创作需求。 蛙学网&#xff1a;多样化的美女视频素材 首先推荐的是蛙…