从列表R中删除特定变量
我想从R中的列表中删除预定义变量,例如:从列表R中删除特定变量,r,list,variables,R,List,Variables,我想从R中的列表中删除预定义变量,例如: vertex <- c("A","B","C","D") list_safe<-vertex z<-sample(list_safe,1) list_infected[z] <- z list_safe_new<-list_safe[list_safe =! "z"] vertex您定义了z,所以不应该在语句中添加“z” vertex <- c("A","B","C","D") list_saf
vertex <- c("A","B","C","D")
list_safe<-vertex
z<-sample(list_safe,1)
list_infected[z] <- z
list_safe_new<-list_safe[list_safe =! "z"]
vertex您定义了z,所以不应该在语句中添加“z”
vertex <- c("A","B","C","D")
list_safe<-vertex
z <-sample(list_safe,1)
list_safe_new<-list_safe[list_safe != z]
顶点语法错误?你是说list\u safe[list\u safe!=z]
你还没有定义list\u infected
。