r - 如何查看 R 中的所有参数选项?

标签 r

这似乎是一个愚蠢的问题,但我无法通过谷歌搜索找到答案。

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/

相关文章:

r - geom_bar 的 geom_text 位置问题

r - 如何在 Jupyter Notebook 上打印 R 中的整个数据框?

r - 根据其他向量在列中查找匹配值

r - 说明 R 中的相对时间线

R按索引对列求和

xml - 如何在 Windows 上安装 Sxslt 包? R

r - stats::reshape 的替代品

r - 使用 R 检查位置是否在一组其他位置的一定距离内

java - RJDBC 问题 : Error in . jfindClass(as.character(driverClass)[1]) :找不到类

r - 如何将数据集放入 R 包