In several cases, you may want to give a sample dataset. dput
is a great tool for doing so. This tool takes
the dput
output and places it on the clipboard, as well as adding an assignment operator.
sodput(object, rows = TRUE, indents = 4, mdformat = TRUE)
object | R object to convert to code. |
---|---|
rows | numeric. Vector of row numbers. These rows will be produced in the output. By default, all rows are included. |
indents | integer. Spaces to be added before each line. |
mdformat | logical. Whether or not to add 4 spaces before every line in order to format as a code block. |
Tyler Rinker
if (FALSE) { sodput(mtcars) sodput(mtcars, rows=1:6) }