Every programming language has them. Those oddball situations where you have an apparently simple task which well… doesn’t fit neatly into the obvious answers. Knowing the right R function to use or a quick workaround can spell the difference between spending hours on Stack Overflow and quickly moving onto the next step. We’re making a list of some little things that can really simplify your life here.
Bookmark us and check back regularly.
Functions of interest
Cleaning Up Data
- complete.cases() – identify entire rows which contain at least one NA values
- is.na() – check for missing values
- na.omit – quick way to drop rows with missing values
- rpois function – Possion Distribution
- rnorm – Normal Distribution
- runif – Uniform distribution
- rbinom – Binomial distribution
- rexp – Exponential distribution
File System Manipulation
Writing Good Code
- Rename Columns in R – hint: make them easy to understand