R/Totally Miscellaneous

From QERM Wiki
Jump to: navigation, search

A dumping ground for totally random but useful pieces of code (at least to me!) that I will know where to find in the future and that might be handy for the rest of the webiverse.

Help option settings

In my latest R installation, I set the default help to be the all-text popup within the GUI out of some misguided sense of simplicity. With more fancypants packages, hyperlinks are extremely useful. How to change the help to the "html" option? Like this:

options("help_type" = "html")

Unstripping Spaghetti

How to assign - more firmly than with "attach" - data frame columns to their heading names? Like this:

n <- names(mydataframe)
for(i in 1:n)
  assign(n[i], mydataframe[,i])

I do this all the time. Is there a more elegant way to do it?

Personal tools