I am working on an R markdown notebook in an active renv in my R project directory. Before I had activated the environment, I could use the load funct ...
I am working on an R markdown notebook in an active renv in my R project directory. Before I had activated the environment, I could use the load funct ...
I started a new project in Rstudio and selected the option to use renv. The first thing I did was type the command install.packages('sf') and R return ...
The code below works fine if ran outside the function - everything is being evaluated correctly, and the comparison cloud can be converted to a ggplot ...
Is it possible to move variables that reside in the global environment into a separate environment to declutter the global namespace? I understand how ...
In the following example, I try to get an element from a grandparent environment using env_get. The first bit works as expected. library(rlang) e1 &l ...
Suppose I have a closure add_y(y) which returns a function that adds y to its input. So the value of add_4 is a function that adds 4 to its input. ...
I have a number of loosely related data analysis scripts in R. Some of these scripts have code that removes all variables from the global environment ...
In R, running the expression x <- 1 defines a variable x in the global environment with the value 1. Doing the same within a function defines the v ...
This question is similar to Source script to separate environment in R, not the global environment, but with a key twist. Consider a script that sour ...
I have a dataset the contains a large number of columns every column has a name of date in the form of x2019.10.10 what I want is to remove the x let ...
I'm new here, sorry for any mistakes. I have the following code working: But now I need to update the progressBar by some code inside a function a ...
Whenever I want to recreate a project on my windows machine using renv:restore() it always fails installing packages. I always get the same error (alt ...
I am using glue() to format strings. Ideally I would like to give the user the option to provide his own, potentially complex formatting patterns. The ...
I have created a simple environment in R with two simple function, AnEnv <- new.env() AnEnv$mod <- function(a, b) a%%b AnEnv$pwr <- function ...
I have a serie of vectors with different lengths within the R environment, for example: And I want call them by pattern into another funtion (rbind ...
A function that I'm writing needs to the know the environment of its caller. Can that be done without passing the environment in as an argument? ...
I'm following this steps, like in this workflow here: renv::init() working as usual and installing new packages renv::snapshot() The proble ...
I have a use-case for mapping a function to a vector and then assigning the results to individual objects in the parent environment - not the global e ...
I am working in the development of an app for decision trees using shiny, and java script. I have a structure of a dynamic tree, where the user can c ...
Inside a function, I am sourcing a script: and unfortunately, the scripts that I am sourcing are not fully under my control. They make calls to lib ...