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(shiny) | |
user_selected <- reactiveValues(a = 1, b = 1, c = 1) | |
observeEvent(input$slider, { | |
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
apt-get install -y unixodbc unixodbc-dev | |
apt-get install -y odbc-postgresql | |
odbcinst -i -s -l -f template/dsn_template_file |
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
## as admin user | |
## | |
sudo adduser rsc-demo # passwd +Ds&.dm/YL!^RX6- | |
sudo useradd rsc-client # passwd: +Ds&.dm/YL!^RX6- | |
sudo usermod -aG rstudio-connect rsc-client | |
sudo usermod -aG rstudio-connect rsc-demo |
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
## | |
## POSTGRES LITE DOCKERFILE- create db, user/pwd, and open listening | |
## | |
FROM postgres:11.1-alpine | |
ADD ./init.sh /docker-entrypoint-initdb.d/. | |
ENV PGDATA /var/lib/postgresql/data | |
EXPOSE 5432 |
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
#!/bin/bash | |
set -e | |
set -u | |
# | |
# GROUP: min user access... | |
# - can connect to database | |
# - can access schema | |
# - can read schema tables | |
# |
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
# Change directory to the current Finder directory | |
cdf() { | |
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` | |
if [ "$target" != "" ]; then | |
cd "$target"; pwd | |
else | |
echo 'No Finder window found' >&2 | |
fi | |
} |
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
# Usecases: | |
# when creating many R environments and each have independent data-set | |
ll <- list( | |
as.factor(c(2001, 2002, 2004, 2006)), | |
I(c(2001, 2002, 2004, 2006)), | |
ordered(c(2001, 2002, 2004, 2006)), | |
as.double(c(366.3240, 365.4124, 366.5323423, 364.9573234)), |
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
ABC <- local({ | |
x <- 1 | |
function(v) { | |
if (missing(v)){ | |
cat("get\n") | |
} else { | |
cat("set\n") | |
x <<- v | |
} | |
x |
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
install.packages("quantreg") | |
pdt <- dt[durProc < 400 & | |
ExpIndex < 500 & | |
ExpIndex > 4] | |
pdt2 <- pdt[, .(aveDur = mean(durProc)), ExpIndex][order(ExpIndex)] | |
m <- ggplot(pdt2, aes(ExpIndex, aveDur)) + |
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(shiny) | |
library(shinyjs) | |
load_data <- function() { | |
Sys.sleep(2) | |
hide("loading_page") | |
show("main_content") | |
} | |
ui <- fluidPage( |