前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >生信入门 第四天

生信入门 第四天

原创
作者头像
用户11153857
发布2024-06-10 15:08:36
960
发布2024-06-10 15:08:36
举报
文章被收录于专栏:生信星球学习小组170

This is my day 4 homework of BIC by 生信星球.

The content for today is the introduction of R and R studio.

1. Installation of R project and R studio

Watch the tutorial video on bilibli: https://www.bilibili.com/video/BV1J44y1R7ci/?share_source=copy_web&vd_source=ba670d5a7ca081b044384f15866b88ef

All done.

an interesting exaple of r application:

代码语言:R
复制
plot(rnorm(50))  
#plot() is a default scatterplot function in r. 
#rnorm() generates n random numbers from a normal distribution with the mean and sd you specify. 

another example:

代码语言:R
复制
boxplot(iris$Sepal.Length~iris$Species,col = c("lightblue","lightyellow","lightpink"))

2. Change the appearence

Tools -> Appearence->Global options

3. Basic opereation of R

3.1 Managing working directory

Read a previous paper for this point.

https://mp.weixin.qq.com/s/G-LXN9P2HVLv9v0cvyFJMA

代码语言:R
复制
setwd() #设置工作目录
getwd() #查看工作目录

3.2 Show the list of files

代码语言:R
复制
> dir()             
> list.files()

3.3 Mathematic calculation

add, minus, multiple, divide, and log (skip).

3.4 create variable

syntax: <-

代码语言:R
复制
x <- 1+2

my question is what is the difference between <- and =?

3.5 delete variable

example:

代码语言:R
复制
a <- 5 #赋值 a
b <- 18 #赋值b
c <- 26 #赋值c
u <- a + b #赋值u
rm(b)  #删除 b
rm(u,c)  #删除 u,c
rm(list = ls()) #清空所有变量

tips: tab key for filling in the rest of command or file name as far as it can automatically.

3.6 check the history of commands

代码语言:R
复制
history()

3.7 clean the console

fast keys:

ctrl + l

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. Installation of R project and R studio
  • 2. Change the appearence
  • 3. Basic opereation of R
    • 3.1 Managing working directory
      • 3.2 Show the list of files
        • 3.3 Mathematic calculation
          • 3.4 create variable
            • 3.5 delete variable
              • 3.6 check the history of commands
                • 3.7 clean the console
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档