```{css, echo=FALSE} .main-container { max-width: 95% !important; }

```r
knitr::opts_chunk$set(echo = FALSE)
library(shufflecards)
library(shiny)

packages <- c("dplyr", "ggplot2", "r2d3", "lubridate", "readxl", "readr",
              "stringr", "devtools", "knitr", "shiny", "rmarkdown", "feather",
              "sparklyr", "testthat", "purrr", "glue", "roxygen2")
url_png <- "https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/%s.png"

Create a sortable grid of hex stickers (with hex stickers from RStudio available here)

rmd_group_buttons(
  shuffleId = "grid-packages", label = "Click to sort packages !",
  arrange_button("Sort by name", "name", icon = icon("sort-alpha-asc")),
  arrange_button("Sort by name (decreasing)", "name", desc = TRUE, icon = icon("sort-alpha-desc")),
  arrange_button("Random!", "random", icon = icon("random"))
)
shuffle_widget(
  shuffleId = "grid-packages",
  card_list = lapply(
    X = packages,
    FUN = function(package) {
      title <- suppressWarnings(packageDescription(package))
      if (!is.na(title)) {
        title <- title$Title
      }
      shuffle_card(
        width = "200px",
        name = package, # for sorting
        thumbnail(
        title = package,
        media = tags$img(
          src = sprintf(url_png, package), width="190"
        ),
        content = tags$div(
          style = "height: 80px;", title
        )
      )
      )
    }
  )
)


dreamRs/shufflecards documentation built on Dec. 4, 2019, 4:44 a.m.