19

私は..density..時々使用します、そしてそれは素晴らしいです。ggplot2この本だけでなく、その例がたくさんあります..count..stat_densityのドキュメントを調べて、について学びました..scaled..。誰かが..n..ここで StackOverflow を使用しているのを見て、そのことを知りました。今、私は他に何が欠けているのだろうと思っています。

検索エンジンは、.「..n.. ggplot2」のような検索文字列の s をエスケープしても無視するようです。これらの変数の一般的な用語はありますか? もっとありますか?それらに関するドキュメントはどこにありますか?

4

2 に答える 2

21

ggplot2ヘルプ ファイル (または、少なくともggplot2によってエクスポートされた関数の 1 つを参照する、と入力して表示できるヘルプ ファイル) で言及されているすべての..*..オプションを次に示します。?"<func>""<func>"

library(ggplot2)

## Read all of the ggplot2 help files and convert them to character vectors
ex <- unlist(lapply(ls("package:ggplot2"), function(g) {
    p = utils:::index.search(g, find.package(), TRUE)
    capture.output(tools::Rd2txt(utils:::.getHelpFile(p)))
}))

## Extract all mentions of "..*.." from the character vectors
pat <- "\\.\\.\\w*\\.\\."
m <- gregexpr(pat, ex)    
unique(unlist(regmatches(ex,m)))
# [1] "..density.."  "..count.."    "..level.."    "..scaled.."   "..quantile.."
# [6] "..n.."   

または、どのヘルプ ファイルがどの を説明しているかを調べるには、次のコマンドを..*..実行します。

library(ggplot2)

ex <- sapply(ls("package:ggplot2"), function(g) {
    p = utils:::index.search(g, find.package(), TRUE)
    capture.output(tools::Rd2txt(utils:::.getHelpFile(p)))
}, simplify=FALSE, USE.NAMES=TRUE)

res <- lapply(ex, function(X) {
    m <- gregexpr("\\.\\.\\w*\\.\\.", X)    
    unique(unlist(regmatches(X, m)))
})
res[sapply(res, length) > 0]
于 2013-09-04T19:49:14.857 に答える