2.3 Oracle Machine Learning for Rのクラス、関数およびメソッドのオンライン・ヘルプの取得
OML4Rのクラス、関数およびメソッドに関するヘルプを取得するには、help
、showMethods
などのR関数を使用します。クラスまたは関数の名前にore
接頭辞が付いている場合は、help
関数にその名前を指定できます。オープン・ソースR関数のオーバーロードされたメソッドに関するヘルプを取得するには、メソッドの名前およびore
クラスの名前を指定します。
例2-1 OML4Rのクラス、関数およびメソッドに関するヘルプの取得
この例では、OML4Rのクラス、関数およびメソッドに関する情報を取得するための様々な方法を示します。例の後にあるリストでは、一部のコードは結果の一部のみを表示するために変更されていて、一部の関数の出力は表示されていません。
# List the contents of the OREbase package. ls("package:OREbase") # Get help for the OREbase package. help("OREbase") # Get help for the ore virtual class. help("ore-class") # Show the subclasses of the ore virtual class. showClass("ore") # Get help on the ore.frame class. help("ore.frame") # Get help on the ore.vector class. help("ore.vector") # Show the arguments for the aggregate method. showMethods("aggregate") # Get help on the aggregate method for an ore.vector object. help("aggregate,ore.vector-method") # Show the signatures for the merge method. showMethods("merge") # Get help on the merge method for an ore.frame object. help("merge,ore.frame,ore.frame-method") showMethods("scale") # Get help on the scale method for an ore.number object. help("scale,ore.number-method") # Get help on the ore.connect function. help("ore.connect")
例2-1のリスト
R> options(width = 80)
# List the contents of the OREbase package.
R> head(ls("package:OREbase"), 12)
[1] "%in%" "Arith" "Compare" "I"
[5] "Logic" "Math" "NCOL" "NROW"
[9] "Summary" "as.data.frame" "as.env" "as.factor"
R>
R># Get help for the OREbase package.
R> help("OREbase") # Output not shown.
R>
R> # Get help for the ore virtual class.
R> help("ore-class") # Output not shown.
R>
R># Show the subclasses of the ore virtual class.
R> showClass("ore")
Virtual Class "ore" [package "OREbase"]
No Slots, prototype of class "ore.vector"
Known Subclasses:
Class "ore.vector", directly
Class "ore.frame", directly
Class "ore.matrix", directly
Class "ore.number", by class "ore.vector", distance 2
Class "ore.character", by class "ore.vector", distance 2
Class "ore.factor", by class "ore.vector", distance 2
Class "ore.date", by class "ore.vector", distance 2
Class "ore.datetime", by class "ore.vector", distance 2
Class "ore.difftime", by class "ore.vector", distance 2
Class "ore.logical", by class "ore.vector", distance 3
Class "ore.integer", by class "ore.vector", distance 3
Class "ore.numeric", by class "ore.vector", distance 3
Class "ore.tblmatrix", by class "ore.matrix", distance 2
Class "ore.vecmatrix", by class "ore.matrix", distance 2
R>
# Get help on the ore.frame class.
R> help("ore.frame") # Output not shown.
R># Get help on the ore.vector class.
R> help("ore.vector") # Output not shown.
R>
R># Show the arguments for the aggregate method.
R> showMethods("aggregate")
Function: aggregate (package stats)
x="ANY"
x="ore.vector"
# Get help on the aggregate method for an ore.vector object.
R> help("aggregate,ore.vector-method") # Output not shown.
# Show the signatures for the merge method.
R> showMethods("merge")
Function: merge (package base)
x="ANY", y="ANY"
x="data.frame", y="ore.frame"
x="ore.frame", y="data.frame"
x="ore.frame", y="ore.frame
# Get help on the merge method for an ore.frame object.
R> help("merge,ore.frame,ore.frame-method") # Output not shown.
R> showMethods("scale")
Function: scale (package base)
x="ANY"
x="ore.frame"
x="ore.number"
x="ore.tblmatrix"
x="ore.vecmatrix"
# Get help on the scale method for an ore.number object.
R> help("scale,ore.number-method") # Output not shown.
# Get help on the ore.connect function.
R> help("ore.connect") # Output not shown.