Category: Module – IRP
-
Introduction to R-programming
Day 2 UI Code Operation Day 5 Condition Day 9 Data Structure Day 10 Data Structure (Con’t) Day 12 Data Query
-
Day 12 (2)
Perks! Add “dplyr” package to enable following function select() filter() mutate() arrange() summarize() sample() select(variable_name, column_name) → similar like SQL select, can perform column alias, range column name, start/end with column name and exclude column. Result: filter(variable_name, condition) → single or multiple logical condition; similar to subset(). Result: mutate(variable_name, column_name) → create, edit or delete…
-
Day 10 (2)
Data Structure (con’t) data.frame(data) → two dimension, multiple datatype Result: Add data rbind(variable_name, variable_name) Result: cbind(variable_name, variable_name) Result: Import data read.csv(file_path, header=TRUE/FALSE) Access column Result: Delete column Result: Data frame function nrow(variable_name) Result: 4 ncol(variable_name) Result: 3 dim(variable_name) Result: names(variable_name) Result: head(variable_name, quantity) Result: tail(variable_name, quantity) Result: list(data) → multi dimension, multiple datatype Result:
-
Day 9 (2)
Data Structure the way how to store data in memory. For example, store data in matrix form, 5row x 3column. factor(data,levels,labels) → single dimension, kinda like relational database dim::fact concept Result: so what happen here is that data is “a”, “a”, “b”, 1. But due to levels parameter, “1” is remove to end and all…
-
Day 5 (2)
Condition ==,<,<=,>,>=,!= → boolean operators if/else Result: switch → if not integer/index, must define result. Result: out of condition return NULL Result: for Result: while Result: repeat Result:
-
Day 2 (1)
UI in R Studio .R File – R script saved location Console – code being executed Environment – variable saved in memory File/Plot/Package/Help – Different functionality like viewing file in explorer, help documentation of script, Cran list of library. Code Code reusability, introduce “package”, which is a public directory from CRAN. also similar to Operation+,-,*,/,%%…
