Experimental browser for the Atmosphere
Tired of writing tempdir()/tempfile() code in your #rstats package examples to be compliant with CRAN's file policy? Get CRAN-compliant file examples with a single #roxygen2 tag: examplesTempdir. š Read more: blog.thecoatlessprofessor.com/programming/...
Apr 2, 2025, 7:50 AM
{ "uri": "at://did:plc:fgeozid7uyx2lfz3yo7zvm3b/app.bsky.feed.post/3llsvngfpvs2f", "cid": "bafyreietznmqpwvwqbojpzzqfqrlj47ptj3xm2jhi5girf3o4rnlpte7ja", "value": { "text": "Tired of writing tempdir()/tempfile() code in your #rstats package examples to be compliant with CRAN's file policy?\n\nGet CRAN-compliant file examples with a single #roxygen2 tag: examplesTempdir.\n\nš Read more: blog.thecoatlessprofessor.com/programming/...", "$type": "app.bsky.feed.post", "embed": { "$type": "app.bsky.embed.images", "images": [ { "alt": "Screenshot showing the @examplesTempdir feature for R packages. The image compares two approaches for managing temporary directories in package examples. The traditional method requires multiple lines of code with setwd(tempdir()) and cleanup commands. With the {rocleteer} package, this can be simplified to a single @examplesTempdir tag. The image shows code examples of both approaches, highlighting how the new method reduces boilerplate code.\n\nOld approach:\n\n#' @examples\n#' \\dontshow{.old_wd <- setwd(tempdir())}\n#'\n#' # Your code here\n#'\n#' \\dontshow{setwd(.old_wd)}\n\nNew approach:\n\n#' @examplesTempdir\n#' # Your code here", "image": { "$type": "blob", "ref": { "$link": "bafkreif5syq6j426gulbvqjd7kfhrysy6qqx6wfo3732ixxfrzp5tvs3sy" }, "mimeType": "image/jpeg", "size": 407709 }, "aspectRatio": { "width": 1804, "height": 962 } } ] }, "langs": [ "en" ], "facets": [ { "index": { "byteEnd": 58, "byteStart": 51 }, "features": [ { "tag": "rstats", "$type": "app.bsky.richtext.facet#tag" } ] }, { "index": { "byteEnd": 174, "byteStart": 165 }, "features": [ { "tag": "roxygen2", "$type": "app.bsky.richtext.facet#tag" } ] }, { "index": { "byteEnd": 260, "byteStart": 215 }, "features": [ { "uri": "https://blog.thecoatlessprofessor.com/programming/r/simplifying-file-based-examples-with-atexamplestempdir-in-r-packages/", "$type": "app.bsky.richtext.facet#link" } ] } ], "createdAt": "2025-04-02T07:50:05.273Z" } }