Search
 
SCRIPT & CODE EXAMPLE
 

R

mutate in r if else

df %>%
  mutate(g = ifelse(a == 2 | a == 5 | a == 7 | (a == 1 & b == 4), 2,
               ifelse(a == 0 | a == 1 | a == 4 | a == 3 |  c == 4, 3, NA)))
Comment

r mutate ifelse function

df <- df %>% mutate(target_bool = case_when(salary == ">50K" ~ TRUE, salary == "<=50K" ~ FALSE))
Comment

PREVIOUS NEXT
Code Example
R :: check R package 
R :: r sapply syntax 
R :: rnorm in r 
R :: for R 
R :: boucle sur r 
R :: find q1, q3 and iqr in r 
R :: how to tell if a variable is discrete or continuous in r 
R :: how to randomly select R 
R :: rename a variable in r 
R :: log likelihood in r 
R :: r dplyr summarize multiple columns 
R :: R create sequence of date each quarters 
R :: R excel 
R :: r predict type 
R :: point estimates and prediction intervals in r 
R :: Significance codes 
R :: arrange rows according to a vector in r 
R :: ways to examine model in r 
R :: legend in r 
Rust :: how to index a string in rust 
Rust :: rust nesting and labels loop 
Rust :: rust implement clone for struct 
Rust :: find last element of vec rust 
Rust :: armanriazi•rust•Rc 
Rust :: rust for loop 
Rust :: get last index of string rust 
Rust :: armanriazi•rust•error•error[E0382]: borrow of moved value: `val` ... thread 
Rust :: rust get items in a list 
Rust :: armanriazi•rust•function•vs•closure 
Lua :: lua how to get random object from a table 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =