This has been incorporated into the highr package: https://github.com/yihui/highr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packages_for_cran_check = function(x, db = available.packages()) { | |
dep = function(x, ...) { | |
if (length(x)) unique(unlist(tools::package_dependencies(x, ...))) | |
} | |
# install these packages to run R CMD check on me | |
# x0 = dep(x, db, 'all') | |
# packages that reverse depend on me | |
x1 = dep(x, db, 'all', reverse = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xy = matrix(0.5, 1, 2) | |
shinyServer(function(input, output) { | |
output$myplot = renderPlot({ | |
hover = input$myplot_hover | |
if (!is.null(hover)) | |
xy <<- rbind(xy, c(hover$x, hover$y)) | |
par(mar = rep(0, 4)) | |
plot.new() | |
points(xy, pch = rep(c(21, 19), c(nrow(xy) - 1, 1))) | |
box() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r twitter, fig.height=626/72, fig.width=1252/71, dev='CairoPNG'} | |
par(mar = rep(0, 4)) | |
layout(matrix(1:2), heights=c(5,1)) | |
plot(sunspots, ann=FALSE, axes=FALSE) | |
plot(sunspots, ann=FALSE, axes=FALSE) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RColorBrewer) | |
col = brewer.pal(3, 'Paired')[-1] | |
par(mfrow = c(1, 2), mar = c(0, 0, 2, 0)) | |
pie(c(estimate = 1, variability = 1), main = 'theory', col = col) | |
pie(c(estimate = 1, variability = 0), main = 'reality', init.angle = 270, col = col) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
makeStaticHTMLHelp <- function(libs = .libPaths()) { | |
make.packages.html(lib.loc = libs) | |
links <- findHTMLlinks() | |
for (lib in libs) { | |
message('* Generating static HTML for packages in library ', lib) | |
for (pkg in rownames(installed.packages(lib))) { | |
message('** package', pkg) | |
pkgRdDB <- tools:::fetchRdDB(file.path(lib, pkg, 'help', pkg)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages(c('gWidgetsRGtk2', 'gWidgetstcltk', 'gWidgetsrJava')) | |
library(gWidgets) | |
## different interfaces | |
options(guiToolkit = 'RGtk2') | |
g = gwindow('RGtk2') | |
gtext('RGtk2', container = g) | |
gbutton('RGtk2', container = g) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
<<adjust-preamble, echo=FALSE, results='asis'>>= | |
if (opts_knit$get('use.highlight')) cat('\\def\\usehighlightdefs{1}\n') | |
@ | |
\ifx\highlightexists\undefined | |
\newcommand{\hlstd}[1]{\textcolor[rgb]{0,0,0}{#1}} | |
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.69,0.49,0}{#1}} | |
\newcommand{\hlesc}[1]{\textcolor[rgb]{1,0,1}{#1}} | |
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.75,0.01,0.01}{#1}} | |
\newcommand{\hlpps}[1]{\textcolor[rgb]{0.51,0.51,0}{#1}} |