Skip to content

Instantly share code, notes, and snippets.

View richardsprague's full-sized avatar

RICHARD Sprague richardsprague

View GitHub Profile
@richardsprague
richardsprague / psomagen screen-scrape.md
Last active May 22, 2020 21:54
How to screen-scrape a Psomagen GutBiome+ report
@richardsprague
richardsprague / plot_ketomojo_csv.R
Last active April 19, 2020 22:06
Plot GKI values from a Keto Mojo CSV file
library(tidyverse)
library(dplyr)
library(lubridate)
read_csv("KetoMojoReadings.csv") %>% dplyr::filter(date>"2020-04-01", !is.na(gki)) %>%
transmute(date= ymd_hms(paste(date, time),tz=Sys.timezone()), gki = gki)%>%
select(date,gki) %>%
ggplot(aes(x=date,y=gki, label = gki)) + geom_line(color="red", size = 1) +
geom_point(size = 3,color = "red") +
geom_text(aes(label=gki), hjust = 1, vjust=0) +
_Akkermansia_ abundances in samples where no yogurt was eaten:
25.4683 1.4619 10.6136 8.4459 0.8461 1.0172 2.6925 0.9855 1.9741 12.4771 0.7 1.8595 1.5559 0.4002 4.3837 4.0416 0.9361 6.7443 14.8509 10.8159 25.0181 15.749 9.4389 8.1075 13.1835 7.9221 26.9847 28.4161 7.7194 3.7619 21.2755 34.3587 15.2118 8.896 4.9089 4.0771 8.6269 15.7222 17.36 2.084 2.84 7.7899 3.5469 2.273 10.6644 7.513 5.0887 4.9946 24.6542 2.7579 4.6904 10.9938 7.2983 6.1336 7.1542 9.678 7.1315 2.1634 6.4015 5.2369 4.3814 17.5186 21.2335 5.8423 11.3519 10.9047 3.924 3.0219 9.3387 18.445 4.8943 10.3697 8.2061 0.8997 9.8224 3.7002 8.1561 8.6911 7.8462 16.763 8.958 10.1368 10.0687 1.5368 1.6671 8.9964 5.4914 5.1881 7.8473 11.0256 17.1773 7.6839 5.5471 29.6741 2.8512 15.5059 0.4757 22.1178 23.8415 6.85 1.8726 5.7246 6.0106 3.2132 10.4816 36.9751 3.6095 3.2936 5.6673 1.8302 1.9481 0.919 2.2237 2.1282 8.0137 3.7958 3.0428 2.5214 9.989 3.0027 1.367 5.3565 3.7387 8.5162 2.8787 2.0477 6.7952 4.8389 23.3473 12.3959 2.7255 2.1361 12.4883 12.3647 15.40
@richardsprague
richardsprague / count_books.R
Last active April 9, 2018 15:36
Count file types in R
# Look recursively through a starting directory and return the number of files of each type
# Useful for counting all the PDFs, EPUBs, TXTs or other file types.
library(tools) # includes functions for easy system file handling
ONEDRIVE <- Sys.getenv(“ONEDRIVE”) # top of OneDrive directory.
BOOKSDIR <- file.path(ONEDRIVE,"Clippings and Docs")
allfilenames <- list.files(BOOKSDIR,full.names=FALSE,recursive=TRUE,include.dirs=FALSE)