rrstudiotidyversereprex

Reprex does not consult the current selection on RStudio Cloud


I would like to use reprex on RStudio Cloud

The reprex manual says:

When the clipboard is structurally unavailable, e.g., on RStudio Server or RStudio Cloud, reprex() consults the current selection instead of the clipboard

However, when I select my code in the script on RStudio Cloud and type reprex::reprex() in the console I get the following message:

No user-supplied code found … so we’ve made some up. You’re welcome!

``` r
sprintf("Happy %s!", weekdays(Sys.Date()))
#> [1] "Happy Thursday!"
```

<sup>Created on 2021-03-18 by the [reprex package](https://reprex.tidyverse.org) (v1.0.0)</sup>

Update1: I get following error in the console if I copy the code into the clipboard and/or select it the script:

> reprex::reprex()

! No input provided and clipboard is not available.

Solution

  • This question got kindly answered by jennybc: https://github.com/tidyverse/reprex/issues/369#issuecomment-803229938

    This is a feature of dev reprex, so it is not yet on CRAN. Therefore, I suspect this is a version issue. (The pkgdown site reflects dev capabilities.)

    I will release these features to CRAN reprex soon.