Extracting outputs from lapply to a dataframe

前端 未结 4 1162
[愿得一人]
[愿得一人] 2020-12-30 02:25

I have some R code which performs some data extraction operation on all files in the current directory, using the following code:

files <- list.files(\".\         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 02:54

    Because and forNelton took the response I was in the process of giving and Joran took the only other reasonable response I could think of and since I'm supposed to be writing a paper here's a ridiculous answer:

    #I named your list LIST
    LIST2 <-  LIST[[1]]
    lapply(2:length(LIST), function(i) {LIST2 <<- rbind(LIST2, LIST[[i]])})
    data.frame(LIST2)
    

提交回复
热议问题