Create a list from a list without nesting

后端 未结 2 1050
灰色年华
灰色年华 2021-01-29 07:15

Lets say I have a list: x <- list(mtcars, iris, cars)

Now lets say I want to add another dataset to the list. Adding one to the end is easy. x[[4]]

2条回答
  •  离开以前
    2021-01-29 07:27

    Yes, you use the append function. For example:

    x <- list()
    
    x <- append(x = x, c(mtcars, iris, cars))
    

提交回复
热议问题