Skip to content

Instantly share code, notes, and snippets.

View smithjd's full-sized avatar

John David Smith smithjd

View GitHub Profile
@smithjd
smithjd / setup-libraries-and-functions.R
Last active July 19, 2023 00:14
Send various kinds of emails using gmailr
library(tidyverse)
library(gmailr)
gm_auth_configure()
prepare_and_send <- function(sender, recipient, title, text) {
email <- gmailr::gm_mime() %>%
gmailr::gm_to(recipient) %>%
gmailr::gm_from(sender) %>%
gmailr::gm_subject(title) %>%
gmailr::gm_html_body(text)
@smithjd
smithjd / googleAnalyticsR-anomaly.md
Last active October 7, 2022 22:27
API and Web-based Google Analytics access to properties I own are different

I am trying to access Google Analytics data with googleAnalyticsR but I find that I can access one site but not the other. I'm the admin for both properties and they both look the same to me when I'm using Google's Analytics web interface.

<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-RH1RGKF16D"></script>

``

Most bank data is readily available for download, but some credit card companies only offer a monthly PDF file with transactions. R makes it easy to pull out the data.

@smithjd
smithjd / Extending_Trackdown.md
Last active August 7, 2023 14:53
Using the R trackdown package for multiple pages and multiple authors

OVERVIEW

I have found that the trackdown package is incredibly useful for collaboration with non-R users. It's design suggests that the main use case was a group of researchers all working on one paper -- a big .Rmd file. The package documentation has a very clear workflow description.

I've put some wrappers and additional code around the package to make working with a couple dozen Distill pages.

This set of functions is handy for synchronizing more than a dozen .Rmd files by simplifying the following: