[R-pkg-devel] saving user preferences per workspace

Godfrey, Jonathan A.J.Godfrey at massey.ac.nz
Sat Dec 12 21:52:29 CET 2015


Hello,

I wish to offer users of my BrailleR package the ability to save their preferences, which may change by the workspace.

I've toyed with the ideas:

1.        saving a file in the corresponding folder;  or,

2.       creating an object containing all the settings in the workspace


In either scenario, the settings get picked up next time the user loads the package in the right workspace. Both have worked.

My problem is that I think my functions to create or modify the file or object breach CRAN policies. I am certainly getting a NOTE for using assign(..., pos=1)

I had thought to try using the parent environment instead of explicitly using 'pos=1' but sometimes my functions are operating at the grandchild level with respect to pos=1 and therefore fail.

I think my previous solution of writing a file in the current folder was only getting past the CRAN checks because I was doing it with a condition of running R in interactive mode. if(interactive()){...}
But I think it is a breach of the policies to write a file to the user's hard drive, and sneaking around with a solution that CRAN checks can't cope with (yet) really doesn't work for me.

Any ideas, especially pointers to other packages that do manage this task would help me greatly.

Thanks for any help/advice,
Jonathan



	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list