Re: [R] converting help files with Sd2Rd

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun 22 Jan 2006 - 06:26:43 EST

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@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@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@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@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 Sun Jan 22 06:40:11 2006

This archive was generated by hypermail 2.1.8 : Sun 22 Jan 2006 - 10:13:18 EST