R Tutorial - Source Function Files With Local Attributes

R Tutorial – Source Function Files With Local Attributes

Outline

    Original Post

    R Tutorial – Source Function Files With Local Attributes


    If you are building your own modules or called codebase, it is common to split some huge functions as independent files. In other words, you may source functions in functions.

    In my case, I have a file named codebase, which includes many short functions. Also, I built some huge modules based on the codebase. However, when I keep improving the codebase, it is hard to update all huge modules to support the latest version of the codebase. So, the following code is really useful. Besides, it’s a great way to prevent conflicts for the same name functions.

    source('D:/Projects/Function/function_1.R', encoding = "UTF-8", local = TRUE)

     



    Related Posts

    Aron

    A data scientist working in a retail company, with experience in web design and marketing. Recently dives into cryptocurrency and quantitative investing.

    facebook telegram
    Content Protection by DMCA.com

    Leave a Reply

    • Required fields are market * .
    • Your email address will not be published.
    • Please ensure your email address is correct, then you will get a notification once a new comment reply.

    Your email address will not be published. Required fields are marked *