bgreenwell / cprint

Print common R data structures in a format which can be used as input to the interpreter
1 stars 1 forks source link

similarities to base::dput() #1

Open bfgray3 opened 5 years ago

bfgray3 commented 5 years ago

Not sure if base::dput() might suit your needs. Its printing of data frames is slightly annoying but overall I think it's pretty useful.

bgreenwell commented 5 years ago

Yep, I use dput() quite a bit. The purpose of cprint()—which was inspired by some python function I can’t find—is to do the same (mostly for data frames) but in a way similar to how you would normally create it (I.e., with data.frame instead of structure). This was really written to solve a common problem I was running into with making reproducible scripts for teaching. But leaving this open as a reminder to distinguish it more from dput()!