Full explanatory article on my site.
A Pen by Dudley Storey on CodePen.
library(shiny) | |
library(datasets) | |
Logged = FALSE; | |
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad") | |
# Define server logic required to summarize and view the selected dataset | |
shinyServer(function(input, output) { | |
source("www/Login.R", local = TRUE) | |
observe({ | |
if (USER$Logged == TRUE) { |
`%!in%` = Negate(`%in%`) |
library(robotstxt) | |
paths_allowed("https://bsi.uniriotec.br/obrigatorias/") | |
# Robots.txt says okay to scrape | |
library(rvest) | |
page <- read_html("https://bsi.uniriotec.br/obrigatorias/") | |
obrigatorias<- page %>% html_nodes("a") %>% | |
html_attr("href") | |
obrigatorias<-obrigatorias[65:99] |
for (i in numeroEntidade) { | |
url <- paste0(Parte1,i,Parte2) | |
local2<-paste0(local,i,".xls") | |
Sys.sleep(3) | |
##Download the file | |
download.file(url, local2, mode="wb") | |
print(i) | |
} |
#------------------------------------------------------------------------------------------- | |
# Versão 2 - modificado em 01/05/2021 | |
#------------------------------------------------------------------------------------------- | |
library(readr) | |
suicide <- read_csv("github/Base_de_dados/suicide.csv") | |
names(suicide) | |
# Pegar o rotulo | |
library(rworldmap) |
#------------------------------------------------------------------------------------------- | |
# Versão 1 - modificado em 08/05/2021 (Thayanne Pinheiro) | |
#------------------------------------------------------------------------------------------- | |
# Carregar as bibliotecas | |
library(janitor) | |
library(readxl) | |
library(dplyr) | |
# Carregar a base de dados e limpar o nome da variavel |
# ----------------------------------------------------------------------- | |
# reactable | |
# ----------------------------------------------------------------------- | |
library(reactable) | |
library(reactablefmtr) | |
library(dplyr) | |
library(flextable) | |
#library(sparkline) |
library(readxl) | |
Stardew_Valley <- read_excel("C:/Users/KGBLAND/endereco_do_arquivo/Stardew_Valley.xlsx") | |
head(Stardew_Valley) | |
names(Stardew_Valley) | |
# Essa variável é quantitativa | |
table(Stardew_Valley$Custo_na_Cidade) | |
# Transformando em variavel quantitativa | |
Stardew_Valley$Custo_na_Cidade<-as.numeric(Stardew_Valley$Custo_na_Cidade) |
#-------------------------------------------------------------------- | |
# codigo para baixar dados do site | |
#-------------------------------------------------------------------- | |
url_do_rds <- "https://github.com/DATAUNIRIO/Base_de_dados/raw/master/basometro.RDS" | |
url_do_rds <- "https://github.com/DATAUNIRIO/Base_de_dados/raw/master/CARROS.RData" | |
url_do_rds <- "https://github.com/DATAUNIRIO/Base_de_dados/raw/master/BasesEstados.xlsx" | |
#download.file(url,"basometro.RDS",method="curl") # linux | |
download.file(url_do_rds,"basometro.RDS",mode="wb") # windows |