Simplified dput() in R

后端 未结 7 1060
深忆病人
深忆病人 2020-12-02 15:24

I miss a way to add data to an SO answer in a transparent manner. My experience is that the structure object from dput() at times confuses inexperi

相关标签:
7条回答
  • 2020-12-02 16:24

    Generally a large dput is difficult to cope with, on SO or otherwise. Instead you can just save the structure directly to an Rda file:

    save(Df, file='foo.Rda')
    

    And read it back in:

    load('foo.Rda')
    

    See this question for a little more info and credit where credit is due: How to save a data.frame in R?

    You could also look at the sink function...

    If I've missed the purpose of your question, please feel free to expand on the reasons why dput is the only mechanism for you.

    0 讨论(0)
提交回复
热议问题