[R] question about scan()

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Wed May 15 09:12:43 CEST 2002


On Tue, 14 May 2002 joshi at engr.orst.edu wrote:

> Hi,
>
> I am using the scan function to read from a file. In
> general the syntax I am using is as follows:
>
> scan("myfile", list(a = "", b="", c="", d=""), sep=",")
>
> The file I am trying to read contains a #< in the 'd'
> field. When the file is read into an object, the d
> field comes as "" for that particular string.
>
> I guess the problem is because the # is used for
> commenting.
> My question is that if I want to read the #< anyways
> from the file, how do I do that?

Options:

1) Read the help page for scan, and set the appropriate argument
to make #  not a comment character, or (preferably)

2) Upgrade to the current version of R, where it will work with the
default values.


*Please* do remember to tell us your R version/platform when posting.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list