0

Quite often when trying to get help people ask for reproducible examples. Sometimes sharing a text file is not possible so I was wondering if there is a function which outputs the copy/paste command to recreate a dataframe or matrix with my data in r.

For example if I have this matrix(3,3,3) matrix I would like the output of the function to be something like this:

a <- data.frame(
    1 = c(3, 3, 3),
    2 = c(3, 3, 3),
    3 = c(3, 3, 3)
)
mfalco
  • 428
  • 3
  • 14
  • 2
    Use E.g. `dput` – GKi Jun 29 '21 at 10:55
  • 2
    Does this answer your question? [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Paul Jun 29 '21 at 10:55
  • Ok, dput was exactly what I was looking for. Sorry, I don't know how I wasn't able to find it... Thanks! – mfalco Jun 29 '21 at 10:58

0 Answers0