Skip to content

equivalent integers and floats don't get the same key #25

@Teebusch

Description

@Teebusch

R creates floats by default when using single numbers, but integers when using the range notation 1:3.
This creates unexpected behaviour:

library(noah)
ark <- Ark$new(parts = list(
  foo = c("one", "two", "three"),
  bar = c("fi", "fa", "fu")
))
max_total <- 9
ark$pseudonymize(1:5)
#> [1] "Two Fi"   "Three Fi" "Two Fu"   "Three Fa" "One Fi"
ark$pseudonymize(5L)  # gets theexisting pseudonym for 5
#> [1] "One Fi"
ark$pseudonymize(5)   # gets new pseudonym
#> [1] "Three Fu"
print(ark)
#> # An Ark: 6 / 9 pseudonyms used (1%)
#>   key         pseudonym
#>   <md5>       <Attribute Animal>
#> 1 14fa27a6... Three Fu
#> 2 216deaa6... Two Fi
#> 3 3297603a... One Fi
#> 4 8357d673... Three Fi
#> 5 9380ec58... Three Fa
#> 6 ee415bd5... Two Fu

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions