I want to run a code when sys.time() is specified.
I don't understand why if I write:
inputTime <- as.POSIXct("2018-02-21 14:51:00")
while(TRUE) {
if(Sys.time() == inputTime){
a <- 5
b <- 6
c <- a+b
print(c)
}
}
I don't get any result, but if I write something like:
inputTime <- Sys.time()+3
while(TRUE) {
if(Sys.time() == inputTime){
a <- 5
b <- 6
c <- a+b
print(c)
}
}
I get the result I was looking for (11 in this case).
Can you please help me?