R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("blighty-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('blighty') Loading blighty version 2.0-0 Copyright David Lucy 2001-2002 > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "blighty" > > ### * blighty > > flush(stderr()); flush(stdout()) > > ### Name: blighty > ### Title: British Isles Coastlines > ### Aliases: blighty > ### Keywords: hplot > > ### ** Examples > > blighty() # UK coastline Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > blighty(grid=TRUE) # UK coastline with grid Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Requested gridding applied ... Map complete ... > points(399,91) # add in Poole OS coords last digit is 1km > text(400,50,"Poole") > > blighty("set.Scotland") # Scotland and the Western Isles Plotting set.Scotland be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > points(327, 672) # OS coords for Authurs Seat > text(327, 655, "Edinburgh") > > blighty("set.Wales") # Wales and Anglesey Plotting set.Wales be patient ... Data loaded ... Less than 200km East-West - poor map resolution - proceeding Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > > blighty("set.England", xlimits=c(400,600), ylimits=c(50, 200)) Plotting set.England be patient ... Data loaded ... Less than 200km North-South - poor map resolution - proceeding Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > box() # south of England and the Isle of Wight > # and the Thames Estuary > > blighty() # do a plot then add the capital cities Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > > x <- c(532, 327, 317) # make up two vectors of points > y <- c(181, 672, 175) # for capital cities > > names <- c("London", "Edinburgh", "Cardiff") # vector of names > > points(x,y, col="red") # add in the points in red > > text(x + 20, y, labels=names, adj=0) > # add some labels displaced by 20km to the right > > blighty(parcol="gray") # use a basic shading Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > > blighty("set.Scotland", parcol="blue", parbor="red", sarcol="red", tlncol="green", tlnwdh=3) Plotting set.Scotland be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > # looks hideous but demonstates some of the shading > # functions > > blighty(parang=45, parden=30, parbor="transparent", parcol="black", sarbor="transparent", tlncol="transparent") Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > # more of a picture for logos etc > > > > cleanEx(); ..nameEx <- "map.scale" > > ### * map.scale > > flush(stderr()); flush(stdout()) > > ### Name: map.scale > ### Title: British Isles Coastline map scale > ### Aliases: map.scale > ### Keywords: hplot > > ### ** Examples > > blighty() # draw coastline Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > map.scale(pos="AUTO", width=2) # automatic placing > map.scale(width=2) # same as above > ## Not run: map.scale(pos="select") # locator to select > map.scale(pos=c(400,400)) # position vector Warning in if (pos == "AUTO") { : the condition has length > 1 and only the first element will be used Warning in if (pos == "select") { : the condition has length > 1 and only the first element will be used > > > cleanEx(); ..nameEx <- "north.pointer" > > ### * north.pointer > > flush(stderr()); flush(stdout()) > > ### Name: north.pointer > ### Title: British Isles Coastline North pointer > ### Aliases: north.pointer > ### Keywords: hplot > > ### ** Examples > > blighty() # draw coastline Plotting set.UK be patient ... Data loaded ... Warning in return(xlims, ylims) : multi-argument returns are deprecated Correct aspect ratio calculated ... Map complete ... > north.pointer(pos="AUTO") # automatic placing > north.pointer() # same as above > ## Not run: north.pointer(pos="select") # uses locator to find the position > north.pointer(pos=c(500,500)) # vector to determine the centre of the Warning in if (pos == "AUTO") { : the condition has length > 1 and only the first element will be used Warning in if (pos == "select") { : the condition has length > 1 and only the first element will be used > # N of the pointer > > > > ### *