R - loop through multiple dataframes from a list of names

后端 未结 2 1609
一个人的身影
一个人的身影 2021-01-16 09:08

I have a number of large DFs and I want to loop through them. Instead of binding them together to make a big list I thought I should make a simple vector with their names an

2条回答
  •  心在旅途
    2021-01-16 09:49

    Or

     sapply(mget(MyDFs),nrow)
     #DF1 DF2 DF3 
     # 3   3   3 
    

    If you don't want to create a vector MyDFs

     sapply(mget(ls(pattern="DF")), nrow) #should also work
    

提交回复
热议问题