Skip to content

dfm_lookup is not robust enough #704

Description

@koheiw
# Error when nothing matches
mx <- dfm(data_char_ukimmig2010)
dict <- dictionary(list('en'=list('foreign policy' = 'aaaaaa', 'domestic politics' = 'bbbbb')))
dfm_lookup(mx, dict)

# Error in x[, unlist(entries_id, use.names = FALSE)] : 
#     invalid or not-yet-implemented 'Matrix' subsetting 

# This is OK
dict <- dictionary(list('en'=list('fp' = 'foreign', 'dp' = 'domestic')))
dfm_lookup(mx, dict)

# but I cannot use space in keys
dict <- dictionary(list('en'=list('foreign policy' = 'foreign', 'domestic politics' = 'domestic')))
dfm_lookup(mx, dict)

# Error in intI(j, n = x@Dim[2], dn[[2]], give.dn = FALSE) : 
#     invalid character indexing 
# In addition: Warning message:
#     In features2vector(features) :
#     dfm_lookup(mx, dict) does not support multi-word features

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions