README.md

dismisc: misc R functions

Guidance

In my projects I always have an init.R script that I run before all others. It varies based on project but typically looks something like this:

library(magrittr) # for %<>% and %$%
library(dplyr) # the main workhorse
library(readr)
library(stringr)
library(reshape2)
library(ggplot2)
# ... etc


library(dismisc) # this package

.rt_scratch <- "/path/to/scratch/directory/"
.rt_proj <- '"/path/to/proj/directory/" 
.rt_data <- '"/path/to/data/directory/" 
.rt_scripts <- '"/path/to/scripts/directory/" 

Functions in dismisc

setrt() and setwdrt()

Note: these are obsolete though kept for running old code. It's better to use hidden objects, like .rt_scratch <- "/path/to/scratch/directory/" etc.

Misc functions

Possible replacements?

Functions removed when I moved from library(disalvo) to library(dismisc), with comments

These comments might help people who are trying to figure out how to solve certain common data problems that sound like they need a new function but actually can be solved easily with dplyr etc.

df <- data_frame(x = c("a","b",""), y = 1:3)
df %>% mutate_all(funs(ifelse(.=="",NA,.)))


rdisalv2/dismisc documentation built on Nov. 2, 2021, 1:34 a.m.