How to convert dataframe to code definition in order to post reproducible question here

I have a question to ask here.
But in order to ask the question, I need to provide you with example data - which I have as a dataframe
How can I convert my dataframe to code so that I can then then ask my question?

For what it is worth, the data looks like this:

Run

dput(problemevent)

to get code output for the whole data set or run

dput(head(problemevent,30))

to get code for the first 30 rows. You can adjust the number of rows to what is reasonable for your data. Paste the output of either one here, place three back ticks just before and after, like this
```
pasted output
```

Thank you for dput
And the reminder about the back ticks - not sure why I didn't use them in the first place

If there are not problems with column types I like the legibility of (my own) draw_frame.

Code like this.

df <- wrapr::build_frame(
     "x"  , "y" |
       1  , "a" |
       2  , "b" )
cat(wrapr::draw_frame(df))

produces this

df <- wrapr::build_frame(
     "x"  , "y" |
       1  , "a" |
       2  , "b" )
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.