-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCorrelacoes.R
More file actions
35 lines (26 loc) · 877 Bytes
/
Correlacoes.R
File metadata and controls
35 lines (26 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#Selecionando o diret?rio
setwd("~/Documentos_pessoais/Estudos_abelha_solitaria")
#Pacotes
require(ggplot2)
library(reshape2)
### Avaliando variaveis ambientais
dados1=read.table("dados_1.txt",h=T)
Repeticao=dados1[,1]
Abelhas=dados1[,2]
Sexo=dados1[,3]
Nascimento=dados1[,4]
Pluviosidade=dados1[,5]
Peso=dados1[,6]
Comprimento=dados1[,7]
Medida_Itertecular=dados1[,8]
Temperatura_Externa=dados1[,9]
Umidade_Externa=dados1[,10]
Temperatura_Interna=dados1[,11]
Umidade_Interna=dados1[,12]
#Criando nova base de dados
dados2 <- cbind(Peso, Comprimento, Medida_Itertecular, Temperatura_Externa, Temperatura_Interna, Umidade_Externa, Umidade_Interna)
# Criando matrix de correlação
cormat <- round(x = cor(dados2), digits = 2)
melted_cormat <- melt(cormat)
ggplot(data = melted_cormat, aes(x=Var1, y=Var2, fill = value)) +
geom_tile()