2 Challenges

Covers broader range of scenarios like data import, export, cleaning, transformation, operating on remote data, package development, productionizing your code.

2.1 R language

2.1.1 functions

We already used some built-in functions in section above, now lets create own functions.

2.1.2 control structure

if (1) 1 else 2

2.1.3 loops

2.1.4 exceptions

2.1.5 debugging

2.2 Data Input/Output

2.2.1 csv

read.table()
fread("head 10 data.csv")
write.table()
fwrite()

2.2.2 databases

DBI, postgresql

library(RPostgreSQL)

dplyr equivalent of fetching whole table is copy_to function.

dplyr::copy_to

2.2.3 binary formats

rds, parquet, arrow