Skip to content

Instantly share code, notes, and snippets.

Avatar

Ian Lyttle ijlyttle

  • Iowa City, Iowa, USA
View GitHub Profile
@ijlyttle
ijlyttle / LICENSE.md
Last active Feb 5, 2022
Generating JSON for CVD matrices
View LICENSE.md

MIT License

Copyright (c) 2022 Ian Lyttle

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@ijlyttle
ijlyttle / manifesto.md
Last active Sep 28, 2020
github flow manifesto
View manifesto.md

These ideas based on GitHub Flow and are heavily influenced by Jenny Bryan and Hadley Wickham, through their R package {usethis}.

Remotes

The term upstream refers to a remote that is the "canonical" repository for a project.

The term origin refers to a remote that is a fork of an upstream remote.

If you are one of the maintainers for a repository, you can push to the upstream remote.

@ijlyttle
ijlyttle / altair.Rmd
Created Jan 23, 2020
Altair + reticulate + vegawidget
View altair.Rmd
---
title: "Altair-reticulate"
output: html_document
---
```{r load_packages}
library(vegawidget)
library(reticulate)
```
@ijlyttle
ijlyttle / woodiac.R
Last active Dec 21, 2019
An alternative calendar
View woodiac.R
# imports lubridate, emo, glue, purrr
as_woodiac <- function(x) {
is_dst <- lubridate::dst(as.POSIXct(x)) # pick up OS timzone
x <- lubridate::as_date(x)
date_2000 <- x
lubridate::year(date_2000) <- 2000
@ijlyttle
ijlyttle / ssh-travis-pkgdown.md
Last active Nov 2, 2019
Manual deployment for travis & pkgdown
View ssh-travis-pkgdown.md

SSH for travis-pkgdown

In the .ssh directory, we should have:

id_rsa & id_rsa.pub - the default keys for this computer

In addition, you need a distinct set of keys for each repository. Accordingly, each of these would be a directory within .ssh:

  • gh-deploy-vegawidget
  • gh-deploy-altair
View 01-proposed_changes.md

Motivation

I see our project as a set of two transformations: one that changes a ggplot2 object into a ggspec, then another that changes a ggspec into a Vega-Lite spec.

The analogy may not be exact, but I see these transformations in terms of linear algebra, where a ggplot2 object is a vector in "ggplot" space, a ggspec is a vector in "ggspec" space, and a Vega-Lite spec is a vector in "Vega-Lite" space.

One of our goals is that "ggspec"-space should be a faithful representation of "ggplot2"-space. One way of doing this is to make sure that the "transformation-matrix" is as close to diagonal as we can make it. As Haley likes to point out, the ggplot2 object is a "list of 9"; therefore the "ggspec" object will have no more than 9 elements (maybe it will not have a "theme"?).

If we wanted to (and we don't want to), we could reproduce the ggplot2 object using the ggspec.

@ijlyttle
ijlyttle / .Renviron
Last active Apr 8, 2019
Generic R setup files
View .Renviron
# An .Renviron file helps keep you safe, by storing secrets in one place that
# you can secure.
# - to open *your* .Renviron file, usethis::edit_r_environ()
# - please make sure that your .Renviron file ends with a newline,
# or R will ignore it
# - this is a minimal file, you will likely want to add your own "stuff"
# - if you need to deal with a firewall, this is the place to define
# your proxy variables
#
# More information: https://whattheyforgot.org/r-startup.html#renviron
@ijlyttle
ijlyttle / .gistr
Created Jan 11, 2019
An mtcars example.
@ijlyttle
ijlyttle / .block
Created Jan 11, 2019
An mtcars example.
View .block
license: mit
height: 500
scrolling: yes
border: yes
@ijlyttle
ijlyttle / .block
Last active Dec 13, 2018
vega-view changeset works as expected
View .block
license: mit
height: 500
scrolling: yes
border: yes