Tag: if statement in R

Posted on: October 28, 2017 Posted by: Guy Manova Comments: 0

simple if statement in R with ifelse

Simple if statement in R with ifelse Let’s see how to create the equivalent of Excel’s simple if statement in R using the ifelse function in base R and with dplyr: In Excel:   In R: # pre-session options rm(list = ls()) #getwd() #setwd(“C:\\Users\\User\\Documents”)   if (!require(dplyr)) install.packages(‘dplyr’) library(dplyr) campaigns …