1. *kohei-kawaguchi-sunada*August 30, 2022 1:54 PM (GMT+8)August 30, 2022 1:54 PM (GMT+8)

    You don't have to call a package in this way if you call each function as dplyr::mutate.

  2. **August 30, 2022 1:54 PM (GMT+8)August 30, 2022 1:54 PM (GMT+8)August 30, 2022 1:54 PM (GMT+8)

  3. **August 30, 2022 1:55 PM (GMT+8)August 30, 2022 1:55 PM (GMT+8)August 30, 2022 1:55 PM (GMT+8)

    I make foreach, magrittr, and some other packages like ggplot2 and modelsummary exceptions and call them by library. August 30, 2022 1:55 PM (GMT+8)

  4. **August 30, 2022 1:56 PM (GMT+8)August 30, 2022 1:56 PM (GMT+8)August 30, 2022 1:56 PM (GMT+8)

    This one should be like the next

  5. **August 30, 2022 1:56 PM (GMT+8)August 30, 2022 1:56 PM (GMT+8)August 30, 2022 1:56 PM (GMT+8)

  6. **August 30, 2022 1:57 PM (GMT+8)August 30, 2022 1:57 PM (GMT+8)August 30, 2022 1:57 PM (GMT+8)

    The reason is otherwise the position of the indent can be different depending on the length of words. For example, if it is not data.frame but tibble::tibble, the location of the indent can be different. By breaking the lines as above, you can keep the location of the indent.

  7. **August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)

    For the same reason, I make

  8. **August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)

  9. **August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)

    into this

  10. **August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)August 30, 2022 1:58 PM (GMT+8)

  11. **August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)

    You can use as many lines as you want.

  12. **August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)

    It is always better to make arguments explicit. This is especially true for user-written functions.

  13. **August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)August 30, 2022 1:59 PM (GMT+8)

  14. **August 30, 2022 2:00 PM (GMT+8)August 30, 2022 2:00 PM (GMT+8)August 30, 2022 2:00 PM (GMT+8)

  15. **August 30, 2022 2:01 PM (GMT+8)August 30, 2022 2:01 PM (GMT+8)August 30, 2022 2:01 PM (GMT+8)

    You can pass additional arguments to optim as follows

  16. **August 30, 2022 2:01 PM (GMT+8)August 30, 2022 2:01 PM (GMT+8)August 30, 2022 2:01 PM (GMT+8)

  17. **August 30, 2022 2:02 PM (GMT+8)August 30, 2022 2:02 PM (GMT+8)August 30, 2022 2:02 PM (GMT+8)

  18. **August 30, 2022 2:03 PM (GMT+8)August 30, 2022 2:03 PM (GMT+8)August 30, 2022 2:03 PM (GMT+8)

    This is the same for other functions that have ... in the arguments. You can see this in the help page

  19. **August 30, 2022 2:03 PM (GMT+8)August 30, 2022 2:03 PM (GMT+8)August 30, 2022 2:03 PM (GMT+8)

  20. **August 30, 2022 2:04 PM (GMT+8)August 30, 2022 2:04 PM (GMT+8)August 30, 2022 2:04 PM (GMT+8)

    R function definitions can be written in a single function like R/functions.R. In Matlab, we had to make a file for each function.