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 = basicPage( | |
# inputs | |
textInput("txt", "Text"), | |
numericInput("n", "Number", 1), | |
actionButton("submit", "Submit"), | |
# outputs | |
uiOutput("ui") | |
) |
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
# Load packages | |
library(shiny) | |
library(ggplot2) | |
library(tidyverse) | |
library(DT) | |
# Load data | |
load(url("http://s3.amazonaws.com/assets.datacamp.com/production/course_4850/datasets/movies.Rdata")) | |
# Define UI for application that plots features of movies |
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
import webbrowser | |
url = 'http://idiotinside.com' | |
# Open URL in new browser window | |
webbrowser.open_new(url) # opens in default browser | |
# Opens in safari browser | |
webbrowser.get('safari').open_new(url) |
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
import urllib | |
import webbrowser | |
def build_url(app, action, action_parameter_dict): | |
url = '%s://x-callback-url/%s' % (app, action) | |
if action_parameter_dict: | |
par_list = [] | |
for k, v in action_parameter_dict.items(): | |
par_list.append( |
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(dplyr) | |
library(readr) | |
load(url("http://s3.amazonaws.com/assets.datacamp.com/production/course_4850/datasets/movies.Rdata")) | |
# UI | |
ui <- fluidPage( | |
sidebarLayout( | |
# Input(s) |
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(dplyr) | |
library(readr) | |
load(url("http://s3.amazonaws.com/assets.datacamp.com/production/course_4850/datasets/movies.Rdata")) | |
# UI | |
ui <- fluidPage( | |
sidebarLayout( | |
# Input(s) |
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 = basicPage( | |
textInput("txt1", "Input the first string"), | |
textInput("txt2", "Input the second string"), | |
uiOutput("cat_str") | |
) | |
server = function(input, output) { |
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) | |
library(dplyr) | |
library(DT) | |
load(url("http://s3.amazonaws.com/assets.datacamp.com/production/course_4850/datasets/movies.Rdata")) | |
all_studios <- sort(unique(movies$studio)) | |
# UI | |
ui <- fluidPage( | |
sidebarLayout( |
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(dcr) | |
ui = fluidPage( | |
chartOutput("plot"), | |
fluidRow(column(6, dc_ui("chart1", text = "cyl", | |
show_filter = TRUE, | |
reset_text = TRUE)), | |
column(6, dc_ui("chart2", text = "gear by carb", | |
show_filter = TRUE, |
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(dcr) | |
dcr <- dcr(mtcars) | |
chart <- dcrchart(type = "rowChart", id = "chart1", dimension = "cyl", | |
reduce = reduceCount(), width = 400, height = 250, | |
colors = dc_code("d3.scale.category10()")) | |
dcr + chart |