I am using the below code but all the values are getting print in one go not step by step.
i <- 1
while(i<6)
{
print (i)
Sys.sleep(2)
i = i+1
}
I am using the below code but all the values are getting print in one go not step by step.
i <- 1
while(i<6)
{
print (i)
Sys.sleep(2)
i = i+1
}
Hi @masingh! Welcome!
I'm afraid I couldn't reproduce your problem — when I run that code, I see what I think you are looking for: each successive value is printed to the console after a 2 second wait.
Can you give some more details about how you're running the code?
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.