guess.sep(tkWidgets)
guess.sep()所属R语言包:tkWidgets
Automatically determines whether a data file has a header and
自动确定数据文件是否有一个头,
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function reads a few lines from a data text file and determines whether a header exists, what the delimiter, and what data type each column is for a given file.
该函数读取几行,从数据的文本文件,并确定是否存在一个头,什么分隔符,和什么样的数据输入每一列是一个给定的文件。
用法----------Usage----------
guess.sep(file.name, numLine = 5, seps = "", isFile = TRUE)
guess.header(twoLines, sep)
find.type(file.name, sep, header = FALSE, numLine = 5, isFile = TRUE)
charOrNum(vect)
getRowNames(file.name, sep, header, skip)
参数----------Arguments----------
参数:file.name
file.name a character string for the name of the file of interests
file.name利益的文件名称的字符串
参数:numLine
n an integer or character indicating the total number of lines to be read from the file for making the determination
n整数或字符表示决心可以从文件中读取的行的总数
参数:seps
seps a vector of characters of potential delimiters to be used to make the determination. Default delimiters include " ", ",", ";", and "\t". Anything inaddition to the default will have to be included in seps
seps被用来进行测定的潜在分隔符的字符向量。默认分隔符包括“”,“”,,“;”,“\ T”。什么inaddition默认将被包括在SEPS
参数:twoLines
twoLines a vector of character string including the first two lines of a file that will be used to determine whether the file has a header
twoLines矢量字符串包括一个将被用来确定文件是否有一个头文件的前两线
参数:sep
sep a character for the delimiter used to separate columns in a file
sep单独列在一个文件中使用的分隔符字符
参数:vect
vect a vector of character or numeric string
vect矢量字符或数字字符串
参数:header
header a boolean indicating whether a file has headers
header一个布尔值,指示文件是否有头
参数:isFile
isFile a boolean that is TRUE when file.name is a file or FALSE an object
isFile一个布尔值,这是真的时,file.name对象是一个文件或FALSE
参数:skip
skip an integer for the number of lines to be skiped using read.table
skip用一个整数的行数被skiped read.table
Details
详情----------Details----------
guess.sep calls guess.sep and find.type to determine the header, delimiter, and column data type of a file.
guess.sep调用guess.sep和find.type确定头,分隔符和列的数据文件类型。
charOrNum determines which elements of a vector are numeric or character.
charOrNum确定其中一个向量的元素是数字或字符。
值----------Value----------
This function returns a list containing
这个函数返回一个列表,其中包含
参数:header
TRUE if there is a header and FALSE otherwise
TRUE,如果有一个头,否则返回FALSE
参数:separater
A character string indicating the delimiter used
一个字符串,指示分隔符使用
参数:type
A vector of character strings that are either character or numeric
一个字符串,也可以是字符或数字的向量
作者(S)----------Author(s)----------
Jianhua Zhang
参见----------See Also----------
fileWizard
fileWizard
举例----------Examples----------
# Create a temp file[创建一个临时文件]
tempData <- matrix(1:20, ncol = 4)
write.table(tempData, file = "tempData", quote = FALSE, sep =
"\t", row.names = FALSE, col.names = TRUE)
guess.sep("tempData")
unlink("tempData")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|