sets.html
来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 89 行
HTML
89 行
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Set Operations</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>
<table width="100%" summary="page for sets {arules}"><tr><td>sets {arules}</td><td align="right">R Documentation</td></tr></table>
<h2>Set Operations</h2>
<h3>Description</h3>
<p>
Provides the generic functions and the S4 methods for the set operations
<code>union</code>, <code>intersect</code>, <code>setequal</code>, <code>setdiff</code> and
<code>is.element</code> on sets of associations (e.g., rules, itemsets) and
itemMatrix.
</p>
<h3>Usage</h3>
<pre>
union(x, y)
intersect(x, y)
setequal(x, y)
setdiff(x, y)
is.element(el, set)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>x,y, el, set</code></td>
<td>
sets of associations or itemMatrix objects.</td></tr>
</table>
<h3>Details</h3>
<p>
All S4 methods for set operations are defined for the
class name <code>"ANY"</code> in the signature,
so they should work for all S4 classes for which the following
methods are available: <code>match</code>, <code>length</code> and <code>unique</code>.
</p>
<h3>Value</h3>
<p>
<code>union</code>, <code>intersect</code>, <code>setequal</code> and <code>setdiff</code> return an
object of the same class as <code>x</code> and <code>y</code>.
<br>
<code>is.element</code> returns a logic vector of length <code>el</code> indicating
for each element if it is included in <code>set</code>.</p>
<h3>See Also</h3>
<p>
<code><a href="associations-class.html">associations-class</a></code>,
<code><a href="itemMatrix-class.html">itemMatrix-class</a></code>
</p>
<h3>Examples</h3>
<pre>
data("Adult")
## mine some rules
r <- apriori(Adult)
## take 2 subsets
r1 <- r[1:10]
r2 <- r[6:15]
union(r1,r2)
intersect(r1,r2)
setequal(r1,r2)
</pre>
<hr><div align="center">[Package <em>arules</em> version 0.6-6 <a href="00Index.html">Index]</a></div>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?