Checking if an object in a list exists and then removing it if it does not in R

前端 未结 1 376
面向向阳花
面向向阳花 2021-01-27 14:34

I have a script that creates a list of objects (data.frame). Then these objects are bound into a single .csv file. The issue is that every now and then, one of the scripts will

相关标签:
1条回答
  • 2021-01-27 14:59

    You can use ls and search for objects with a pattern. It will return only those objects which exist which we can rbind.

    dataset <- do.call(rbind, mget(ls(pattern = 'object')))
    
    0 讨论(0)
提交回复
热议问题