函数在R中创建多个列表
我希望能够创建一个返回3个列表的函数。例如:函数在R中创建多个列表,r,list,R,List,我希望能够创建一个返回3个列表的函数。例如: Objects <- function(SetType, 2Type){ 1Set <- list() 1Set$type <- SetType 2Set <- list() 2Set$type <- 2Type 3Set <- list() return(1Set) return(2Set) return(3Set) } Objects也请检查此项 对象执行此操作返回(列表(1
Objects <- function(SetType, 2Type){
1Set <- list()
1Set$type <- SetType
2Set <- list()
2Set$type <- 2Type
3Set <- list()
return(1Set)
return(2Set)
return(3Set)
}
Objects也请检查此项
对象执行此操作返回(列表(1集、2集、3集))
非常简单,谢谢!很高兴今天天气好
Objects <- function(SetType, 2Type){
1Set <- list()
1Set$type <- SetType
2Set <- list()
2Set$type <- 2Type
3Set <- list()
return(list(1Set,2Set,3Set))
}
Ret=Objects(SetType, 2Type)
1Set=Ret[[1]]
2Set=Ret[[2]]
3Set=Ret[[3]]