Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 384 Bytes

R_tricks.md

File metadata and controls

26 lines (19 loc) · 384 Bytes

R cheatsheet / tricks

Data Frame manipulation

MUCH faster rbind

instead of doing:

df_combine = data.frame()
for (file in files){
    df_curr = read.csv(file)
    df_combine = rbind(df_combine, df_curr)

do

library(data.table)
df_list = list()
for (file in files){
    df_list[file] = read.csv(file)
df_combine = rbindlist(df_list)

it's much faster!!