validate by one analyst: confirm there are precisely the columns used across all analyses

Open
#54 0 comments 0 reactions 1 assignee View on GitHub

@softloud is already working on this.

Since Jan 15, 2026.

Assessment

This issue has not been assessed yet.

Description

bug wrangling

Debug why this validation doesn't work -- probably time to #55

This code will be less complex without carrying the column index.

# scratchpad validation

# validate_analysts

# source_dat <- targets::tar_read(dat_eucalyptus)
# source_column_index <- targets::tar_read(column_index_eucalyptus)
# analysts <- targets::tar_read(analysts_eucalyptus)
# set.seed(45)

get_validate_analysts <- function(dat, source_column_index, analysts) {

message("select an analyst to validate")
analyst_sample <- 
  analysts |>
    dplyr::filter(n_analyses > 1) |>
    dplyr::sample_n(1)
message("analyst ID: ")
message(analyst_sample$analyst_id)
message("number of analyses conducted: ")
message(analyst_sample$n_analyses)

source_dat_rows <-
  dat |>
    dplyr::filter(analyst_id == analyst_sample$analyst_id) 

message("check the number of rows in the source data 
is the same as the number of analyses recorded")
message(nrow(source_dat_rows) == analyst_sample$n_analyses)

# select the columns that are not all NA
source_dat_cols <- source_dat_rows |>
  dplyr::select(
    where(~!all(is.na(.)))
  ) |>
  colnames()


# match the column indexes to the source columns
# and extract

identified_cols <- tibble::tibble(
  col_index = analyst_sample |> dplyr::pull(source_cols) |> unlist()
) |>
  dplyr::left_join(
    source_column_index,
    by = "col_index"
  ) |>
  dplyr::pull(col_name)

message("check the source columns identified match those in the source data")
# exclude first 6 metadata columns
message(all(sort(identified_cols) == sort(source_dat_cols[-c(1:6)])))

}
Dominant language
HTML
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from softloud/questionability

All issues in softloud/questionability

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.