Skip to content

Instantly share code, notes, and snippets.

@kevinushey
kevinushey / server.R
Created September 4, 2014 23:53
Input slider has some bugs when used through uiOutput
library(shiny)
## Example
# shinyServer(function(input, output) {
# output$value <- renderPrint({ input$sliderId })
# })
## uiOutput
shinyServer(function(input, output) {
output$slider <- renderUI({
@kevinushey
kevinushey / rstudio-windows-encoding-workarounds.R
Created September 23, 2016 18:24
Some workarounds for mis-encoded environment variables on Windows for users with non-ASCII characters in their username.
# Place this in a file at '~/.Rprofile' to ensure it's sourced on startup
.First <- function() {
# RStudio-specific startup
if (!is.na(Sys.getenv("RSTUDIO", unset = NA)) &&
Sys.info()[["sysname"]] == "Windows")
{
# work around mis-encoded environment variables
USERPROFILE <- Sys.getenv("USERPROFILE")
HOME <- file.path(USERPROFILE, "Documents", fsep = "\\")
R_USER <- HOME
@kevinushey
kevinushey / # llvm - 2017-07-01_09-17-42.txt
Created July 1, 2017 17:39
llvm on macOS 10.12.5 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.12.5
Build date: 2017-07-01 09:17:42
{'StringIO': <module 'StringIO' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/StringIO.pyc'>,
'UserDict': <module 'UserDict' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc'>,
'__builtin__': <module '__builtin__' (built-in)>,
'__future__': <module '__future__' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/__future__.pyc'>,
'__main__': <module '__main__' (built-in)>,
'_abcoll': <module '_abcoll' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc'>,
'_ast': <module '_ast' (built-in)>,
'_codecs': <module '_codecs' (built-in)>,
'_collections': <module '_collections' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so'>,
'_ctypes': <module '_ctypes' from '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so'>,
@kevinushey
kevinushey / # cairo - 2017-08-10_15-08-14.txt
Created August 10, 2017 22:09
cairo on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for cairo on macOS 10.12.6
Build date: 2017-08-10 15:08:14
@kevinushey
kevinushey / # llvm - 2017-09-08_13-00-19.txt
Created September 8, 2017 20:50
llvm on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.12.6
Build date: 2017-09-08 13:00:19
@kevinushey
kevinushey / # llvm - 2017-09-09_12-28-18.txt
Created September 10, 2017 18:55
llvm on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.12.6
Build date: 2017-09-09 12:28:18
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
@kevinushey
kevinushey / repro.md
Created November 1, 2018 18:57
Markdown document that crashes during Pandoc render.
title author output_format
State of the Ecosystem: Indicator Processing & Visualization
Sean Hardison
html_document

Introduction

The purpose of this file is to document State of the Ecosystem (SOE) indicator data processing. To update existing data sets, set the save_clean parameter in the Rmarkdown set-up chunk to TRUE. Raw data for these indicators are available in the file directory extdata, and libraries required to process indicator data sets are shown below.

@kevinushey
kevinushey / rtools.R
Last active December 13, 2018 18:19
Rtools not found in expected PATH
Sys.setenv(PATH = paste("C:\\RBuildTools\\3.5\\bin;C:\\RBuildTools\\3.5\\mingw_64\\bin", Sys.getenv("PATH"), sep = ";"))
file <- tempfile(fileext = ".c")
writeLines("void test() {}", con = file)
R <- file.path(R.home("bin"), "R")
file <- normalizePath(file, winslash = "/")
system2(R, c("CMD", "SHLIB", shQuote(file)))
# c:/Rtools/mingw_64/bin/gcc -I"C:/R/R-35~1.2BE/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c C:/Users/kevin/AppData/Local/Temp/RtmpK2O0OE/file123830c41969.c -o C:/Users/kevin/AppData/Local/Temp/RtmpK2O0OE/file123830c41969.o
# sh: c:/Rtools/mingw_64/bin/gcc: No such file or directory