Skip to content

Big, complex, well-structured .R file for demonstration?

6 messages · Sarah Goslee, Greg Snow, Thorsten Jolitz +1 more

#
Hi List, 

I'm looking for a rather big, but well structured R file that contains
as much of R language features as possible (i.e. that uses a lot of the
functionality described in the 'R Reference Card' and, if possible, S4
classes too).

I want to check some code I wrote against such a file and use it for
demonstration purposes. However, most .R files I find out there are
rather short without much structure.

Any links to candidate (open source) files would be appreciated.
#
On Tue, Jun 11, 2013 at 11:06 AM, Thorsten Jolitz <tjolitz at gmail.com> wrote:
http://cran.r-project.org/web/packages/

I might start with MASS, though I have no idea what "well structured"
means to you.
Your request doesn't make a whole lot of sense to me, but there are so
many thousands of R files on CRAN that there's bound to be something
that makes you happy.

Sarah
#
Sarah Goslee <sarah.goslee at gmail.com> writes:
you are probably right, it might not make any sense, I guess I was
looking for something like a "full application" written in R, not just a
specialized library, but thank you for the link anyway, I decided to
clone the github repo of R, and the sources together with the CRAN
packages should give me what I want.
#
Greg Snow <538280 at gmail.com> writes:
As Emacs Org-mode has proven for text files, this structuring into
smaller pieces can be done in one single file too (that is structured as
a hierarchical outline tree) an this can be even more convenient than to
deal with many small files. But otherwise I agree with you, its much
better to split a file up before it becomes a growing mess.

  
    
#
Just because you have an editor that can let you see the organization within the file does not mean the code itself is well-structured. If you do put a lot of code in one file, you will be more likely in your next project that builds on this one to load code you do not need (bloat), and that is a very practical defect in the structure of the current project. Regardless of any arguments you can think of to the contrary, that is why single large files with otherwise well-structured code are uncommon.
---------------------------------------------------------------------------
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.
Thorsten Jolitz <tjolitz at gmail.com> wrote: