Re: [R] add counter to file name + dir.create

From: HBaize <HBaize_at_buttecounty.net>
Date: Fri, 20 Jun 2008 08:57:48 -0700 (PDT)

## Create directory with unique name based on values of x and y dir.create(paste(PathName, x,"_",y,sep=""))

Yasin Hajizadeh wrote:
>
> Hi all
>
> I have 2 loops with 2 counters, say outer loop counter is X and inner
> loop counter is Y. In outer loop a data file with known number of columns
> and unknown number of rows is generated in each script iteration. What
> inner loop should do is to read this file line by line and generate a
> directory for each row, then put the elements of that row in a text file
> insides the generated directory and then execute another script inside
> that directory ( system command )
> I have 2 questions: I want the name of the directory to be unique and I
> am going to generate them by dir.create ( tell me if there is a better way
> ), so In the name which will be created, I want to add X, Y, so all the
> files generated at each inner loop and in next iterationsbe unique. How I
> can add X and Y to the file name?
> and the second question is general comments on the script structure
> itself.
>
> Thank you so much ( IN ADVANCE )
>
> Cheers
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
View this message in context: http://www.nabble.com/add-counter-to-file-name-%2B-dir.create-tp18010573p18032665.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 20 Jun 2008 - 19:02:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 Jun 2008 - 20:32:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive