Resources

Small Package, Broad Impact: How I Discovered the Ultimate New Hire Hack - posit::conf(2023)

Presented by Trang Le Onboarding new hires can be a challenging process, but taking a problem-focused approach can make it more meaningful and rewarding. In this talk, I will share how I discovered the ultimate new hire hack by creating two small packages that gave me the confidence I needed when I started at BMS. Through building these packages, I not only learned R things like using bslib and making font files available for published dashboards, but also gained a deep understanding of my company's internal systems and workflows, and connected with my team via lots of questions. The resulting packages are still heavily used today. Join me to discover how small packages can have a broad impact and what hiring managers can do to help. Presented at Posit Conference, between Sept 19-20 2023, Learn more at posit.co/conference. -------------------------- Talk Track: Developing your skillset; building your career. Session Code: TALK-1112

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

Hi everyone, thank you for sticking around to the last talk here. My name is Tran, and this is me two years ago, fresh out of academia, pre-pregnancy. This was the day before I started my job at Bristol Myers Squibb. Very excited, as you can see.

Now, like with many new jobs, my first weeks were filled with training and orientations and getting to know my new co-workers, familiarizing myself with everything else in the organization, which left me feel like this a few weeks later.

I still remember the moment when I first learned to ski, and I felt like I started to get the hang of it. I felt confident, I'm on a nicely groomed trail, I can turn my weight forward, feeling very good. But then comes a powder day. Now, if you ski, you know what happens. Everything falls apart. I am no longer in control, I cannot turn, there's way too much powder, and I was scared. I felt like I wasn't good enough, and there was still a lot more to learn.

Well, at BMS, I started my hands on like a few different bigger projects, and I had very little contacts on them. Most of my time was spent digging around for essentially non-existent documentation, and any progress at that point felt extremely incremental.

But in retrospect, I think the onboarding process can be structured quite in a straightforward way with three items on the checklist. You want to understand the company systems, where the servers are and everything. You want to build relationships with your new colleagues, and I do think that you also want to develop some new skills and start to contribute.

But in retrospect, I think the onboarding process can be structured quite in a straightforward way with three items on the checklist.

Finding a small, doable problem

So like Lydia's journey of learning data science, how she structured that around R4DS, my argument today is that by structuring the onboarding process around a small doable problem, you'll be able to check off all of these items on your list. Lucky for me, this problem came very quickly after I joined.

So we were in a bigger brainstorming meeting when my manager, Ian, sent this message on Teams. Do we have a BMS color theme? Would be very useful. So I thought, well, I can continue to get frustrated and struggle with these two bigger projects or I can take on a new one that is more fun and hopefully more doable.

And today, I'm here to tell you the story, what I learned in building this package that I later named BMS Dash and how rewarding it felt and the environment, the very engaging and productive environment that it created.

Questions and colleagues

So first, the questions. Before you build anything, you're always faced with tons of questions. Mine was, where can I find the color templates? What about the fonts? What are these .WORF2 and TTF files? I've never seen them before. How does Shiny work? I've never built a Shiny app before, although many people in my team have.

And then once I get something, then where do I host the app? And I've heard about this bslib package that's very good for theming. Will it be useful? And is there a way to circumvent the manual installation of fonts on the user's computer? And finally, once I have this package together, how do I distribute?

At first, I was trying to work through all these questions by myself, doing my own research and everything, but I soon realized that these questions were a great excuse to talk to my incredible new colleagues.

So let me introduce you to my co-author of VMS Dash, Leslie, Clara, Lon, and Ian. These individuals have been incredibly welcoming and supporting to me from the beginning. When I first joined, they would answer every single question I had from, oh, where is the branding information store? Or how do I ignore this file when I deploy my Shiny app?

And also, these questions, so instead of one-on-ones, instead of going through these small talks and ask about, oh, how was your day? What did you do during the weekend? I had these real questions that they can answer, and they were great starting points for conversations.

Learning the company's systems

I was surprised to learn that at VMS, we actually used a lot of Posit products before it was called Posit Team. So for VMS Dash, I would develop the package on Workbench, deploy some of the example Shiny apps and Flex dashboards and notebooks on Connect, and then finally, once I had the package, I could distribute it on, I could put it on Package Manager so that other people in my team and the company can download and use it.

I also learned about the JIRA Ticket System, Confluence Pages, and how to set proxy when I'm on VPN so that I can download the R packages from Crayon, because somehow VMS blocked that.

New R skills: bslib and theming

What new R skills have I learned? I learned that bslib is magical. I don't know if many of you here have used it, but it's great for Shiny, and especially in my case, on the theming side, if you've seen BS stands for Bootstrap. If you've used this function BS Theme Preview, what it will do is spin up an example dashboard for you. In here, you can choose what theme you like, the colors, the fonts, and once you're done with all of that, all you need to do is close the app, and what bslib would give you is this snippet of code that you can basically copy and paste into your theme argument in your Shiny function, so incredibly helpful if you haven't checked it out, I highly recommend you do so.

So that's basically what I did. I just wrapped it around a function I called BMS Light, and then put those color hex codes into my default argument, and then called BS Theme in my function. What about the dot, dot, dots? So the rest of this function was to do fonts.

Initially, it was really hard to kind of figure out all these font things, and the user would have to install the font and load it into R manually. What I did was digging around the bslib GitHub issues and found this really nice issue, and I said it's really nice because the poster had created an excellent reproducible example where I found this one line that was helpful in my case. They said, oh, this line borrows the font from bslib, so then I learned that, oh, I just need to put these wolf2 font files that I found earlier in the branding information into my inst directory in the package, and then use this function, add resource path in my package.

So that's what I did. Put it into unload, and finally, another tidbit here is that you have to use this font, the package, to add the font into your environment, so in this case, the font that we have is BMS Humanity.

So with all of that together, now all the user have to do is to change theme equals BMS Light, and then you would get an app that looks something like this. You would have the BMS signature, Passion Popal, and also our BMS Humanity font, and I couldn't capture the entire screenshot here for obvious reasons, but hopefully you can have a feel of what it looks like.

I also added a few different functions for ggplot theming. So for example, this is an example plot using the default theme, but once you add scale fill BMS and theme BMS, it would change the color to use our own colors, the BMS colors, and then using the Humanity font again.

I learned, so this function is show BMS colors. I find it incredibly helpful. I sort of stole this from my friend Jake Riley at the Children's Hospital of Philadelphia when I saw his talk, but yeah, just a great, he's done something, internal package for CHOP as well. But I think this is a great way to show, especially with the new RStudio IDE, you can see all the colors and everything, so that the user can kind of pick which colors they want, and they don't have to go dig deep into any documentation for, you know, oh, what colors should I use if I want this to be kind of looking like BMS brand.

More bslib tips

One last tip on bslib. So with all of that, your DD data table, if you use it in your app, which we do a lot in our organization, it may still have this default blue when you select a row, and if you're like me, that's really annoying, like this blue in the middle of all the purple. So to change this color, however, you can use BS add rules to add a little bit more sass into your app. So this just speaks to kind of how customizable bslib is.

And finally, just a warning, is to watch out for different bootstrap versions. So make sure to kind of, you know, try to pass through that version argument, because you may have a different shiny app and different, with different versions. So if the user wants to use a different version, they can do so.

Impact and a culture of knowledge sharing

So I'm now happy. I think all of my skills have kind of improved a little bit in R, but also some of my new relationships, I've gotten a handle of, I've gotten some understanding of the company's internal systems. There was still a lot more to learn, but I was happy to know that, you know, the package was used right away, and it's still being heavily used today. Very exciting to see, you know, any app, any new app that comes out that have this, you know, BMS dash theme.

I'm a huge fan of packages, because of all of these advantages that it gives you, you can read more on about, you know, advantages of internal packages in this amazing blog post by Emily Reeder. Some of the ideas for creating, like, starter packages, if you're a new hire, is to get your package to connect to databases, or perform some simple imputation missing values, of imputation of missing values, or common visualizations or data aggregations.

But it doesn't have to be a package. If you're a new hire, you can just add more to the documentation, or if the documentation doesn't exist, create Wasm, put it in a notebook, deploy it on connect, make it visible for other people to use. You can create setup guide, how to set up your VS code to work with R in this EC2 instance. Or you can make benchmarks.

So this is an example notebook written in Quarto by a recent hire in our team, Jonathan Chang. And as you can see, it uses BMS dash, and actually is not just BMS dash, but BMS dash for Quarto, which my colleague Jimmy here made as an extension to BMS dash. And so yeah, just by kind of working through this, I think Jonathan put this together maybe in less than a week. He learned Quarto, he learned connect, and kind of how to deploy all of this document. And by the way, he's a Python programmer. But we love Python at BMS too, and in this particular instance, he was trying to compare the speed in data wrangling in Pandas, Polars, and Modern.

So all that is to say, I think focusing on a small problem is really, really valuable. The success of BMS dash, I think it's not the end of the story here. I like to think that it's the start of a culture of knowledge sharing in our team, and beyond in the department as well.

I like to think that it's the start of a culture of knowledge sharing in our team, and beyond in the department as well.

So we have BMS dash, I eventually pull some of the theming out to a different package I call BMS pal. We have potent for those response analyses. So now scientists don't have to kind of copy code here and paste it there. We have all things BMS, which is actually not a package, but something I started writing down, you know, how to request access to this particular server. And then many other have contributed to it. So including my summer intern last year, so very excited about that. We also started BMS connect widgets, which is a package to track user stats on our deployed documents.

Call to action

So my call to action for you today is that please be welcoming. If you have a new hire on your team now or soon, please invite them to contribute to your existing project. Using the hashtag good first issue is a really good idea to do so, so they know where to look. Be kind and flexible and patient. You know, they're new. They still have a lot to learn. So don't make them contribute to something so big and expect results right away. If they contribute to your packages, give bravos, give authorships so that we can all build together.

And don't get me wrong. I think everyone on the slope will have to fall once in a while in order to learn. But my hope is that together we can help each other fall a little bit more gracefully. Thank you.

Thank you, Cheng. So again, we are taking questions on Slido. So you've done a wonderful job of walking us through sort of that process. I'm wondering if you got to go back and do that again, what might you adjust or do differently?

That's a great question. I think maybe just talking to more people and don't afraid of get networking, like Lydia said. Yeah, because it was, you know, when you started it, you feel like everything is so new and you don't know where things are. And so it took me a long time to kind of figure out all this information. But yeah, I think your co-workers are there to support you. So just get talking.