First you'll need to install the reprex package, then, to see it in action, copy (but don't paste) the following code:
# include any packages you need
library(tidyverse)
my_tibble <-
tibble(a = 1:3, b = letters[1:3])
my_tibble
dput(my_tibble)
Immediately afterwards, run the command reprex(), and note the output rendered in the RStudio 'Viewer' tab: all the commands are shown along with their output.
Now, copy and also paste the rendered output to an R file in your 'Source' pane, and add the following command (which you can obtain by modifying the commented output from the dput() command):
my_dup <- structure(list(a = 1:3, b = c("a", "b", "c")), row.names = c(NA,
-3L), class = c("tbl_df", "tbl", "data.frame"))
my_dup
Finally, copy -- but don't paste -- all of the code you placed in the R file, and run reprex() again, then come back here, reply, and paste to see what happens.