a <- c(1, 2, 3) # b starts as a copy of a b <- a # modifying b does not touch a b[1] <- 99 print(a) print(b)
assignment copies when modified