The R Project SVN R

Rev

Rev 13932 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13932 Rev 16016
Line 1... Line 1...
1
\name{count.fields}
1
\name{count.fields}
2
\title{Count the Number of Fields per Line}
2
\title{Count the Number of Fields per Line}
3
\usage{
3
\usage{
4
count.fields(file, sep = "", quote = "\"'", skip = 0,
4
count.fields(file, sep = "", quote = "\"'", skip = 0,
5
             blank.lines.skip = TRUE)
5
             blank.lines.skip = TRUE, comment.char = "#")
6
}
6
}
7
\alias{count.fields}
7
\alias{count.fields}
8
\arguments{
8
\arguments{
9
  \item{file}{a character string naming an ASCII data file, or a
9
  \item{file}{a character string naming an ASCII data file, or a
10
    \code{\link{connection}}, which will be opened if necessary,
10
    \code{\link{connection}}, which will be opened if necessary,
Line 19... Line 19...
19
  \item{skip}{the number of lines of the data file to skip before
19
  \item{skip}{the number of lines of the data file to skip before
20
    beginning to read data.}
20
    beginning to read data.}
21
 
21
 
22
  \item{blank.lines.skip}{logical: if \code{TRUE} blank lines in the
22
  \item{blank.lines.skip}{logical: if \code{TRUE} blank lines in the
23
    input are ignored.}
23
    input are ignored.}
-
 
24
 
-
 
25
  \item{comment.char}{character: a character vector of length one
-
 
26
    containing a single character or an empty string.}
24
}
27
}
25
\description{
28
\description{
26
  \code{count.fields} counts the number of fields, as separated by
29
  \code{count.fields} counts the number of fields, as separated by
27
  \code{sep}, in each of the lines of \code{file} read.
30
  \code{sep}, in each of the lines of \code{file} read.
28
}
31
}
29
\details{
32
\details{
30
  This used to be used by \code{\link{read.table}} and can still be
33
  This used to be used by \code{\link{read.table}} and can still be
31
  useful in discovering problems in reading a file by that function.
34
  useful in discovering problems in reading a file by that function.
-
 
35
 
-
 
36
  For the handling of comments, see \code{\link{scan}}.
32
}
37
}
33
\value{
38
\value{
34
  A vector with the numbers of fields found.
39
  A vector with the numbers of fields found.
35
}
40
}
36
\seealso{
41
\seealso{