Skip to content
Prev 59136 / 63424 Next

return (x+1) * 1000

I'm not thinking of complicated cases.

This happened to me in a function that returns 10 minute slots

slot <- function (seconds) {
    return (seconds %/% 600) * 600
}

Obviously I found the issue while debugging and corrected my code with 
surrounding parenthesis, but I was surprised that the R parser did not catch 
this syntactic error.

This is especially poignant when we have to switch between languages like 
python where the original line would produce the desired result.

Mateo.
--  
Mateo Obreg?n.
On Friday, 20 November 2020 21:58:29 GMT Gabriel Becker wrote: