reconhub / linelist

An R package to import, clean, and store case data
https://www.repidemicsconsortium.org/linelist
Other
25 stars 5 forks source link

top_values does not work with 2 categories and n = 1 #91

Closed thibautjombart closed 5 years ago

thibautjombart commented 5 years ago

At 58ed4c745ef6ee4799e0912a5704a1176c084db2, we have:

top_values(factor(c(1,1,2)), n = 1)
# [1] 1 1 2
# Levels: 1 2

while we would expect:

# [1] 1 1 other
# Levels: 1 other
zkamvar commented 5 years ago

closing this in favor of #88 because it is described there.

zkamvar commented 5 years ago

https://github.com/reconhub/linelist/pull/90#issuecomment-534459911

thibautjombart commented 5 years ago

Thanks for the fix!