saving . . . saved Conditional Statements has been deleted. Conditional Statements has been hidden .
Conditional Statements
Title
Question
Use the built-in data set iris. Find the Species, in which Sepal.Length is greater than Petal.Length. 
please send the answer

R Conditional-Statements 11-12 min 0-10 sec 30-04-20, 12:52 p.m. bvs.nnsvidya@gmail.com

Answers:

Count = 0
Species = vector(mode = "character",length = nrow(iris))
for(i in 1:nrow(iris))
{
if(iris$Sepal.Length[i]>iris$Petal.Length[i])
{
Species[Count + 1] <- as.character(iris$Species[i])
Count = Count + 1
}
}
Species
30-04-20, 2:28 p.m. chrl3hr5@gmail.com


Log-in to answer to this question.