Skip to content

Commit

Permalink
Merge pull request #117 from generable/fetch-doses-error
Browse files Browse the repository at this point in the history
fix possible duplicate names in other tables
  • Loading branch information
jburos authored Feb 28, 2024
2 parents 894e4a7 + c07a010 commit 403b9e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/geco_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pivot_events_wider <- function(.d) {
d <- as_dataframe.geco_api_data(events, flatten_names = c('params'))
if ('params' %in% names(d)) {
d <- d %>%
tidyr::unnest_wider(.data$params)
tidyr::unnest_wider(.data$params, names_repair = 'universal')
}
suppressWarnings({
d <- d %>%
Expand Down
2 changes: 1 addition & 1 deletion R/geco_lesions.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fetch_lesions <- function(project = NULL, project_version_id = NULL, annotate =
lesions <- geco_api(LESIONS, project_version_id = pv_id, url_query_parameters = filters)
d <- as_dataframe.geco_api_data(lesions, flatten_names = 'params')
if (nrow(d) > 0 && 'params' %in% names(d) && isTRUE(annotate)) {
d <- d %>% tidyr::unnest_wider(.data$params)
d <- d %>% tidyr::unnest_wider(.data$params, names_repair = 'universal')
}
suppressWarnings({
d <- d %>%
Expand Down
2 changes: 1 addition & 1 deletion R/geco_regimens.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
purrr::map('treatments')

td <- purrr::map_dfr(treatments, ~ as_dataframe.geco_api_data(content = .x, flatten_names = 'drug'), .id = 'regimen_id') %>%
tidyr::unnest_wider(.data$drug, names_sep = '_') %>%
tidyr::unnest_wider(.data$drug, names_sep = '_', names_repair = 'universal') %>%
dplyr::rename_at(.vars = dplyr::vars(-dplyr::starts_with('drug'),
-dplyr::starts_with('regimen')),
.funs = .add_prefix,
Expand Down
2 changes: 1 addition & 1 deletion R/geco_trial_arms.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
if ('params' %in% names(ta) && all(purrr::map_int(ta$params, nrow) == 1)) {
ta <- ta %>%
tidyr::unnest_wider(.data$params)
tidyr::unnest_wider(.data$params, names_repair = 'universal')
}
}
suppressWarnings({
Expand Down

0 comments on commit 403b9e2

Please sign in to comment.