Conditional Statements - English
- subtitles off
- captions off
- English
- Questions posted on Forums
- R Tutorials - English
-
Conditional statement assignment
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 ?
10-11M 40-50S suhailalphacs
Answer last updated on: May 6, 2020, 8:16 p.m.
-
Some problem on the execution of the statement
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"))
03-04M 20-30S sumankr545
Answer last updated on: May 2, 2020, 6:20 p.m.
-
Conditional Statements
Use the built-in data set iris. Find the Species, in which Sepal.Length is greater than Petal.Length. please send the answer
11-12M 0-10S bvs.nnsvidya@gmail.com
Answer last updated on: April 30, 2020, 2:28 p.m.
-
Conditional Statements
Count all such Species.Answer for Assignment Question
09-10M 0-10S bvs.nnsvidya@gmail.com
Answer last updated on: April 30, 2020, 2:27 p.m.
-
Adding a new column
Is it possible to add a new column to a specific position in a dataframe?
09-10M 30-40S vijayaprabhu
Answer last updated on: April 24, 2020, 1:05 p.m.
-
1Overview of R and RStudio
-
2Installing R and RStudio on Linux
-
3Installing R and RStudio on Windows
-
4Introduction to basics of R
-
5Introduction to Data Frames in R
-
6Introduction to RStudio
-
7Introduction to R script
-
8Working directories in RStudio
-
9Indexing and Slicing Data Frames
-
10Creating Matrices using Data Frames
-
11Operations on Matrices and Data Frames
-
12Merging and Importing Data
-
13Data types and Factors
-
14Lists and its Operations
-
15Plotting Histograms and Pie Chart
-
16Plotting Bar Charts and Scatter Plot
-
17Introduction to ggplot2
-
18Aesthetic Mapping in ggplot2
-
19Data Manipulation using dplyr Package
-
20More Functions in dplyr Package
-
21Pipe Operator
-
Conditional Statements
-
23Functions in R
Questions posted on ST Forums:
11997 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
Width: | 892 | Height: | 632 |
---|---|---|---|
Duration: | 00:12:06 | Size: | 6 MB |
Show video info