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
Whoops. I missed the notification on this issue while I was on vacation. It's been raised by a few other customers too. I'll take a look and see how this can be improved.
While passing an R vector of timestamps to the timeseries_client.R parseIso8601 function, I got this message:
Warning message:
In if (substr(isoText, len - 2, len - 2) == ":") { :
the condition has length > 1 and only the first element will be used
I modified the relevant portion of the function code to use an ifelse statement and no longer get the warning message:
ifelse(substr(isoText, len - 2, len - 2) == ":",
isoText <- paste0(substr(isoText, 1, len - 3), substr(isoText, len - 1, len)),
ifelse(substr(isoText, len, len) == "Z",
isoText <- paste0(substr(isoText, 1, len - 1), "+0000")
)
)
Alex's email included an easy way to demonstrate that the parseIso8601 function only works on strings rather than vectors:
For example, this line of code will produce the warning:
ii=c("00:00","00:01"); if(substr(ii, 5- 2, 5 - 2) == ":") { print("hey") }else{print("no")}
but if use just a string for ii, no error.
ii="00:00"; if(substr(ii, 5- 2, 5 - 2) == ":") { print("hey") }else{print("no")}
The ifelse construct in R works with vectors.
The text was updated successfully, but these errors were encountered: