home.social

Search

32 results for “roxygen”

  1. Experimenting with `@examplesWebR` - a new #roxygen2 tag that makes #rstats package examples interactive!

    Instead of static code blocks, users get "View in webR REPL" buttons that open examples in their browser or the embedded webR REPL. No R installation needed!

    Still WIP (🚧 ) since the main challenge is distributing dev packages for #webR (non-CRAN versions).

    Would love input on the best approach! Here or:

    github.com/coatless-rpkg/rocle

  2. TIL you can include multiple `#' @examples` and `#' @examplesIf` statements in your #roxygen2 #RStats code for conditional examples based on the user's system state.

    I had previously thought that you could only use `#' @examples` OR `#' @examplesIf`, but never both. This is fantastic news!

    github.com/cran/report/blob/ee

  3. Day 7: roxygen2 Advanced Tags and Cross-References 📝

    Master documentation with advanced roxygen2 features, with markdown-style writing! 🎯

    💡 Pro Tip: Use @inheritDotParams to inherit ... parameter documentation.
    📚 Resources: roxygen2.r-lib.org

  4. The {document} #rstats 📦 creates roxygen2-style documentation for functions that aren't (yet) part of an R package.

    In the screenshot below, top left shows a test.R file with a function called test_function , including roxygen definitions. After running

    d <- document("test.R")

    I can use

    ?test_function

    to read the help file as if it were part of a package.

    By Andreas Dominik Cullmann

    cran.r-project.org/web/package

    @rstats
    #roxygen #roxygen2

  5. Dear #rstats friends, remember all those tempdir()/tempfile() gymnastics for CRAN compliance?

    examplesTempdir just made that circus act a one-liner with a simple #roxygen2 tag extension. Your future self will thank you.

    💻 Code: github.com/coatless-rpkg/rocle

    📝 Post: blog.thecoatlessprofessor.com/

  6. I am about to push a new functionality to .nvim to insert skeleton to function in

  7. And another ding for #VScode/#positron as a package developer: I cannot run #roxygen examples (at least I can still do that in #Nvim (or a simulacrum of it as long as I'm careful: github.com/R-nvim/R.nvim/issue))

    [edit: I have to run the roxygen comments line-by-line: github.com/posit-dev/positron/]

    github.com/posit-dev/positron/
    github.com/REditorSupport/vsco

  8. That was new. Mistakenly put a new function definition below an #RStats #ROxygen2 stub for exporting a method, and my NAMESPACE got very, very weird with stuff from the function description.

    But faults on me for not looking at the NAMESPACE changes before committing and pushing the result.

    Thankfully simple to fix. Move the function definition, delete the borked NAMESPACE, and {devtools::document()} to refresh it. Examine it, commit, push.

  9. Document your data packages! Join @OSPpatrick and I for 154 where we make an package to serve @f1 championships data!

    We go through writing out your tags and creating a vignette as well!

    Bit.ly/TidyX_Ep154

  10. Document your data packages! Join @OSPpatrick and I for #TidyX 154 where we make an #rstats package to serve @f1 championships data!

    We go through writing out your #Roxygen tags and creating a vignette as well!

    Bit.ly/TidyX_Ep154

  11. Recently ran into a disturbing #ChatGPT result: I asked it to translate a #python function written by Mathieu Daëron (github.com/mdaeron/D47crunch) to #R, using the #tidyverse and a #tibble. I had done this manually for my #rpackage github.com/isoverse/clumpedr/ and wanted to see how they would compare.

    It returned my code literally, including TODO notes, comments, and #roxygen skeleton. But it did not say where it got the code from, even when pressed. My R package is on #github under #GPL 3. Thoughts?

  12. 1. write a function
    2. write roxygen documentation
    3. procrastinate for a hour
    4. lunch
    5. write unit tests

    #rstats #RPackages

  13. 1. write a function
    2. write roxygen documentation
    3. procrastinate for a hour
    4. lunch
    5. write unit tests

    #rstats #RPackages

  14. 1. write a function
    2. write roxygen documentation
    3. procrastinate for a hour
    4. lunch
    5. write unit tests

    #rstats #RPackages

  15. 1. write a function
    2. write roxygen documentation
    3. procrastinate for a hour
    4. lunch
    5. write unit tests

    #rstats #RPackages

  16. Last month I switched over from using #NvimR to #RNvim (the lua-based successor), which uses #TreeSitter for syntax highlighting. It was hard enough to do the transition and the realize that debugging support was turned off, but one of the biggest disappointments is the lack of #roxygen highlighting (github.com/r-lib/tree-sitter-r), which is actually default in #Nvim :blobfoxcry2: I was thinking to switch over to #VScode or #positron, but having to learn new shortcuts for everything make me sad.

  17. @beps I truly understand what you mean. I am now talking a little about . We have a solid integration of , and some other tools. works. A tight integration of would be nice. We have a good R console and a terminal. Likewise, we don't have the deep integration of , and . Some find it good (I) others find it a hindrance.
    In the end, there are many good choices.

  18. @beps I truly understand what you mean. I am now talking a little about #RKWard. We have a solid integration of #git, #rio and some other tools. #quarto works. A tight integration of #styler would be nice. We have a good R console and a terminal. Likewise, we don't have the deep integration of #devtools, #roxygen2 and #pkgdown. Some find it good (I) others find it a hindrance.
    In the end, there are many good choices.

    #rstats

  19. @beps I truly understand what you mean. I am now talking a little about #RKWard. We have a solid integration of #git, #rio and some other tools. #quarto works. A tight integration of #styler would be nice. We have a good R console and a terminal. Likewise, we don't have the deep integration of #devtools, #roxygen2 and #pkgdown. Some find it good (I) others find it a hindrance.
    In the end, there are many good choices.

    #rstats

  20. @beps I truly understand what you mean. I am now talking a little about #RKWard. We have a solid integration of #git, #rio and some other tools. #quarto works. A tight integration of #styler would be nice. We have a good R console and a terminal. Likewise, we don't have the deep integration of #devtools, #roxygen2 and #pkgdown. Some find it good (I) others find it a hindrance.
    In the end, there are many good choices.

    #rstats

  21. @beps I truly understand what you mean. I am now talking a little about #RKWard. We have a solid integration of #git, #rio and some other tools. #quarto works. A tight integration of #styler would be nice. We have a good R console and a terminal. Likewise, we don't have the deep integration of #devtools, #roxygen2 and #pkgdown. Some find it good (I) others find it a hindrance.
    In the end, there are many good choices.

    #rstats

  22. The Bottom Line: Manually editing DESCRIPTION = typos, wrong formatting, forgotten versions. usethis = automatic, correct, sorted. Let the tool handle the details so you focus on code.
    Tomorrow: Advanced roxygen2 for better documentation! 📝

    Resources: usethis.r-lib.org

  23. So not many people were keen on a weekly zoom for the intro to R packages (focussing on research project packages), but @mcaleerp suggested an intensive course. Would people be interested in a (free) 2-day course this summer covering setting up a package project, creating functions, documenting them with roxygen, creating vignettes, unit testing, package testing, version control with git, and distribution with github? It could be in Glasgow (my preference) or on Zoom, but not hybrid. #rstats #PsyTeachR

    psyteachr.github.io/intro-r-pk

  24. So not many people were keen on a weekly zoom for the intro to R packages (focussing on research project packages), but @mcaleerp suggested an intensive course. Would people be interested in a (free) 2-day course this summer covering setting up a package project, creating functions, documenting them with roxygen, creating vignettes, unit testing, package testing, version control with git, and distribution with github? It could be in Glasgow (my preference) or on Zoom, but not hybrid. #rstats #PsyTeachR

    psyteachr.github.io/intro-r-pk

  25. So not many people were keen on a weekly zoom for the intro to R packages (focussing on research project packages), but @mcaleerp suggested an intensive course. Would people be interested in a (free) 2-day course this summer covering setting up a package project, creating functions, documenting them with roxygen, creating vignettes, unit testing, package testing, version control with git, and distribution with github? It could be in Glasgow (my preference) or on Zoom, but not hybrid. #rstats #PsyTeachR

    psyteachr.github.io/intro-r-pk

  26. So not many people were keen on a weekly zoom for the intro to R packages (focussing on research project packages), but @mcaleerp suggested an intensive course. Would people be interested in a (free) 2-day course this summer covering setting up a package project, creating functions, documenting them with roxygen, creating vignettes, unit testing, package testing, version control with git, and distribution with github? It could be in Glasgow (my preference) or on Zoom, but not hybrid. #rstats #PsyTeachR

    psyteachr.github.io/intro-r-pk

  27. So not many people were keen on a weekly zoom for the intro to R packages (focussing on research project packages), but @mcaleerp suggested an intensive course. Would people be interested in a (free) 2-day course this summer covering setting up a package project, creating functions, documenting them with roxygen, creating vignettes, unit testing, package testing, version control with git, and distribution with github? It could be in Glasgow (my preference) or on Zoom, but not hybrid. #rstats #PsyTeachR

    psyteachr.github.io/intro-r-pk

  28. Dear R developers and CRAN maintainers, I wonder if you can kindly help me understand how I should deal with the import of some packages and package functions. Despite reading "R Packages" (eg <r-pkgs.org/dependencies-mindse>) and "Writing R Extensions" (eg <cran.r-project.org/doc/manuals>), I'm still unsure how to deal with the following situation.

    Suppose you have a package with the following requirements:

    1. *One* function in your package, say "funA" requires a whole package, say PKGA. *However*, the function only uses PKGA in a separate (parallel::makeCluster) process. This function is fundamental to your package, in the sense that the user will surely use it at least once in their workflow.

    2. Another function in your package, say "funB", requires two functions "aux1" and "aux2" from another package, say PKGB. The user might use this function, or maybe not. In your code (no parallel invocation), the functions are called with PKGB::aux1 etc.

    3. The two functions "aux1" and "aux2" from PKGB are also available in PKGA. You'd like to be sure that the user can choose freely which ones they want in their workflow, alongside your package. In other words, no masking should take place a priori.

    Given these conditions, what should NAMESPACE and DESCRIPTION contain? With Roxygen, where should I use @ import and @ importFrom? and what about usethis::use_import()?

    Thank you very much for any tips or extra references to read!

    Edit: for the moment, my solution has been to include PKGA, PKGB, and parallel in the Imports field of the DESCRIPTION file, but not to have these three packages in the NAMESPACE file as Import(). This seems to achieve what i want, but I'm not sure it's the "proper" solution.

    #rstats #cran