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
library(R0) | |
# Historico de casos | |
historico <- c( 3, 3, 2, 4, 3, 5, 1, 2, 4, 2, | |
10, 10, 7, 2, 3, 4, 6, 2, 15, 15, | |
12, 4, 14, 25, 21, 12, 18, 20, 4, 51, | |
20, 14, 17, 43, 15, 10, 18, 17, 15, 33, | |
20, 67, 43, 45, 44, 76, 27, 17, 25, 11, | |
61, 102, 3, 26, 16, 24) |
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
# Exemplo de ggplot com facet e diferentes cores | |
library(ggplot2) | |
bike_filtered <- data.frame( | |
year = rep(c(2015, 2016, 2017), 40), | |
month = rep(c(1:12), 10), | |
average_hire = rep(rpois(12, 10), 10), | |
bikes_hired = rep(rpois(12, 10), 10) |
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
# Precisa instalar as bibliotecas abaixo na primeira execução, | |
# remova o simbolo de comentário ara instalar | |
# install.packages('GA') | |
# install.packages('parallel') | |
# install.packages('remotes') | |
# remotes::install_github('ewarchul/cecs') | |
library(GA) | |
library(cecs) |
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
roll <- function(dados, fome, dif) { | |
resultados_dados <- sample(1:10, dados, replace = T) | |
sucessos <- | |
sum(resultados_dados > 5) + | |
(sum(resultados_dados == 10) %/% 2) * 2 | |
if (fome >= dados) { |
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
library(bibliometrix) | |
library(openxlsx) | |
# Definir pasta de trabalho onde devem estar os arquivos Ctrl + Shit H | |
# Colocar o nome correto dos arquivos | |
# Web of Science | |
wos <- convert2df(file = 'savedrecs.bib', | |
dbsource = 'wos', |
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
# simular rolagem | |
roll <- function(dados, dif) { | |
resultados_dados <- sort(sample(1:10, dados, replace = T)) | |
sucessos <- resultados_dados[resultados_dados >= dif] | |
n_1 <- length(resultados_dados[resultados_dados == 1]) | |
if (n_1 > 0) { | |