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
Describe the bug
When GAMA runs a R script the lines are executed line by line.
A condition taking several lines is not considered as a whole, as each line is independant. Thus even if the condition is not fulfilled the lines will be executed.
Maybe there is a way to execute several lines at once?
To Reproduce
Steps to reproduce the behavior:
Write script.R:
value = 0
if(F){
value = 1
}
print(paste("value:",value))
if(T){
value = 2
}
print(paste("value:",value))
Run this model:
model R_in_Gama
global skills:[RSkill]{
file Rcode <- text_file("myscript.R");
init {
// Try to use R tasks
do startR;
// Loop that takes each line of the R script and execute it.
loop s over: Rcode.contents{
unknown a <- R_eval(s);
write a;
}
}
}
experiment Test_R_Task type: gui {
}
Expected behavior
The value should not become 1 as the condition is false.
The if statement is placed in the previous line and is not considered in the next line which is executed.
Desktop:
OS: Windows 10
GAMA version: 1.9.2
The text was updated successfully, but these errors were encountered:
Describe the bug
When GAMA runs a R script the lines are executed line by line.
A condition taking several lines is not considered as a whole, as each line is independant. Thus even if the condition is not fulfilled the lines will be executed.
Maybe there is a way to execute several lines at once?
To Reproduce
Steps to reproduce the behavior:
Write script.R:
Run this model:
Output in GAMA:
Expected behavior
The value should not become 1 as the condition is false.
The if statement is placed in the previous line and is not considered in the next line which is executed.
Desktop:
The text was updated successfully, but these errors were encountered: