Benjamin Tyner
2013-May-24 21:46 UTC
[R] retaining comments within functions defined in Rprofile.site
Hi, I have some functions defined within etc/Rprofile.site which contain embedded comments, but it seems the comments get stripped out when the site profile is sourced into the base namespace. I'm thinking I need to enable options(keep.source=TRUE) somewhere prior to the actual sourcing of the site profile, but haven't been able to figure it out yet. Does anyone have any suggestions? Thanks, Ben
Greg Snow
2013-May-24 21:53 UTC
[R] retaining comments within functions defined in Rprofile.site
The help page "?Startup" gives details on the startup procedures and the order in which different files, variables, etc. are read/executed. That may give you insight into where to set and option so that it is in place when needed. On Fri, May 24, 2013 at 3:46 PM, Benjamin Tyner <btyner@gmail.com> wrote:> Hi, > > I have some functions defined within etc/Rprofile.site which contain > embedded comments, but it seems the comments get stripped out when the > site profile is sourced into the base namespace. I'm thinking I need to > enable options(keep.source=TRUE) somewhere prior to the actual sourcing > of the site profile, but haven't been able to figure it out yet. Does > anyone have any suggestions? > > Thanks, > Ben > > > ______________________________________________ > R-help@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. > >-- Gregory (Greg) L. Snow Ph.D. 538280@gmail.com [[alternative HTML version deleted]]
Benjamin Tyner
2013-May-25 21:15 UTC
[R] retaining comments within functions defined in Rprofile.site
Thank you Duncan; that is a most helpful explanation and suggestion. On 05/25/2013 09:26 AM, Duncan Murdoch wrote:> Those files are read in a hard-wired way quite early in the startup > process, and there's no way to enable keep.source on them. However, > there's nothing to stop those files from calling source() on another > file, and using keep.source=TRUE when they do so. You could probably > even hack something together so that Rprofile.site sourced itself, but > it would be pretty easy to get into an infinite loop if you weren't > careful... > > > On Fri, May 24, 2013 at 5:46 PM, Benjamin Tyner <btyner at gmail.com > <mailto:btyner at gmail.com>> wrote: > > Hi, > > I have some functions defined within etc/Rprofile.site which contain > embedded comments, but it seems the comments get stripped out when the > site profile is sourced into the base namespace. I'm thinking I > need to > enable options(keep.source=TRUE) somewhere prior to the actual > sourcing > of the site profile, but haven't been able to figure it out yet. Does > anyone have any suggestions? > > Thanks, > Ben > > > ______________________________________________ > R-help at r-project.org <mailto: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. > >