Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Prior to October 30, 2013 you need to run this code:
- # To install for the first time, this may require also installing
- # RTools. An error message will be returned here if this is the case:
- install.packages("devtools")
- # If the above line runs okay, then the rest should run fine. If not then either you need to run R as
- # an administrator, you need to check your internet connection, or you need to install RTools. To download
- # and install RTools follow this link: http://cran.r-project.org/bin/windows/Rtools/
- require(devtools)
- install_github("neotoma", "ropensci")
- ## After October 30, 2013 this should be sufficient:
- install.packages('neotoma', repos='http://R-Forge.R-project.org', type='source')
- library(ggplot2)
- library(ggmap)
- # Gt the lines for the world map:
- map <- map_data('world')
- map <- subset(map, map$long > -90 & map$long < -30)
- map <- subset(map, map$lat > -52.8 & map$lat < 11)
- map <- as.data.frame(map)
- sa.sites <- get_sites(loc=c(-109.5, -60, -25, 14))
- # Get rid of one site from off the coast of Nicaragua:
- sa.sites <- sa.sites[-73,]
- sa.map <- get_map(location = c(-67, -24), maptype='satellite', crop=FALSE, zoom=3)
- ggmap(sa.map) +
- geom_path(data=map, aes(long, lat, group=group), alpha=0.6) +
- xlab('') + ylab('') +
- geom_point(data=sa.sites, aes(x = LongitudeWest, y = LatitudeNorth),
- size = 4, color='red', alpha=0.6) +
- scale_x_continuous(limits=c(-90, -30), expand=c(0,0)) +
- scale_y_continuous(limits=c(-56, 11)) +
- theme_bw() +
- theme(text=element_text(family='serif', size = 12)) +
- geom_vline(xintercept=seq(-80, -40, by = 10), color = 'gray50', alpha=0.4) +
- geom_hline(yintercept=seq(-50, 0, by = 10), color = 'gray50', alpha=0.4)
- ggsave(dpi=300, file='sa.neotoma.sat.pdf')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement