https://github.com/cran/fields
Raw File
Tip revision: 6769ffc81115fbf0bf7d9c566cf7ac81be0049dc authored by Doug Nychka on 25 July 2005, 00:00:00 UTC
version 3.04
Tip revision: 6769ffc
world.r
"world" <-
function (ylim = c(-90, 90), xlim = NULL, add = FALSE, asp = 1, 
    xlab = "", ylab = "", xaxt = "n", yaxt = "n", eps = 0.1, 
    shift = FALSE, ...) 
{
    if (shift) {
ind1<- !is.na(world.dat$x)
ind2<- (world.dat$x<0)
# shift coordinates
        world.dat$x[ind2&ind1] <- world.dat$x[ind2&ind1] + 360
# "pick up pen" at the new edges by inserting NA's
        world.dat$x[(world.dat$x <= eps | world.dat$x >= (360 - 
            eps))&ind1] <- NA
    }
    if (is.null(xlim)) {
        if (shift) {
            xlim <- c(0, 360)
        }
        else {
            xlim <- c(-180, 180)
        }
    }
    if (!add) {
        plot(world.dat, ylim = ylim, xlim = xlim, type = "n", 
            xaxt = xaxt, yaxt = yaxt, xlab = xlab, ylab = ylab, 
            asp = asp, ...)
    }
    lines(world.dat, err = -1, ...)
    invisible()
}

back to top