1,349 questions
Tooling
3
votes
12
replies
196
views
How can I retrieve the fraction of functions with examples purely from an R Package source archive without installing that package?
Given the source code of a CRAN R package (e.g., an extracted .tar.gz directory), how can I determine, without installing the package, what fraction of the package's functions have directly associated ...
Best practices
1
vote
3
replies
99
views
Is calling S3 methods in my own S3 method a good idea?
I am writing a package that handles different kinds of model objects, and different objects often have their own S3 methods for common functions, e.g. lme4 has coef.merMod() for getting coefficients.
...
4
votes
0
answers
171
views
How do I resolve this error when installing tidyverse on MacOS?
When I run
install.packages("tidyverse")
R returns the following
also installing the dependencies ‘broom’, ‘modelr’
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.5/...
Best practices
2
votes
14
replies
6k
views
Situations where R strips attributes for S3 classes, and how to work around or avoid them?
I was thinking of making an S3 class to handle p-values like 1.1e-2000 that are too small to be stored as regular R numeric values. I am a beginner with S3, and was alarmed to discover how easy it is ...
Best practices
0
votes
1
replies
42
views
Mixing roxygen2 with traditional documentation in an R package
What is recommended regarding mixing roxygen2 with traditional documentation in an R package?
I just copied an R/*.R file from a roxygen2 package to an older one that's not roxygenized then ran "...
0
votes
0
answers
123
views
Reuse function in a package
I'm trying to reuse a function from one of my packages that installs the latest version of my package in another package. The original package is {pkgA} and the function is update(). The function uses ...
0
votes
1
answer
108
views
Is there a way to import internally defined functions in an R package into the main working environment?
I need to create a modified version of a function found within a package namespace to perform a specific statistical calculation. E.g., say I have a function function and save the modified version as ...
1
vote
2
answers
152
views
Why are ggplot2 font family changes not reflected in vdiffr::expect_doppelganger()?
In creating unit tests for an r package that provides a custom ggplot2 theme, I've noticed that the snapshots created by vdiffr::expect_doppelganger() aren't reflecting font family changes that work ...
1
vote
1
answer
109
views
using json schema in an R package
I am developing an R package that is supposed to work with some json data. I have json schemas defined and would like to use them in the package to validate the data. I'm not sure how those should be ...
2
votes
0
answers
120
views
Error when using stat_density_2d in package example
I am maintaining an R package (dynConfiR) and, since the recent ggplot2 update, I get an error, which I cannot resolve (https://cran.r-project.org/web/checks/check_results_dynConfiR.html).
My data ...
2
votes
1
answer
136
views
R {flow} flow_view_dependencies does not work with non-package structure
I started collaborating on a new, large R project. I want to get an idea of how various functions relate to each other using {flow} and flow_view_deps(). There is an R/functions folder where all ...
0
votes
0
answers
96
views
minimal import of data.table functionality into another package
What would be the minimum set of include.only directives in a call to library() in loading data.table for basal functioning? Without the library statement I can make calls to data.table functions by ...
1
vote
1
answer
137
views
How to force `renv` to use a private Artifactory repository instead of P3M for specific package versions?
I am trying to force renv to download all R packages, including specific archived versions, from our private Artifactory repository. However, renv ignores my settings and defaults to Posit Package ...
2
votes
1
answer
82
views
How best to depend on lubridate's update() in a package?
The "update" method that lubridate provides isn't exported (related: Why is there no lubridate:::update function?)
I guess the simple update() API seems to call one of the appropriate ...
2
votes
0
answers
105
views
Run reticulate::py_require() once on package installation
We have an internal python library that we want to build an R wrapper for. The python package only needs to be installed once and not every time. The documentation says to use py_require() over ...