Skip to content

Instantly share code, notes, and snippets.

View zsigmas's full-sized avatar

Luis Morís Fernández zsigmas

  • Freelance
  • Gijón, Asturias, Spain
  • X @0sigmas
View GitHub Profile
@zsigmas
zsigmas / utils-importFrom.R
Created October 27, 2021 09:33
Common importFrom from other packages
#' .data object from dplyr
#'
#' @name .data
#' @rdname dplyr_.data
#' @keywords internal
#' @importFrom dplyr .data
NULL
#' := object from rlang
#'
@zsigmas
zsigmas / app.R
Created November 25, 2020 15:31 — forked from aagarw30/app.R
Demo - side by side input widgets in R Shiny
library(shiny)
ui <- fluidPage(
tags$div(sliderInput("slide1", "Slider1", min = 0, max=10, value=4), style="display:inline-block"),
tags$div(sliderInput("slide1=2", "Slider2", min = 0, max=10, value=4), style="display:inline-block"),
tags$div(sliderInput("slide3", "Slider3", min = 0, max=10, value=4), style="display:inline-block")
)
@zsigmas
zsigmas / app.R
Created September 24, 2020 07:43
R Shiny Nested Dynamic Modules Returning Values Example
library(shiny)
innerInputUI <- function(id){
ns <- NS(id)
tagList(textInput(ns('ttt'), "First text"))
}
innerInputServer <- function(input, output, session){
ns <- session$ns
@zsigmas
zsigmas / server.r
Created May 20, 2020 19:38 — forked from wch/app.r
Shiny example app with dynamic number of plots
max_plots <- 5
shinyServer(function(input, output) {
# Insert the right number of plot output objects into the web page
output$plots <- renderUI({
plot_output_list <- lapply(1:input$n, function(i) {
plotname <- paste("plot", i, sep="")
plotOutput(plotname, height = 280, width = 250)
})