Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. volume <- function(L,B,H){
  2. vol <- L*B*H
  3. return(vol)
  4. }
  5. volume(7,8,9)
  6.  
  7. volume <- function(x) {
  8. x <- c(L,B,H) #This is incorrect
  9. vol <- L*B*H
  10. return(vol)
  11. }
  12.  
  13. L <- 7
  14. B <- 8
  15. D <- 1
  16. volume(x)
  17.  
  18. volume <- function(x){
  19. return(prod(x))
  20. }
  21.  
  22. L <- 7
  23. B <- 8
  24. D <- 1
  25. x <- c(L, B, D)
  26. volume(x)
  27. [1] 56
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement