type
status
date
slug
summary
tags
category
icon
password

0、R与Rstudio的关系

R提供了语言环境,它提供了R的语法规则,编译,扩展包等信息。如果只用它自带的软件包来编写和调试R脚本的话,既耗时又费力,甚至不具有开发完整项目的条件。 所以,Rstudio提供了一个人性化的可视界面来操作R语言。在软件里可以创建完整的项目,编写脚本,查看变量值,获取绘图的结果等等。 打个比方,如果R是马,那么Rstudio就是马鞍。直接骑马的话也可以,但是人们不怎么舒服,如果加上马鞍,不仅美观漂亮而且还能提高效率。

一、R下载及安装

1.下载

  • https://cran.r-project.org/mirrors.html
  • 选择清华的TUNA镜像
notion image
mark
  • 根据需要选择下载,以windows下载为例
notion image
mark
  • 选择base
notion image
mark
  • 点击下载
notion image
mark

2.安装

  • 确定
notion image
mark
  • Next
notion image
mark
  • 选安装目录时候,需要注意没必要安装在C盘,后续安装包会占用资源。建议在其他盘创建目录,然后以R版本号命名的方式安装R。 比如我在E盘下的R目录:
notion image
mark
notion image
mark
  • Next
notion image
mark
  • Next
notion image
mark
  • Finish,安装完成
notion image
mark

二、Rstudio下载及安装

1.下载

  • https://rstudio.com/products/rstudio/download
notion image
mark
  • 这里以安装window版为例
notion image
mark

2.安装

  • 下一步
notion image
mark
  • 与安装R一样,设置一个以版本命名的文件夹,比如我的是E:\R\Rstudio1.2.5\RStudio
notion image
mark
  • 安装
notion image
mark
  • 安装完成
notion image
mark
  • 安装好,会在任务栏中显示Rstudio的图标
notion image
mark

3.配置

  • 进入配置
notion image
mark
  • 设置目录
notion image
mark
  • Browser
notion image
mark
  • 这里需要注意,选择你刚刚设置的安装目录即可,比如我的是E:\R\R-3.6.1
notion image
mark
  • 选择后,会出现在列表中,选中该版本的R,点击Ok
notion image
mark
  • 出现重启Rstudio,设置完成
notion image
mark
  • 测试下,如果显示出Hello World,说明我们的设置没问题
notion image
 
Windows11安装Ubuntu 20.04.3 LTS双系统(详细过程)Docker 常用命令
Loading...