Git Product home page Git Product logo

Comments (8)

stschiff avatar stschiff commented on July 17, 2024 1

OK. Wow. This is actually very clever. So I tried join_df_list(df_list_1) and it gives back a tibble with 117 columns, merging through the entire cascade. Very cool!

from sidora.core.

nevrome avatar nevrome commented on July 17, 2024

Hm - you're right - modifying the input list is a little bit hacky, but I think it's not so bad here, given the sequential merging procedure.

My implementation allows to merge multiple tables at once, not just two. And I would argue that this is a key feature.

from sidora.core.

stschiff avatar stschiff commented on July 17, 2024

Ah... OK, I expected I must have missed something... so it merges all pairs that are in direct sequence?

from sidora.core.

nevrome avatar nevrome commented on July 17, 2024

Yes. And that's why we need check_completeness(). The merging cascade breaks if an intermediate pair is missing.

This is also just a prototype at the moment. Doesn't include other tables beyond "TAB_Site", "TAB_Individual", "TAB_Sample", "TAB_Extract", "TAB_Library".

from sidora.core.

stschiff avatar stschiff commented on July 17, 2024

OK, cool. Good that I didn't go straight for a PR then.

from sidora.core.

nevrome avatar nevrome commented on July 17, 2024

Check out this example code:

creds <- readLines("playground/.credentials")
con <- DBI::dbConnect(
  RMySQL::MySQL(), 
  host = creds[1],
  user = creds[2],
  password = creds[3],
  db = "pandora"
)

df_list_1 <- get_df_list(c(
  "TAB_Site", "TAB_Individual", "TAB_Sample", "TAB_Extract", "TAB_Library"
), con = con)

join_df_list(df_list_1)

df_list_2 <- get_df_list(c(
  "TAB_Site", "TAB_Individual"
), con = con)

join_df_list(df_list_2)

df_list_3 <- get_df_list(c(
  "TAB_Site", "TAB_Extract"
), con = con)

join_df_list(df_list_3)

from sidora.core.

stschiff avatar stschiff commented on July 17, 2024

I also misunderstood R's in-place modify. I now remember having read in advanced R that in-place modify of lists creates duplicates, so this may be hacky but actually save, I think.

from sidora.core.

nevrome avatar nevrome commented on July 17, 2024

Is this issue still relevant or can we close it @stschiff?

from sidora.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.