Lahman icon indicating copy to clipboard operation
Lahman copied to clipboard

Entity-Relationship (ER) diagram for Lahman

Open friendly opened this issue 8 years ago • 8 comments

Many people find it hard to see how the various Lahman data frames are related: what are the keys that link the different data sets? One possibility is an ER diagram, commonly used to describe relational data bases.

A quick Google search turned up the datamodler package. Perhaps this could be used here in some way:

  • In a vignette
  • In the README.md as a package overview

friendly avatar Oct 09 '17 14:10 friendly

I hope this tutorial will help: http://bergant.github.io/datamodelr/lahman.html

bergant avatar Oct 13 '17 15:10 bergant

@bergant -- that's a great candidate for the vignette project! I had no idea that sort of functionality was available in R, but shouldn't have been surprised.

MonkmanMH avatar Oct 13 '17 21:10 MonkmanMH

Perhaps we could use {dm} to both present the ER diagram and offer a data structure that has the keys integrated?

https://krlmlr.github.io/dm/

krlmlr avatar Mar 27 '20 15:03 krlmlr

An example ER diagram or proof of concept would be welcomed

friendly avatar Mar 28 '20 02:03 friendly

Looks interesting after a rather quick glance. I'd encourage anyone wanting to try this out in the short term to do so against the annual data update branch as there will be added data frames and potentially some (looking at you Master table..) removed.

I'm hoping to bring work on the annual data update to a close this weekend, and I'll update here as to where the best target branch is when it changes in a meaningful way.

cdalzell avatar Mar 28 '20 03:03 cdalzell

I just added a graphic of the database schema I got from Sean Lahman to the README.md. Maybe this is sufficient

friendly avatar Mar 29 '22 22:03 friendly

I think that the schema image addresses this issue nicely.

We don't want to lose the {datamodelr} example by @bergant, so I'll add it to the Vignette Introduction.

MonkmanMH avatar Mar 30 '22 00:03 MonkmanMH

We don't want to lose the {datamodelr} example by @bergant, so I'll add it to the Vignette Introduction.

I just followed the {datamodelr} web connections, and see that the package has evolved/been incorporated into {dm}, which makes no mention of {Lahman}. I have a supplementary purpose for tackling this, so I'll put together a vignette demonstrating {dm} functions.

FYI: the {dm} page is here https://cynkra.github.io/dm/

MonkmanMH avatar Mar 30 '22 00:03 MonkmanMH