[R] - Function to export files

From: Ana Patricia Martins <ana.pmartins_at_ine.pt>
Date: Fri 10 Feb 2006 - 20:55:46 EST


Hi all,  

I've done a simple function for import files but can't do the same think for export files.

Could you help me solve it?

Thanks in advance for your cooperation.  

 wd<-"C:\\Teste"  

import<-function(wd0){

        wd1<-paste(wd,wd0,"Input\\.", sep = "\\")

            d<-read.table(choose.files(default = wd1, caption = "Escolher o Ficheiro de Input - *.txt ", multi = FALSE), head=T,sep="\t",dec=".")

            return(d)}  

reg<-"Region1"

import(reg)  

reg<-"Region2"

import(reg)    

export<-function(wd0,var1,trim){

        wd1<-paste(wd,wd0,trim,"Output\\.", sep = "\\")

            d<-
write.table(var1,"C:/Teste/Region/Trim/Output/var1.txt",sep="\t",dec="." ,row.names=F)

            return(d)}  

reg<-"Region1"

export(reg,Apur,1t05)

export(reg,Apur,2t05)    

Atenciosamente

Ana Patricia Martins


Serviço Métodos Estatísticos

Departamento de Metodologia Estatística

Telef: 218 426 100 - Ext: 3210

E-mail: <mailto:ana.pmartins@ine.pt> ana.pmartins@ine.pt  

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 10 21:42:37 2006

This archive was generated by hypermail 2.1.8 : Mon 13 Feb 2006 - 22:40:18 EST