Fichas
Control Structures - If-else
Fichas del conjunto (5)
- 1What is the template for an if statement?if ( condition ) {
## do something
} - 2What is the template for an if-else statement?if ( ) {
## do something
} else {
## do something else
} - 3using if, express a switch statementif ( ) {
## do something
} else if (condition) {
## do something different
} else {
## do something different
} - 4create an if-else that assigns y a value of 10 when x > 3 otherwise 0 with 1 assignment.y <- if ( x > 3 ) {
10
} else {
0
} - 5Is the else clause necessary?no
Información
- Descripción
- I (Week 1 - Getting Started) Programming R Fichas sobre Control Structures - If-else, creado por Thomas Allan el 09/02/2016.
- Creado por
- Thomas Allan
- Visitas
- 0
- Valoración