insightsengineering / insightsengineering/teal.code
qenv.error: cannot add bindings to a locked environment when evaluating qenv code:
Offen
bug
core
- Vorherrschende Sprache
- R
- Sterne
- 12
- Forks
- 11
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
### What happened?
When creating an S4 class inside `eval_code` you get an error that you `cannot add bindings to a locked environment`
```r
library(teal.data)
library(teal.code)
code <- c(
"setClass('aclass', slots = c(a = 'numeric', x = 'numeric', y = 'numeric')) # @linksto a x",
"x <- new('aclass', a = 1:3, x = 1:3, y = 1:3)",
"a <- new('aclass', a = 1:3, x = 1:3, y = 1:3)",
"a@x <- a@y",
"a@x <- a@x + 2",
"a@x <- x@a"
)
tdata <- eval_code(teal_data(), code)
tdata
```
```r
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.