Reordenar scripts e documentos #2

This commit is contained in:
2023-10-25 11:49:55 -03:00
parent 5ef8d9e08a
commit 02bf9cfb8a
7 changed files with 89 additions and 1737 deletions

39
script/EvolucaoVitruvio.R Normal file
View File

@ -0,0 +1,39 @@
# data: 2023-10-25
library(data.table)
library(tidyr)
library(dplyr)
library(ggplot2)
# Nota: iniciar uma sessão de R desde o diretório "script" para carregar a tabela com o seguinte caminho relativo ("../data/Tabela4.csv"):
Evol_exist <- fread("../data/Tabela4.csv", check.names=FALSE, header=TRUE)
str(Evol_exist)
# Transpor a tabela
Evol_exist1 <- dcast(melt(Evol_exist, id.vars = "Ano"), variable ~Ano)
# deu um trabalho para n ão aparecer uma linha nova com os nomes da colunas...
str(Evol_exist1)
Evoluc <- Evol_exist1 %>%
pivot_longer(!variable, names_to="Categoria", values_to="Cabecas") %>%
dplyr::mutate(Ano=variable)
#View(Evoluc)
str(Evoluc)
Evoluc <- ggplot(Evoluc, aes(x=Ano, y=Cabecas, group = Categoria)) +
geom_line (aes(color=Categoria)) +
geom_point(aes(color=Categoria))
getwd()
png(filename = "fig/Evoluc1.png")
plot(Evoluc)
Evoluc