-
Create local repo and create/add/edit required files and dirs
egREADME.md
,Dockerfile
,.gitignore
,.github/workflows/docker-image.yml
-
On GitHub select "New repository" from the "+" menu and set name to match local repo.
Do not add any template files. -
Initialize up local repo and push to GitHub:
(assumes currently in local repo root dir)
This file contains 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
## Setting and modifying default theme for plots | |
theme_set(theme_gray(base_size=12, base_family="Arial") + | |
theme( | |
panel.border=element_rect(colour="black", fill="transparent"), | |
plot.title=element_text(face="bold", hjust=0), | |
axis.text=element_text(color="black", size=14), | |
axis.text.x=element_text(angle=0, hjust=0.5), | |
axis.ticks = element_line(color = "black"), # make sure tick marks are black | |
panel.background=element_blank(), | |
panel.grid=element_blank(), |
This file contains 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
# See https://usethis.r-lib.org/articles/git-credentials.html | |
# Need to periodically add/update personal access token (PAT) for Github | |
# check token status and git details | |
usethis::gh_token_help() | |
usethis::git_sitrep() | |
# To generate a new PAT (takes you to a pre-filled form to create a new PAT) | |
usethis::create_github_token() |
This file contains 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
## Density color function | |
# usage: | |
# tbl |> | |
# mutate(density = getDenCols(x, y, transform = TRUE)) |> # transformation here must match aes() | |
# arrange(density) |> # ensures highest desity points on top | |
# ggplot(aes(log2(x), log2(y), color = density)) + | |
# geom_point() + | |
# scale_color_vididis_c() # works best with viridis | |
getDenCols <- function(x, y, transform = TRUE) { # set to TRUE if using log2 transformation of data | |
if(transform) { |
This file contains 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
## Excel export function | |
export_excel <- function(named_list, filename = "") { | |
wb <- openxlsx::createWorkbook() | |
## Loop through the list of split tables as well as their names | |
## and add each one as a sheet to the workbook | |
Map(function(data, name){ | |
openxlsx::addWorksheet(wb, name) | |
openxlsx::writeData(wb, name, data) | |
}, named_list, names(named_list)) | |
## Save workbook to working directory |
This file contains 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
mem_used <- function() lobstr::mem_used() %>% as.numeric() %>% R.utils::hsize() |
This file contains 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
obj_size <- function(x) object.size(x) %>% print(units = "auto") |
This file contains 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
# get standard ggplot colors | |
gg_color_hue <- function(n) { | |
hues = seq(15, 375, length = n + 1) | |
hcl(h = hues, l = 65, c = 100)[1:n] | |
} |
This file contains 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
cat download_links.txt | xargs -P 1 wget --content-disposition --trust-server-names -nv -a wget_downloading.log |
This file contains 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
# Ignore .DS_Store | |
.DS_Store | |
# Ignore R image files | |
rdata/*RData | |
##################################### | |
# From Github R .gitignore template # | |
##################################### | |
# History files |