Atividade 04

Author

Lucas Andrade

Exercício 1

Utilizando qualquer recurso apresentado em aula, faça um mapa destacando ou mostrando o estado e município que você nasceu.

library(ggmap)
library(maps)
library(tidyverse)
library(geobr)
library(ggsn)
library(ggplot2)
library(rgbif)
library(png)

mundo<-map_data("world")
data<-list_geobr()

estados<-read_municipality(code_muni = "all",year = 2020,showProgress = F)
muni.CE<-read_municipality(code_muni = "CE",year = 2020,showProgress = F)


ggplot()+
  geom_sf(data = muni.CE,aes(fill=muni.CE$name_muni=="Sobral"))+
  theme(legend.position = "none")

ggplot()+borders("world", fill = "lightgray", colour = "gray60")+
  geom_sf(data = estados,fill="palegreen3",color="gray60")+
  geom_sf(data = muni.CE,fill="lemonchiffon2",color="gray60")+
  geom_sf(data = filter(muni.CE, name_muni=="Sobral"),fill="indianred")+
  coord_sf(xlim = c(-42,-37),ylim = c(-8,-3,5))+
  theme_classic()+
  theme(panel.background = element_rect(fill="slategray2"))+
  north(muni.CE,symbol = 14,location = "bottomright")+
  scalebar(muni.CE,location ="bottomleft",dist = 50,dist_unit = "km", transform = T,model = "WGS84")

Exercício 2

Utilizando os recursos do banco de dados do GBIF e utilizando o pacote rgbif, apresente a localização de alguma espécie que você estude ou goste. Lembre-se que se a distribuição é muito ampla, os dados vão demorar a carregar, então limitar o número de observações ou escolher uma espécie de distribuição restrita pode ser uma opção!

oc<-occ_search(scientificName = "Micrasterias americana Ehrenberg ex Ralfs 1848",hasCoordinate = T)

names(oc)
[1] "meta"      "hierarchy" "data"      "media"     "facets"   
lc<-as.data.frame(oc$data) %>% 
  select(3:4) %>% 
  rename(Lat = decimalLatitude, Long=decimalLongitude)

ggplot() + borders("world", colour="gray46", fill="gray81") + theme_bw() + geom_point(aes(x=Long,y=Lat),data=lc,colour="green3",size=2,alpha=0.1)

alga<-readPNG("alga.png") %>% 
  as.raster()
dis<-c(min(lc$Long,na.rm=T)-1,
            min(lc$Lat,na.rm=T)-1,
            max(lc$Long,na.rm=T)+1,
            max(lc$Lat,na.rm=T)+1)

ggplot() + borders("world", colour="gray46", fill="darkolivegreen3") + theme_classic() + geom_point(aes(x=Long,y=Lat),data=lc,colour="blue4",size=2,alpha=0.1)+
  coord_fixed(xlim = dis[c(1,3)], ylim=dis[c(2,4)])+
  theme(panel.background = element_rect(fill="slategray2"))+
  annotation_raster(alga, -60,-30,11,35)

Exercício 3

Utilizando os dados de Numbats na Australia, faça um mapa de ocorrência nos diferentes anos.(um mapa ou vários mapas)

bats <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-03-07/numbats.csv')


bats<-bats %>% 
  filter(year!="NA") %>% 
  mutate(decada=case_when(year<=2000~"1956-2000",year<=2010~"2001-2010",year<=2023~"2011-2023")) %>% 
  filter(decada!="NA")

ggplot(data = bats,aes(x=decimalLongitude,y=decimalLatitude))+
  geom_map(data = mundo,map=mundo, aes(x=long, y=lat, map_id=region), fill="lightgray", color="black")+
  geom_point(aes(x=decimalLongitude,y=decimalLatitude,color=year),alpha=0.5)+
  coord_fixed(xlim= c(113,152), ylim=c(-43,-12))+
  facet_wrap(~decada)

Exercício 4

Utilizando os dados de Culturas agrícolas do passado faça um mapa mostrando a ocorrência das diferentes famílias de culturas agrícolas. (um mapa ou vários mapas)

agri <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-04-18/founder_crops.csv')

ggplot() + borders("world", colour="gray46", fill="darkseagreen1") + theme_classic()+
  geom_point(data = filter(agri,(!is.na(category))),aes(x=longitude,y=latitude,color=category),alpha=0.5)+
  coord_fixed(xlim = c(20,60),ylim = c(20,50))+
  facet_wrap(~category)+
  theme_classic()+
  theme(legend.position = "none",panel.background = element_rect(fill="slategray2"))