Skip to content

Commit 1af38b9

Browse files
committed
Fix variable scopes
1 parent afba3f4 commit 1af38b9

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ importFrom(purrr,map2)
107107
importFrom(purrr,map_df)
108108
importFrom(purrr,map_dfr)
109109
importFrom(rlang,":=")
110+
importFrom(rlang,.data)
110111
importFrom(rlang,as_function)
111112
importFrom(rlang,fn_fmls)
112113
importFrom(rvest,html_table)

R/chembl.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ validate_chembl_version <- function(version = "latest") {
734734
#'
735735
#' Query a ChEMBL resource with a representative example and convert the
736736
#' response into a structured table.
737+
#'
738+
#' @importFrom rlang .data
737739
#' @param resource character; the ChEMBL resource to query. Use
738740
#' [chembl_resources()] to see all available resources.
739741
#' @param verbose logical; should verbose messages be printed to the console?
@@ -802,22 +804,22 @@ get_chembl_ws_schema <- function(resource, verbose = getOption("verbose")) {
802804
all <- dplyr::bind_rows(all, result)
803805
}
804806
all <- all |>
805-
dplyr::group_by(field, parent) |>
807+
dplyr::group_by(.data$field, .data$parent) |>
806808
dplyr::filter(
807-
if (any(!is.na(value))) {
808-
dplyr::row_number() == which(!is.na(value))[1]
809+
if (any(!is.na(.data$value))) {
810+
dplyr::row_number() == which(!is.na(.data$value))[1]
809811
} else {
810812
dplyr::row_number() == 1
811813
}
812814
) |>
813815
dplyr::ungroup()
814816
all <- all |>
815817
dplyr::mutate(
816-
parent_row = match(parent, field),
817-
order_index = ifelse(is.na(parent_row), dplyr::row_number(), parent_row + 0.1)
818+
parent_row = match(.data$parent, .data$field),
819+
order_index = ifelse(is.na(.data$parent_row), dplyr::row_number(), .data$parent_row + 0.1)
818820
) |>
819-
dplyr::arrange(order_index) |>
820-
dplyr::select(-parent_row, -order_index)
821+
dplyr::arrange(.data$order_index) |>
822+
dplyr::select(-.data$parent_row, -.data$order_index)
821823

822824
if ("value" %in% names(all)) {
823825
na_fields <- all$field[is.na(all$value) & all$class != "tbl_df"]

0 commit comments

Comments
 (0)