diff --git a/DESCRIPTION b/DESCRIPTION index 95243f1..a12f8d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: kqol Title: K's R Quality of Life Improvements -Version: 1.0.1 +Version: 1.1.0 Authors@R: person("K","github.com/kenf1",role=c("aut","cre"),email="mail@mail.com") -Description: A collection of K's custom functions & RMD templates to boost productivity. +Description: A collection of K's custom functions. License: GPL-3.0 + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) diff --git a/README.md b/README.md index 48f85a2..d1b75c7 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,7 @@ #### R package containing KF's frequently-used custom functions and templates. -This package contains the following: - -1. Rmd Templates -1. Custom functions - -For more infomation, visit the [kqol Documentation](https://vignettes.netlify.app/kqol) website. +For more infomation, visit [kqol Documentation](https://vignettes.netlify.app/kqol). ### To install: diff --git a/inst/rmarkdown/templates/General Rmd/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/General Rmd/skeleton/skeleton.Rmd deleted file mode 100644 index 4ce15dd..0000000 --- a/inst/rmarkdown/templates/General Rmd/skeleton/skeleton.Rmd +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "Title" -author: "KF" -output: - html_document: - toc: TRUE - toc_float: TRUE - code_folding: show - theme: - bg: "#000000" - fg: "#e9f8ff" - primary: "#00aeff" - secondary: "#11ff00" - base_font: - google: Prompt - heading_font: - google: Proza Libre -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set( - echo=TRUE, - message=FALSE, - warning=FALSE, - eval=FALSE -) -``` - -## Import - -### Packages + Functions - -```{r} -gc() -library(kqol) #custom functions -library(tidyverse) -library(data.table) -library(readxl) -library(bslib) -``` - -### Data - -```{r} - -``` diff --git a/inst/rmarkdown/templates/General Rmd/template.yaml b/inst/rmarkdown/templates/General Rmd/template.yaml deleted file mode 100644 index 50ded2a..0000000 --- a/inst/rmarkdown/templates/General Rmd/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: General (HTML Output) -description: KF's custom general Rmd template. -create_dir: false diff --git a/inst/rmarkdown/templates/Py in R/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Py in R/skeleton/skeleton.Rmd deleted file mode 100644 index 1462a2c..0000000 --- a/inst/rmarkdown/templates/Py in R/skeleton/skeleton.Rmd +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "Title" -author: "KF" -output: - html_document: - toc: TRUE - toc_float: TRUE - code_folding: show - theme: - bg: "#000000" - fg: "#e9f8ff" - primary: "#00aeff" - secondary: "#11ff00" - base_font: - google: Prompt - heading_font: - google: Proza Libre -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set( - echo=TRUE, - message=FALSE, - warning=FALSE, - eval=FALSE -) -``` - -## Import - -### Packages + Functions - -```{r} -gc() -library(kqol) #custom functions -library(tidyverse) -library(data.table) -library(readxl) -library(bslib) -``` - -```{r} -#python, path can vary -library(reticulate) -reticulate::use_python("/Library/Frameworks/Python.framework/Versions/3.10/bin/python3") -``` diff --git a/inst/rmarkdown/templates/Py in R/template.yaml b/inst/rmarkdown/templates/Py in R/template.yaml deleted file mode 100644 index 253bab2..0000000 --- a/inst/rmarkdown/templates/Py in R/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Py in R (HTML Output) -description: KF's custom general Rmd template for workflows containing both R and Python code. -create_dir: false diff --git a/inst/rmarkdown/templates/Quick Report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Quick Report/skeleton/skeleton.Rmd deleted file mode 100644 index a02140c..0000000 --- a/inst/rmarkdown/templates/Quick Report/skeleton/skeleton.Rmd +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Title" -author: "KF" -output: html_document -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set(echo=FALSE,warning=FALSE,message=FALSE,fig.height=3,fig.width=3) -``` - -```{r} -#obtain full names of all files in specified file path -files <- unlist(list.files("",full.name=TRUE)) - -#make list for storage/reference -searchTerms <- c("") -``` - -```{r} -#find those that match specified searchTerms -allFiles <- lapply(searchTerms,function(x){ - grep(x,files,value=TRUE) -}) - -#set names -names(allFiles) <- searchTerms -``` - -```{r} -#sort by specific order -cPlot <- function(x){ - c(allFiles[[x]][[1]],allFiles[[x]][[2]],allFiles[[x]][[3]]) -} -``` - -### - -```{r} -knitr::include_graphics(cPlot(1)) -``` - - diff --git a/inst/rmarkdown/templates/Quick Report/template.yaml b/inst/rmarkdown/templates/Quick Report/template.yaml deleted file mode 100644 index ef73995..0000000 --- a/inst/rmarkdown/templates/Quick Report/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Quick Reports (HTML Output) -description: KF's custom template to create quick reports. -create_dir: false diff --git a/inst/rmarkdown/templates/Shiny Rmd/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Shiny Rmd/skeleton/skeleton.Rmd deleted file mode 100644 index 6460b81..0000000 --- a/inst/rmarkdown/templates/Shiny Rmd/skeleton/skeleton.Rmd +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "Title" -author: "KF" -output: - html_document: - toc: TRUE - toc_float: TRUE - code_folding: show - theme: - bg: "#000000" - fg: "#e9f8ff" - primary: "#00aeff" - secondary: "#11ff00" - base_font: - google: Prompt - heading_font: - google: Proza Libre -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set( - echo=TRUE, - message=FALSE, - warning=FALSE, - eval=FALSE -) -``` - -## Import - -### Packages + Functions - -```{r} -gc() -library(kqol) #custom functions -library(tidyverse) -library(data.table) -library(readxl) -library(bslib) -library(shiny) -``` - -### Data - -```{r} - -``` - -## Shiny - -### UI - -```{r} -ui <- fluidPage( - titlePanel("Title"), - theme=bs_theme(version=5,bootswatch="materia"), - -) -``` - -### Server - -```{r} -server <- function(input,output){ - -} -``` - -### Run App - -```{r} -shinyApp(ui=ui,server=server) -``` diff --git a/inst/rmarkdown/templates/Shiny Rmd/template.yaml b/inst/rmarkdown/templates/Shiny Rmd/template.yaml deleted file mode 100644 index a9fb5e8..0000000 --- a/inst/rmarkdown/templates/Shiny Rmd/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Shiny (App Output) -description: KF's custom Shiny Rmd template. -create_dir: false diff --git a/inst/rmarkdown/templates/Test Code Rmd/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Test Code Rmd/skeleton/skeleton.Rmd deleted file mode 100644 index d45ff1e..0000000 --- a/inst/rmarkdown/templates/Test Code Rmd/skeleton/skeleton.Rmd +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Store & Test Code" -author: "KF" -output: html_document: -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set(echo=TRUE) -``` - -## - - diff --git a/inst/rmarkdown/templates/Test Code Rmd/template.yaml b/inst/rmarkdown/templates/Test Code Rmd/template.yaml deleted file mode 100644 index c743143..0000000 --- a/inst/rmarkdown/templates/Test Code Rmd/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Test Code (No Output) -description: Minimal Rmd file used to store & test code. -create_dir: false diff --git a/inst/rmarkdown/templates/Vitae Rmd/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Vitae Rmd/skeleton/skeleton.Rmd deleted file mode 100644 index 1080ee0..0000000 --- a/inst/rmarkdown/templates/Vitae Rmd/skeleton/skeleton.Rmd +++ /dev/null @@ -1,166 +0,0 @@ ---- -#name: -surname: "First Last" -#position: -#profilepic: -address: -phone: -www: -email: -#twitter: -github: -#linkedin: -aboutme: "Sample about me" -orcid: -#date: "`r format(Sys.time(), '%B %Y')`" -headcolor: 414141 -output: - vitae::awesomecv: - page_total: true -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -knitr::opts_chunk$set(echo=FALSE,warning=FALSE,message=FALSE) -library(vitae) -library(here) #to simplify path/file referencing, can be excluded -``` - -```{r functions} -#import data -readExcelSheets <- function(filepath){ - #save filename for subsequent funct - filename <- here::here(filepath) - - #get names of all sheets in xlsx - sheet_names <- readxl::excel_sheets(filename) %>% - as.list() - - #read + save everything into single list of df - temp_data <- lapply(sheet_names,function(x){ - readxl::read_excel(filename,sheet=x) %>% - as.data.frame() - }) - - #add names to each df in list of df - names(temp_data) <- sheet_names - - #mandatory step to save data - return(temp_data) -} - -#'filter all_data by sheet & include all filled cells under "include" col - #'to exclude a row, leave cell under "include" col empty -select_sheet <- function(sheet){ - all_data[[sheet]] %>% filter(!is.na(include)) -} -``` - -```{r import data,message=FALSE,results='hide'} -#'import data - #'input name of reference excel file if here package is used - #'else, input path of reference excel file -all_data <- readExcelSheets("vitae_data.xlsx") - -sheet_names <- names(all_data) #for double-check purposes -``` - -# Education - -```{r education} -select_sheet("education") %>% - detailed_entries(what=degree, - when=year, - with=institution, - where=where, - why=details) -``` - -# Clinical Experiences - -```{r clinical_exp} -select_sheet("clinical") %>% - detailed_entries(what=role, - when=dates, - with=institution, - where=where, - why=details) -``` - -# Research Experiences - -```{r research_exp} -select_sheet("research") %>% - detailed_entries(what=role, - when=dates, - with=institution, - where=where, - why=details) -``` - -# Non-clinical Experiences - -```{r non-clinical_exp} -select_sheet("non-clinical") %>% - detailed_entries(what=role, - when=dates, - with=institution, - where=where, - why=details) -``` - -# Community Service - -```{r community_service} -select_sheet("volunteer") %>% - detailed_entries(what=role, - when=dates, - with=institution, - where=where, - why=details) -``` - -# Awards - -- item 1 -- item 2 -- item 3 - -# Skills - -- item 1 -- item 2 -- item 3 - -\newpage - -# Abstracts - -```{r abstracts} -select_sheet("abstracts") %>% - detailed_entries(what=title, - when=dates, - with=event, - where=where, - why=details) -``` - -# Presentations - -```{r presentations} -select_sheet("presentations") %>% - detailed_entries(what=title, - when=dates, - with=event, - where=where, - why=details) -``` - -# Publications - -1. sample publication 1 - -1. sample publication 2 - -1. sample publication 3 diff --git a/inst/rmarkdown/templates/Vitae Rmd/template.yaml b/inst/rmarkdown/templates/Vitae Rmd/template.yaml deleted file mode 100644 index 87ef13c..0000000 --- a/inst/rmarkdown/templates/Vitae Rmd/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Vitae Template -description: KF's modified Vitae template for generating a curriculum vitae (CV) in pdf format. Relies on specific formatted .xlsx file. -create_dir: false diff --git a/inst/rmarkdown/templates/Xaringan Rmd/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/Xaringan Rmd/skeleton/skeleton.Rmd deleted file mode 100644 index e44013f..0000000 --- a/inst/rmarkdown/templates/Xaringan Rmd/skeleton/skeleton.Rmd +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: "Title" -subtitle: -author: "KF" -date: "Date" -output: - xaringan::moon_reader: - css: [xaringan-themer.css,widths.css] - nature: - slideNumberFormat: "%current%" - highlightStyle: github - highlightLines: true - ratio: 16:9 - countIncrementalSlides: true -editor_options: - chunk_output_type: console ---- - -```{r setup,include=FALSE} -options(htmltools.dir.version=FALSE) -knitr::opts_chunk$set( - fig.width=9,fig.height=3.5,fig.retina=3, - out.width="100%", - cache=FALSE, - echo=FALSE, - message=FALSE, - warning=FALSE, - hiline=TRUE -) -``` - -```{r xaringan-customizations,include=FALSE,warning=FALSE} -gc() - -library(xaringanExtra) -xaringanExtra::use_xaringan_extra(c("tile_view","scribble","fit_screen","freezeframe")) - -library(xaringanthemer) -style_duo_accent( - primary_color="#6DA9DF", - secondary_color="#FF961C", - inverse_header_color="#FFFFFF" -) -``` - -## diff --git a/inst/rmarkdown/templates/Xaringan Rmd/template.yaml b/inst/rmarkdown/templates/Xaringan Rmd/template.yaml deleted file mode 100644 index f0ec5bf..0000000 --- a/inst/rmarkdown/templates/Xaringan Rmd/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Xaringan Presentation -description: KF's custom Xaringan Rmd template. -create_dir: false