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
# I'm trying to let the user select points and paint them in a certain colour, and if the user clicks on a point then paint that point a different colour. | |
# It looks like the pointNumber and curveNumber data that plotly returns are different for the same points. I'm not sure how curveNumber works, but to me it doesn't make sense yet :) | |
# Any help is appreciated! | |
library(plotly) | |
library(shiny) | |
ui <- fluidPage( | |
plotlyOutput("plot") | |
) |
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
# Get a person's name, location, summary, # of connections, and skills & endorsements from LinkedIn | |
# URL of the LinkedIn page | |
user_url <- "https://www.linkedin.com/in/daattali" | |
# since the information isn't available without being logged in, the web | |
# scraper needs to log in. Provide your LinkedIn user/pw here (this isn't stored | |
# anywhere as you can see, it's just used to log in during the scrape session) | |
username <- "yourusername" | |
password <- "yourpassword" |
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) | |
# Define the fields we want to save from the form | |
fields <- c("name", "used_shiny", "r_num_years") | |
# Save a response | |
# ---- This is one of the two functions we will change for every storage type ---- | |
saveData <- function(data) { | |
data <- as.data.frame(t(data)) | |
if (exists("responses")) { |
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
[{"CountryList": ["Austria", "Germany", "Italy", "Spain", "United Kingdom"], "Sector3": "Commercial Leases"}, {"CountryList": ["Belgium", "France", "Germany", "Ireland", "Italy", "Netherlands", "Portugal", "Spain", "United Kingdom"], "Sector3": "Residential Mortgage"}, {"CountryList": ["Belgium", "France", "Ireland", "Spain", "United Kingdom"], "Sector3": "Credit Card"}, {"CountryList": ["Belgium", "Germany", "Italy", "Portugal", "Spain"], "Sector3": "SME CLO"}, {"CountryList": ["France", "Germany", "Netherlands"], "Sector3": "Auto Leases"}, {"CountryList": ["France", "Germany", "Italy", "Netherlands", "Norway", "Portugal", "Spain", "United Kingdom"], "Sector3": "Auto Loans"}, {"CountryList": ["France", "Germany", "Italy", "Netherlands", "Portugal", "Spain", "Sweden"], "Sector3": "Consumer Loans"}, {"CountryList": ["France", "Portugal", "United Kingdom"], "Sector3": "Mixed Auto Loans and Leases"}, {"CountryList": ["Germany", "Ireland", "Italy", "Spain"], "Sector3": "Consumer and Commercial Leases"}, {"Country |
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) | |
ui <- fluidPage( | |
shinyjs::useShinyjs(), | |
# You have to include this one-liner CSS | |
tags$style(".fullwidth { width: 100% !important; }"), | |
# You need to wrap the sidebarLayout() by a div() and give it an ID | |
div(id = "SOMEID", |
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(dplyr) | |
rawDataUrl <- "http://pub.data.gov.bc.ca/datasets/176284/BC_Liquor_Store_Product_Price_List.csv" | |
bcl <- read.csv(rawDataUrl, stringsAsFactors = FALSE) | |
products <- c("BEER", "REFRESHMENT BEVERAGE", "SPIRITS", "WINE") | |
bcl <- dplyr::filter(bcl, PRODUCT_CLASS_NAME %in% products) %>% | |
dplyr::select(-PRODUCT_TYPE_NAME, -PRODUCT_SKU_NO, -PRODUCT_BASE_UPC_NO, | |
-PRODUCT_LITRES_PER_CONTAINER, -PRD_CONTAINER_PER_SELL_UNIT, | |
-PRODUCT_SUB_CLASS_NAME) %>% | |
rename(Type = PRODUCT_CLASS_NAME, | |
Subtype = PRODUCT_MINOR_CLASS_NAME, |
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(datasets) | |
Logged = FALSE; | |
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad") | |
# Define server logic required to summarize and view the selected dataset | |
shinyServer(function(input, output) { | |
source("www/Login.R", local = TRUE) | |
observe({ |
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" |
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
# 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) |
NewerOlder