# [R] R maps Help

Frank Rodgers frodgers at frankrodgers.com
Sat Feb 9 17:06:37 CET 2013

```I am fairly new to R and am plotting flight data on a map. Everything is
working well except the size of the map is really too small to show the data
effectively and I can't seem to figure out how to make the output map
larger. Do I need to change the device characteristics or is it a map.???
call.  Here is the code:

library(maps)
library(geosphere)

checkDateLine <- function(l){
n<-0
k<-length(l)
k<-k-1
for (j in 1:k){
n[j] <- l[j+1] - l[j]
}
n <- abs(n)
m<-max(n, rm.na=TRUE)
ifelse(m > 30, TRUE, FALSE)
}

clean.Inter <- function(p1, p2, n, addStartEnd){
if (checkDateLine(inter[,1])){
m1 <- midPoint(p1, p2)
m1[,1] <- (m1[,1]+180)%%360 - 180
a1 <- antipode(m1)
l3 <- rbind(l1, l2)
l3
}
else{
inter
}
}

pal <- colorRampPalette(c("#00FF00", "#FF0000"))
colors <- pal(100)

fsub <- flights[flights\$airline == "FSR",]
fsub <- flights[order(flights\$cnt),]
maxcnt <- max(fsub\$cnt)

for (j in 1:length(fsub\$airline)) {
air1 <- airports[airports\$iata == fsub[j,]\$airport1,]
air2 <- airports[airports\$iata == fsub[j,]\$airport2,]
p1 <- c(air1[1,]\$long, air1[1,]\$lat)
p2 <- c(air2[1,]\$long, air2[1,]\$lat)

colindex <- round( (fsub[j,]\$cnt / maxcnt) * length(colors))

lines(inter, col=colors[colindex], lwd=0.1)
}
}

map_usa <- function(){
xlim <- c(-171.738281, -56.601563)
ylim <- c(12.039321, 71.856229)
map("world", col="#191919", fill=TRUE, bg="#736F6E", lwd=0.05, xlim=xlim,
ylim=ylim)
}

map_world <- function(){
map("world", col="#191919", fill=TRUE, bg="#736F6E", lwd=.1)
}

map_world()

--
View this message in context: http://r.789695.n4.nabble.com/R-maps-Help-tp4658030.html
Sent from the R help mailing list archive at Nabble.com.

```