r-environment Questions

4

Solved

Suppose I have a closure add_y(y) which returns a function that adds y to its input. add_y <- function(y) { function(x) { x + y } } add_4 <- add_y(4) So the value of add_4 is a function t...
Actinomycete asked 24/12, 2021 at 19:35

1

Solved

I have a project that used R 3.6, I have upgraded R to 4.0.2 and would like to use 4.0.2 for this project. I'm wondering how to go about doing so, or should I completely delete renv/ and rebuild? E...
Mcmahon asked 2/9, 2020 at 11:9

5

Solved

Is there a way to source() a script in R such that it is attached as a parent to the global environment (.GlobalEnv)? Currently, when I source a script, all variables and functions of that script ...
Wardrobe asked 21/9, 2016 at 15:24

0

Is it possible to lock the global environment and still allow .Random.seed to be set or removed? The default behavior of lockEnvironment() is too aggressive for my use case. lockEnvironment(global...
Everrs asked 21/2, 2019 at 16:17

1

Solved

What advantage/disadvantage is there for using one over other in the following two cases? Case-I is returning its output as an environment and Case-II is returning its output as a list. Case I: f...
Basalt asked 5/2, 2019 at 14:51

1

Solved

I have the following Rmd file I called test.Rmd: --- title: "test" output: html_document --- ```{r} print(y) ``` ```{r} x <- "don't you ignore me!" print(x) ``` I want to call render the fo...
Peursem asked 9/10, 2018 at 15:37
1

© 2022 - 2024 — McMap. All rights reserved.