tools.R

# explodes a string into a character vector
explode <- function(s) strsplit(s,"")[[1]]

# version of lapply that also passes along the 
# name of each list element. f must be a function
# with arguments n and x.

nlapply <- function( l, f ) mapply( f, 
	n=names(l), 
	x=l )
richelbilderbeek/bianchi_et_al_2017 documentation built on Jan. 4, 2023, 1:36 a.m.