R How many males and females kids are on board? code example
Example 1: R How many males and females kids are on board?
> test$Survived <- 0
> test$Survived[test$Sex == 'female']
Example 2: R How many males and females kids are on board?
> test$Survived <- 0
> test$Survived[test$Sex == 'female'] <- 1