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
# Clicking on a single point seems to clear the lasso selection. But the opposite is not true: doing a lasso selection still keeps the clicked point information. | |
# To reproduce: | |
# - Click a single point | |
# - Do a lasso selection | |
# - Both are currently visible | |
# - Click a different point | |
# - Now the lasso selection information is gone | |
# - Do a lasso selection again, both are visible again | |
library(shiny) |
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
# production | |
dbConnect( | |
RSQLServer::SQLServer(), | |
server = config$server, | |
database = config$database, | |
properties = list( | |
user = config$uid, | |
password = config$pwd | |
) | |
) |
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(ggplot2) | |
library(plotly) | |
data <- data.frame(x = rnorm(20), y = runif(20), z = letters[1:20]) | |
p <- ggplot(data, aes(x = x, y = y)) + | |
geom_smooth(method='lm') + | |
geom_point(aes(text = z)) + | |
scale_x_continuous(limits = c(0, 5)) + | |
annotate("text", label = "foo", x=1, y=1) |
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
# Connecting using RPostgreSQL works | |
library(RPostgreSQL) | |
con <- dbConnect(dbDriver("PostgreSQL"), | |
host = "localhost", | |
dbname = "postgres", | |
user = "postgres", | |
password = password, | |
port = 5432) | |
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
## foo `bar` | |
hello | |
``` | |
x <- 5 | |
``` | |
<p align="center">test</p> |
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(shiny) | |
library(gmailr) | |
ui <- fluidPage( | |
textInput("subj", "Subject", "Schedule change"), | |
textInput("text", "Message"), | |
actionButton("btn", "Send") | |
) | |
server <- function(input, output, session) { |
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
makeReactiveTrigger <- function() { | |
rv <- shiny::reactiveValues(a = 0) | |
list( | |
depend = function() { | |
rv$a | |
}, | |
trigger = function() { | |
rv$a <- shiny::isolate(rv$a + 1) | |
} | |
) |
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
# This script uploads all the FAST files to the taxonomer server (only one file can be uploaded at a time) | |
# Assumes that you have RSelenium package installed and that you've got a simple selenium example to work | |
if (FALSE) { | |
fastq_files <- c( | |
list.files(# WHERE ARE THE FILES?, pattern = "fastq.gz$", full.names = TRUE) | |
) | |
login_password <- "" # what is my password??? | |
library(RSelenium) |
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(shiny) | |
library(ggplot2) | |
makePlot <- function(xvar, yvar) { | |
ggplot(iris, aes_string(xvar, yvar)) + geom_point() | |
} | |
ui <- fluidPage( | |
selectInput("xvar", "X variable", choices = names(iris), selected = names(iris)[1]), | |
selectInput("yvar", "Y variable", choices = names(iris), selected = names(iris)[2]), |
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
#' Suppress all output from an expression. Works cross-platform. | |
#' @param expr Expression to run. | |
#' @param all If \code{TRUE} then suppress warnings and messages as well; | |
#' otherwise, only suppress printed output (such as from \code{print} or | |
#' \code{cat}). | |
#' @keywords internal | |
#' @export | |
quiet <- function(expr, all = TRUE) { | |
if (Sys.info()['sysname'] == "Windows") { | |
file <- "NUL" |