Eric Leung's Avatar

Eric Leung

@erictleung.bsky.social

marketing data scientist, generalist, math and library enthusiast, data scientist of the third kind, loves good stationary and pens, low tech enthusiast, open source tinkerer, opinions = mine #rstats

859 Followers  |  466 Following  |  70 Posts  |  Joined: 25.08.2023  |  2.0236

Latest posts by erictleung.bsky.social on Bluesky

User:Twotwofourtysix - Wikimedia Commons

more maps by the author if you're curious

commons.wikimedia.org/wiki/User:Tw...

05.11.2025 18:37 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
map of the 2025 New York City mayoral race, using different colors to represent the three main candidates

map of the 2025 New York City mayoral race, using different colors to represent the three main candidates

politics aside, it's pretty amazing to find high quality data visualizations for free on the Wikipedia page for the recent NYC mayoral election. and using a clever ternary plot to represent the breakdown of votes for three candidates in one color

en.wikipedia.org/wiki/2025_Ne...

05.11.2025 18:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

yes yes! thanks for sharing your Libby fact. also, jetpens is indeed the best. I thought about a side project of scraping all their fountain pens and visualizing all the dimensions of pens (sizes, color, etc). never did, but I still think of it from time to time πŸ˜…

22.10.2025 14:10 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

maybe I'll add it to the Christmas wish list πŸ˜‚

22.10.2025 02:31 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

a fellow stationary and pens nerd! I got a retractable fountain pen for my birthday and it is just the best. I've seen this pen advertised to me, but I keep on telling myself I have enough pens πŸ₯² so tempting!

22.10.2025 02:02 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
sQuote function - RDocumentation <p>Single or double quote text by combining with appropriate single or double left and right quotation marks.</p>

some example documentation

www.rdocumentation.org/packages/bas...

06.10.2025 19:54 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

i guess they could be useful to be consistent with specifying different quotes, instead of remembering which quotes need to be escaped etc.

either way, it's a "the more you know" kind of thing built into R

06.10.2025 19:54 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

recently learned the sQuote() and dQuote() R functions

> cat("distinguish plain", sQuote("single"), "and", dQuote("double"), "quotes")
distinguish plain β€˜single’ and β€œdouble” quotes
> cat("distinguish between 'single' and \"double\" quotes")
distinguish between 'single' and "double" quotes

#RStats

06.10.2025 19:54 β€” πŸ‘ 10    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Preview
Statistical Rethinking - Wikipedia

for fans of mcelreath's statistical rethinking book, it now has a wikipedia page en.wikipedia.org/wiki/Statist...

26.09.2025 15:54 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

thought I understood f-strings enough, untill I took this lil quiz. humbled me real quick fstrings.wtf

06.08.2025 13:31 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

If you ask me for advice, the answer I give you will almost always be to reach out and talk to people. Not to read blog posts or watch youtube videos, though those are wonderful resources, but to meet with & talk to actual humans. It's not easy, and it takes time and effort, but it's the way #databs

25.07.2025 20:44 β€” πŸ‘ 22    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
tree.fm – Tune Into Forests From Around The World πŸŒ³πŸ”ˆ People around the world recorded the sounds of their forests, so you can escape into nature, while in lockdown or unable to travel. Use this site to chill, meditate or do some digital shinrin-yoku.

been using forest sounds in the background for work. it's been quite peaceful

www.tree.fm

24.07.2025 14:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Google Colab

TIL you can make an R Jupyter notebook in Google Colab with this link colab.research.google.com/notebook#cre...

24.07.2025 03:59 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
A system to organise your life Johnny.Decimal is a system to organise your life. Find things, quickly, with more confidence, and less stress. It's free to use and the concepts are the same at home or work.

been dragging my feet on organizing my digital folders after finally finding this framework for organizing your digital.

in theory, i really like it. but with any digital cleaning, easier said than done.

anyone else have other systems they use to organize your life?

johnnydecimal.com

21.07.2025 19:29 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 1

i've been writing sql code for a while now, but yesterday i learned the acronym CTAS, which stands for "create table as select"

17.07.2025 19:11 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Keyboard shortcuts for Visual Studio Code Here you will find the complete list of keyboard shortcuts for Visual Studio Code and how to change them.

been trying to get into using vscode a bit more, and had some of the keyboard shortcuts interfere with each other.

took me a bit to figure it out, but in case anyone else is having issues with it, go to File > Preferences > Keyboard Shortcuts menu

code.visualstudio.com/docs/configu...

17.07.2025 19:10 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
tryCatch block in R, change value of outer variable Here is my code. It produces infinite loop, because value of something variable does not change within captured error. Is it supposed to be this way? How can I fix it so that value of something cha...

turns out, tryCatch() in R is locally scoped, so if you need to change any variables, you'll need to make it more explicit with something like

assign("var_i_need_to_change", "change_to_this_value", env = globalenv())

stackoverflow.com/a/48391135/2...

17.07.2025 18:50 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Data Behind the Scenes Conf - Call for Speakers What This Conference Is About "Data, Behind the Scenes" is a (free) online-only, single track conference centered on the real stories of data work from the folks in the trenches. We’re not here for th...

The #dataBS (Data Behind the Scenes) Conference Call for speakers is out! We're gonna do this!!

All online, single track, free to attend. Come talk about your messy experiences doing data stuff. At work, personal projects, whatever. A space to commiserate about nerdy things!

bit.ly/dataBSconf-cfs

01.07.2025 14:47 β€” πŸ‘ 54    πŸ” 26    πŸ’¬ 3    πŸ“Œ 4
Promotional graphic for the Posit Data Science Hangout featuring Cat Hicks, scheduled for June 26th, 2025 at 12 PM Eastern. The image shows Cat Hicks in front of a bright yellow background, wearing a patterned jacket and looking confidently at the camera. The left side of the graphic displays the date β€œ26 JUN 2025,” and below the image is a short description mentioning Cat’s work with Catharsis Consulting and her expertise in the psychology of software teams.

Promotional graphic for the Posit Data Science Hangout featuring Cat Hicks, scheduled for June 26th, 2025 at 12 PM Eastern. The image shows Cat Hicks in front of a bright yellow background, wearing a patterned jacket and looking confidently at the camera. The left side of the graphic displays the date β€œ26 JUN 2025,” and below the image is a short description mentioning Cat’s work with Catharsis Consulting and her expertise in the psychology of software teams.

So freaking excited to have Cat Hicks on the Hangout tomorrow. She's keynoting at posit conf, too ✨ Go register and I'll see you there!! #databs

Event:
Posit Data Science Hangout with Cat Hicks
Thursday June 26th 2025 at 12PM Eastern/9am Pacific
Register for the Hangout event series at pos.it/dsh

25.06.2025 22:28 β€” πŸ‘ 20    πŸ” 6    πŸ’¬ 0    πŸ“Œ 0

so true. I've been doing the over documentation for a bit, but still working on over communicating

26.06.2025 02:55 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

better to over communicate than assume when working across teams

25.06.2025 22:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Mosaic Plots in the ggplot2 Framework Mosaic plots in the ggplot2 framework. Mosaic plot functionality is provided in a single ggplot2 layer by calling the geom mosaic.

TIL about ggmosaic, an R package for visualizing categorical data haleyjeppson.github.io/ggmosaic/ind...

20.05.2025 02:14 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

i spent a whole day trying to get 5 lines of code to run properly. never have i had such a sigh of relief that it finally worked

07.05.2025 22:24 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Tidymodels + Spark I'm trying to develop a simple logistic regression model using Tidymodels with the Spark engine. My code works fine when I specify set_engine = &quot;glm&quot;, but fails when I attempt to set the

following up on this, my problems is using recipes and workflows, and how parity between Spark and R is still being worked on and/or features even possible stackoverflow.com/a/68324650/2... but good to know that modeling is fine with parsnip tho!

07.05.2025 19:55 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

ah yes yes, if it wasn't clear, i was pleasantly surprised to have this feature! thanks for your team's work on making these cool user experience conveniences for us data people πŸ™Œ

06.05.2025 23:38 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
GitHub - NYPL/engineering-general: Standards, values, and other information relevant to the NYPL Engineering Team. Standards, values, and other information relevant to the NYPL Engineering Team. - NYPL/engineering-general

pretty cool that the new york public library has some of their engineering practices up on GitHub github.com/NYPL/enginee...

02.05.2025 22:58 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
screenshot of a coding integrated development environment showing an autocomplete suggestion, along with a preview of the underlying object

screenshot of a coding integrated development environment showing an autocomplete suggestion, along with a preview of the underlying object

woah, when did RStudio gain this functionality that when you wait for autocomplete to finish, it'll show you a preview of that data object that it is suggesting in the autocomplete?? #RStats

02.05.2025 16:35 β€” πŸ‘ 10    πŸ” 3    πŸ’¬ 1    πŸ“Œ 0

very cool! didn't know of this package. might be useful after training indeed. yeah, my problem is on the training side of things. thanks for sharing!

30.04.2025 13:06 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

oh interesting, I could give it a try and see. thanks for pointing this out! wasn't aware of them nor noticed them in the documentation

30.04.2025 13:05 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@erictleung is following 20 prominent accounts