当前位置:网站首页>[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
\;\\\;\\\;
边栏推荐
- LeetCode每日一练 —— 21. 合并两个有序链表
- 搭建discuz论坛并攻破盗取数据库
- redis cook book.notes.
- Zhongdi Digital: integrating innovative domestic GIS to boost the construction of real 3D China
- 如何查看蓝牙耳机的蓝牙版本
- 文件上传绕过WAF的技巧大全
- 【历史上的今天】7 月 27 日:模型检测先驱出生;微软收购 QDOS;第一张激光照排的中文报纸
- Hcip day 5
- PG 之 Free Space Map & Visibility Map
- Chapter 7 Intermediate Shell Tool I
猜你喜欢

一文读懂Plato&nbsp;Farm的ePLATO,以及其高溢价缘由

命令行 PDF 转换器:::fCoder 2PDF

NPDP|什么样的产品经理可以被称为优秀?

Automated testing ----- selenium (II)

The variable "lattice" or class "lattice.latticeeasy" (matlab) is not defined

LeetCode每日一练 —— CM11 链表分割

Uncaught SyntaxError: redeclaration of let page

Read Plato & nbsp; Eplato of farm and the reasons for its high premium

Arduino development (II)_ RGB light control method based on Arduino uno development board

MAPGIS 3D pipeline modeling awakens the pulse of urban underground pipelines
随机推荐
Programmer growth Chapter 18: project launch
文件上传绕过WAF的技巧大全
Hexagon_ V65_ Programmers_ Reference_ Manual(8)
Hexagon_V65_Programmers_Reference_Manual(7)
Differences among native objects, built-in objects, and host objects
Overview of understanding the physical layer of transmission media
14 day Hongmeng device development practice - Chapter 7 device networking cloud learning notes
redis cook book.notes.
Understanding network model TCPIP model
QT link MSSQL
Arduino development (II)_ RGB light control method based on Arduino uno development board
原生对象、内置对象、宿主对象的区别
[Numpy] 数组属性
Obtain website shell permission based on file upload vulnerability
[deep learning] pytoch torch Autograd automatic differential engine
NPDP | what kind of product manager can be called excellent?
[numpy] broadcast mechanism
[deep learning] pytoch tensor
Qt OPenGL 光的漫反射
[program life] "stage summary" - unwilling to be ordinary