webchem
webchem copied to clipboard
Check for possible edge case in `bcpc_query()`
@jranke fixed the way bcpc_query() parses activities and sub-activities in #348, #349 (thank you!). I think the fix relies on their always being one sub-activity for every activity, so we should look for any cases where activities have multiple sub-activities and add a test.
It may be best to just re-work the output to be a tibble (something that might be good to do anyways, #218).
I hope I'm now using the most recent version of the function.. Is this an example for the situation you mentioned @Aariq?
webchem::bcpc_query("silica gel")[[1]][c("activity", "subactivity")]
#> $activity
#> [1] "insecticides"
#>
#> $subactivity
#> [1] "desiccant insecticides; inorganic insecticides"
Created on 2022-02-16 by the reprex package (v2.0.1)
Exactly. So it looks like it's not "broken"—the activity and subactivity vectors will be the same length—but could be better as a tibble.