Skip to content

Instantly share code, notes, and snippets.

@kar9222
Last active August 2, 2020 22:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kar9222/e47e8f4535ea6a8f8f33bfa120b1241f to your computer and use it in GitHub Desktop.
Save kar9222/e47e8f4535ea6a8f8f33bfa120b1241f to your computer and use it in GitHub Desktop.
I love base R

I dont use base R for everything. But I use & ❀️ base R

  • Super high emphasis on stability & backward compatibility
  • No dependency
  • Works well with {data.table}
  • Most importantly, it's the foundation of all packages

Feel free to see image & shared Gist link. You might find some useful ones.

Imgur

"I'm literally typing out the Base R which I use before/regularly/still using/will use...Thank you base R πŸ₯°β€οΈ"

help(package = 'base') ; help() ; '`?`' ; head() ; tail() ; str() ; 
attributes() ; class() ; typeof() ; install.packages() ; library() ; source() ;
loadedNamespaces() ; getwd() ; setwd() ; normalizePath() ; c() ; list() ; 
matrix() ; seq() ; seq_len() ; seq_along() ; sequence() ; req() ; rev() ; 
table() ; summary() ; unique() ; duplicated() ; setdiff() ; intersect() ; 
union() ; order() ; sort() ; ifelse() ; if else ; for ; while ; try() ;  
function() ; print() ; readLines() ; writeLines() ; isTRUE() ; isFALSE() ; 
as.logical() ; as.numeric() ; as.character() ; as.factor() ; factor() ; 
log() ; exp() ; max() ; min() ; which() ; which.max() ; which.min() ; any() ; 
all() ; sum() ; mean() ; median() ; quantile() ; round() ; floor() ; cor() ; 
sd() ; cumsum() ; cummin() ; cummax() ; t() ; ls() ; rm() ; assign() ; 
makeActiveBinding() ; attach() ; detach() ; data.frame() ; as.data.frame() ; 
'`[.data.frame`' ; '`=`' ; '`<-`' ; '`::`' ; nrow() ; ncol() ; paste() ; 
paste0() ; sprintf() ; grep() ; grepl() ; sub() ; gsub() ; toupper() ; 
strrep() ; strtrim() ; strptime() ; strsplit() ; tolower() ; cut() ; 
sample() ; runif() ; rnorm() ; rpois() ; system2() ; as.POSIXct() ; 
sapply() ; lapply() ; vapply() ; mapply() ; Map() ; Reduce() ; Filter() ; 
do.call() ; deparse() ; substitute() ; quote() ; as.call() ; match.fun() ;
match.arg() ; match.call() ; append() ; browser() ; rbind() ; cbind() ; 
nchar() ; suppressMessages() ; suppressWarnings() ; stop() ; stopifnot() ; 
warn() ; message() ; on.exit() ; Sys.time() ; system.time() ; set.seed() ; 
interactive() ; .Platform ; getRversion() ; traceback() ; recover() ; debug() ;
debugonce() ; .Last.value ; letters ; with() ; withCallingHandlers() ;
invisible() ; format() ; clipboard() ; address() ; tracemem() ; list.files() 
system.file() ; Sys.which() ; file.create() ; file.exists() ; file.remove() 
file.rename() ; file.append() ; file.copy() ; file.symlink() ; file.link() 
file.info() ; Sys.chmod() ; Sys.getpid() ; Sys.getenv() ; Sys.setenv() ; 
options() ; getOption() ; .libPaths() ; search() ; as.environment() ; get() ; 
mget() ; .GlobalEnv ; all.equal() ; identical() ; all.names()

'Oh...and base R works with emoji too'

identical('🀣', 'πŸ˜€')
# [1] FALSE

grepl('☺️', 'πŸ₯° πŸ˜— πŸ˜™ 😚 ☺️ πŸ™‚ πŸ€— 🀩 πŸ€” 🀨 😐 πŸ˜‘ 😢 πŸ™„')
# [1] TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment