write.dbf(foreign)
write.dbf()所属R语言包:foreign
Write a DBF File
写DBF文件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function tries to write a data frame to a DBF file.
该函数尝试写一个数据框到DBF文件。
用法----------Usage----------
write.dbf(dataframe, file, factor2char = TRUE, max_nchar = 254)
参数----------Arguments----------
参数:dataframe
a data frame object.
数据框对象。
参数:file
a file name to be written to.
被写入到一个文件名。
参数:factor2char
logical, default TRUE, convert factor columns to character: otherwise they are written as the internal integer codes.
逻辑,默认的TRUE,转换因子列字符:否则,他们内部的整数代码编写的。
参数:max_nchar
The maximum number of characters allowed in a character field. Strings which exceed this will be truncated with a warning. See Details.
字符字段中允许的最大字符数。超过此字符串将被截断警告。查看详细信息。
Details
详情----------Details----------
Dots in column names are replaced by underlines in the DBF file, and names are truncated to 11 characters.
点被替换列名的DBF文件中强调,名称被截断为11个字符。
Only vector columns of classes "logical", "numeric", "integer", "character", "factor" and "Date" can be written. Other columns should be converted to one of these.
类的唯一向量列"logical","numeric","integer","character","factor"和"Date"可以写。其他列应该被转换为其中之一。
Maximum precision (number of digits including minus sign and decimal sign) for numeric is 19 - scale (digits after the decimal sign) which is calculated internally based on the number of digits before the decimal sign.
最大精度(包括减号和小数点的数字)的数字是19 - 规模(小数点后的位数)计算内部小数点前的数字为基础的。
The original DBASE format limited character fields to 254 bytes. It is said that Clipper and FoxPro can read up to 32K, and it is possible to write a reader that could accept up to 65535 bytes. (The documentation suggests that only ASCII characters can be assumed to be supported.) Readers expecting the older standard (which includes Excel 2003, Access 2003 and OpenOffice 2.0) will truncate the field to the maximum width modulo 256, so increase max_nchar only if you are sure the intended reader supports wider character fields.
原dBase格式有限的字符字段254个字节。据说,Clipper和FoxPro可以读取高达32K,是有可能写一个读者能够接受高达65535字节。 (文件表明,只有ASCII字符可以假设得到支持。)期待旧的标准(包括Excel 2003中,Access 2003和OpenOffice 2.0的)的读者,将截断该领域最大宽度256模,以便增加max_nchar只有当你确定的读者支持更宽的字符字段。
值----------Value----------
Invisible NULL.
无形的NULL。
注意----------Note----------
Other applications have varying abilities to read the data types used here. Microsoft Access reads "numeric", "integer", "character" and "Date" fields, including recognizing missing values, but not "logical" (read as 0,-1). Microsoft Excel understood all possible types but did not interpret missing values in character fields correctly (showing them as character nuls).
其他应用程序有不同的能力,阅读这里使用的数据类型。微软Access读取"numeric""integer","character"和"Date"领域,包括承认缺失值,而不是"logical"(0,-1)。 Microsoft Excel中了解所有可能的类型,但没有解释在字符字段遗漏值正确(显示字符nuls的)。
作者(S)----------Author(s)----------
Nicholas J. Lewin-Koh, modified by Roger Bivand and Brian Ripley;
shapelib by Frank Warmerdam.
参考文献----------References----------
参见----------See Also----------
read.dbf
read.dbf
举例----------Examples----------
str(warpbreaks)
try1 <- paste(tempfile(), ".dbf", sep = "")
write.dbf(warpbreaks, try1, factor2char = FALSE)
in1 <- read.dbf(try1)
str(in1)
try2 <- paste(tempfile(), ".dbf", sep = "")
write.dbf(warpbreaks, try2, factor2char = TRUE)
in2 <- read.dbf(try2)
str(in2)
unlink(c(try1, try2))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|