I. Online installation package
Install.packages (Package_name)
Two. View variables
LS ()
Three. Deleting variables
RM ()
Four. Variable type
Meta data types: characters, shaping, numbers, imaginary, BOOL
Vector: Vec=c (a)
List: ls=list (1, ' A ', C ()
Matrix: Matri=matrix (C (1,2,2,2,3,4), nrow=2,ncol=3,byrow=ture)
Data frames: Frame=data.frame (name=c ("Zhangsan", "Wangwu", "Lisi"), Age=c (12,13,23), Gender=c ("M", "F", "M"))
Array: Arr=array (C (VEC1,VEC2), dim=c (number of rows, number of columns, dimensions)//each vector is arranged in columns
Factor: Vec=c (1,2,3,4)
Fac=factor (VEC)
Five, several important operators:
Percent: to find the remainder
%/%: Seeking integer quotient
%in%: Judging whether the former is in the latter
%*%: Multiplication of matrices with their inverse matrices
&& | | : Compare the first value of a vector
R language-data types and operators