1,345 questions
0
votes
0
answers
69
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 ...
1
vote
2
answers
129
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 ...
2
votes
0
answers
110
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 ...
0
votes
0
answers
92
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
72
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 ...
4
votes
0
answers
92
views
Using @inheritParams for arguments from another package gets CRAN warning about missing package anchors
I have a package that has existed quietly and happily on CRAN for some years but in the last few months have received this NOTE accompanied by email warnings that the package will be withdrawn if I ...
3
votes
2
answers
194
views
How can I count lines of code in an R package?
How can I count the lines of code in an R package? I have two possible types of input:
The raw package code (my own package); I could point the function to the R folder that contains source code.
The ...
2
votes
1
answer
82
views
How to write models to tempdir()
I'm creating an R package that automatically creates trained models. One of the goals is to allow the user to save the trained models for use with future data. The trained models were originally saved ...
3
votes
1
answer
155
views
How to Properly Use Internal Data from Another Package in a Golem Shiny App?
I am currently developing a Golem Shiny app. Since it relies on a massive amount of raw data that needs transformation before use, I have separated this part of the workflow into a dedicated package ...
0
votes
1
answer
271
views
Error in if (newversion != oldversion) when Creating Package in R [closed]
I am in the process of creating a new R package and when I try to clean and install button on RStudio it, I get the following error message in the console:
> library(MY_R_PACKAGE)
Error in if (...
1
vote
1
answer
22
views
Use same example template in several roxygen blocks
Assume that I have two functions f and g and in my roxygen2 documentation I want that the @examples of g extend the examples of f.
If I write them by hand, it would look like this:
#' Adds One to Its ...
1
vote
1
answer
225
views
How do I use the usethis package when I have already developed an R package on GitHub?
I have a package I created a while ago using the RStudio package option. I am linked in via 2 factor authentication. I have successfully pushed, pulled, and committed to my repo.
I have now reached ...
0
votes
1
answer
478
views
"stats" Package not found in RStudio
I have a problem with RStudio. When I start the program, it shows this warning message:
During startup -
Warning message:
package ‘stats’ in options("defaultPackages") was not found.
...
2
votes
1
answer
69
views
Package with Rcpp ignores #include <stack>
I want to use a std::stack in a C++ function inside an R package. Consider the following example C++ file:
// [[Rcpp::plugins(cpp20)]]
#include <Rcpp.h>
#include <stack>
// [[Rcpp::export]...
4
votes
1
answer
374
views
How to write an R example in Latex file
I am writing a latex file in Rstudio, and need to present an R example for an R package developed by myself. I noticed the published paper often has a format for the example as shown below, but I am ...
3
votes
1
answer
85
views
R devtools::check() WARNING: "The argument of a replacement function which corresponds to the right hand side must be named 'value'."
I am using devtools::check() in R to check a package and cannot overcome this warning:
The argument of a replacement function which corresponds to the right
hand side must be named 'value'.
You can ...
2
votes
1
answer
1k
views
R package object not exported?
I'm trying to load he package epiR but I'm getting the message:
Error: object 'match_fonts' is not exported by 'namespace:systemfonts'
Execution halted
ERROR: lazy loading failed for package 'epiR'
...
0
votes
0
answers
106
views
Installing R xml2 package from .tar.gz file failing
I am currently trying to install the xml2 package on R/RStudio.
There are firewall restrictions on the device which I am working on which does not allow R/RStudio to connect fetch the packages ...
0
votes
1
answer
44
views
Issue with Evaluating Arguments in `tar_script()` for Custom Workflow Function in R Package
I’m developing a function within an R package that is designed to run a targets workflow. The package is currently hosted on GitHub. Here’s a simplified version of the _targets.R script that works ...
1
vote
0
answers
224
views
How to install R package hsdar?
I need to use a discontinued R package called hsdar. It seems to be impossble to install, I have tried installing an older version of R to run it, but no version seems to accept the package.
I've also ...
0
votes
1
answer
197
views
Equation not rendered in helper files of function of html pages [closed]
I am building a package and an associated website (via Github Pages). Let's say I have a function funX. In R, when I do ?funXI have some equations (using \eqn{} or \deqn{}) in the description files, ...
0
votes
1
answer
618
views
devtools::check() fails with "Error: Could not find tools necessary to compile a package", however debugging detects no issues
When checking my R package with devtools::check(), I run into this error.
══ Checking ═══════════════════════════════════════════════════════════
Setting env vars:
• _R_CHECK_CRAN_INCOMING_REMOTE_ ...
1
vote
0
answers
59
views
Best practice in including C functions of R library into a R package for CRAN
We are building a R package for the CRAN that only contains R functions. However, one of these R functions directly calls stats:::C_Cdqrls, which is a built-in C functions of the stats library of R. ...
0
votes
0
answers
104
views
Makevars:1: *** missing separator. Stop. -> Compiling for an R package that is written in C++
Im trying to install an R packages of the following GitHub Repo:
https://github.com/MACKattenberg/cffe/tree/main
When I execute the build_package file, I get the following Error
> roxygen2::...
1
vote
2
answers
148
views
What is the correct way of extending an S3 class from another package in R
I am writing an R package pkgA that is extending another package, pkgB. In particular, I implemented a new class gas_planet that extends the functionality of a class planet written in pkgB. When I use ...