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

news2024/11/24 6:36:54

目录

  • 一、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-match
  node-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-data
  node-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-ini
  node-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-nopt
  node-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-rimraf
  node-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-license
  node-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-match
  node-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-data
  node-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-ini
  node-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-nopt
  node-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-rimraf
  node-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-license
  node-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-0
  libpcre2-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-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-nlme
  r-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-generic
  texlive-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-0
  libpcre2-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-core
  r-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-nlme
  r-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# R

R 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 locale

R 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 LTS

Matrix 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.1

locale:
 [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... Done

RStudio Server
 RStudio 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.coloradmin.cn/o/1606685.html

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

相关文章

《Kubernetes部署篇:基于Kylin V10+ARM架构CPU+外部etcd使用containerd部署K8S 1.26.15容器版集群(多主多从)》

总结&#xff1a;整理不易&#xff0c;如果对你有帮助&#xff0c;可否点赞关注一下&#xff1f; 更多详细内容请参考&#xff1a;企业级K8s集群运维实战 1、在当前实验环境中安装K8S1.25.14版本&#xff0c;出现了一个问题&#xff0c;就是在pod中访问百度网站&#xff0c;大…

通过修改注册表,允许Windows电脑使用USB

在Windows操作系统中&#xff0c;如果您需要通过修改注册表来启用或允许USB存储设备的读写权限&#xff0c;通常涉及到更改与USB存储类驱动相关的服务启动类型。下面是大致步骤&#xff1a; 启用USB存储设备&#xff1a; 打开注册表编辑器&#xff08;按 Win R 键&#xff0c;…

Mac中隐私安全性设置-打开任何来源

文章目录 **Mac中隐私安全性设置-打开任何来源**一、目的二、打开方式 Mac中隐私安全性设置-打开任何来源 一、目的 从外部下载的软件频繁打不开&#xff0c;需要从隐私安全性中重新选择一下&#xff1b;默认Mac隐藏了任何来源 二、打开方式 打开终端&#xff0c;输入一下命…

LabVIEW卡尔曼滤波技术

LabVIEW卡尔曼滤波技术 在现代航空导航中&#xff0c;高精度和快速响应的方位解算对于航空安全至关重要。通过LabVIEW平台实现一种卡尔曼滤波方位解算修正技术&#xff0c;以改善传统导航设备在方位解算中的噪声干扰问题&#xff0c;从而提高其解算精度和效率。通过LabVIEW的强…

广告智能投放工具oCPM 计费方式演进

广告计费方式概览 在互联网发展的二十年里&#xff0c;互联网广告的计费方式从 CPT&#xff08;时间&#xff09;开始&#xff0c;总共发生了三次较大的迭代进化&#xff0c;大致分为 CPM&#xff08;曝光&#xff09;、CPC&#xff08;点击&#xff09;和 oCPM&#xff08;目…

工作流JBPM操作API删除流程部署流程

文章目录 8.3 删除流程定义8.3.1 按照id删除(有关联信息会抛异常)8.3.2 按照id删除(会删除关联信息)8.3.3 按照key删除 8.4 获取部署时的文件资源8.4.1 获取部署时的文件资源方式18.4.2 获取部署时的文件资源方式2 8.3 删除流程定义 删除流程定义可以按照id和key删除。 8.3.1…

#LLM入门|RAG#3.5_基于文档的问答

大语言模型&#xff08;LLM&#xff09;构建的问答系统&#xff0c;通过整合用户文档&#xff0c;提供个性化和专业化回答。系统可检索内部文档或产品说明书&#xff0c;结合语言模型生成精准答案。 这种方法让语言模型利用外部文档专业信息&#xff0c;显著提升回答的质量和适…

计算机系统基础知识总结

一、计算机系统概述 计算系统可以分为硬件和软件两部分。硬件主要有中央处理器、存储器、输入和输出设备组成&#xff1b;软件由系统软件和应用软件组成。 冯诺依曼计算机体系&#xff1a;将硬件划分为&#xff1a;输入、输出、运算器、存储器、控制器五部分。 中央处理器&…

【计算机毕业设计】学习平台功能介绍——后附源码

&#x1f389;**欢迎来到我的技术世界&#xff01;**&#x1f389; &#x1f4d8; 博主小档案&#xff1a; 一名来自世界500强的资深程序媛&#xff0c;毕业于国内知名985高校。 &#x1f527; 技术专长&#xff1a; 在深度学习任务中展现出卓越的能力&#xff0c;包括但不限于…

工作流JBPM操作API办理任务流程变量

文章目录 8.7 办理任务8.7.1 办理个人任务8.7.2 办理个人组任务 8.8 驳回任务8.9 流程变量8.9.2 设置流程变量8.9.3 获取流程变量 8.7 办理任务 8.7.1 办理个人任务 办理前数据表中&#xff1a; 办理任务&#xff1a; // 办理个人任务 Test public void comPeletePersonTas…

荣誉 | 人大金仓获评轨交行业“智慧运维优秀应用案例”

4月12日至13日&#xff0c;2024&#xff08;第八届&#xff09;中国城市轨道交通智慧运维大会在成都顺利举行。会上&#xff0c;人大金仓以其在轨交行业的卓越贡献和创新实践&#xff0c;获评“智慧运维优秀应用案例”。公司副总裁梁红凤出席大会并发表了题为“打造世界一流的数…

K8s: 关于Kubernetes中的Pod的创建,实现原理,Job调度pod以及pod网络

Pod 概述 Pod 是最小部署的单元&#xff0c;Pod里面是由一个或多个容器组成&#xff0c;也就是一组容器的集合一个pod中的容器是共享网络命名空间&#xff0c;每个Pod包含一个或多个紧密相关的用户业务容器Pod 是 k8s 系统中可以创建和管理的最小单元是资源对象模型中由用户创…

[开发日志系列]PDF图书在线系统20240415

20240414 Step1: 创建基础vueelment项目框架[耗时: 1h25min(8:45-10:10)] 检查node > 升级至最新 (考虑到时间问题,没有使用npm命令行执行,而是觉得删除重新下载最新版本) > > 配置vue3框架 ​ 取名:Online PDF Book System 遇到的报错: 第一报错: npm ERR! …

Visual Studio调试C/C++指南

1. 前言 Visual Studio&#xff08;VS&#xff09;是微软开发的一款集成开发环境(IDE)软件&#xff0c;支持C/C、C#、VB、Python等开发语言&#xff0c;开发桌面、Web等应用程序。VS功能极其强大&#xff0c;使用极其便利&#xff0c;用户数量最多&#xff0c;被誉为"宇宙…

Python进阶编程 --- 3.闭包、装饰器、设计模式、多线程、网络编程、正则表达式、递归

文章目录 第三章&#xff1a;3.1 闭包3.2 装饰器语法糖写法 3.3 设计模式3.3.1 单例模式3.3.2 工厂模式 3.4 多线程3.4.1 进程、线程和并行执行3.4.2 多线程编程 3.5 网络编程3.5.1 Socket3.5.2 服务端开发3.5.3 客户端开发 3.6 正则表达式3.6.1 基础匹配3.6.2 元字符匹配单字符…

DevOps(八)Jenkins的Maven和Git插件

一、Maven简介 Maven是一个构建生命周期管理和理解工具&#xff0c;用于Java项目。它提供了标准化的构建流程&#xff0c;并简化了从项目编译到文档生成等各种构建方面的管理。 Maven是由Apache软件基金会开发和维护的一个流行的项目管理工具。它的设计目的是简化Java项目的构…

基于深度学习的光场超分辨率算法综述

摘要&#xff1a;光场图像分辨率低的原因之一是光场空间分辨率和角度分辨率之间存在相互制约。光场超分辨率技术旨在从低分辨率光场图像中重建出高分辨率光场图像。基于深度学习的光场超分辨率方法通过学习高、低分辨率光场图像之间的映射关系来提升图像的质量&#xff0c;突破…

三级等保安全解决方案——实施方案

实施方案设计 本方案将依照国家有关信息安全建设的一系列法规和政策&#xff0c;为电台建立体系完整、安全功能强健、系统性能优良的网络安全系统。以“统一规划、重点明确、合理建设、逐步强化”为基本指导原则。根据电台网络系统不同信息的重要性调整保护策略&#xff0c;不欠…

OpenHarmony网络组件-Mars

项目简介 Mars 是一个跨平台的网络组件&#xff0c;包括主要用于网络请求中的长连接&#xff0c;短连接&#xff0c;是基于 socket 层的解决方案&#xff0c;在网络调优方面有更好的可控性&#xff0c;暂不支持HTTP协议。 Mars 极大的方便了开发者的开发效率。 效果演示 编译…

【数学】推荐一种用尺规绘制正五边形,简单而又精确的作法

【说明】 正五边形的尺规作图方法很多&#xff0c;但大多比较繁琐&#xff0c;下面介绍一种作法&#xff0c;这种方法步骤少&#xff0c;简便易行。 【具体步骤】 1.作相互垂直的两条直线&#xff0c;交点为O&#xff1b; 2.以O为圆心作圆&#xff0c;交横线与AB两点&#…