Software by Emil Hvitfeldt#
Posts and resources by Emil Hvitfeldt#
Advent of Code for R users | Emil Hvitfeldt | Data Science Lab
The Data Science Lab is a live weekly call. Register at pos.it/dslab! Discord invites go out each week on lives calls. We’d love to have you!
The Lab is an open, messy space for learning and asking questions. Think of it like pair coding with a friend or two. Learn something new, and share what you know to help others grow.
On this call, Libby Heeren is joined by Posit engineer Emil Hvitfeldt as he walks through Day 1 of Advent of Code 2026 using R. This is a super friendly, collaborative, and cheery intro to AoC! Don’t forget, you can do Advent of Code at any ole time of year
Hosting crew from Posit: Libby Heeren, Isabella Velasquez, Daniel Chen, Emil Hvitfeldt
Emil’s socials and urls: website: https://emilhvitfeldt.com/ GitHub: https://github.com/emilhvitfeldt Bluesky: https://bsky.app/profile/emilhvitfeldt.bsky.social LinkedIn: https://www.linkedin.com/in/emilhvitfeldt/
Resources from the hosts and chat:
Advent of Code: https://adventofcode.com/ Install Positron: https://positron.posit.co/ Eric Wastl, Advent of Code: Behind the Scenes: https://www.youtube.com/watch?v=_oNOTknRTSU AoC Subreddit: https://www.reddit.com/r/adventofcode/ Kieran Healy shared a reddit post with an Advent of Code answer done in Minecraft: https://www.reddit.com/r/adventofcode/comments/1pbeyxx/2025_day_01_part_2_advent_of_code_in_minecraft/ Emil’s Solutions: https://github.com/EmilHvitfeldt/rstats-adventofcode Emil’s helper package: https://github.com/EmilHvitfeldt/aocfuns purrr::accumulate() function: https://purrr.tidyverse.org/reference/accumulate.html
And, for anyone hangin’ in there at the end, Emil updated us on Discord that he figured out why his cumsum() didn’t work: he forgot to start the dial at 50! Once you fix that, it works to solve part 1 :)
► Subscribe to Our Channel Here: https://bit.ly/2TzgcOu
Follow Us Here: Website: https://www.posit.co The Lab: https://pos.it/dslab Hangout: https://pos.it/dsh LinkedIn: https://www.linkedin.com/company/posit-software Bluesky: https://bsky.app/profile/posit.co
Thanks for learning with us!
Timestamps 00:00 Introduction 01:01 Tour of the Advent of Code website 02:30 Dashboard overview and puzzle schedule 03:23 How to view and access previous years’ events 03:37 Structure of puzzles: Two parts and stars 04:40 Understanding the global leaderboard 05:08 “Does that ASCII art build itself? 06:16 Setting up private leaderboards for friend 07:54 Starting Day 1: Story prompt and mechanics 09:30 Understanding unique puzzle inputs 10:51 Submission feedback and delay penalties 11:44 Safe dial logic: Left, Right, and circularity 12:50 Starting position and Part 1 success criteria 14:09 Setting up the project in Positron 16:26 Strategy for speed: Reading from the bottom up 18:49 Problem-solving strategies: Pen, paper, and visualization 19:22 Walking through the logic with a sample case 20:52 Coding Part 1: Data parsing and vectorization 23:17 Positron keyboard shortcuts for duplicating lines 24:40 Debugging the logic and handling negative numbers 26:03 Explaining the Modulo operator (%%) 28:15 Managing large inputs of over 4,000 instructions 29:21 Submitting Part 1 and transitioning to Part 2 32:03 Part 2 challenge: Counting zero “clicks” 34:02 Brainstorming Part 2 code modifications 36:19 Checking important warnings for edge cases 37:00 Coding Part 2: Nested loops and incrementing counters 38:23 Hint: Modulo vs. integer division 40:40 Success with the Part 2 test case 42:30 Alternative method: Vectorized cumulative sums 45:29 “What’s the difference between % and %%?” (percent vs modulo) 46:50 Mathematical optimization to avoid inner loops

DuckDB and the future of databases | Hannes Mühleisen | Data Science Hangout
To join future data science hangouts, add it to your calendar here: https://pos.it/dsh - All are welcome! We’d love to see you!
We were recently joined by Hannes Mühleisen, Co-founder and CEO at DuckDB Labs, to chat about the evolution of database systems, the unique architecture of DuckDB, and how to find opportunities in areas others might consider “boring.” He also showed us a picture of the real life duck, Wilbur, that inspired the name DuckDB! 🦆
In this Hangout, we explore how DuckDB is changing the traditional concept of a database by making it accessible to a wide range of users and use cases. We also discuss its origins and how it was inspired by the challenges of data analysis and the importance of focusing on real user problems when building tools.
What is a database and where does it live? DuckDB is challenging database assumptions by saying… maybe your expensive laptop can hold a database instead of just pinging one? Maybe it can do more than just run web browsers! Hannes wants you to know that database doesn’t have to be a bad word, and that you can actually have a great experience with one. If the data community’s affinity and enthusiasm for DuckDB is any indication, we think he’s right.
We hope you listen in to hear Hannes talk about: a simple explanation of what DuckDB is, DuckDB’s in-process architecture and why it’s so cool, different DuckDB use cases (should you be using DuckDB?), DuckDB’s compatibility with cloud data systems, and more.
Resources mentioned in the video and zoom chat: DuckDB Website → https://duckdb.org/ DuckDB Labs Website → https://duckdblabs.com/ Posit Conf talk by Hannes → https://www.youtube.com/watch?v=GELhdezYmP0 Sarah Alman’s webinar on using DuckDB and Shiny → https://www.youtube.com/watch?v=6AGroJb4zPM Forbes Article on Imposter Syndrome → https://www.forbes.com/sites/marycrossan/2024/12/18/how-to-combat-imposter-syndrome-by-developing-character/ MotherDuck → https://motherduck.com/ MotherDuck Blog Post “Big Data is Dead” → https://motherduck.com/blog/big-data-is-dead/ Posit Blog post on Shiny with Databases → https://posit.co/blog/shiny-with-databases/ DSH episode with Marco Gorelli → https://www.youtube.com/watch?v=lhAc51QtTHk Emil Hvitfeldt’s talk at posit::conf about orbital → https://youtu.be/Qnm1y0KPxVM Marcos Huerta’s Blog post on DuckDB and Bert → https://marcoshuerta.com/posts/duckdb-and-bert/
If you didn’t join live, one great discussion you missed from the zoom chat was about whether industry teams who use and benefit from open source tools could devote 5-10% of their time to giving back to the open source projects with code contributions or other support. Let us know below if you’d like to hear more about this topic!
► Subscribe to Our Channel Here: https://bit.ly/2TzgcOu
Follow Us Here: Website: https://www.posit.co Hangout: https://pos.it/dsh LinkedIn: https://www.linkedin.com/company/posit-software Bluesky: https://bsky.app/profile/posit.co
Thanks for hanging out with us!

Quarto Websites 4: Add lists of content with listings | Charlotte Wickham | Posit
Adding a listing page to your website is a great way to showcase your projects, talks, publications or blog posts. In this video you’ll learn how to create a listing page in Quarto and see two ways to populate it with content: Quarto documents, or a yaml file.
In this video: 0:50 Use a listing to add a blog 3:36 Listing options 5:47 Why use a listing? 7:22 Use a YAML file to populate a project portfolio 9:50 Customize the display of a listing 12:10 Advanced customization of listings 13:42 Remove pages
Links: Listings: https://quarto.org/docs/websites/website-listings.html Andrew Heiss’ teaching listing: https://www.andrewheiss.com/teaching/
Code: Starter source code: https://github.com/cwickham/quarto-website-video/tree/v0.3 Final source code: https://github.com/cwickham/quarto-website-video/tree/v0.4
For more in-depth coverage and slides check out: https://posit-conf-2024.github.io/quarto-websites/
Do you need a professional website to showcase your work? If you’ve used Quarto to produce a document, you’ve already got the technical skills to create a Quarto website. In this video series, you’ll learn everything else you need to build a website and customize its appearance.
This video series is for you if you:
- Have used Quarto to generate documents (e.g. HTML, PDF, MS Word etc.)
- Are comfortable editing plain text documents (e.g .qmd) in your IDE (e.g. RStudio, Visual Studio Code etc.)
- Want to walk away with your own personal website
Taught by: Charlotte Wickham (https://www.cwick.co.nz/ ) Emil Hvitfeldt (https://emilhvitfeldt.com/ )
Videos in this series:
- Build your homepage [https://youtu.be/l7r24gTEkEY]
- Add pages and navigation [https://youtu.be/k65E-8PXZmA] 3: Customize appearance with CSS/SCSS [https://youtu.be/pAN2Hiq0XGs] 4: Add lists of content with listings [https://youtu.be/bv_Cw-3HI1Y]


Quarto Websites 3: Customize appearance with CSS/SCSS | Emil Hvitfeldt | Posit
You now have a set of content you are happy with on your website, but how do you customize the look and feel of your site beyond options set in YAML? In this video, you’ll start by learning the basics of CSS and SCSS and how to make good design choices. Then, you’ll see how to apply these choices to your Quarto website.
In this video: 0:14 What is HTML? 3:23 CSS Selectors 8:05 CSS Attributes 8:25 Layout attributes 10:24 Reducing repetition with SASS/SCSS? 15:26 Consistent design 16:36 Choosing colors 17:50 Choosing fonts 19:28 Maintaining accessibility 22:13 Apply SCSS to your website 24:16 Change the appearance of headings 25:28 Change the appearance of navigation bar 30:30 Use google fonts
Links: Color contrast checker: https://colourcontrast.cc/ Google fonts: https://fonts.google.com/
Code: Starter source code: https://github.com/cwickham/quarto-website-video/tree/v0.2 Final source code: https://github.com/cwickham/quarto-website-video/tree/v0.3
For more in-depth coverage and slides check out: https://posit-conf-2024.github.io/quarto-websites/
Do you need a professional website to showcase your work? If you’ve used Quarto to produce a document, you’ve already got the technical skills to create a Quarto website. In this video series, you’ll learn everything else you need to build a website and customize its appearance.
This video series is for you if you:
- Have used Quarto to generate documents (e.g. HTML, PDF, MS Word etc.)
- Are comfortable editing plain text documents (e.g .qmd) in your IDE (e.g. RStudio, Visual Studio Code etc.)
- Want to walk away with your own personal website
Taught by: Charlotte Wickham (https://www.cwick.co.nz/ ) Emil Hvitfeldt (https://emilhvitfeldt.com/ )
Videos in this series:
- Build your homepage [https://youtu.be/l7r24gTEkEY]
- Add pages and navigation [https://youtu.be/k65E-8PXZmA] 3: Customize appearance with CSS/SCSS [https://youtu.be/pAN2Hiq0XGs] 4: Add lists of content with listings [https://youtu.be/bv_Cw-3HI1Y]


Quarto Websites 2: Add pages and navigation | Charlotte Wickham | Posit
Now you’ve got a homepage, you’ll likely want to add some other pages. In this video, learn how to add pages to your website, and help people find them, by adding them to your website navigation.
In this video: 1:00 Add a page to your website 2:54 Your file structure determines your URL structure 5:49 Add a link to your page in navigation 7:50 Customize navigation item text and icon 9:12 Control where items appear in the navigation bar 10:16 Navigation bar options 11:11 Switch to side navigation 12:22 Other types of navigation 16:30 Wrap Up
Links: List of icons you can use in navigation items: https://icons.getbootstrap.com/ Top navigation bar options: https://quarto.org/docs/websites/website-navigation.html#top-navigation Quarto website navigation: https://quarto.org/docs/websites/website-navigation.html
Code: Starter source code: https://github.com/cwickham/quarto-website-video/tree/v0.1 Final source code: https://github.com/cwickham/quarto-website-video/tree/v0.2
For more in-depth coverage and slides check out: https://posit-conf-2024.github.io/quarto-websites/
Do you need a professional website to showcase your work? If you’ve used Quarto to produce a document, you’ve already got the technical skills to create a Quarto website. In this video series, you’ll learn everything else you need to build a website and customize its appearance.
This video series is for you if you:
- Have used Quarto to generate documents (e.g. HTML, PDF, MS Word etc.)
- Are comfortable editing plain text documents (e.g .qmd) in your IDE (e.g. RStudio, Visual Studio Code etc.)
- Want to walk away with your own personal website
Taught by: Charlotte Wickham (https://www.cwick.co.nz/ ) Emil Hvitfeldt (https://emilhvitfeldt.com/ )
Videos in this series:
- Build your homepage [https://youtu.be/l7r24gTEkEY]
- Add pages and navigation [https://youtu.be/k65E-8PXZmA] 3: Customize appearance with CSS/SCSS [https://youtu.be/pAN2Hiq0XGs] 4: Add lists of content with listings [https://youtu.be/bv_Cw-3HI1Y]


Quarto Websites 1: Build your homepage | Charlotte Wickham & Emil Hvitfeldt | Posit
In this video, you’ll get a running start by using a template we’ve designed to be functional and attractive, and that will serve as a foundation for the rest of the video series. You’ll customize the content of your homepage, and how it looks, and along the way learn about the two key files in a Quarto website index.qmd and _quarto.yml. Finally, you’ll learn one way to publish your website so other people can see it.
In this video: 0:21 Use a template to get started 2:33 Preview the template homepage, index.qmd 4:12 Customize the content of your homepage 5:45 “About” pages 7:22 Customize the image on your homepage 9:24 Website configuration, _quarto.yml 10:40 Customize colors with YAML 13:45 Customize fonts with YAML 17:00 Publish your site
Links: About pages: https://quarto.org/docs/websites/website-about.html Appearance options you can set in YAML: https://quarto.org/docs/output-formats/html-themes.html#basic-options
Code: Starter source code: https://github.com/EmilHvitfeldt/website-template Final source code: https://github.com/cwickham/quarto-website-video/tree/v0.1
For more in-depth coverage and slides check out: https://posit-conf-2024.github.io/quarto-websites/
Do you need a professional website to showcase your work? If you’ve used Quarto to produce a document, you’ve already got the technical skills to create a Quarto website. In this video series, you’ll learn everything else you need to build a website and customize its appearance.
This video series is for you if you:
- Have used Quarto to generate documents (e.g. HTML, PDF, MS Word etc.)
- Are comfortable editing plain text documents (e.g .qmd) in your IDE (e.g. RStudio, Visual Studio Code etc.)
- Want to walk away with your own personal website
Taught by: Charlotte Wickham (https://www.cwick.co.nz/ ) Emil Hvitfeldt (https://emilhvitfeldt.com/ )
Videos in this series:
- Build your homepage [https://youtu.be/l7r24gTEkEY]
- Add pages and navigation [https://youtu.be/k65E-8PXZmA] 3: Customize appearance with CSS/SCSS [https://youtu.be/pAN2Hiq0XGs] 4: Add lists of content with listings [https://youtu.be/bv_Cw-3HI1Y]


Emil Hvitfeldt - Tidypredict with recipes, turn workflow to SQL, spark, duckdb and beyond
Tidypredict is one of my favorite packages. Being able to turn a fitted model object into an equation is very powerful! However, in tidymodels, we use recipes more and more to do preprocessing. So far, tidypredict didn’t have support for recipes, which severely limited its uses. This talk is about how I fixed that issue. After spending a couple of years thinking about this problem, I finally found a way! Being able to turn a tidymodels workflow into a series of equations for prediction is super powerful. For some uses, being able to turn a model to predict inside SQL, spark or duckdb allows us to handle some problems with more ease.
Talk by Emil Hvitfeldt
Slides: https://emilhvitfeldt.github.io/talk-orbital-positconf/ GitHub Repo: https://github.com/EmilHvitfeldt/talk-orbital-positconf/tree/main

Styling and Templating Quarto Documents - posit::conf(2023)
Presented by Emil Hvitfeldt
Quarto is a powerful engine to generate documents, slides, books, websites, and more. The default aesthetics looks good, but there are times when you want and need to change how they look. This is that talk.
Whether you want your slides to stand out from the crowd, or you need your documents to fit within your corporate style guide, being able to style Quarto documents is a valuable skill.
Once you have persevered and created the perfect document, you don’t want the effort to go to waste. This is where templating comes in. Quarto makes it super easy to turn a styled document into a template to be used over and over again.
Presented at Posit Conference, between Sept 19-20 2023, Learn more at posit.co/conference.#
Talk Track: Compelling design for apps and reports. Session Code: TALK-1106

Emil Hvitfeldt - Slidecraft: The Art of Creating Pretty Presentations
Slidecraft: The Art of Creating Pretty Presentations by Emil Hvitfeldt
Visit https://rstats.ai/nyr to learn more.
Abstract: Do you want to make slides that catch the eye of the room? Are you tired of using defaults when making slides? Are you ready to spend every last hour of your life fiddling with css and js? Then this talk is for you! Making slides with Quarto and revealjs is a breeze and comes with many tools and features. This talk gives an overview of how we can improve the visuals of your slides with the highest effect to effort ratio.
Bio: Emil Hvitfeldt is a software engineer at Posit and part of the tidymodels team’s effort to improve R’s modeling capabilities. He maintains several packages within the realms of modeling, text analysis, and color palettes. He co-authored the book Supervised Machine Learning for Text Analysis in R with Julia Silge.
Twitter: https://twitter.com/Emil_Hvitfeldt
Presented at the 2023 New York R Conference (July 13, 2023)


posit::conf(2023) Workshop: Introduction to tidymodels
Register now: http://pos.it/conf Instructors: Hannah Frick, Simon Couch, Emil Hvitfeldt Workshop Duration: 1-Day Workshop
This workshop is for you if you: • have intermediate R knowledge, experience with tidyverse packages, and either of the R pipes • can read data into R, transform and reshape data, and make a wide variety of graphs • have had some exposure to basic statistical concepts such as linear models, random forests, etc.
Intermediate or expert familiarity with modeling or machine learning is not required.
This workshop will teach you core tidymodels packages and their uses: data splitting/resampling with rsample, model fitting with parsnip, measuring model performance with yardstick, and basic pre-processing with recipes. Time permitting, you’ll be introduced to model optimization using the tune package. You’ll learn tidymodels syntax as well as the process of predictive modeling for tabular data



Beautiful reports and presentations with Quarto | Led by Tom Mock, RStudio
Quarto is a powerful tool for authoring reproducible computational documents in R, Python or Julia. Quarto can also help with sharing your results to business stakeholders across your company. This talk will provide an overview of Quarto’s implementation of revealjs for interactive presentations and HTML/PDF documents for static reports.
Content website: rstd.io/quarto-reports
Timestamps: 2:55 - Start of session 4:10 - Visual editor in RStudio 6:20 - Parameters to create different variations of a report 15:30 - Unified syntax across different output formats 18:01 - Pandoc fenced divs 20:10 - Tabsets 22:22 - Pandoc bracketed spans 24:30 - Footnotes 26:30 - Layout image inline with paragraphs / image into “gutter” column margin 29:23 - Hide all code 29:50 - Code tools (Fold code, source code) 34:12 - Code highlighting 37:03 - HTML Appearance 38:00 - Bootswatch themes 38:43 - PDF Articles 42:05 - Presentations (revealjs (HTML), PowerPoint (MS Office), beamer (LaTeX, PDF)) 45:06 - Creating slides 47:53 - Multiple columns 48:28 - Secret Tip (Alt + Click to Zoom in to a section) 49:24 - Absolute Position 51:04 - Presentation themes 52:44 - Footer/Logo 54:01 - Slide Background 57:01 - Custom classes 58:35 - End slide with helpful links (all shared here: rstd.io/quarto-reports)
This meetup is Part 3 in our Quarto series: Part 1: Welcome to Quarto Workshop: https://www.youtube.com/watch?v=yvi5uXQMvu4 Part 2: Building a Blog with Quarto: https://youtu.be/CVcvXfRyfE0 For more about Quarto: quarto.org
Resources discussed: Visual editor: https://quarto.org/docs/visual-editor/ Parameters: https://quarto.org/docs/computations/parameters.html Tabsets: https://quarto.org/docs/interactive/layout.html#tabset-panel Fenced Divs and Bracketed spans: https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans Footnotes: https://quarto.org/docs/authoring/footnotes-and-citations.html Figures and figure layouts: https://quarto.org/docs/authoring/figures.html#complex-layouts Code execution options: https://quarto.org/docs/computations/execution-options.html Code chunk format options: https://quarto.org/docs/reference/formats/html.html#code Code appearance: https://quarto.org/docs/output-formats/html-code.html#appearance Code highlighting light/dark: https://quarto.org/docs/output-formats/html-code.html#appearance Function links in code chunks with downlit: https://quarto.org/docs/output-formats/html-code.html#code-linking HTML Themes: https://quarto.org/docs/output-formats/html-themes.html PDF formatting options: https://quarto.org/docs/reference/formats/pdf.html#title-author PDF journal templates: https://quarto.org/docs/journals/templates.html Presentations: https://quarto.org/docs/presentations/index.html Revealjs Options: https://quarto.org/docs/presentations/revealjs/ Advanced Revealjs (absolute positioning, layout helpers like r-stack): https://quarto.org/docs/presentations/revealjs/advanced.html Revealjs themes and customizing: https://quarto.org/docs/presentations/revealjs/themes.html Revealjs footer & logo: https://quarto.org/docs/presentations/revealjs/index.html#footer-logo Inline span text formatting: Emil Hvitfeldt’s Slidecraft 101: Colors and Fonts, https://www.emilhvitfeldt.com/post/slidecraft-colors-fonts/ Meghan Hall’s Quarto Slides, https://meghan.rbind.io/blog/quarto-slides/ Andrew Heiss’ Quarto slides on APIs and webscraping with R, https://github.com/andrewheiss/2022-seacen
Speaker bio: Thomas is the Customer Enablement Lead at RStudio, helping RStudio’s customers be as successful as possible. He is deeply involved in the global data science community, sharing tips on RStats Twitter (find him at @thomas_mock), as co-founder of TidyTuesday, a weekly Data Science learning challenge, and presenting on various Data Science topics on YouTube or at conferences.
For upcoming meetups: rstd.io/community-events

