inst/shiny-examples/myapp/global.R

## Load packages
#library("tidyr")
#library("httr")
library("lubridate")
#library("knitr")
#library("shiny")
#library("shinyjs")
#library("shinyBS")
library("plotly")
#library("shinythemes")
#library("shinycssloaders")
#library("markdown")
#library("flexdashboard")
library("plyr")
library("tidyverse")
library("ggthemes")
library("treemap")
#library("readxl")
library("readODS")
#library("htmlTable")
#library("stringr")
#library("esquisse")
#library("gridExtra")
#library("ggpubr")
library("RColorBrewer")
library("DT")
library("data.table")
options(DT.options = list(scrollY="300px",scrollX="300px",
                          pageLength = 100,
                          columnDefs = list(list(className = 'dt-center', targets = "_all"))))
library("shinydashboard")
library("shinyWidgets") # nicer inputs
##############################################################################

## Define font to be used later
f1 = list(family = "Arial", size = 10, color = "rgb(30,30,30)")

## Function to format the dates for better plotting
printDate = function(date){
  # paste0(day(date),"/",month(date, lab=T, locale="us"))
  monthsEn=c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  paste0(day(date),"/",monthsEn[month(date)])
}

## colors for observed data
blu = 'rgb(100,140,240)'
dblu = 'rgb(0,0,102)'
red = 'rgb(200,30,30)'
dred = 'rgb(100,30,30)'

##############################################################################
## DATA SOURCES

load(file="dados.rda")
#dados <- readRDS("Enem2018.Rds")
load(file="pop.rda")
names(pop) <- c("UF_EXERCICIO", "POPULACAO", "REGIAO")
fsbmat-ufv/statenem documentation built on Dec. 20, 2021, 9:41 a.m.