IT-Academy

Vetvenie a struktura R

Apr 26th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.66 KB | None | 0 0
  1. # ---- -2 ---- -1 ---- 0 ---- 1 ---- 2 ----
  2.  
  3. x = remove(vysledok)
  4. x = rnorm(1)
  5.  
  6. x = .5
  7. if(x > 1) {
  8.   vysledok = "x je vacsie ako 1"
  9. } else {
  10.   vysledok = "x je mensie ako 1"
  11. }
  12.  
  13.  
  14. vek = 25
  15. # Verzia 1
  16. # if(vek >= 18){
  17. #   status = "Dostanes vodicak..."
  18. # } else {
  19. #   status = "Nedostanes vodicak..."
  20. # }
  21.  
  22. # Verzia 2 overenie seniory
  23. # if(vek < 18) {
  24. #   status = "Nedostanes vodicak..."
  25. # } if (vek < 90){
  26. #   status = "Dostanes vodicak..."
  27. # } else {
  28. #   status = "Nedostanes vodicak..."
  29. # }
  30.  
  31. # Verzia 3 overenie seniory skratene
  32. if((vek >= 18) & (vek < 90)) {
  33.   status = "Dostanes vodicak..."
  34. } else {
  35.   status = "Nedostanes vodicak..."
  36. }
Advertisement
Add Comment
Please, Sign In to add comment