2016-06-07 22 views
2

例如,數學運算符+, -, *, /都被定義爲中綴運算符,因此1 + 3也可以寫爲`+`(1, 3)。 (Further reading)。功能的文檔和代碼需要反向功能「以功能形式訪問

我知道您有時可以通過使用?`+`help(`+`)來獲得這些功能的文檔。

然而,這是不工作的distr包,它定義了隨機變量,其是類的對象上述的數學運算符。例如。

library(distr) 
Norm() * Norm() 

我曾嘗試之類的東西help(`distr::*`)help(distr::`*`)。有趣的是,如果我嘗試

library(dplyr) 
help(`%>%`) 

我得到的幫助窗口兩個環節,一到dplyr包,一到magrittr包。我也不知道用直接訪問的dplyr::`%>%`幫助什麼語法。

+2

'help(\'%>%\',package = dplyr)'你的第二個問題 – thelatemail

+0

或'?dplyr :: \%>'' – alistaire

+0

謝謝,好像沒有這些helpfile運營商 – Alex

回答

3

嘗試以下操作:

library(distr) 
?operators 

這也可能感興趣:

?"Math-methods" 
methods?Math # same 

也試試這個瀏覽頗包"-class"幫助文件,關鍵字math幫助文件和關鍵字arith幫助文件:

help.search("class", package = "distr") 
help.search("math", fields = "keyword", package = "distr") 
help.search("arith", fields = "keyword", package = "distr") 

如果您想瀏覽所有的包頗幫助文件:

help(package = "distr") 

您也可以瀏覽源代碼在https://github.com/cran/distrhttp://distr.r-forge.r-project.org或將其從CRAN主頁https://cran.r-project.org/package=distr下載。