Today I Learned
  • About
Categories
All (17)
Github (1)
PowerPoint (1)
R (12)
RStudio (4)
Word (3)
duckdb (1)
ggplot2 (1)
git (3)
github (1)

Word similarity

with duckdb
R
duckdb
Suppose you have been asked with comparing or joining two…
27 May 2024
Nick Twort

Get back to where you came from - dealing with cross-references in Microsoft Word

Life changing
Word
If you’re writing in Microsoft Word you have probably used cross-references before, and occasionally you want to see where a previously-written cross-reference will take you.
20 Nov 2023
Nick Twort

Break pipeline execution in R

with breakerofchains
R
RStudio
Suppose you have a tidyverse-style pipeline and you want to check out an intermediate output (eg, find the input to the ggplot below).
17 Oct 2023
Nick Twort

Generate pptx slides from R

with officer
R
The awesome R package officer has tools to connect R to Office documents. You can use it to generate a PowerPoint document from R.
12 Oct 2023
Nick Twort

Geocoding addresses in R

The tidygeocoder package
R
If you need to geocode addresses (ie, get the longitude and latitude from an address), I’ve had great luck with the tidygeocoder package:
04 Oct 2023
Nick Twort

Adding total facets to a ggplot

facet_grid + margins
R
ggplot2
Sometimes you want to use facets (or small multiples) to show something about individual groups in the data - but if you want to also have a…
04 Oct 2023
Nick Twort

Scrape table from webpage using R

snip snip
R
RStudio
Here’s a snippet for scraping a table from a webpage. Copy the URL (or enter it after) and execute the snippet1 with scrape Shift Tab.
29 Sep 2023
Nick Twort

git pull with Github Actions

Easy deployment
git
github
If you want a remote server to git pull changes to your Github repo, add this workflow (and the relevant secrets) to the repo:
26 Sep 2023
Nick Twort

Opening external files from R

Go on, have a browse
R
Sometimes you want to check out a link that you generate in an R script, or perhaps open a table of outputs that you’ve just saved as a csv.
22 Sep 2023
Nick Twort

Stop PowerPoint from resizing text

Because sometimes you just want to do it yourself
PowerPoint
If you’re getting frustrated because PowerPoint keeps resizing your text, but you’d like to keep a consistent size, just Format Shape and choose ‘Do not Autofit’:
22 Sep 2023
Nick Twort

Running many regressions in R

With map and broom
R
If you’re in a situation where you have a lot of parameters and want to run regressions on many subsets of a dataset based on those parameters, one option is to pmap:
14 Sep 2023
Nick Twort

Combine multiple words into a single string in R

Oxford commas are optional
R
If you’ve got a vector of words that you want to combine with a different separator for the last pair of words (eg, you want to use ‘and’), just use knitr::combine_words()
16 Aug 2023
Nick Twort

Starting your R scripts in a common way

Keeping it consistent
R
RStudio
I always find it useful to start my R scripts in a consistent way, and in RStudio I have a snippet for this.
16 Aug 2023
Nick Twort

Easier cross-references in Microsoft Word

Feat. macros
Word
If you have ever been frustrated by how long it takes to create a cross-reference in Microsoft Word, Traveler4 on GitHub has the macro for you.
15 Aug 2023
Nick Twort

Keyboard shortcuts in Microsoft Word

Speed up your workflows
Word
If you need to assign a new keyboard shortcut in Microsoft Word:
15 Aug 2023
Nick Twort

Running an R script with Github actions

Daily data refresh
git
R
Github
If you want to run an R script every n days, use the below workflow file. Pop it in .github/actions and Bob’s your uncle. You might need to enable write…
02 Aug 2023
Nick Twort

Showing git branch in R terminal

Adding to your .Rprofile
git
R
RStudio
If you want to show your current git branch while using RStudio, like this:
27 Jul 2023
Nick Twort
No matching items