sudo /usr/sbin/rstudio-server stop #stop the current version
# Download
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.1.463-amd64.deb
sudo gdebi rstudio-server-1.1.463-amd64.deb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install.packages("usethis") | |
#usethis::use_course("https://github.com/DATAUNIRIO/Base_de_dados/archive/master.zip") | |
library(leaflet) | |
leaflet() %>% | |
addTiles() %>% | |
addCircles(lng=-43.1688718, lat=-22.9549635, popup="Eu estou aqui!") | |
leaflet() %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Step 1 cleaning data | |
#install.packages("stopwords") | |
library("stopwords") | |
library(tidyverse) | |
library(tidytext) | |
fernando = 'http://gae.uniriotec.br/7/educaser/fernandopessoa.txt' | |
text_dataframe = readLines(fernando, encoding = "latin1") | |
text_dataframe = tolower(text_dataframe) | |
text_dataframe = tibble(txt = text_dataframe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url_do_arquivo <- "https://github.com/DATAUNIRIO/Base_de_dados/raw/master/BasesEstados.xlsx" | |
download.file(url_do_arquivo,"BasesEstados.xlsx",mode="wb") # windows | |
library(readxl) | |
BasesEstados <- read_excel("BasesEstados.xlsx") | |
# Import ----------------------------------------------------------------------- | |
mapa_estados <- geobr::read_state() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#----------------------------------------------------------------------------- | |
# Parte 1 | |
#----------------------------------------------------------------------------- | |
library(reticulate) | |
reticulate::py_install("requests") | |
reticulate::py_install("bs4") | |
reticulate::py_install("os") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# devtools::install_github("DanChaltiel/crosstable", build_vignettes=TRUE) | |
# https://danchaltiel.github.io/crosstable/ | |
# https://vincentarelbundock.github.io/modelsummary/articles/datasummary.html | |
load("C:/Users/Hp/Desktop/Base_de_dados-master/Titanic.RData") | |
names(Titanic) | |
library(crosstable) | |
ct1 <- crosstable(Titanic, c(Sobreviveu), by=Sexo, total="row") | |
ct2 <- crosstable(Titanic, c(Sobreviveu), by=Sexo, total="column") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dados_aula_regressao <-read.csv("C:/Users/Hp/Documents/GitHub/Base_de_dados/dados_aula_regressao.csv") | |
plot(dados_aula_regressao$anos_de_empresa,dados_aula_regressao$salario) | |
modelo <- lm(salario ~ anos_de_empresa,data=dados_aula_regressao) | |
summary(modelo) | |
residuos <-residuals(modelo) | |
#produce residual vs. fitted plot | |
plot(fitted(modelo), residuos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
salario <- rnorm(200,4000,15) | |
salario <- round(salario,2) | |
anos_de_empresa<- salario/1000 + rnorm(200,0,5) | |
anos_de_empresa<- anos_de_empresa + 10 | |
anos_de_empresa<- round(anos_de_empresa) | |
plot(anos_de_empresa,salario) | |
min(anos_de_empresa) | |
modelo <- lm(salario ~ anos_de_empresa) | |
bptest(modelo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Carrega o pacote | |
library(deflateBR) | |
deflate(nominal_values = 1091.01, | |
nominal_dates = as.Date("2015-01-01"), | |
real_date = "01/2022") | |
# R$ 1653.53 | |
# R$ 1759,56 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remotes::install_github("thomas-neitmann/ggcharts", upgrade = "never") | |
library(dplyr) | |
library(ggcharts) | |
biomedicalrevenue %>% | |
filter(year %in% c(2012, 2015, 2018)) %>% | |
bar_chart(x = company, y = revenue, facet = year, top_n = 10) | |
biomedicalrevenue %>% filter(year == 2018) %>% |