Kyle Husmann
kylehusmann.bsky.social
Kyle Husmann
@kylehusmann.bsky.social
Data Engineer, Open Science Advocate | kylehusmann.com
So I may rework cfactors so data are kept as codes, but labels are displayed when printing the tibble, and then could be accessed by as_factor()... (similar to what haven does, I think). what do you think?
August 11, 2025 at 5:08 AM
One thing I'm not sure I like about the cfactor approach -- I convert codes to textual factor levels because they are much nicer to work with. The downside is that if you have a codelist table with more metadata about the levels indexed by code, you have to convert back to codes before joining.
August 11, 2025 at 4:58 AM
It should retain unused levels! If it doesn't, let me know... It's designed to work just like a regular factor, just with codes added to the levels.

That said, be sure to use codes() to get the codes for the levels, not as.numeric() which uses the index of levels for compatibility with factor()
August 11, 2025 at 4:54 AM
Awesome! If you're working with SPSS / SAS users, be sure to check out the novel ways it handles coded data as well: interlacer.kylehusmann.com/articles/cod...
Coded Data
interlacer.kylehusmann.com
August 11, 2025 at 1:36 AM
Hey, nice to meet more folks passionate about tagged missingness... There's dozens of us!

I briefly mentioned this in the blog post, but I've come up with my own system for improved tagged missingness in R: interlacer.kylehusmann.com

I'd be really curious to get your feedback!
Read Tabular Data With Interlaced Values And Missing Reasons
interlacer provides functions for handling tabular data with interlaced missing reasons (e.g., N/A, REFUSED, -99). It introduces a special "interlaced" vector type that enables you to keep the values ...
interlacer.kylehusmann.com
August 10, 2025 at 7:41 PM
Awesome, glad to hear from other folks who have run into this! Did you still have to $destroy() the inner observers, or were you changing the ids / namespaces each time to avoid duplicate close events? (If the latter, you still get a build-up of zombie observers, right?)
July 5, 2025 at 10:37 PM
Wow, thanks for the shout-out, Crystal! I'm over here as a total Bluesky newb just trying to figure out how to follow people — and you’ve gone and made me a whole intro post? You rock!
July 5, 2025 at 7:01 PM