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:54This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
This Valentine's Day brand marketing handbook provides businesses with five practical models, covering everything from creating offline experiences to driving online engagement. Whether you're a shopping mall, restaurant, or online brand, you'll find a suitable strategy: each model includes clear objectives and industry-specific guidelines, helping brands transform traffic into real sales and lasting emotional connections during this romantic season.
This Valentine's Day map illustrates love through 30 romantic possibilities, from the vintage charm of "handwritten love letters" to the urban landscape of "rooftop sunsets," from the tactile experience of a "pottery workshop" to the leisurely moments of "wine tasting at a vineyard"—offering a unique sense of occasion for every couple. Whether it's cozy, experiential, or luxurious, love always finds the most fitting expression. May you all find the perfect atmosphere for your love story.
The ice hockey schedule for the Milano Cortina 2026 Winter Olympics, featuring preliminary rounds, quarterfinals, and medal matches for both men's and women's tournaments from February 5–22. All game times are listed in Eastern Standard Time (EST).
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