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
aw_query() currently returns a list of lists of vectors, when it finds a match and a vector NA of length 1, if it doesn't. In my opinion this is quite cumbersome to wrangle with in R. Example:
The first two entries are NA vectors with length 1, the second two entries are lists of vectors. In my opinion it would be better to return a tibble if something is found, because one can use data.table::rbindlist() or dplyr::bind_rows() then. E.g.: data.table::rbindlist(aw[ !is.na(aw) ]). Though, we could also think about returning tibble::tibble(query = '630-20-6') in the case of no match instead of NA, meaning one wouldn't have to exclude NA explicitly when binding. AW returns tabular-freinldy data, so I think it's quite easy to implement the tibbles.
Also, aw_query() results have the class attribute aw_query assigned. Designed by @Edild to work with the S3-OO system. Should we continue using this? Lately, we haven't made use of any OO-functions. I think we haven't really agreed on that up to now. Also to discuss further in #228.
The text was updated successfully, but these errors were encountered:
aw_query()
currently returns a list of lists of vectors, when it finds a match and a vectorNA
of length 1, if it doesn't. In my opinion this is quite cumbersome to wrangle with in R. Example:The first two entries are
NA
vectors with length 1, the second two entries are lists of vectors. In my opinion it would be better to return a tibble if something is found, because one can usedata.table::rbindlist()
ordplyr::bind_rows()
then. E.g.:data.table::rbindlist(aw[ !is.na(aw) ])
. Though, we could also think about returningtibble::tibble(query = '630-20-6')
in the case of no match instead ofNA
, meaning one wouldn't have to excludeNA
explicitly when binding. AW returns tabular-freinldy data, so I think it's quite easy to implement the tibbles.This also belongs to #218.
Also,
aw_query()
results have the class attributeaw_query
assigned. Designed by @Edild to work with theS3
-OO system. Should we continue using this? Lately, we haven't made use of any OO-functions. I think we haven't really agreed on that up to now. Also to discuss further in #228.The text was updated successfully, but these errors were encountered: