Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request convinence function to provide flat table of non-sequential tables. #32

Open
jfy133 opened this issue Aug 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jfy133
Copy link
Member

jfy133 commented Aug 10, 2020

Use case (from Ben): user wants a flat table of just columns from Site and Library tables.

Proposed implementation:

  • get_df to get tables requested
  • make_complete (
    #' Make sequence-complete Pandora table list
    #'
    #' Pandoras layout is a hierarchical sequence of tables: All tables have a clear
    #' predecessor and successor. \code{join_pandora_tables()} uses this fact to
    #' merge tables accordingly. \code{make_complete_table_list} is
    #' a helper function to fill the gaps in a sequence of Pandora tables.
    #'
    #' @param tabs character vector. List of Pandora table names
    #' @param join_order_vector character vector. Reference vector with the Pandora
    #' structure
    #'
    #' @export
    make_complete_table_list <- function(
    tabs,
    join_order_vector = sidora.core::pandora_tables
    ) {
    positions <- sapply(tabs, function(x) { which(x == join_order_vector) })
    res <- join_order_vector[seq(min(positions), max(positions), 1)]
    return(res)
    }
    )
    • allow make_complete to fill in the gaps
    • New functionality: if not sequential tables requested, remove the columns from 'intemrediate' tables filled in by make_complete before returning (in case above, e.g. psuedocode: `select_if(-starts_with("sample", "individual", "extract")
@jfy133 jfy133 added the enhancement New feature or request label Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant