Questions tagged [r-box]

Questions about the ‘box’ module system for the R programming language

box’ is an R package that provides a modern module system for the programming language.

12 questions
4
votes
1 answer

R Function 'box::help()' Cannot Generate Help File: "Invalid Argument"

Motivation My colleagues and I routinely create ad hoc scripts in R, to perform ETL on proprietary data and generate automated reports for clients. I am attempting to standardize our approach, for the sake of consistency, modularity, and…
Greg
  • 3,054
  • 6
  • 27
2
votes
1 answer

Loading data mask manually when using box

I have an R code that I'm changing to use R's box package. But I noticed that a function I had no longer has the dataframes columns as variables in the environment, so when I do dplyr's filter I get object 'verified' not found. What's the easiest…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
2
votes
2 answers

Call Project Scripts from Another Project

I'm building an RStudio project (Project 2) where I would like to access certain scripts that are contained within another already-built RStudio project (Project 1). Project 1 contains various scripts, some of which reference one another through…
kamiks
  • 184
  • 7
1
vote
1 answer

How to seperate the one modules function across multiple .R files?

to organize the functions in my largest r-project, I am trying to migrate from a horribly flat folder structure to a nicely modularized hierarchical one using the box package. How can I keep on R-file per function in nested modules? R |- ... …
pieuvre
  • 13
  • 3
1
vote
2 answers

How can I reload a custom module using r-box

I start to use the R package box, but struggle during development of nested dependencies. Setup Usually I develop a first function helper.R: # helper.R helper <- function(i) { return(paste("help", i)) } Then a I use it in a wrapper: #…
1
vote
1 answer

R, box: How to add to generic function print the message method print.message?

Suppose getwd() yields "C:/Users/Tom/Documents/Tom_Levers_Git_Repository". In this repository, I have directory TomLeversRBox. In this box, I have modules calculate_probability.R and print.message.R. In the module calculate_probability.R, I have the…
Tom Lever
  • 321
  • 3
  • 16
1
vote
2 answers

R, box: How do I use an external package like stats?

Suppose getwd() yields "C:/Users/Tom/Documents/Tom_Levers_Git_Repository". In this repository, I have directory TomLeversRBox. In this box, I have module calculate_probability.R. In this module, I have the following function. #'…
Tom Lever
  • 321
  • 3
  • 16
0
votes
1 answer

How to use imported names from box modules inside parallel code?

Here is a minimal example showing the issue: mod.r: #' @export run_sqrt <- function (x) { sqrt(x) } mwe.r box::use( ./mod[...], parallel, dp = doParallel, foreach[foreach, `%dopar%`], ) cl <-…
Ferroao
  • 3,042
  • 28
  • 53
0
votes
1 answer

using klmr box::use in an rmarkdown document

Can anyone give me an example to add libraries and local functions with the klmr::box package in a rmarkdown document? I am aware of their use in Rhino´s framework, but I feel a bit confused where can I declare modules and libraries in a YAML +…
Captain Tyler
  • 500
  • 7
  • 19
0
votes
1 answer

Setting up a new {box} module with {roxygen2} comments

I'm new to both {box} and {roxygen2} and have never written a package - so please bear with me. I've got a script that has a smallish function in it which I've verified works at my end. It's sited in a bespoke folder I've created, called R, inside…
C. W.
  • 25
  • 6
0
votes
0 answers

Using {targets} and {box}

What would be the best way to use {targets} but writing all the functions using {box}? The problems I am facing are mainly that it is verbose to "source" the functions in my module (box::use() instead of tar_source()) and any alteration in the code…
glhrm
  • 51
  • 2
0
votes
1 answer

How to make conditionalPanel work with box with rhino

This conditional panel is not working: File: app/view/submit.R ,div( conditionalPanel(condition = "input.region_input == 2", ns = ns, uiOutput(ns("africaCountrySelect")) ) ) Context:…
Ferroao
  • 3,042
  • 28
  • 53