title: Creating reproducible examples author: Mauro Lepore date: '2019-12-10' slug: reprex categories: [] tags: - reprex - r - reproduce description: ''
By default, reprex works on a temporary directory.
reprex::reprex(getwd())
yields
getwd()
#> [1] "C:/Users/Mauro/AppData/Local/Temp/RtmpcDRddU/reprex108c190d657"
Use outfile = NA
to work on your project's working directory.
reprex::reprex(getwd(), outfile = NA)
yields
getwd()
#> [1] "C:/Users/Mauro/git/ds-incubator"
(See the full description of outfile
at ?reprex::reprex()
.)
And
reprex::reprex(readr::read_csv("your-file.csv"), outfile = NA)
yields
readr::read_csv("your-file.csv")
#> Parsed with column specification:
#> cols(
#> Time = col_double(),
#> demand = col_double()
#> )
#> # A tibble: 6 x 2
#> Time demand
#> <dbl> <dbl>
#> 1 1 8.3
#> 2 2 10.3
#> 3 3 19
#> 4 4 16
#> 5 5 15.6
#> 6 7 19.8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.