当前位置:网站首页>[R language] [1] beginners learn the grammar of R language and edit it with rstudio
[R language] [1] beginners learn the grammar of R language and edit it with rstudio
2022-07-27 21:09:00 【Su Nianxin】
Preface
I think R Ranking so high , mapping It's very nice , I'm going to learn , In the future, I will use this thing to process data and draw graphs
\;\\\;\\\;
Knock anything
Type a few lines of code first , Whatever it means
a=rnorm(100)
plot(a)
print(' I'm Yi Shijun ')
h <- c(1,2,3,4,5,6)
M <- c("A","B","C","D","E","F")
barplot(
h,
names.arg=M,
xlab="X",
ylab="Y",
col="#00c0c9",
main="Chart",
border="#fdcb6e"
)
C1 <- c(1,2,3,4)
C2 <- c(1,2,3,4)
C3 <- c(1,2,3,4)
C4 <- c(1,2,3,4)
C5 <- c(1,2,3,4)
mydata_frame <- data.frame(C1,C2,C3,C4,C5)
View(mydata_frame)


I still don't know how to configure launch.json, Or not vscode 了 . Use Rstudio To write R The language code
\;\\\;\\\;
Basic grammar and operation
= Left assignment
<- Left assignment ( A l t − Alt \quad - Alt− )
<<- Left assignment
-> Right assignment
->> Right assignment
Operation point Source( C t r l A l t R Ctrl \quad Alt \quad R CtrlAltR)
Multiline comment C t r l S h i f t C Ctrl \quad Shift \quad C CtrlShiftC
Copy and paste a line ( C t r l S h i f t D Ctrl \quad Shift \quad D CtrlShiftD)
c() Is to turn several values into a list
restart R( C t r l S h i f t F 10 Ctrl \quad Shift \quad F10 CtrlShiftF10)
String concatenation :s=cat(1,"cat",'dog',2)
Wrap a piece of code into a function : C t r l A l t X Ctrl \quad Alt \quad X CtrlAltX
try <- function() {
s=cat(1,"cat",'dog',2)
}
Clear the console : C t r l L Ctrl \quad L CtrlL
\;\\\;\\\;
Data and Value window
nums <- rnorm(100) #100 A random number
mat <- matrix(nums,ncol=2) # Split into two columns
means <- Matrix::colMeans(mat) # averaging


data and value Is the difference between the vector Format variables are placed in values below , Other things like matrix、dataframe、factor、list、arrary Format variables are placed in data
\;\\\;\\\;
Pipeline functions
%>%
( C t r l S h i f t M Ctrl \quad Shift \quad M CtrlShiftM , Also turn off the shortcut key of the input method )
rnorm(100) %>% matrix(ncol=2) %>% Matrix::colMeans()
The result of the previous function is the first parameter of the next function
\;\\\;\\\;
边栏推荐
- Qt opengl 让物体在关照下动起来,形成动画
- 认识传输介质通信方式
- [Numpy] 广播机制(Broadcast)
- sscanf 导致地址越界
- opencv实现图片裁剪和缩放
- How to translate the address in the program?
- R语言使用epiDisplay包的lroc函数可视化logistic回归模型的ROC曲线并输出诊断表(diagnostic table)、可视化多条ROC曲线、使用legend函数为可视化图像添加图例
- 人脸识别5.1- insightface人脸检测模型训练实战笔记
- Overview of understanding the physical layer of transmission media
- R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组加和值(sum)
猜你喜欢

go --- air自动重新编译

一文读懂Plato&nbsp;Farm的ePLATO,以及其高溢价缘由
![重复的DNA序列[hash判定重复+滑动窗口+二进制编码之位运算]](/img/ed/6f4da22e86b44935fc84e3b4901c48.png)
重复的DNA序列[hash判定重复+滑动窗口+二进制编码之位运算]
![[dart] a programming language for cross end development](/img/e1/1167a322bb9f276f2e00fb12414d17.png)
[dart] a programming language for cross end development

Recommend a powerful search tool listary

LeetCode每日一练 —— 21. 合并两个有序链表

LeetCode每日一练 —— 206. 反转链表

Hcip day 5

Uncaught SyntaxError: redeclaration of let page

Hexagon_ V65_ Programmers_ Reference_ Manual(7)
随机推荐
Zhongdi Digital: integrating innovative domestic GIS to boost the construction of real 3D China
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组加和值(sum)
PHP code audit 6 - file contains vulnerability
基于文件上传漏洞获得网站 shell 权限
How to solve the problem that tp6 controller does not exist: app\controller\index
How to make personalized recommendations instantly accessible? Cloud native database gaussdb (for redis) to help
redis cook book.notes.
Hexagon_V65_Programmers_Reference_Manual(5)
Hexagon_ V65_ Programmers_ Reference_ Manual(5)
Beijing / Shanghai / Guangzhou / Shenzhen dama-cdga/cdgp data governance certification registration conditions
“收割”NFT:200元淘宝买图,上链卖30万元
ELK太重?试试KFC日志采集
成分句法分析综述(第二版)
云管平台中租户以及多租户概念简单说明
Uncaught SyntaxError: redeclaration of let page
Opencv implements image clipping and scaling
Automated testing ----- selenium (II)
QT link MSSQL
Repeated DNA sequence [hash determination repetition + sliding window + bit operation of binary coding]
[deep learning] pytoch torch Autograd automatic differential engine