Skip to content

dictionary names() and indexing methods broken in Windows #744

Description

@kbenoit

Seems related to #685 and also why the current master is broken on Windows.

The following fails on Windows.

testdict <- dictionary(file = "tests/data/dictionaries/issue-459.cat")
names(testdict)
## NULL
## Warning message:
## In class(x) <- class(x)[-i] :
##   Setting class(x) to "NA" sets attribute to NULL; result will no longer be an S4 object
testdict$SOUTH
## Error in sprintf(.subset2(x, "lookup_msg"), name) : 
##   'fmt' is not a character vector

testdict
## Dictionary object with 0 primary key entries and 2 nested levels.
## - SOUTH:
##   - BW:
##     - botswana, botswanan*, gaborone
##   - LS:
##     - lesotho, lesothonian*, maseru
##   - NA:
##     - namibia, namibian*, windhoek
##   - ZA:
##     - south africa, s african, sa, south african*, s african*, cape town, johannesburg
##   - SZ:
##     - swaziland, swazi*, lobamba, mbabane

On macOS, however:

testdict <- dictionary(file = "tests/data/dictionaries/issue-459.cat")
names(testdict)
## [1] "SOUTH"
testdict$SOUTH
## $BW
## $BW[[1]]
## [1] "botswana"   "botswanan*" "gaborone"  
## 
## 
## $LS
## $LS[[1]]
## [1] "lesotho"      "lesothonian*" "maseru"      
## 
## 
## $`NA`
## $`NA`[[1]]
## [1] "namibia"   "namibian*" "windhoek" 
## 
## 
## $ZA
## $ZA[[1]]
## [1] "south africa"   "s african"      "sa"             "south african*" "s african*"     "cape town"      "johannesburg"  
## 
## 
## $SZ
## $SZ[[1]]
## [1] "swaziland" "swazi*"    "lobamba"   "mbabane"  


testdict
## Dictionary object with 9 primary key entries and 2 nested levels.
## - CULTURE:
##   - people, war_in_iraq, civil_war
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions