write.foreign(foreign)
write.foreign()所属R语言包:foreign
Write Text Files and Code to Read Them
读写文本文件和代码来读取
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function exports simple data frames to other statistical packages by writing the data as free-format text and writing a separate file of instructions for the other package to read the data.
此功能简单的数据框导出其他统计软件包写自由格式的文本数据和其他包读取数据写入单独的文件中的指令。
用法----------Usage----------
write.foreign(df, datafile, codefile,
package = c("SPSS", "Stata", "SAS"), ...)
参数----------Arguments----------
参数:df
A data frame
数据框
参数:datafile
Name of file for data output
数据输出文件名
参数:codefile
Name of file for code output
代码输出的文件名
参数:package
Name of package
软件包名称
参数:...
Other arguments for the individual writeForeign functions
个人writeForeign功能其他参数
Details
详情----------Details----------
The work for this function is done by foreign:::writeForeignStata, foreign:::writeForeignSAS and foreign:::writeForeignSPSS. To add support for another package, eg Systat, create a function writeForeignSystat with the same first three arguments as write.foreign. This will be called from write.foreign when package="Systat".
此功能的工作是通过foreign:::writeForeignStata,foreign:::writeForeignSAS和foreign:::writeForeignSPSS。要添加另一个包的支持,如SYSTAT,创建一个函数writeForeignSystat具有相同的前三个参数write.foreign。这将被称为write.foreign时package="Systat"。
Numeric variables and factors are supported for all packages: dates and times (Date, dates, date, and POSIXt classes) and logical vectors are also supported for SAS and characters are supported for SPSS.
数值变量和因素,所有软件包支持:日期和时间(Datedates,date,POSIXt类)和逻辑向量,也支持SAS和字符SPSS软件支持。
For package="SAS" there are optional arguments dataname = "rdata" taking a string that will be the SAS data set name, validvarname taking either "V6" or "V7", and libpath = NULL taking a string that will be the directory where the target SAS datset will be written when the generated SAS code been run.
package="SAS"有可选参数dataname = "rdata"一个字符串,将SAS数据集的名称,validvarname服用要么"V6"或"V7",<X >一个字符串,将目标的SAS datset时,将写入生成的SAS代码运行的目录。
值----------Value----------
Invisible NULL.
无形的NULL。
作者(S)----------Author(s)----------
Thomas Lumley and Stephen Weigand
举例----------Examples----------
datafile<-tempfile()
codefile<-tempfile()
write.foreign(esoph,datafile,codefile,package="SPSS")
file.show(datafile)
file.show(codefile)
unlink(datafile)
unlink(codefile)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|