Example: bankruptcy

Package ‘maps’ - R

Package maps April 3, 2018 TitleDraw Geographical S code by Richard A. Becker and Allan R. version by Ray by Thomas P Minka and Alex of maps. Projection code and larger maps are inseparate packages ('mapproj' and 'mapdata').DependsR (>= )Importsgraphics, utilsLazyDatayesSuggestsmapproj (>= ), mapdata (>= ), sp, maptools,rnaturalearthLicenseGPL-2 MaintainerAlex 08:24:49 UTCR topics ..4county ..5france ..8iso3166 ..9italy .. 10lakes .. 12map .. 22maps-deprecated .. 23nz .. 25ozone .. 26 Spatial2map .. 28state .. 32usa .. 33world .. 36world2 .. of projected map regionsDescriptionComputes the areas of regions in a projected (m, regions = ".", sqmi=TRUE, ..)Argumentsma map object containing named polygons (created withfill = TRUE).

Package ‘maps’ April 3, 2018 Title Draw Geographical Maps Version 3.3.0 Date 2018-04-03 Author Original S code by Richard A. Becker and Allan R. Wilks.

Tags:

  Packages, Amps, Package maps

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Package ‘maps’ - R

1 Package maps April 3, 2018 TitleDraw Geographical S code by Richard A. Becker and Allan R. version by Ray by Thomas P Minka and Alex of maps. Projection code and larger maps are inseparate packages ('mapproj' and 'mapdata').DependsR (>= )Importsgraphics, utilsLazyDatayesSuggestsmapproj (>= ), mapdata (>= ), sp, maptools,rnaturalearthLicenseGPL-2 MaintainerAlex 08:24:49 UTCR topics ..4county ..5france ..8iso3166 ..9italy .. 10lakes .. 12map .. 22maps-deprecated .. 23nz .. 25ozone .. 26 Spatial2map .. 28state .. 32usa .. 33world .. 36world2 .. of projected map regionsDescriptionComputes the areas of regions in a projected (m, regions = ".", sqmi=TRUE, ..)Argumentsma map object containing named polygons (created withfill = TRUE).

2 Regionsa character vector naming one of more regions, as , measure area in square miles. Otherwise keep the units arguments area of each matching region in the map is computed, and regions which match the same ele-ment ofregionshave their areas combined. Each region is assumed planar, with vertices specifiedby thexandycomponents of the map correct use of this function is to first usemapto create polygons and project the coordinatesonto a plane, then compute the area of the projected regions. If the projectionis area-preserving (such asalbers), then these areas will match the area on the globe, up to aconstant. To get an absolute area in square miles, thesqmioption will scale the result, dependingon the coordinates frommapare affected by itsresolutionargument, so useresolution=0for themost accurate named vector of region assumes the coordinates have been projected with the mapproject (s)Tom MinkaSee , # because the projection is rectangular, these are not true areas on the = map("state", fill = TRUE, plot = FALSE) (m) (m, ".)

3 *dakota") (m, c("North Dakota", "South Dakota"))if(require(mapproj)) {# true areas on the globem = map("state", proj="bonne", param=45, fill=TRUE, plot=FALSE)# North Dakota is listed as 70,704 square (m, "North Dakota")} of Canadian citiesDescriptionThis database is of Canadian cities of population greater than about 1,000. Also included areprovince capitals of any population list with 6 components, namely "name", " ", "pop", "lat", "long", and "capital", contain-ing the city name, the province abbreviation, approximate population (as at January 2006), latitude,longitude and capital status indication (0 for non-capital, 1 for capital, 2 for of the city names may be out of date. Please send any corrections to the Package States County MapDescriptionThis database produces a map of the counties of the United States mainland generated from USDepartment of the Census data (see the reference).

4 Usagedata(countyMapEnv)FormatThe data file is merely a character string which specifies the name of an environment variable whichcontains the base location of the binary files used by the map drawing functions. This environmentvariable (R_MAP_DATA_DIRfor the datasets in the maps Package ) is set at Package load timeif it doesnot already exist. Hence setting the environment variable before loading the Package can overridethe default location of the binary A. Becker, and Allan R. Wilks, "Maps in S",AT\&T Bell Laboratories Statistics ResearchReport [ ], A. Becker, and Allan R. Wilks, "Constructing a Geographical Database",AT\&T Bell Lab-oratories Statistics Research Report [ ], Department of Commerce, Census Bureau,County Boundary File,computer tape, availablefrom Customer Services, Bureau of the Census, Washingdon DC ('county','iowa', fill = TRUE, col = palette()) county codes for US County MapDescriptionA database matching FIPS codes to maps Package county and state ( )FormatA list with 2 components, namely "fips" and "polyname", containing the FIPS number and respec-tive state or county polygon name.

5 Note that "fips" is represented as an integer, so any leading zero(which is part of the fips code) is not shown by MapDescriptionThis france database comes from the NUTS III (Tertiary Administrative Units of the EuropeanCommunity) database of the United Nations Environment Programme (UNEP) GRID-Geneva datasets. These were prepared around 1989, and so may be somewhat out of of data sets supplied through UNEP/GRID are requested to incorporate in output productsand reports acknowledgements to the originator of the data and to the fact that they were acquiredthrough UNEP/GRID. Appropriate wording may be "UNESCO (1987) through UNEP/GRID-Geneva".Usagedata(franceMapEnv )FormatThe data file is merely a character string which specifies the name of an environment variable whichcontains the base location of the binary files used by the map drawing functions.

6 This environmentvariable (R_MAP_DATA_DIRfor the datasets in the maps Package ) is set at Package load timeif it doesnot already exist. Hence setting the environment variable before loading the Package can overridethe default location of the binary A. Becker, and Allan R. Wilks, "Maps in S",AT\&T Bell Laboratories Statistics ResearchReport [ ], A. Becker, and Allan R. Wilks, "Constructing a Geographical Database",AT\&T Bell Lab-oratories Statistics Research Report [ ], AlsomapExamplesmap('france', fill = TRUE, col = 1:10) regions on a mapDescriptionIdentifies the map regions clicked by the ## S3 method for class'map'identify(x, n = 1, index = FALSE, ..)Argumentsxa map object containing named number of clicks to wait TRUE, returns the index of the polygon, rather than its arguments passed current algorithm is somewhat crude selects the region whose centroid is closest to the more sophisticated approach would character vector of lengthn, naming the selected (s)Tom MinkaSee Alsoidentify, (map("state", fill = TRUE, col = 0))if(require(mapproj))identify(map("wor ld", proj = "lagrange", fill = TRUE, col = 0, wrap=c(-180,180,-90))) countries by ISO 3166 codes (2 or 3 letters) or by data set and the simple look-up functions allow to build lists of counrtries for the world (a, regex=TRUE) (sov, regex=TRUE) (x, n=2)ArgumentsaA vector of ISO codes.

7 All elements should have the same length, either 2 or 3letters. Not case vector of country names. The result is a list of all countries that fall undertheir sovereignty. Case sensitive, must fit TRUE (default), the return vector has the same length as the input (aorsov),but the entries may be regular expressions. If FALSE, the result is a vector ofpolygon names. This may be more readable, but the return vector may be longerthan the of country names, may include integer identitying which ISO code is required. Allowed values are 2 and ISO 3166-1 standard identifies countries by a 2 and 3 letter codes into the country names as used by theworlddata the that these functions will not work well with the legacy world data base.

8 Some countries havedifferent ISO codes for different regions ( China:Hong Kong has ISO code HK). In such cases, return the main code, return a regular expression that excludessome vector of country names. When used as input formapit will plot all the coun-tries as identified either by their sovereignty or by ISO codes. Ifregex=FALSEthe length of thevector may be shorter or longer than the input. Ifregex=TRUE, the results are concatenated inregular expressions. This format is less readable, but can be used as input returns a vector of the same length as the input, containing the 2- or functions use regular expressions and the results will often not work well withmap(..,exact=TRUE).iso31669 , ,iso3166 Examples# France and all its overseas departments, territories ("France") # France and all its overseas departments, territories etc.

9 # Canary Islands are not included in map("Spain") ("ES")map(regions= ("Spain"))# draw a map with ISO codes as labels:wm <- map("world", fill=TRUE, col=0, xlim=c(-10,40), ylim=c(30,60))# take out islands, but you loose UK, New Zealand, small island statesnam <- grep(":", wm$names, inv=TRUE, val=TRUE)# ad ISO codes as (wm, regions=nam, label= (nam), col=2, exact=TRUE, add=TRUE)iso3166 ISO 3166 country codes (2 or 3 letters) and data set lists all ISO3166 country codes and the sovereignty for each country in the list. Someentries are regular data frame with 5 columns: "a2", "a3", "name", "mapname", "sovereignty". These contain the 2-and 3-letter ISO code, the official name, the (possibly shorter) name used in the map data base, andthe sovereign ISO 3166-1 standard identifies countries by a 2 and 3 letter codes.

10 This table listst these for allcountries on the world map. This data set also serves as basis for the function () and countries have different ISO codes for some regions. To deal with such particular cases, the"mapname" column may sometimes contain (perl-style) regular expressions rather than simply acountry name. For instance, "FI" has mapname "Finland(?!:Aland)", because the Aland islandshave a different ISO code. Other codes may appear in two rows if certain parts of countries are notwritten with the main country as base name. Usually, that is for compatibility with the legacy worlddata MapDescriptionThis italy database comes from the NUTS III (Tertiary Administrative Units of the European Com-munity) database of the United Nations Environment Programme (UNEP) GRID-Geneva data were prepared around 1989, and so may be somewhat out of of data sets supplied through UNEP/GRID are requested to incorporate in output productsand reports acknowledgements to the originator of the data and to the fact that they were acquiredthrough UNEP/GRID.


Related search queries