Skip to content

Instantly share code, notes, and snippets.

View cdeterman's full-sized avatar

Charles Determan cdeterman

View GitHub Profile
@cdeterman
cdeterman / rpm_to_deb.sh
Created January 13, 2016 15:31
ubuntu install multiple rpm files
#/bin/bash
for f in *.rpm; do
fakeroot alien --to-deb $f
done
for f in *.deb; do
sudo dpkg -i $f
done
@cdeterman
cdeterman / airline_data_test.R
Created August 19, 2015 20:36
load the airlines dataset with bigmemory
for (year in 1987:2008) {
file.name <- paste(year, "csv.bz2", sep = ".")
if ( !file.exists(file.name) ) {
url.text <- paste("http://stat-computing.org/dataexpo/2009/",
year, ".csv.bz2", sep = "")
cat("Downloading missing data file ", file.name, "\n", sep = "")
download.file(url.text, file.name)
}
}
@cdeterman
cdeterman / server.R
Created May 14, 2015 12:39
SO 30177053
library(shiny)
library(tools)
library(XLConnect)
shinyServer(function(input, output){
filedata <- reactive({
infile <- input$templatedfile
if(is.null(infile)){
return(NULL)
@cdeterman
cdeterman / global.R
Last active August 29, 2015 14:15
SO 28673137
df1_number <-sample(seq(1,20,0.01),20,replace = T)
df1_number2 <-sample(seq(1,5,0.01),20,replace = T)
df1 <- data.frame(name = rep(letters[1:4],each = 5), number = df1_number, number2 = df1_number2,
info = "info")
@cdeterman
cdeterman / bootstrap.css
Last active August 29, 2015 14:15
SO 28498853
@import url("//fonts.googleapis.com/css?family=Lato:400,700,900,400italic");
/*!
* Bootstrap v2.3.2
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
@cdeterman
cdeterman / global.R
Last active August 29, 2015 14:15
SO 28534436
Visitas_Por_Fuente <- structure(list(date = structure(c(1417410000, 1417410000, 1417410000,
1417410000, 1417410000, 1417410000, 1417496400, 1417496400, 1417496400,
1417496400, 1417496400, 1417496400, 1417496400, 1417582800, 1417582800,
1417582800, 1417582800, 1417582800, 1417582800, 1417582800, 1417669200,
1417669200, 1417669200, 1417669200, 1417669200, 1417669200, 1417669200,
1417755600, 1417755600, 1417755600, 1417755600, 1417755600, 1417755600,
1417842000, 1417842000, 1417842000, 1417842000, 1417842000, 1417842000,
1417842000, 1417928400, 1417928400, 1417928400, 1417928400, 1417928400,
1417928400, 1417928400, 1418014800, 1418014800, 1418014800, 1418014800,
1418014800, 1418014800, 1418014800, 14181
@cdeterman
cdeterman / server.R
Last active August 29, 2015 14:15
SO 28491576
library(shiny)
library(ggvis)
library(dplyr)
shinyServer(
function(input, output, session) {
# A reactive subset of mtcars
mtc <- reactive({
mtcs <- mtcars %>%
mutate(name = row.names(.))
@cdeterman
cdeterman / global.R
Last active August 29, 2015 14:15
28423302
Visitas_Por_Fuente <- structure(list(date = structure(1:31, .Label = c("2014-12-01",
"2014-12-02", "2014-12-03", "2014-12-04", "2014-12-05", "2014-12-06",
"2014-12-07", "2014-12-08", "2014-12-09", "2014-12-10", "2014-12-11",
"2014-12-12", "2014-12-13", "2014-12-14", "2014-12-15", "2014-12-16",
"2014-12-17", "2014-12-18", "2014-12-19", "2014-12-20", "2014-12-21",
"2014-12-22", "2014-12-23", "2014-12-24", "2014-12-25", "2014-12-26",
"2014-12-27", "2014-12-28", "2014-12-29", "2014-12-30", "2014-12-31"
), class = "factor"), sessions = c(1932L, 1828L, 2349L, 8192L,
3188L, 3277L, 2846L, 2541L, 5434L, 4290L, 2059L, 2080L, 2111L,
3776L, 1989L, 1844L, 3641L, 1283L, 1362L, 1568L, 2882L, 1212L,
@cdeterman
cdeterman / gist:d0e38a768b1a55d9b900
Last active August 29, 2015 14:07
basic caret demo with ROC
library(mlbench)
library(caret)
data(Sonar)
inTraining <- createDataPartition(Sonar$Class, p = 0.75, list = FALSE)
training <- Sonar[inTraining, ]
testing <- Sonar[-inTraining, ]
myTuneGrid <- expand.grid(n.trees = 500,interaction.depth = 11,shrinkage = 0.1)
fitControl <- trainControl(method = "repeatedcv",
@cdeterman
cdeterman / datatable_between_tabs
Created September 5, 2014 13:22
shared datatable between tabs?
library(shiny)
runApp(list(
ui = fluidPage(
tags$head(tags$style("tfoot {display: table-header-group;")), # move filters to the tob of dataTable
sidebarLayout(
sidebarPanel("Sharing Data between Tabs"),
mainPanel(
tabsetPanel(