Here is a slightly shorter version:
## Start R and type:
setwd(path_to_.d_files)
pat <- "\\.d"
for(f in list.files(pattern = pat))
shell(paste("R CMD Sd2Rd", f, ">", sub(pat,
".Rd", f)))
q("no")
On 1/21/06, Uwe Ligges <ligges at statistik.uni-dortmund.de>
wrote:> Fredrik Lundgren wrote:
>
> > Dear list,
> >
> > I would like to convert several .d files to several .Rd files
> > in cmd.exe (Win XP home):
> >
> > R CMD Sd2Rd *.d
> > prints all files to the screen, I want the individual files saved to
> > disk
> >
> > R CMD Sd2Rd *.d > foo.Rd
> > puts them into one file, I want the individual files
> >
> > R CMD Sd2Rd *.d > *.Rd
> > complains:
> > Wrong syntax for file name, directory name eller volyme etiquette.
> >
> > R CMD Sd2Rd foo.d > foo.Rd
> > works OK
> >
> >
> > How can I transform several .d files to several .Rd files with one
> > command?
>
>
> Beside shell programming, you can also use R ...
>
> ## Start R and type:
> setwd(path_to_.d_files)
> f <- list.files(pattern="\\.d$")
> fo <- paste(sapply(strsplit(f, "\\."), "[", 1),
".Rd", sep="")
> for(i in seq(along=f))
> shell(paste("R CMD Sd2Rd", f[i], ">", fo[i]))
> q("no")
>
>
> Uwe Ligges
>
>
>
>
> > Best wishes Fredrik
> >
> > ______________________________________________
> > R-help at 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
>
> ______________________________________________
> R-help at 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
>