Skip to content

Instantly share code, notes, and snippets.

View McClellandLegge's full-sized avatar

McClelland Legge McClellandLegge

View GitHub Profile
@jthomasmock
jthomasmock / rprofile-custom-prompt.R
Created September 29, 2021 21:38
An example of customizing your R prompt with the RProfile.
.First <- function(){
# adapted from: https://lapsedgeographer.london/2020-11/custom-r-prompt/
my_prompt <- function(...) {
git_branch <- suppressWarnings(system("git rev-parse --abbrev-ref HEAD",
ignore.stderr = TRUE, intern = TRUE))
if (length(git_branch) != 0) {
git_msg <- paste0(" @", git_branch)
@alex-gable
alex-gable / initialize-r-project-main.R
Last active June 3, 2021 14:44
R project Init with usethis + renv
#' initialize_project
#'
#' @param database_user defaulted to `NULL`. if you use a database in your
#' project, this parameter takes your username as its value
#' prompts for creation if not
#' @param use_renv should the project use renv?
#' @param use_vscode do you use vscode for your project?
#' @param include_readme creates a README.md file
#' @param include_sql creates a directory for sql files
#' @param include_data creates a directory for data in, out, and temporary