The latest version of the devtools
package on CRAN (version 1.12.0) has a bug that causes issues with the installation of package dependencies on Windows, which usually manifest as errors during the installation of GitHub packages stating some dependency (e.g. stringi
or dplyr
or htmltools
, etc. package missing). The issue is described in various bug reports and was fixed in December 2016 (devtools issue #1409). However, as of March 2017, this bug fix has not propagated to the version of devtool
on CRAN yet. The easiest solution is to use the fixed devtools
from GitHub (this specific commit fixes the problem) for the installation of GitHub packages. Windows may not allow installation of a GitHub version of devtools using devtools (because it cannot overwrite the loaded package), in which case the easiest approach is to use the build_github_devtools
function whic
This file contains hidden or 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
originals |
The attached code file provides an easy basic interface to the Wolfram Alpha API. Inspired by the wolframalpha module available for Python.
source("wa_lib.R")
This file contains hidden or 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
--- | |
title: "Analysis test" | |
output: html_document | |
--- | |
```{r, echo=FALSE, warning=FALSE} | |
# This code chunk simply makes sure that all the libraries used here are installed, it will not be shown in the report (notice echo = FALSE). | |
packages <- c("readxl", "knitr", "tidyr", "dplyr", "ggplot2", "plotly") | |
if ( length(missing_pkgs <- setdiff(packages, rownames(installed.packages()))) > 0) { | |
message("Installing missing package(s): ", paste(missing_pkgs, collapse = ", ")) |
Install the newest version of R. Additionally, I highly recommend R-Studio for working with R regularly (but the basic command line will work just fine for most applications). Once R is installed, you can install GTK directly from within R (details below). In short:
- install R for Windows
- optional but recommended: install R-Studio
- install GTK+
- From the R command line (e.g. in R-Studio), install the
RGtk2
package by running:install.packages("RGtk2", depen=T)
This might fail with the warning thatpackage ‘RGtk2’ is not available (for R version xxx)
if your version of R has been released very recently. If so, just runinstall.packages("RGtk2", depen=T, type="source")
instead to install theRGtk2
package directly from its source code (this might take a few
This file contains hidden or 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(rCharts) | |
library(rjson) # required for overwrite | |
# load rCharts and extend Nvd3 object to allow y2Axis parameters (not implemented in rCharts yet) | |
nPlot <- function(x, data, ...){ | |
Nvd3mod <- setRefClass('Nvd3mod', contains = 'Nvd3', methods = list( | |
initialize = function(){ | |
callSuper(); | |
LIB <<- get_lib('nvd3') # library name and url to parent library | |
templates$script <<- 'NVD3.html' # chart template to include y2Axis- | |
params <<- c(params, list(y2Axis = list())) |
This file contains hidden or 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
<script type='text/javascript'> | |
$(document).ready(function(){ | |
draw{{chartId}}() | |
}); | |
function draw{{chartId}}(){ | |
var opts = {{{ opts }}}, | |
data = {{{ data }}} | |
var data = d3.nest() | |
.key(function(d){ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.