https://speakerdeck.com/jcheng5/shiny-x-ai
- Video input and audio spinner controls: {shinymedia}, for R and Python
- Video assistant example app
- R version: source
https://speakerdeck.com/jcheng5/shiny-x-ai
library(sf) | |
library(tigris) | |
library(tidycensus) | |
library(tidyverse) | |
library(mapview) | |
library(mapboxapi) | |
library(randomNames) | |
options(tigris_use_cache = TRUE) | |
denton <- counties(cb = TRUE) %>% |
<?php | |
use Illuminate\Console\Command; | |
use Pgvector\Laravel\Vector; | |
use OpenAI\Laravel\Facades\OpenAI; | |
use App\Models\Document; | |
class AskQuestion extends Command | |
{ | |
protected $signature = 'app:ask-question'; |
<?php | |
use Pgvector\Laravel\Vector; | |
use Illuminate\Console\Command; | |
use App\Models\Document; | |
use App\Models\Post; | |
use OpenAI\Laravel\Facades\OpenAI; | |
class ProcessPosts extends Command { |
library(mapboxapi) | |
library(tidyverse) | |
library(sf) | |
library(patchwork) | |
city_halls <- c( | |
"New York" = "City Hall Park, New York, NY 10007", | |
"Los Angeles" = "200 N Spring St, Los Angeles, CA 90012", | |
"Chicago" = "121 N La Salle St, Chicago, IL 60602", | |
"Houston" = "901 Bagby St, Houston, TX 77002", |
library(tidycensus) | |
library(tidyverse) | |
sysfonts::font_add_google("Roboto") | |
var <- "DP03_0025" | |
commute19 <- get_acs( | |
geography = "place", | |
variables = var, | |
survey = "acs1", |
#### --------------------------------------------- | |
## Edit via: RStudio > Tools > Edit Code Snippets | |
# Released under a MIT license | |
snippet fragment | |
[${1:text}]{.${2:type}} | |
snippet aside | |
[${1:text}]{.aside} | |
Social | |
github.com/pedrocoutinhosilva | |
linkedin.com/in/pedrocoutinhosilva | |
twitter.com/sparktuga | |
www.pedrocsilva.com | |
Examples | |
https://appsilon.com/journey-from-basic-prototype-to-production-ready-shiny-dashboard/ | |
http://uaborder.com/ | |
https://appsilon.com/is-it-possible-to-build-a-video-game-in-r-shiny/ |
#' Description | |
#' This file runs a live election-night forecast based on The Economist's pre-election forecasting model | |
#' available at projects.economist.com/us-2020-forecast/president. | |
#' It is resampling model based on https://pkremp.github.io/update_prob.html. | |
#' This script does not input any real election results! You will have to enter your picks/constraints manually (scroll to the bottom of the script). | |
#' | |
#' Licence | |
#' This software is published by *[The Economist](https://www.economist.com)* under the [MIT licence](https://opensource.org/licenses/MIT). The data generated by *The Economist* are available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). | |
#' The licences include only the data and the software authored by *The Economist*, and do not cover any *Economist* content or third-party data or content made available using the software. More information about licensing, syndication and the copyright of *Economist* content can be fou |
library(reactable) | |
library(dplyr) | |
red_pal <- function(x) rgb(colorRamp(c("#FFCDD2FF", "#C62828FF"))(x), maxColorValue = 255) | |
blue_pal <- function(x) rgb(colorRamp(c("#BBDEFBFF", "#1565C0FF"))(x), maxColorValue = 255) | |
mtcars %>% | |
select(cyl, mpg) %>% | |
reactable( | |
pagination = FALSE, |