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
I was looking to get ranks using frankv(...,ties.method="random") and encountered a seemingly inconsistent behavior. Say we'd like to calculate ranks, by reference, using a character vector of names of colums in .SD. The following all work:
dt[,ranks:= frankv(.SD,cols=rank_cols,ties.method='average',na.last=NA),by='z']
dt[,ranks:= frankv(.SD,cols=rank_cols,ties.method='random'),by='z']
# two wrongs don't make a right!dt[,ranks:= frankv(.SD,cols=rank_cols,ties.method='random',na.last=NA),by='z']
it likewise works again when not explicitly invoking .SD:
It seems like an interface bug that this call does not work for some (valid) choices of ties.method or na.last ('random' and NA respectively) while working for all others. In both cases it appears that frankv calling set during the function evaluation is what triggers the error. Trying to specify .SDcols also does not work.
In failing cases the error is of the form:
Errorin set(x, NULL, "..stats_runif..", v) :.SDislocked.Updating.SDbyreferenceusing:=orsetarereservedforfutureuse.Use:=injdirectly.Oruse copy(.SD) as a (slow) lastresort, until shallow() isexported.
I was looking to get ranks using
frankv(...,ties.method="random")
and encountered a seemingly inconsistent behavior. Say we'd like to calculate ranks, by reference, using a character vector of names of colums in.SD
. The following all work:Example
but these do not:
it likewise works again when not explicitly invoking .SD:
It seems like an interface bug that this call does not work for some (valid) choices of
ties.method
orna.last
('random' and NA respectively) while working for all others. In both cases it appears thatfrankv
callingset
during the function evaluation is what triggers the error. Trying to specify.SDcols
also does not work.In failing cases the error is of the form:
Session Info
The text was updated successfully, but these errors were encountered: