Modern Plain Text Social Science
Week 13
Duke University
November 2025
R script files but not qmd files.lintr. It’s built on top of Air.You already know that …
library() function.?packagename
devtools::check() function.usethis package workflowcreate_package()use_git(), use_github() (as you would in a project)use_data_raw(), use_data()use_mit_license() (or other license)use_readme_rmd()pkgdown workflowThe pkgdown package makes it easy to build a website for your package.
usethis::use_pkgdown()usethis::use_pkgdown_github_pages()pkgdown::build_site()You are responsible.
How should you think about the case where you’re using an LLM to help you write code?
Here’s a very rough analogy: Find the Prime Factors of 91.
You need to try dividing by primes: 2, 3, 5, 7, 11, 13…
91 ÷ 2? No (91 is odd)
91 ÷ 3? No (9+1=10, not divisible by 3)
91 ÷ 5? No (doesn’t end in 0 or 5)
91 ÷ 7? Yes. 91 = 7 × 13
This took several steps and required knowledge of primes up to √91 ≈ 9.5.
Check the answer:
7 × 13 = 91 ✓
Maybe we have more clever ways of figuring out the division steps, starting from just keeping a list of all the numbers we know are prime. But the checking step is going to be faster and easier than the solving step.
Now find the prime factors of
1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139
(This is RSA-100).
Now find the prime factors of
1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139
They are:
37975227936943673922808872755445627854565536638199
× 40094690950920881030683735292761468389214899724061
Finding the prime factors of a really large number is extremely hard. There is no efficient method for it. Checking whether two given large primes multiply to a given large number, on the other hand, is easy. (This is the basis of public-key cryptography.)
Let’s work through some examples, live.