Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: add suport for config files #38

Closed
aL3xa opened this issue Feb 11, 2012 · 6 comments
Closed

New feature: add suport for config files #38

aL3xa opened this issue Feb 11, 2012 · 6 comments
Labels

Comments

@aL3xa
Copy link
Contributor

aL3xa commented Feb 11, 2012

Okay, the idea is to add an R file (as @daroczig suggested), in which various rapport settings will take place. File should probably be named like .rapport.R or something. This issue should summarise all user customisable settings. Feel free to add/request new ones. At first, we'll support all settings available in init.R file.

@daroczig
Copy link
Member

That's a great idea indeed, thanks @aL3xa!

Just adding my 2 cents: .rapport.R or .rapport.conf might live in user's home dir (both on Unix-like systems and on Windows) and we might add a new line at the end of init.R to check if that files exists. If so, then it's sourced, so default settings would be overwritten. We just need a function to easily alter that file which would hold some options(...) calls.

@daroczig
Copy link
Member

daroczig commented Jul 5, 2012

Bumping this issue: why not ask users simply to add some tweaks in their .Rprofile instead of custom hacks?

@daroczig
Copy link
Member

My recent request fits this ticket, so here goes the "specification": instead of config files, users can tweak their default settings in .Rprofile. That's the R way :)

But we need to tweak the current options setup, which messes with global options and we are definitely cluttering up that. Please change the options to work like in pander package: https://github.com/Rapporter/pander/blob/master/R/options.R

In short: let us have a rapport option which would hold the current options in a list. Pls add a helper function (e.g. rapportOptions) like I did in pander where users can query and update those easily. Do not forget to update all options and getOption calls in the sources and in the docs :)

And a "fallback compatibility" would be awesome for loyal users, so if they have e.g. an rp.file.path option, then the custom rapportOptions fn should return that instead of the default one.

@ghost ghost assigned aL3xa Dec 15, 2012
@aL3xa
Copy link
Contributor Author

aL3xa commented Dec 26, 2012

I have a few suggestions about this one:

  • if we move all options to rapport list, we don't need rp. prefix, or do we?
  • IMO, getter/setter approach is way better, e.g. rapportOption('tpl.paths') should return template paths, but rapportOption('tpl.paths') <- c('/my/path1', '/my/path2') would be a bit more elegant

Whadda U think?

@daroczig
Copy link
Member

Yeah, we can drop rp prefix.
About setter method: as you wish :)

@daroczig
Copy link
Member

rp prefix is gone in #93, and users can specify options in their .Rprofile, so let's say it's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants