这似乎是一个愚蠢的问题,但我无法通过谷歌搜索找到答案。
R 文档通常不会概述特定参数的所有可能值。是否有打印该信息的命令?
例如,我想使用 maps
包中的函数 map()
绘制一些 map 。 R 文档说明了区域参数:
regions: character vector that names the polygons to draw. Each database is composed of a collection of polygons, and each polygon has a unique name. When a region is composed of more than one polygon, the individual polygons have the name of the region, followed by a colon and a qualifier, as in michigan:north and michigan:south. Each element of regions is matched against the polygon names in the database and, according to exact, a subset is selected for drawing. The default selects all polygons in the database.
是否可以获取区域名称列表?
最佳答案
您可以通过以下方式查看参数和默认值:
args(map)
我相信您正在寻找数据库中的元素而不是参数,因为 map 函数不知道您传递给它的是哪个数据库。它的默认值为“世界”。
w <- map('world')
str(w) # not necessary, but good to look at
w$names
还有:
canada <- map(region = 'Canada')
canada$names
关于r - 如何查看 R 中的所有参数选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26806015/