MindMap Gallery R language data structure
This is a mind map about the data structure of the R language. It mainly introduces the vectors, matrices, arrays, lists, data frames, etc. of the R language.
Edited at 2021-08-15 20:20:54Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
R language data structure
vector
A vector is a group of data of the same type
create
data=C()
seq(from=,to=,by=n) generates an arithmetic sequence within a certain range
rep(x=,time=) repeats a certain number
name
name(data)=vector()
Generate statistically distributed random numbers
Normal random number rnorm(n, mean=n, sd=n)
Mark the random seed number to ensure that the random number remains unchanged for each operation; set.seed(n)
Inquire
data[n]
any(data>x)=T/F
all(data<x)=T/F
data[data>n]=data1, data*data=T/F
ifelse(data==n, n,n) performs vectorized filtering on vectors
subset(data,data>n) automatically selects non-NA qualified values
which(data>n) returns the position index of the qualified value
data[T/F,] performs Boolean operations on indexes
matrix
The matrix is cross-sectional data
operate
create
data=martix(data(vector),nrow=n,ncol=n) input by column
Name colname/rownme(matrix)[i]=c(str,)
increase
data=cbind(data1,data2) merge by columns
data=rbind(data1,data2 merge by row)
delete
Delete to reassign
data<-data[,-c(n,n)]
check
data[n,n,drop=T/F ], data[n,n:n] , data[n, -c(n,n)]
Dimensionality reduction or not
Multidimensional query
data[n, ][,n]
Conditional query: cs[4, ][cs[4,]>20]<-20
Attributes
dim(data) Number of rows and columns of matrix
array
The array is panel data (data at different time nodes), and the matrix is cross-sectional data at a certain time
list
Data structures that combine objects of different types (more practical)
create
data=list(""=name,...) tags-datas
data=c(list(list(),list()),list(),recursive=T/F) Whether to flatten the list recursively
check
data$a, data[["a"]] data[[i]] data[i] query a certain component
data[n:n]
len(data)
What is obtained is the number of components
delete
Delete by part name
delete by index
data[,-c(n,n)]
data frame
A special kind of list (each component has the same length but different types)
increase
data$new<-data
Directly create a new variable name and assign a value to it
factor
Vector with level values (function that classifies vectors, level values cannot be repeated)
The two components of the data frame correspond one to one and assign factors to each other.
create
data=factor(data,levels=c(),orders=T/F)
operate
tapply(vector, list(vextor1, vextor2),f())
Use functions to classify a certain column of the data frame according to certain two conditions.
splite(datafame, list(vector1, vector2)) is classified according to two conditions
table(data)
Count the number of occurrences of each factor
Calculate the confusion frequency of the confusion matrix where two vectors are mixed together
composition
level
Array of categorical variables
data
Horizontal position index (belonging to that categorical variable)
Apart from