| Line 38... |
Line 38... |
| 38 |
}
|
38 |
}
|
| 39 |
\item{x}{the object to be written, typically a data frame. If not, it
|
39 |
\item{x}{the object to be written, typically a data frame. If not, it
|
| 40 |
is attempted to coerce \code{x} to a data frame.}
|
40 |
is attempted to coerce \code{x} to a data frame.}
|
| 41 |
\item{append}{logical. If \code{TRUE}, the output is appended to the
|
41 |
\item{append}{logical. If \code{TRUE}, the output is appended to the
|
| 42 |
file. If \code{FALSE}, any existing file of the name is destroyed.}
|
42 |
file. If \code{FALSE}, any existing file of the name is destroyed.}
|
| 43 |
\item{useBytes}{logical to be passed to \code{\link{writeLines}()},
|
43 |
\item{useBytes}{ignored, and retained only for back-compatibility.
|
| - |
|
44 |
Since \code{write.dcf} now always writes UTF-8 (see \sQuote{Details}),
|
| 44 |
see there: \dQuote{for expert use}.}
|
45 |
the output is no longer re-encoded to the session's native encoding.}
|
| 45 |
\item{indent}{a positive integer specifying the indentation for
|
46 |
\item{indent}{a positive integer specifying the indentation for
|
| 46 |
continuation lines in output entries.}
|
47 |
continuation lines in output entries.}
|
| 47 |
\item{width}{a positive integer giving the target column for wrapping
|
48 |
\item{width}{a positive integer giving the target column for wrapping
|
| 48 |
lines in the output.}
|
49 |
lines in the output.}
|
| 49 |
}
|
50 |
}
|
| Line 71... |
Line 72... |
| 71 |
only) lines.
|
72 |
only) lines.
|
| 72 |
\item Individual lines may not be arbitrarily long; prior to \R 3.0.2 the
|
73 |
\item Individual lines may not be arbitrarily long; prior to \R 3.0.2 the
|
| 73 |
length limit was approximately 8191 bytes per line.
|
74 |
length limit was approximately 8191 bytes per line.
|
| 74 |
}
|
75 |
}
|
| 75 |
|
76 |
|
| - |
|
77 |
DCF files are required to be encoded in UTF-8. \code{read.dcf}
|
| - |
|
78 |
therefore returns values in UTF-8 (non-ASCII values being marked as
|
| 76 |
Note that \code{read.dcf(all = FALSE)} reads the file byte-by-byte.
|
79 |
such), and \code{write.dcf} converts values with a declared encoding
|
| - |
|
80 |
(such as \code{"latin1"}) to UTF-8 and always writes UTF-8, regardless
|
| 77 |
This allows a \file{DESCRIPTION} file to be read and only its ASCII
|
81 |
of the session's locale. Any bytes which are not valid UTF-8 are not
|
| - |
|
82 |
dropped but preserved visually by escaping them as \samp{<xx>} (where
|
| - |
|
83 |
\code{xx} is the byte in hexadecimal), as done by
|
| - |
|
84 |
\code{\link{iconv}(sub = "byte")}. As a consequence, the
|
| 78 |
fields used, or its \samp{Encoding} field used to re-encode the
|
85 |
\samp{Encoding} field of a \file{DESCRIPTION} file is no longer used to
|
| 79 |
remaining fields.
|
86 |
re-encode the other fields.
|
| 80 |
|
87 |
|
| 81 |
\code{write.dcf} does not write \code{NA} fields.
|
88 |
\code{write.dcf} does not write \code{NA} fields.
|
| 82 |
}
|
89 |
}
|
| 83 |
\value{
|
90 |
\value{
|
| 84 |
The default \code{read.dcf(all = FALSE)} returns a character matrix
|
91 |
The default \code{read.dcf(all = FALSE)} returns a character matrix
|
| Line 101... |
Line 108... |
| 101 |
|
108 |
|
| 102 |
For \code{write.dcf}, invisible \code{NULL}.
|
109 |
For \code{write.dcf}, invisible \code{NULL}.
|
| 103 |
}
|
110 |
}
|
| 104 |
|
111 |
|
| 105 |
\references{
|
112 |
\references{
|
| 106 |
\url{https://www.debian.org/doc/debian-policy/ch-controlfields.html}.
|
113 |
\url{https://www.debian.org/doc/debian-policy/ch-controlfields.html},
|
| 107 |
|
- |
|
| 108 |
Note that \R does not require encoding in UTF-8, which is a recent
|
114 |
which requires control files to be encoded in UTF-8.
|
| 109 |
Debian requirement.
|
- |
|
| 110 |
}
|
115 |
}
|
| 111 |
|
116 |
|
| 112 |
\note{
|
117 |
\note{
|
| 113 |
As from \R{} 3.4.0, \sQuote{whitespace} in all cases includes newlines.
|
118 |
As from \R{} 3.4.0, \sQuote{whitespace} in all cases includes newlines.
|
| 114 |
}
|
119 |
}
|