[R] LOOKING FOR CODE REPOSITORY

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Fri Mar 21 02:25:53 CET 2014


Although there is a great deal of value to be gained by understanding how "package" code is written, most of my R "projects" consist of a file with 10-100 lines of code working with data in the global environment that call on packages. Such code is not typically posted online.

I do find it convenient to split my one file into three: an "output" file that starts off by using the source function to execute the main "work" file. If I write any non trivial functions, I put them in a third file and source that at the beginning of the "work" file. The output file has all my print, summary, and plot-type statements. I can re-compute all my work at any time by just executing the source statement in my output file. Having my project-specific functions in their own file makes it easier to reload them all when I edit several of them. It also makes debugging in RStudio easier because it links function code to line numbers. I also write roxygen-style comments for my functions to ease putting them into packages later should they prove to be generally applicable, and refer to those comments if I forget what the arguments are for.

HTH
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On March 20, 2014 10:49:33 AM PDT, Greg Snow <538280 at gmail.com> wrote:
>Please read the posting guide (there is a link at the bottom of every
>post) and post in plain text, not HTML, and also avoid all caps.
>
>The biggest repository of R code is probably CRAN which is linked from
>the main R page.  There are also R-forge and Bioconductor and many R
>packages on Github.
>
>On Thu, Mar 20, 2014 at 11:37 AM, Subhabrata Banerjee
><subhabangalore at gmail.com> wrote:
>> Dear Group,
>>
>> I am bit new in R. I am looking for a code repository of few projects
>> developed in R.
>> I want to see them to learn more.
>>
>> If any one of the esteemed members of the group may kindly help.
>>
>> Regards,
>> Subhabrata Banerjee.
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list