count.fields(utils)
count.fields()所属R语言包:utils
Count the Number of Fields per Line
计算每行的字段数
译者:生物统计家园网 机器人LoveR
描述----------Description----------
count.fields counts the number of fields, as separated by sep, in each of the lines of file read.
count.fields的若干领域,sepfile读的每个线分离,计数。
用法----------Usage----------
count.fields(file, sep = "", quote = "\"'", skip = 0,
blank.lines.skip = TRUE, comment.char = "#")
参数----------Arguments----------
参数:file
a character string naming an ASCII data file, or a connection, which will be opened if necessary, and if so closed at the end of the function call.
一个字符串,命名ASCII数据文件,或一个connection,如果必要的话,这将被打开,如果在函数调用结束封闭。
参数:sep
the field separator character. Values on each line of the file are separated by this character. By default, arbitrary amounts of whitespace can separate fields.
字段分隔符。文件的每一行的值是通过这个角色分离。默认情况下,任意数量的空白可以分离领域。
参数:quote
the set of quoting characters
引用字符集
参数:skip
the number of lines of the data file to skip before beginning to read data.
行的数据文件数量开始读取数据前跳过。
参数:blank.lines.skip
logical: if TRUE blank lines in the input are ignored.
逻辑:如果TRUE在输入空行被忽略。
参数:comment.char
character: a character vector of length one containing a single character or an empty string.
性格:特征向量的长度包含单个字符或一个空字符串之一。
Details
详情----------Details----------
This used to be used by read.table and can still be useful in discovering problems in reading a file by that function.
这用来read.table使用,仍然可以在发现问题,在阅读文件,由该函数非常有用。
For the handling of comments, see scan.
有关处理意见,看到scan。
值----------Value----------
A vector with the numbers of fields found.
发现领域的数字向量。
参见----------See Also----------
read.table
read.table
举例----------Examples----------
cat("NAME", "1:John", "2aul", file = "foo", sep = "\n")
count.fields("foo", sep = ":")
unlink("foo")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|