This R function adds the current datetime (access_datetime
), user (user
), and system information (sysinfo
) to a data.frame or tibble.
meta_cols <- function(data) {
library(tibble)
library(lubridate)
data_raw <- data
#=====================================================================# | |
# This is code to create: 34.0-animate-norm-vars.R | |
# Authored by and feedback to: mjfrigaard@gmail.com | |
# MIT License | |
# Version: 1.0 | |
# Share: http://bit.ly/gganimate-gif | |
#=====================================================================# | |
library(ggplot2) | |
library(gganimate) |
#=====================================================================# | |
# This is code to create: jupyter-install-pkgs.R | |
# Authored by and feedback to: @mjfrigaard | |
# MIT License | |
# Version: 1.0 | |
#=====================================================================# | |
# packages ---------------------------------------------------------------- | |
install.packages(c('rzmq','repr','IRkernel','IRdisplay'), |
#=====================================================================# | |
# This is code to create: 38-rolling-averages-wrangle.R | |
# Authored by and feedback to: @mjfrigaard | |
# MIT License | |
# Version: 1.1 | |
#=====================================================================# | |
# Download files into COVID-19/ folder from: | |
# https://github.com/CSSEGISandData/COVID-19 |
# Create a bs4Dash app | |
install.packages(c("purrr", "rstudioapi")) | |
library(purrr) | |
library(rstudioapi) | |
bs4_app <- function() { | |
bs4_app_code <- c( | |
"library(shiny)\nlibrary(bs4Dash)\n\nui <- bs4Dash::dashboardPage(title = '<NAME>',\n\t\theader = bs4Dash::dashboardHeader(\n\t\t\ttitle = bs4Dash::dashboardBrand(\n\t\t\ttitle = 'bs4Dash template',\n\t\t\tcolor = 'primary'\n\t\t\t\t)\n\t\t\t),\n\tsidebar = bs4Dash::dashboardSidebar(),\n\t\tbody = bs4Dash::dashboardBody(\n\t\t\tshiny::fluidRow(\n\t\t\t\tbs4Dash::sortable(\n\t\t\t\tbs4Dash::box(title = 'box 1', width = 12)\n\t\t\t)\n\t\t),\n\t\t\tshiny::fluidRow(\n\t\t\t\tbs4Dash::sortable(\n\t\t\t\tbs4Dash::box(title = 'box 2', width = 12)\n\t\t\t)\n\t\t\t)\n\t\t),\n\tcontrolbar = bs4Dash::dashboardControlbar()\n\t)\nserver <- function(input, output) {\n\t\t}\n\nshiny::shinyApp(ui = ui, server = server)\n") | |
purrr::map(.x = bs4_app_code, .f = rstudioapi::insertText) | |
} |
You’ll need to setup YouTube OAuth Authentication (with an application id and password). If you have questions check out the package documentation or the tutorial on Storybench.