Skip to content

Instantly share code, notes, and snippets.

View pvictor's full-sized avatar

Victor Perrier pvictor

View GitHub Profile
@pvictor
pvictor / server.R
Created July 15, 2013 14:23
testShiny
library(shiny)
shinyServer(function(input, output) {
sortie<-NULL
sortie <- reactive({
if (input$click1>0) {data.frame(rnorm(10), rexp(10))}
})
output$click.feeback1 <- renderText({
# France map with ggiraph -------------------------------------------------
#### Packages ####
library("ggplot2")
library("ggiraph")
library("ggthemes")
library("rgdal")
library("readxl")
@pvictor
pvictor / bb8_with_ggplot2.R
Created April 25, 2016 13:57
A Star Wars BB-8 with ggplot2 !
# BB-8 --------------------------------------------------------------------
# Inspired by Brian Hough in http://codepen.io/bhough/pen/wawrPL
# Packages ----------------------------------------------------------------
library("dplyr")
library("ggplot2")
@pvictor
pvictor / selectize-remove_button.R
Last active May 30, 2022 18:07
Add a remove button to each item of a selectize input
library(shiny)
ui <- fluidPage(
selectizeInput(
inputId = "select",
label = "Select",
choices = NULL,
multiple = TRUE,
options = list(
plugins = list("remove_button"),
create = TRUE,
@pvictor
pvictor / module_choix_groupes.R
Created April 12, 2018 10:22
Module Shiny pour définir des groupes
# ------------------------------------------------------------------------
#
# Title : Module choix groupe
# By : Vic
# Date : 2018-04-12
#
# ------------------------------------------------------------------------
@pvictor
pvictor / billboarder-donut-title
Last active July 26, 2018 11:05
Title font size
library(billboarder)
dat <- data.frame(
lib = c("A", "B", "C"),
value = c(34, 54, 62)
)
# Donut title
billboarder() %>%
bb_donutchart(dat) %>%
@pvictor
pvictor / linked-tooltip-billboarder
Last active August 21, 2018 14:41
Linked tooltip between charts in {billboarder} https://github.com/dreamRs/billboarder
# on CRAN now (version 0.2.3)
library(billboarder)
# data
data("economics", package = "ggplot2")
# helper fun
make_line <- function(var, title, percent = TRUE) {
billboarder() %>%
bb_linechart(data = economics[, c("date", var)]) %>%
@pvictor
pvictor / linked-tooltip-billboarder-bar
Last active August 21, 2018 14:41
Linked tooltip between barcharts in {billboarder} https://github.com/dreamRs/billboarder
# on CRAN now (version 0.2.3)
library(billboarder)
# data
data("prod_par_filiere")
# helper fun
make_bar <- function(year, show_y_axis = TRUE) {
@pvictor
pvictor / inline-pickers.R
Last active April 13, 2021 00:31
Inline shinyWidgets::pickerInput
library(shiny)
library(shinyWidgets)
library(htmltools)
ui <- fluidPage(
tags$h2("Inline pickers input"),
tags$br(),
# CSS styles