Learning R from Scratch
Learning R from Scratch
Richard Treves
Ep5] Cleaning Data, loops and Vectorisation
11 minutes Posted Aug 21, 2020 at 2:06 pm.
){
0:00
11:13
Download MP3
Show notes
2] Cleaning Data: To remove a column 'col' in a dataframe 'data' using null, the command is:
data$col <- NULL
How to apply hash strings (a series of unreadable text) to replace important data e.g. full names. https://cran.r-project.org/web/packages/openssl/vignettes/crypto_hashing.html
3] For Loops:
The code I discussed
For (i in
commands to be written here in a series of lines
}
4] Vectorisation: The explanation of apply (and related commands like 'lapply') I used is here https://www.guru99.com/r-apply-sapply-tapply.html