assignment question:Use the built-in data set iris. Find the Species, in which Sepal.Length is greater than Petal.Length. 2. Count all such Species.solution: iris$find = ifelse(iris$Sepal.Length > iris$Petal.Length,1,0)View(iris) sum(ifelse(iris$Sepal.Length > iris$Petal.Length,1,0))[1] 150Is it correct or any better code can be implemented ?
I am trying to execute this statement. In this, I have to get one output i.e. India won the first ODI but I got two times instead of one. please provide me a useful solutionif(inScore[1]> ausScore[1])( print("India won the first ODI"))
Use the built-in data set iris. Find the Species, in which Sepal.Length is greater than Petal.Length. please send the answer
Count all such Species.Answer for Assignment Question
Is it possible to add a new column to a specific position in a dataframe?
11522 visits
Outline:About conditional statements Syntax of if, else and else if statements Use if, else and else if statements Use if else function Arguments of if else function Add a new column in an existing data frame Read and store a csv file View a data frame Count true values in a column Use sum function
About conditional statements Syntax of if, else and else if statements Use if, else and else if statements Use if else function Arguments of if else function Add a new column in an existing data frame Read and store a csv file View a data frame Count true values in a column Use sum function
Show video info
Pre-requisite