Use the for
loop and if
control statements to list the women's names, age 34 or more that emabrked from S (Southampton), on the Titanic.
for (i in 1:length(titanicDataset$age))
{if (!is.na(titanicDataset$age[i]) & (titanicDataset$age[i] >= 34) & (titanicDataset$sex==female) & (titanicDataset$home.dist==Southampton))
{print(titanicDataset$name[i])}}
Error in female : object 'female' not found
[enter image description here][1]
[1]: https://i.stack.imgur.com/l857a.jpg