Trace:

day1_exercise4

This shows you the differences between two versions of the page.

— |
day1_exercise4 [2017/12/13 18:14] (current) hyjeong created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | x = runif(10) | ||

+ | | ||

+ | #1 | ||

+ | if(sum(x)>5) { | ||

+ | cat('sum(x) is greater than 5.\n') | ||

+ | } else if(sum(x)<5) { | ||

+ | cat('sum(x) is less than 5.\n') | ||

+ | } else | ||

+ | cat('sum(x) is equal to 5.\n') | ||

+ | | ||

+ | #2 | ||

+ | y = ifelse(x<0.5,x,x-0.5) | ||

+ | | ||

+ | #3 | ||

+ | i=3 | ||

+ | switch(i,x+y,x-y,x*y) |

day1_exercise4.txt · Last modified: 2017/12/13 18:14 by hyjeong

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International