There was an error while loading. Please reload this page.
1 parent 1236117 commit afba3f4Copy full SHA for afba3f4
1 file changed
R/chembl.R
@@ -651,8 +651,12 @@ format_chembl <- function(cont) {
651
# Helper to flatten a single entity
652
flatten_entity <- function(entity) {
653
for (nm in df_names) {
654
+ # e.g. activity is sometimes a list sometimes a character string
655
+ # only flatten if it is a list to prevent error.
656
if (nm %in% names(entity)) {
657
+ if (inherits(entity[[nm]], "list")) {
658
entity[[nm]] <- dplyr::bind_rows(entity[[nm]])
659
+ }
660
}
661
662
for (nm in flat_names) {
0 commit comments