mapGriddedData(rworldmap)
mapGriddedData()所属R语言包:rworldmap
Produce maps of global gridded data at half degree resolution
在半度分辨率的全球格点数据的图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Produce maps of global gridded data at half degree resolution
在半度分辨率的全球格点数据的图
用法----------Usage----------
mapGriddedData( dataset = ""
, nameColumnToPlot = ""
, numCats = 5
, catMethod = "quantiles"
, colourPalette = "heat"
, xlim = c(-180,180)
, ylim = c(-80,90)
, mapRegion = "world"
, addLegend = TRUE
, addBorders = 'low'
, borderCol = 'grey'
, oceanCol = NA
, landCol = NA
, plotData = TRUE
, aspect = 1
)
参数----------Arguments----------
参数:dataset
gridded data either as a : <ol> SpatialGridDataFrame (R object defined in package sp)
栅格数据,无论是作为一个<OL> SpatialGridDataFrame(R对象中定义的封装SP)
file name of a GridAscii file - this is an Esri format
的GridAscii文件的文件名 - 这是一个ESRI格式
2D R matrix or array (rows by columns) </ol>
2D R矩阵或数组的列(行)</ OL>
参数:nameColumnToPlot
name of column containing the data to plot
包含的数据来绘制名称列
参数:numCats
number of categories to put the data in, may be overidden if catMethod ='pretty'
一些类别中的数据,可能是,,凌驾如果catMethod =漂亮
参数:catMethod
method for categorisation of data "pretty", "fixedWidth","diverging", "logfixedWidth","quantiles","categorical", or a numeric vector defining breaks
“漂亮”,“固定宽度”,“分歧”,“logfixedWidth”,“位数”,“分类”,或一个数值向量定义中断的数据进行分类方法
参数:colourPalette
a string describing the colour palette to use, choice of : <ol> "palette" for the current palette
一个字符串来描述当前的调色板使用的调色板,选择:<OL>的“调色板”
a vector of valid colours, e.g. =c('red','white','blue') or output from RColourBrewer
一个向量的有效的颜色,例如= C(红,白,蓝)或RColourBrewer输出
one of "heat","diverging","white2Black","black2White","topo","rainbow","terrain","negpos8","negpos9" </ol>
之一</ OL>
参数:xlim
map extents c(west,east), can be overidden by mapRegion
图数据区C区(西部,东部),可以凌驾通过的MapRegion
参数:ylim
map extents c(south,north), can be overidden by mapRegion
图范围是C(南,北),可以凌驾通过的MapRegion
参数:mapRegion
a country name from getMap()[['NAME']] or 'world','africa','oceania','eurasia','uk' sets map extents, overrides xlim,ylim
国家名称的GetMap()[“NAME”或“世界”,“非洲”,“大洋洲”,“欧亚”,“英国将图的程度,覆盖作适当调整,ylim
参数:addLegend
whether to add a legend or not
是否添加图例或
参数:addBorders
options for country borders, 'low','coarse' = low or coarse resolution, 'coasts' = coasts only, 'none' or NA for none
“粗”,“低”,国家边界的选项=低或粗决议,“海岸”=海岸,none或NA没有
参数:borderCol
the colour for country borders
国家边界的颜色
参数:oceanCol
a colour for the ocean if the grid values are NA
海洋的颜色,如果网格值是NA
参数:landCol
a colour to fill countries if the grid values are NA over land
如果网格值是Na对土地的颜色,以填补国家
参数:plotData
whether to plotData, if FALSE a legend can be added on its own
是否plotData,如果为FALSE一个传说可以添加自己的
参数:aspect
aspect for the map, defaults to 1, if set to 'variable' uses same method as plot.Spatial in sp
图方面,默认为1,如果设置为“变量”SP使用相同的方法plot.Spatial
Details
详细信息----------Details----------
Plots a map of global half degree gridded data, allowing classification, colours and regions to be set.
全球一半的程度栅格数据绘制图,允许设置分类,颜色和区域。
Certain catMethod and colourPalette options go well together. e.g. "diverging" and "diverging", "categorical" and "rainbow"
某些catMethod和colourPalette可以融洽相处。例如“分流”和“分流”,“类别”和“彩虹”
值----------Value----------
invisibly returns a list containing the data and main options used for the map, the list can be passed to addMapLegend along with additional options to allow greater flexibility in legend creation.
无形地返回一个列表,其中包含的数据,主要用于图的选项,可以通过列表addMapLegend随着额外的选项,允许更大的灵活性传说中的创造。
(作者)----------Author(s)----------
andy south and matthew staines
参见----------See Also----------
classInt, RColorBrewer
classInt,RColorBrewer
实例----------Examples----------
## mapping continuous data[#连续的数据映射]
data(gridExData,envir=environment(),package="rworldmap")
gridExData <- get("gridExData")
mapGriddedData(gridExData)
## reclassing continuous data to categorical & mapping[#reclassing连续的数据分类和映射]
data(gridExData,envir=environment(),package="rworldmap")
#find quartile breaks[找到四分截断]
cutVector <- quantile(gridExData@data[,1],na.rm=TRUE)
#classify the data to a factor[对数据进行分类的一个因素]
gridExData@data$categories <- cut( gridExData@data[,1]
, cutVector, include.lowest=TRUE)
#rename the categories[重命名的类别]
levels(gridExData@data$categories) <- c('low', 'med', 'high', 'vhigh')
#mapping[映射]
mapGriddedData( gridExData, nameColumnToPlot= 'categories'
, catMethod='categorical')
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|