Skip to content

Instantly share code, notes, and snippets.

View mnazarov's full-sized avatar

Maxim Nazarov mnazarov

View GitHub Profile
## Check all three-letter acronyms (TLA) in Wikipedia
## Assuming TLA is unused if no wikipedia entry with its name exists
library(rvest)
# splits from https://en.wikipedia.org/wiki/Wikipedia:TLAs
ranges <- c("AAA_to_DZZ", "EAA_to_HZZ", "IAA_to_LZZ", "MAA_to_PZZ", "QAA_to_TZZ", "UAA_to_XZZ", "YAA_to_ZZZ")
baseUrl <- "https://en.wikipedia.org/wiki/Wikipedia:TLAs_from_"
all <- c()
@mnazarov
mnazarov / docx_flextable.Rmd
Last active March 1, 2018 23:59
Use flextable with rmarkdown for Word (docx) output
---
title: "Insert `flextable`s into Word documents generated with `rmarkdown`"
author: Maxim Nazarov
output:
word_document:
keep_md: yes
html_document:
keep_md: yes
smart: false
---
@mnazarov
mnazarov / app.R
Created February 10, 2025 16:18
shiny progress bar linked to rmarkdown/knitr progress
library(shiny)
# custom progress function
myProgress <- function(total, labels) {
list(update = function(i) {
shiny::setProgress(value = i/total, message = paste0("Running chunk ", i, "/", total, ": "), detail = labels[i])
cat(sep = "", i, "/", total, ": ", labels[i], "\n")
}, done = function() {
shiny::setProgress(1, message = "Done")
})