Looping through list of data frames in R

前端 未结 3 874
忘掉有多难
忘掉有多难 2020-12-05 09:06

I have a series of data frames, df1 df2, where each data frame follow this structure:

x <- c(1:5)
y <- c(1:5)
df1 <- data         


        
3条回答
  •  长情又很酷
    2020-12-05 09:49

    Or use llply (from plyr) or lapply like so:

    library(plyr)
    result_list <- llply(list_of_df, function(x) {
                    # do the replacing
                    return(x)
                    })
    

提交回复
热议问题