write.html

来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 94 行

HTML
94
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Writes transactions or associations to disk</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 WRITE {arules}"><tr><td>WRITE {arules}</td><td align="right">R Documentation</td></tr></table>
<h2>Writes transactions or associations to disk</h2>


<h3>Description</h3>

<p>
Provides the generic function <code>WRITE</code> and the S4 methods to 
write transactions or associations (itemsets, rules) to disk.
</p>


<h3>Usage</h3>

<pre>
WRITE(x, file = "",...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
the transactions or associations (rules, itemsets, etc.) object.</td></tr>
<tr valign="top"><td><code>file</code></td>
<td>
either a character string naming a file or a connection open
for writing.  '""' indicates output to the console.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
further arguments passed on to <code><a href="../../utils/html/write.table.html">write.table</a></code>.</td></tr>
</table>

<h3>Details</h3>

<p>
<code>WRITE</code> first uses coercion to data.frame to obtain a printable form of
<code>x</code> and then uses <code><a href="../../utils/html/write.table.html">write.table</a></code> to write the data to disk.
</p>
<p>
Note: To save and load associations in compact form, use <code>save</code> and
<code>load</code> from the <span class="pkg">base</span> package.  Alternatively, association can be
written to disk in PMML (Predictive Model Markup Language). This requires
the packages <span class="pkg">pmml</span> and <span class="pkg">XML</span>. See Examples section for usage.
</p>


<h3>See Also</h3>

<p>
<code><a href="../../utils/html/write.table.html">write.table</a></code> (in <span class="pkg">base</span>),
<code><a href="transactions-class.html">transactions-class</a></code>,
<code><a href="associations-class.html">associations-class</a></code>
</p>


<h3>Examples</h3>

<pre>
data("Epub")

## write the formated result to screen
WRITE(head(Epub))

## write the formated result to file in CSV format
WRITE(Epub, file = "data.csv", sep = ",", col.names = NA)

## write rules in CSV format
rules &lt;- apriori(Epub, parameter=list(support=0.002, conf=0.8))
WRITE(rules, file = "data.csv", sep = ",", col.names = NA)

unlink("data.csv") # tidy up

## write rules as PMML
library(pmml)
rules_pmml &lt;- pmml(rules)
saveXML(rules_pmml, "data.xml")

unlink("data.xml") # tidy up
</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 + -
显示快捷键?