Mudanças entre as edições de "Linguagem R:Gráficos"

De BrapciWiki
Ir para navegação Ir para pesquisar
Linha 11: Linha 11:
 
|style="width:20%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;"|
 
|style="width:20%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;"|
 
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:#B5CBDF;"
 
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:#B5CBDF;"
! <h2 style="margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;">DOWNLOAD</h2>
+
! <h2 style="margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;">GRÁFICOS</h2>
 
|-
 
|-
 
||
 
||
 
[[File:Wiki Homepage Start Here v2.PNG||150px|right]]
 
[[File:Wiki Homepage Start Here v2.PNG||150px|right]]
'''<u>Linux Ubuntu 18.04</u>'''
 
* [[Pacotes Linux Ubuntu 18.04]]
 
'''<u>Cursos Online</u>'''
 
* [[EMI]] - Estudos Métricos da Informação
 
 
|-
 
|-
|}
+
|
 +
 
 +
|-
 +
||
 +
[[File:Wiki Homepage Start Here v2.PNG||150px|right]]
 +
|-
 +
|
 +
 
 +
|-
 +
||
 +
[[File:Wiki Homepage Start Here v2.PNG||150px|right]]
 +
|-
 +
|
 +
}
  
 
[[Arquivo:Linguagem r grafo 01.png|miniaturadaimagem|direita]]
 
[[Arquivo:Linguagem r grafo 01.png|miniaturadaimagem|direita]]

Edição das 14h17min de 21 de junho de 2020

Gráficos Básicos do R

Plot

plot(=nome da variável=)

Gráfico simples

GRÁFICOS

}

Linguagem r grafo 01.png
 c <- c(3991,1059,493,287,184,131,113,85,64,65,41,47,32,28,21)
 plot(c)


 c <- (10,20,30,20,14,30)
 freq <- table(c)
 plot(freq)
 # ORDENAR DO MAIOR PARA O MENOR
 freq <- sort(freq, decreasing=TRUE)
 plot(freq)

Legenda na Vertical

 par(las=1)
 plot(freq)

Dispersion

Dados padrão do R para exemplos

# Cria um modelo de dados
my_data <- mtcars
# Mostra as seis primeiras linhas
head(my_data, 6)
plot(x = my_data$wt, y = my_data$mpg,
    pch = 16, frame = FALSE,
    xlab = "wt", ylab = "mpg", col = "#2E9FDF")


RGui word count.jpg

Bar Plot

barplot(=nome da variável=)

GGPLOT2

Pacotes

# Installation
install.packages('ggplot2')
# Loading
library(ggplot2)
[1]

Salvando gráfico em arquivo

PNG

Temperature = c(15,15,15,15,20,21,12,32,23,33,32,19,54)
png(file="d:/lixo/saving_plot2.png",
width=600, height=350)
hist(Temperature, col="gold")
dev.off()