Skip to content
Course Notes: Intermediate R
  • AI Chat
  • Code
  • Report
  • Loops have different ways for elementes as vectors and lists [] -> if vector in the print [[]] -> if list in the print both regarding the loop2

    # Write and run code here
    
    increment <- function(x, inc = 1) {
      x <- x + inc
      x
    }
    count <- 5
    a <- increment(count, 2)
    b <- increment(count)
    count <- increment(count, 2)
    
    b