Small Package Broad Impact

How I discovered the ultimate new hire hack 

Trang Lê

data scientist, BMS

OCTober 2021

a few weeks later...

  • Understand company's systems

  • Build relationships

  • Develop skills/contribute

milestones

a bitesize
problem

1

Where can I find the color templates?
The fonts?

What are these .woff2 and .ttf files?

2

How does Shiny work?

Where do we host the apps?

Will bslib be useful?

3

4

Will the user always have to install the BMS fonts manually?

How do I distribute this package?

5

Leslie Emery

an "excuse" to talk to my incredible colleagues

Clara Amorosi

Loan Robinson

Iain Wallace

great starting points for our conversations

internals

- Jira tickets

- Confluence pages

- VPN/proxy

What new R skills have I learned?

bslib rules! 👑

bs_theme_preview()
bs_theme(
  primary = "#be2bbb", secondary = "#eee7e",
  success = "#1dce9b", info = "#009fba",
  warning = "#ffac25", danger = "#df603a"
)
bms_light <- function(
  version = 3,
  primary = "#be2bbb", secondary = "#eee7e",
  success = "#1dce9b", info = "#009fba",
  warning = "#ffac25", danger = "#df603a",
  font = c("bms", "bms_nw"),
  fallback_font = "Arial Narrow", dir = "bmsfonts", ...
) {
  ...

  bslib::bs_theme(
    version = version,
    primary = primary, secondary = secondary, 
    success = success, info = info, warning = warning, danger = danger,
    base_font = bslib::font_collection(base_font, fallback_font), ...
  )
}

bslib rules! 👑

Clunky: install font and load into R manually

.onLoad <- function(){
  shiny::addResourcePath(
    "bmsfonts", 
    system.file("fonts", "bmsdash")
  )
  sysfonts::font_add("BMS Humanity")
}

fluidPage(
  theme = bms_light(), 
  ...
)
diamond


diamond +
  scale_fill_bms() +
  theme_bms()

 show_bms_colors()

theme = bms_light() |>
  bslib::bs_add_rules(
    sass::as_sass("
      table.dataTable tbody 
      tr.active td {
        background: #A69F9F 
        !important;
      }"
    )
  )
  

DT::datatable format may still have the default blue when selecting a row.
To change this color, we can use bs_add_rules() to add a little more sass.

⚠️ Watch out for

different bootstrap versions!!!!

  • Understand company's systems

  • Build relationships

  • Develop skills/contribute

milestones

  • connect to databases
  • impute missing values
  • common visualizations
  • data aggregations

Packages

  • documentation
  • setup guide
  • benchmarks

Notebooks

  • 🛞 reinvent the wheel

  • 💨 speed up routine tasks

  • 🔥 consistency

  • ✨ streamline updates

a package

The start of something bigger

What can we all do?

Be welcoming

invite people to contribute to your existing project

#good-first-issue

be kind

- and flexible

- and patient

- give bravos, authorships

BUIld together

- packages

- notebooks

- memes

- institutional knowledge

Thank you!

Made with Slides.com