| Line 42... |
Line 42... |
| 42 |
}
|
42 |
}
|
| 43 |
\references{
|
43 |
\references{
|
| 44 |
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
|
44 |
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
|
| 45 |
\emph{The New S Language}.
|
45 |
\emph{The New S Language}.
|
| 46 |
Wadsworth & Brooks/Cole.
|
46 |
Wadsworth & Brooks/Cole.
|
| - |
|
47 |
|
| - |
|
48 |
Murdoch, D. (2010).
|
| - |
|
49 |
\href{http://journal.r-project.org/archive/2010-2/RJournal_2010-2_Murdoch.pdf}{Source
|
| - |
|
50 |
References}. \emph{The R Journal} 2/2, 16-19.
|
| 47 |
}
|
51 |
}
|
| 48 |
\seealso{
|
52 |
\seealso{
|
| 49 |
\code{\link{scan}}, \code{\link{source}}, \code{\link{eval}},
|
53 |
\code{\link{scan}}, \code{\link{source}}, \code{\link{eval}},
|
| 50 |
\code{\link{deparse}}.
|
54 |
\code{\link{deparse}}.
|
| - |
|
55 |
|
| - |
|
56 |
The source reference information can be used for debugging (see e.g.
|
| - |
|
57 |
\code{\link{setBreakpoint}}) and profiling (see
|
| - |
|
58 |
\code{\link{Rprof}}). It can be examined by \code{\link{getSrcref}}
|
| - |
|
59 |
and related functions. More detailed information is available through
|
| - |
|
60 |
\code{\link{getParseData}}.
|
| 51 |
}
|
61 |
}
|
| 52 |
\details{
|
62 |
\details{
|
| 53 |
If \code{text} has length greater than zero (after coercion) it is used in
|
63 |
If \code{text} has length greater than zero (after coercion) it is used in
|
| 54 |
preference to \code{file}.
|
64 |
preference to \code{file}.
|
| 55 |
|
65 |
|
| Line 75... |
Line 85... |
| 75 |
\code{\link{srcfilecopy}} containing the text. If a character
|
85 |
\code{\link{srcfilecopy}} containing the text. If a character
|
| 76 |
string is used for \code{file}, a \code{\link{srcfile}} object
|
86 |
string is used for \code{file}, a \code{\link{srcfile}} object
|
| 77 |
referring to that file will be used.
|
87 |
referring to that file will be used.
|
| 78 |
|
88 |
|
| 79 |
When \code{srcfile} is a character string, error messages will
|
89 |
When \code{srcfile} is a character string, error messages will
|
| - |
|
90 |
include the name, but source reference information will not be added
|
| 80 |
include the name. When it is a \code{\link{srcfile}} object,
|
91 |
to the result. When \code{srcfile} is a \code{\link{srcfile}}
|
| 81 |
source reference information will be retained.
|
92 |
object, source reference information will be retained.
|
| 82 |
}
|
93 |
}
|
| 83 |
\value{
|
94 |
\value{
|
| 84 |
An object of type \code{"\link{expression}"}, with up to \code{n}
|
95 |
An object of type \code{"\link{expression}"}, with up to \code{n}
|
| 85 |
elements if specified as a non-negative integer.
|
96 |
elements if specified as a non-negative integer.
|
| 86 |
|
97 |
|
| Line 99... |
Line 110... |
| 99 |
Character strings in the result will have a declared encoding if
|
110 |
Character strings in the result will have a declared encoding if
|
| 100 |
\code{encoding} is \code{"latin1"} or \code{"UTF-8"}, or if
|
111 |
\code{encoding} is \code{"latin1"} or \code{"UTF-8"}, or if
|
| 101 |
\code{text} is supplied with every element of known encoding in a
|
112 |
\code{text} is supplied with every element of known encoding in a
|
| 102 |
Latin-1 or UTF-8 locale.
|
113 |
Latin-1 or UTF-8 locale.
|
| 103 |
}
|
114 |
}
|
| - |
|
115 |
|
| 104 |
\examples{
|
116 |
\examples{
|
| 105 |
cat("x <- c(1, 4)\n x ^ 3 -10 ; outer(1:7, 5:9)\n", file = "xyz.Rdmped")
|
117 |
cat("x <- c(1, 4)\n x ^ 3 -10 ; outer(1:7, 5:9)\n", file = "xyz.Rdmped")
|
| 106 |
# parse 3 statements from the file "xyz.Rdmped"
|
118 |
# parse 3 statements from the file "xyz.Rdmped"
|
| 107 |
parse(file = "xyz.Rdmped", n = 3)
|
119 |
parse(file = "xyz.Rdmped", n = 3)
|
| 108 |
unlink("xyz.Rdmped")
|
120 |
unlink("xyz.Rdmped")
|