This is a list of writings about mathematics that I think are accessible to a mathematically interested audience, as well as quite worth the read. I have read many of these multiple times, and will be quite happy if somebody finds something they enjoy on this list.
This information is likely to quickly become outdated when Qualtrics next changes the formatting of the QSF file. This guide was started February 2017. I hope that it is a useful introduction to understanding the contents of the QSF file that one can download from Qualtrics.
This document includes:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Let's try and find out what parameters are undocumented in my package QualtricsTools. | |
| # July 2017 | |
| # Christian Testa | |
| # This uses some internals (such as parse_rd and .Rd_get_argument_names) from the tools package | |
| # with the .Rd files generated by Roxygen with the args function to get arguments of functions | |
| # loaded from the QualtricsTools in order to approximately tell which parameters are undocumented | |
| # in the package. | |
| # The script below seems to be prone to false-positives where the documentation for a parameter does |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coerce_df_coltypes <- function(df, ...) { | |
| types <- list(...) | |
| # check for arguments | |
| if (length(types) > 0) { | |
| # if types is named, use names to coerce columns | |
| typenames <- names(types) | |
| if (!is.null(typenames) && length(typenames) == length(types)) { | |
| if (!all(typenames %in% colnames(df))) | |
| stop("the names of types must be colnames of df.") | |
| for (i in seq(types)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(tidycensus) | |
| library(magrittr) | |
| variables_dict <- | |
| tibble::tribble( | |
| ~var, ~desc, | |
| "B03002_001", 'total_race', "total pop for race/non-hispanic estimate", | |
| "B03002_003", 'white_nh', "white non-hispanic pop", | |
| "B25014_001", 'total_crowd', "total for occupants by room by owner/renter", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(magrittr) | |
| # 1. here's some made up data | |
| df <- data.frame( | |
| value = rgamma(n=1000, 1, .1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install.packages("tigris") | |
| library(tigris) | |
| library(sp) | |
| fulton20 <- tracts(state = 'GA', county = c('Fulton'), year = 2020) | |
| fulton10 <- tracts(state = 'GA', county = c('Fulton'), year = 2010) | |
| fulton00 <- tracts(state = 'GA', county = c('Fulton'), year = 2000) | |
| library(leaflet) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(magrittr) | |
| # New York Times style 7-day moving average | |
| # | |
| # Use each value from the given vector and the prior 6 values | |
| # to compute a moving average where values less than 0 are dropped | |
| # both from the sum in the numerator and from the count of days | |
| # in the denominator. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(plotly) | |
| library(sf) | |
| library(dplyr) | |
| nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) | |
| N <- 10 | |
| # make random data | |
| df <- lapply(1:N, function(x) nc) %>% bind_rows %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # animate a saddle differential equation system | |
| # | |
| # dX = -x - y | |
| # dY = x - y | |
| # dZ = .25 * z | |
| # | |
| # 25 trajectories are simulated and animated -- rendered using rgl in R | |
| # | |
| # Read more about rgl: https://dmurdoch.github.io/rgl/ |