1
0

sample.r.txt 710 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # © Microsoft. All rights reserved.
  2. #' Add together two numbers.
  3. #'
  4. #' @param x A number.
  5. #' @param y A number.
  6. #' @return The sum of \code{x} and \code{y}.
  7. #' @examples
  8. #' add(1, 1)
  9. #' add(10, 1)
  10. add <- function(x, y) {
  11. x + y
  12. }
  13. add(1, 2)
  14. add(1.0, 2.0)
  15. add(-1, -2)
  16. add(-1.0, -2.0)
  17. add(1.0e10, 2.0e10)
  18. #' Concatenate together two strings.
  19. #'
  20. #' @param x A string.
  21. #' @param y A string.
  22. #' @return The concatenated string built of \code{x} and \code{y}.
  23. #' @examples
  24. #' strcat("one", "two")
  25. strcat <- function(x, y) {
  26. paste(x, y)
  27. }
  28. paste("one", "two")
  29. paste('one', 'two')
  30. paste(NULL, NULL)
  31. paste(NA, NA)
  32. paste("multi-
  33. line",
  34. 'multi-
  35. line')