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
If the same expression is passed into microbenchmark() twice, then the resulting error is not very helpful.
library(microbenchmark)
microbenchmark(1+1, 1+1)
## Error in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels) else paste0(labels, : factorlevel [2] isduplicated
(On older versions of R, you get the warning duplicated levels in factors are deprecated).
I can't think of a good reason why you would want to include the same expression twice, so this usually means a copy and paste error. Consequently, you should throw a human-readable error or warning before the expressions are evaluated, explaining the problem. Some thing like
Thesameexpression, 1+1, appearsmorethanonce.
The text was updated successfully, but these errors were encountered:
This was reported as olafmersmann#7.
If the same expression is passed into
microbenchmark()
twice, then the resulting error is not very helpful.(On older versions of R, you get the warning
duplicated levels in factors are deprecated
).I can't think of a good reason why you would want to include the same expression twice, so this usually means a copy and paste error. Consequently, you should throw a human-readable error or warning before the expressions are evaluated, explaining the problem. Some thing like
The text was updated successfully, but these errors were encountered: