Articles by tshafer.com

Shuffling Columns: Pandas is Competitive‽

August 10, 2023 | tshafer.com

Last year I benchmarked a few ways of shuffling columns in a data.table, but what about pandas? I didn’t know, so let’s revisit those tests and add a few more operations! pandas winds up being much more competitive than I expected. First, dplyr is by far the ...
[Read more...]

Experimenting with Quarto

June 24, 2022 | tshafer.com

Quarto is the up-and-coming “next generation version of R Markdown” being developed by RStudio. It’s more or less a superset of R Markdown/knitr that’s suited to programming languages besides R. Quarto&r... [Read more...]

Timing data.table Operations

June 11, 2022 | tshafer.com

In a post last week I offered a couple of simple techniques for randomly shuffle a data.table column in place and benchmarked them as well. A comment on the original question, though, argued these timings aren’t useful si...
[Read more...]

Shuffling Columns With data.table

June 4, 2022 | tshafer.com

Yesterday, in a post syndicated to R-bloggers, kjytay asked about how to programmatically shuffle a data.table column in place, as the straightforward way didn’t work well. Here are two other ways to solve the same proble... [Read more...]

Programming with lapply

March 31, 2022 | tshafer.com

TIL that lapply accepts both functions and function names (as character vectors). From right there in the documentation (emph. mine): FUN is found by a call to match.fun and typically is specified as a function or a symbol (e.... [Read more...]

Unexported S3 Methods and R Packages

August 13, 2020 | tshafer.com

I’ve recently spent some time at work updating a few R packages we’ve built and deployed over the last several years, and during these updates I’ve run up against an old foe: my_package::run_model(...) #__ Error in UseMethod("predict") : #__ no applicable method for 'predict' applied to ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)