-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e03c8d
commit a89c59f
Showing
10 changed files
with
1,273 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: "Prática de Computador III: Socialidade" | ||
output: pdf_document | ||
author: "Marco A. R. Mello" | ||
editor_options: | ||
markdown: | ||
wrap: 72 | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
knitr::knit_hooks$set(inline = function(x) { | ||
prettyNum(x, big.mark=",") | ||
}) | ||
``` | ||
|
||
Universidade de São Paulo | ||
|
||
Instituto de Biociências | ||
|
||
Departamento de Ecologia | ||
|
||
[Tópicos Avançados em Ecologia de Animais | ||
(BIE0315)](https://uspdigital.usp.br/jupiterweb/obterDisciplina?sgldis=BIE0315&verdis=4) | ||
|
||
Profs. José Carlos Motta Jr. & Marco A. R. Mello | ||
|
||
Artigo de base: [Guimarães Jr. et al. (2007, Physical Review E)](https://doi.org/10.1103/PhysRevE.76.042901) | ||
|
||
Agradecimentos: O primeiro autor do artigo de base tirou nossas dúvidas sobre os resultados de seu trabalho. | ||
|
||
[README](https://github.com/marmello77/EcoAnimal#readme) | ||
|
||
|
||
## Instruções | ||
|
||
Nesta prática, usaremos a solução apresentada no roteiro: fazer as simulações diretamente na plataforma online NetLogo Web. Siga as instruções dadas no roteiro. | ||
|
||
|
||
## Para saber mais | ||
|
||
[O modelo SIR e o achatamento da curva](https://biologiadeprogramas.wordpress.com/2020/03/22/o-modelo-sir-e-o-achatamento-da-curva/) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
################################################################################ | ||
# Universidade de São Paulo | ||
# Instituto de Biociências | ||
# Departamento de Ecologia | ||
# Topicos Avançados em Ecologia de Animais (BIE0315) | ||
# Profs. José Carlos Motta Jr. & Marco A. R. Mello | ||
# Prática de Computador IV: Movimentos | ||
# README: https://github.com/marmello77/EcoAnimal#readme | ||
################################################################################ | ||
|
||
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) | ||
|
||
rm(list= ls()) | ||
|
||
cat("\014") | ||
|
||
library(ggplot2) | ||
library(ggmap) | ||
library(ggsn) | ||
library(maps) | ||
library(mapdata) | ||
library(ggrepel) | ||
|
||
pontos = read.csv("pc4 dados.csv", header = T) | ||
|
||
head(pontos) | ||
|
||
colnames(pontos) = c("individuo", "lat", "long", "data", | ||
"datajul", "hora", "posicao") | ||
head(pontos) | ||
|
||
pontos$individuo = as.factor(pontos$individuo) | ||
class(pontos$individuo) | ||
|
||
area <-map_data("world", region="Brazil", zoom=5) | ||
|
||
head(area) | ||
|
||
min(pontos$long) | ||
max(pontos$long) | ||
min(pontos$lat) | ||
max(pontos$lat) | ||
|
||
longs<-c(min(pontos$long)-0.01, max(pontos$long)+0.01) | ||
lats<-c(min(pontos$lat)-0.01, max(pontos$lat)+0.01) | ||
|
||
plot(pontos$lat~pontos$long) | ||
|
||
|
||
################################# MAPA 1 ####################################### | ||
|
||
|
||
g1 <- ggplot() + geom_polygon(data = area, | ||
aes(x=long, y = lat, group = group), | ||
fill = "lightgrey", color = "lightgrey") + | ||
coord_fixed(1.1) + | ||
geom_polygon(data = area, | ||
aes(x = long, y = lat, group = group), | ||
color = "white", fill = NA, size = 0.04) + | ||
geom_point(data = pontos, aes(x = long, y = lat), | ||
color = "red", | ||
size = 2, | ||
alpha = 0.6) + | ||
ggtitle("Localizações dos morcegos") + | ||
labs(x = "Longitude", | ||
y = "Latitude") + | ||
theme(text = element_text(size=14), #Ajuste os tamanhos das fontes | ||
plot.title = element_text(size=20, hjust=0.5), | ||
axis.text.x = element_text(size = 10, angle=0, hjust=1), | ||
axis.text.y = element_text(size = 10, angle=0, vjust=1), | ||
axis.title.x = element_text(size = 12, angle=0), | ||
axis.title.y = element_text(size = 12, angle=90)) | ||
|
||
png(filename= "figuras/mapa1.png", res= 300, height= 1500, width= 3000) | ||
plot(g1) | ||
dev.off() | ||
|
||
|
||
################################# MAPA 2 ####################################### | ||
|
||
|
||
g2 <- ggplot() + geom_polygon(data = area, | ||
aes(x=long, y = lat, group = group), | ||
fill = "lightgrey", color = "lightgrey") + | ||
xlim(longs) + | ||
ylim(lats) + | ||
coord_fixed(1.1) + | ||
geom_polygon(data = area, | ||
aes(x = long, y = lat, group = group), | ||
color = "white", fill = NA, size = 0.04) + | ||
geom_point(data = pontos, aes(x = long, y = lat), | ||
color = "red", | ||
size = 2, | ||
alpha = 0.6) + | ||
ggtitle("Localizações dos morcegos") + | ||
labs(x="Longitude", y = "Latitude") + | ||
theme(text = element_text(size=14), #Ajuste os tamanhos das fontes | ||
plot.title = element_text(size=20, hjust=0.5), | ||
axis.text.x = element_text(size = 10, angle=0, hjust=1), | ||
axis.text.y = element_text(size = 10, angle=0, vjust=1), | ||
axis.title.x = element_text(size = 12, angle=0), | ||
axis.title.y = element_text(size = 12, angle=90)) | ||
|
||
png(filename= "figuras/todos_escala.png", res= 300, height= 1500, width= 3000) | ||
plot(g2) | ||
dev.off() | ||
|
||
|
||
################################# MAPA 3 ####################################### | ||
|
||
|
||
g3 <- ggplot() + geom_polygon(data = area, | ||
aes(x=long, y = lat, group = group), | ||
fill = "lightgrey", color = "lightgrey") + | ||
xlim(longs) + | ||
ylim(lats) + | ||
coord_fixed(1.1) + | ||
geom_polygon(data = area, | ||
aes(x = long, y = lat, group = group), | ||
color = "white", fill = NA, size = 0.04) + | ||
geom_point(data = pontos, aes(x = long, y = lat, color = individuo), | ||
size = 2, | ||
alpha = 0.6) + | ||
ggtitle("Localizações dos morcegos") + | ||
labs(x = "Longitude", | ||
y = "Latitude", | ||
color = "Indivíduo") + | ||
theme(text = element_text(size=14), #Ajuste os tamanhos das fontes | ||
plot.title = element_text(size=20, hjust=0.5), | ||
axis.text.x = element_text(size = 10, angle=0, hjust=1), | ||
axis.text.y = element_text(size = 10, angle=0, vjust=1), | ||
axis.title.x = element_text(size = 12, angle=0), | ||
axis.title.y = element_text(size = 12, angle=90)) | ||
|
||
png(filename= "figuras/individuos_escala.png", res= 300, | ||
height= 1500, width= 3000) | ||
plot(g3) | ||
dev.off() | ||
|
||
|
||
################################# MAPA 4 ####################################### | ||
|
||
|
||
area_de_estudo = get_map(c(left = longs[1], bottom = lats[1], | ||
right = longs[2], top = lats[2]), | ||
maptype = "satellite") | ||
ggmap(area_de_estudo) | ||
|
||
g4 <- ggmap(area_de_estudo) + geom_polygon(data = area, | ||
aes(x=long, y = lat, group = group), | ||
fill = "lightgrey", | ||
color = "lightgrey") + | ||
coord_fixed(1.1) + | ||
geom_polygon(data = area, | ||
aes(x = long, y = lat, group = group), | ||
color = "white", fill = NA, size = 0.04) + | ||
geom_point(data = pontos, aes(x = long, y = lat, color = individuo), | ||
size = 2, | ||
alpha = 0.6) + | ||
ggtitle("Localizações dos morcegos") + | ||
labs(x = "Longitude", | ||
y = "Latitude", | ||
color = "Indivíduo") + | ||
theme(text = element_text(size=14), #Ajuste os tamanhos das fontes | ||
plot.title = element_text(size=20, hjust=0.5), | ||
axis.text.x = element_text(size = 10, angle=0, hjust=1), | ||
axis.text.y = element_text(size = 10, angle=0, vjust=1), | ||
axis.title.x = element_text(size = 12, angle=0), | ||
axis.title.y = element_text(size = 12, angle=90)) | ||
|
||
png(filename= "figuras/individuos_paisagem.png", res= 300, | ||
height= 1500, width= 3000) | ||
plot(g4) | ||
dev.off() |
Oops, something went wrong.