.Rd links to suggested package [closed] - r

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
My hyperSpec package provides functions to work with spectoscopic data sets. I provide hyperSpec-methods for quite a number of functions coming from other packages. However, some of these other packages, I have listed as Suggests: as I do not want to force users to install something like 20 other packages (counting dependencies) if they may never use the specific functionality.
From the coding point of view, that works nicely. However, I'm at a loss how to deal with that in the .Rd file - but I'm sure it is a rather common problem.
The usual \code{\link[otherpkg]{fun}} will not reliably work, as there is no guarantee that otherpkg is available. If otherpkg is not installed, then the link is broken. That will be detected by R CMD check e.g. on Winbuilder and r-forge. Which means: the package won't pass CRAN checks.
Which packages would be a good example to look at?
The only hint (though no solution) I found so far: https://stat.ethz.ch/pipermail/r-devel/2009-November/055425.html (but there was no answer to that email).

The Cross-References section of Writing R Extensions says that to link to other packages use
\link[otherpkg]{foo}
with the tricky / inscrutable thing being that foo is the name of the html help page that you want to link to (within a package, there would be no need for [mypkg] and foo would be an \alias in another man page). The name of the help page is determined by the \name directive in the Rd file defining the help you're interested in retrieving.

In the end, I made otherpkg a dependency.

Related

Writing manpages in 20XX [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I wrote a program, and I'd like to write a manpage for it.
I started to learn Groff, and I really find it awful. The man macros are difficult to understand, difficult to use, and a real obstacle to productivity. The mdoc macros add a nice "semantic" extension, but they still suffer of limitations which make it incredibly hard. The resulting "code" is poor in maintainability.
Of course I know I can convert any modern markup language (say Markdown) into manpages via pandoc, but I dislike the result, and I'm not that fond of adding pandoc as dependency of my project, anyway.
Is there a way to obtain a decent manpage from a reasonable markup language?
I write manpages for the bash and ruby scripts I write.
I format them in markdown, which is a popular and simple text format.
Then I use a ruby gem called ronn to process the markdown into groff format with man macros. Ronn can also output html from the same markdown source.
OP here. After checking some alternatives, I decided to go for Asciidoc.
There are many alternatives indeed. For example, check this other question.
I also realized that there's no good answer to this question, given the fact that many tools can be used, and in the end it is just a matter of taste :)
I'll just vote for closing my own question (if anything it will remain as reference).

Writing R demos for a package [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have a very simple question really. There's a demo function demo() i.e. demo(scoping) which runs a demo of the topic. How do I write something like this for my own package? Its crazy but I have tried googling for any documentation related to it but there is none available (either that or my googling skills suck big time). I tried the documentation for devtools and roxygen too but maybe I missed it.
Can anyone point me in a right direction? Are there any packages which can generate it during the package installation? Or do I have to write it manually (I'm totally fine with that but right now I have zero information on this).
And yes, I would want to be able to do it in R console (not rstudio).
While roxygen2 does not allow you to create demos, it does allow you to include special #examples within the documentation[1]. These showup in your function or object help pages and can even be run automatically upon loading the package to test for functioning dependencies, or they can just serve as examples to your end users.
devtools on the other hand offers vignettes which is a "long-form guide to your package"[2]. These can be accessed through your overall package documentation and actually linked to anywhere within your documentation. You can make multiple vignettes and make them function or work-flow specific, organized by function family or something similar.
If you are adamant about using demos, you'll have to manually go through the trouble of establishing the proper directories, formatting and testing the demo files. If you do intend to go down this path, Hadley Wickham has some very sparse documentation on the subject here: [3].

Complete list of all vimrc configuration options? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm not quite sure if stackoverflow is the correct site to post this on, but i dont see any other better fit for it when it comes to the stack exchange sites.
Vim has a lot of documentation, everything from free books to interactive learning, but there seems to be a piece missing, at least from what i can see.
Despite all the documentation im unable to find a complete list of all options that can be specified in a .vimrc file, does anyone know where this is documented ? It is not documented in :help vimrc or any other documentation ive seen, not even the free books ive looked at. The vim tricks wiki gives an intro like so many other pages on the web, but thats about it..no page or documentation seems to list all available options for the vimrc file. The man page doesnt even list a single option, only usage and command line options.
The books and other documentation are good at mentioning how to use vim but not how to configure the configuration file.
So, does someone know where i can find a complete list of all available options in the vimrc file ?
:help 'option' will take you to the documentation of any option. All of those are contained in a single documentation file named option.txt.
Additionally, you can obtain a special report that shows all options, a short help, and the current values via
:options

Translate SPSS syntax files to R source code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
A friend is in search of a method to translate SPSS 'syntax' files to semantically equivalent R source code files.
I suppose, no one ever wrote a translator. But maybe I'm wrong.
PS: Please excuse the wrong use of 'syntax': People using SPSS tend to name an SPSS source program a 'syntax file' ;-)
The short answer is that sorry, you are right, there is no tool for automatically translating SPSS script to R script. Even worse, such a tool would likely take several (many?) man-years to create, so don't hold your breath.
A small concession is that it is probably not to hard to create a tool for translating very small, specific subsets of SPSS to R. For example, if you have a chunk of code for reading in CSV files, then you could use regular expressions to extract the useful bits from the SPSS code and autogenerate some R code from them. In most instances however it will be far easier and faster to manually port the code yourself.
If all else fails, ask Bob Muenchen; he know a lot about porting SPSS to R.
Another option for this is SPSStoR, which claims to be able to translate many common (but basic) SPSS procedures to R code. It seems to be under active development on GitHub as of August 2014.
I know it's been more than 3 years after the question was originally asked, but it's worth noting that a German company by the name of eoda is actually working on such software. It's called translateR. It is currently in beta status and you can register for a beta test on their website.

What's a good example of really clean and clear [R] code, for pedagogical purposes? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm working with a small team of analysts and statisticians on what will be a medium-sized body of R code. They're smart people, but they're not trained or experienced as programmers, per se. (I am.) They've written some R code, but for our project to be expandable, efficient, and maintainable, it needs to become well-structured, and rather more piratical. One of the better way to learn to be a better programmer is to study elegant existing code. Can anyone suggest some open source examples of R code (on CRAN or wherever) that you think are particularly clear, literate, and good examples? Functional is good, S3 objects are OK, deep magic is bad.
My two favorite packages can both be browsed on R-Forge and are very well documented (although they may be too big for an introduction):
The caret homepage and source code.
The zelig homepage and and source code.
I think that the Google style guide does a great job of capturing the style of the Core team, although Hadley has his own style guide which can be read if you're looking at his packages. You can browse Hadley's packages on Github (and his homepage is full of useful content), in particular:
plyr
ggplot2
reshape
This article on the R-Wiki is also a good read for seeing ways to optimize code.
Not strictly related, but make sure you get them used to using Source Control (perforce, subversion, git, rcs, etc) as quickly as possible. That reduces the learning pains.

Resources