You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If object is treated as an iterator in a for loop, like x below, then get_code treats this case as this object created in this for loop, hence even though it's a temporary object (just for the time of the for loop execution) it gets extracted in the get_code
library(teal.code)
q<- within(qenv(), {
a<-1b<-2
}) |> within({
for (xin c(1, 2)) {
b<-ab<-b+a+1b+3->b
}
}) |> within({
x<-5
})
get_code(q, names='x') |> cat()
#> a <- 1#> b <- 2#> for (x in c(1, 2)) {#> b <- a#> b <- b + a + 1#> b <- b + 3#> }#> x <- 5
If object is treated as an iterator in a
for
loop, likex
below, thenget_code
treats this case as this object created in thisfor
loop, hence even though it's a temporary object (just for the time of thefor
loop execution) it gets extracted in theget_code
Created on 2024-11-27 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: