Re: [Rd] [R] string problems with "\\" (Windows)
Moved to r-devel. Perhaps basename should take an optional separator argument so that basename(x, "\\") could be used to override the default behavior. On 7/9/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > basename() works. If you're on a system that doesn't think \\ is a path > separator, you could do something like > > x <- "C:\\Documents and Settings\\myName\\My > Documents\\RProjects\\Project1\\file.name.csv" > basename(gsub('','/',x)) > > Duncan Murdoch > > Charles Annis, P.E. wrote: > > Greetings, R-ians: > > > > I'm using R 2.3.1 on WindowsXP. > > > > I need to find the name of a file at the end of a sting that contains the > > path + file, with the problematic "\\" as separators. > > > > The string looks something like this: > > > > "C:\\Documents and Settings\\myName\\My Documents\\R > > Projects\\Project1\\file.name.csv" > > > > What I want is "file.name.csv" > > > > Currently I use the name of the project as the splitter in > > > > strsplit(string.name, split="Project1", extended = FALSE) > > > > This works, of course, but I won't always be using folder Project1, so I > > need a more universal way to find the name of a file at the end of a string > > with "\\" separators. > > > > Can I get there from here? (I've looked through previous R-help listing of > > similar problems but if it's there, I missed it.) > > > > Thanks. > > > > > > Charles Annis, P.E. > > > > [EMAIL PROTECTED] > > phone: 561-352-9699 > > eFax: 614-455-3265 > > http://www.StatisticalEngineering.com > > > > > > __ > > 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-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] vignette("introduction") causes "Error in sprintf(" (PR#9069)
Full_Name: Chris Evans Version: 2.3.1 OS: Windoze XP Submission from: (NULL) (217.34.100.197) If I give "vignette("introduction")" I get: Error in sprintf(gettext(fmt, domain = domain), ...) : use format %s for character objects vignette() works for some other vignettes and "vignette()" gets me a list of vignettes and shows three with the name "introduction" (on my package collection). I don't know if that's related to this. Happy to try anything you want done (except perhaps trying to install the bleeding edge version of R!) Chris __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] vignette("introduction") causes "Error in sprintf(" (PR#9069)
Same for me. Looking through the output of vignette I noticed that both the ggplot and reshape packages have a vignette called "introduction" in my case and either of the following brings up the associated vignette (as opposed to the error message): vignette("introduction", "ggplot") vignette("introduction", "reshape") On 7/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Full_Name: Chris Evans > Version: 2.3.1 > OS: Windoze XP > Submission from: (NULL) (217.34.100.197) > > > If I give "vignette("introduction")" I get: > Error in sprintf(gettext(fmt, domain = domain), ...) : >use format %s for character objects > > vignette() works for some other vignettes and "vignette()" gets me a list of > vignettes and shows three with the name "introduction" (on my package > collection). I don't know if that's related to this. > > Happy to try anything you want done (except perhaps trying to install the > bleeding edge version of R!) > > Chris > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] vignette("introduction") causes "Error in sprintf(" (PR#9069)
Gabor Grothendieck sent the following at 09/07/2006 19:02: > Same for me. Looking through the output of vignette > I noticed that both the ggplot and reshape packages have > a vignette called "introduction" in my case and either of > the following brings up the associated vignette (as opposed > to the error message): > > vignette("introduction", "ggplot") > vignette("introduction", "reshape") Aha, works for me too. Sorry, I probably should have been able to work that out myself. So: not so much a bug, more a wish as it might be good if the vignette code checked for multiple vignettes with the same name and returned a choice or a message warning you that there are multiples. Should I do a follow-up to that bug? Many thanks to you and all for R: incredible resource. Chris -- Chris Evans <[EMAIL PROTECTED]> Professor of Psychotherapy, Nottingham University; Consultant Psychiatrist in Psychotherapy, Rampton Hospital; Research Programmes Director, Nottinghamshire NHS Trust; Hon. SL Institute of Psychiatry, Hon. Con., Tavistock & Portman Trust **If I am writing from one of those roles, it will be clear. Otherwise** **my views are my own and not representative of those institutions** __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] vignette("introduction") causes "Error in sprintf(" (PR#9069)
If there are no other instances of multiple vignettes with the same name perhaps the fastest solution is just for the author of those two vignettes to change them to each be unique. On 7/9/06, Chris Evans <[EMAIL PROTECTED]> wrote: > Gabor Grothendieck sent the following at 09/07/2006 19:02: > > Same for me. Looking through the output of vignette > > I noticed that both the ggplot and reshape packages have > > a vignette called "introduction" in my case and either of > > the following brings up the associated vignette (as opposed > > to the error message): > > > > vignette("introduction", "ggplot") > > vignette("introduction", "reshape") > > Aha, works for me too. Sorry, I probably should have been able to work > that out myself. > > So: not so much a bug, more a wish as it might be good if the vignette > code checked for multiple vignettes with the same name and returned a > choice or a message warning you that there are multiples. Should I do a > follow-up to that bug? > > Many thanks to you and all for R: incredible resource. > > Chris > > -- > Chris Evans <[EMAIL PROTECTED]> > Professor of Psychotherapy, Nottingham University; > Consultant Psychiatrist in Psychotherapy, Rampton Hospital; > Research Programmes Director, Nottinghamshire NHS Trust; > Hon. SL Institute of Psychiatry, Hon. Con., Tavistock & Portman Trust > **If I am writing from one of those roles, it will be clear. Otherwise** > > **my views are my own and not representative of those institutions** > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Unexpected difference in Bounding Box of PDF graphics between 2.3.1p and 2.4 (PR#9070)
Full_Name: Wolfgang Huber Version: R version 2.4.0 Under development (unstable) (2006-07-09 r38523) OS: i686-pc-linux-gnu Submission from: (NULL) (62.253.128.15) There appears to be unintentional behaviour in the size of the bounding box for PDF graphics produced with the current R2.4, compared to 2.3.1. I posted two PDF files, both produced with the same R script below, but different versions of R: http://www.ebi.ac.uk/~huber/pub The code is here: pdf(file=sprintf("test-%s.pdf", version$"svn rev"), width=4, height=4) par(mai=par("mai")[rep(1:2,2)]) x = seq(0, 10*pi, length=3000) plot(x*cbind(sin(x),cos(x)), type="l", col="mistyrose", lwd=3) sink(textConnection("s", "w")) options(width=40) print(sessionInfo(), width=30) sink() text(-30, 30-4*seq(along=s), s, adj=c(0,0.5), cex=0.7) dev.off() and one of the differences between the resulting PDF files is: test-38323.pdf: /MediaBox [0 0 288 288] test-38523.pdf: /MediaBox [0 0 595 841] The former corresponds to 4x4 inches, the latter to 21cm x 29.67cm. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] string problems with "\\" (Windows)
Gabor Grothendieck wrote: > Moved to r-devel. > > Perhaps basename should take an optional separator argument > so that > >basename(x, "\\") > > could be used to override the default behavior. > That seems like a reasonable idea, but not very high priority. Anyone want to contribute a patch (to the source and man page)? Duncan Murdoch > On 7/9/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> basename() works. If you're on a system that doesn't think \\ is a path >> separator, you could do something like >> >> x <- "C:\\Documents and Settings\\myName\\My >> Documents\\RProjects\\Project1\\file.name.csv" >> basename(gsub('','/',x)) >> >> Duncan Murdoch >> >> Charles Annis, P.E. wrote: >> >>> Greetings, R-ians: >>> >>> I'm using R 2.3.1 on WindowsXP. >>> >>> I need to find the name of a file at the end of a sting that contains the >>> path + file, with the problematic "\\" as separators. >>> >>> The string looks something like this: >>> >>> "C:\\Documents and Settings\\myName\\My Documents\\R >>> Projects\\Project1\\file.name.csv" >>> >>> What I want is "file.name.csv" >>> >>> Currently I use the name of the project as the splitter in >>> >>> strsplit(string.name, split="Project1", extended = FALSE) >>> >>> This works, of course, but I won't always be using folder Project1, so I >>> need a more universal way to find the name of a file at the end of a string >>> with "\\" separators. >>> >>> Can I get there from here? (I've looked through previous R-help listing of >>> similar problems but if it's there, I missed it.) >>> >>> Thanks. >>> >>> >>> Charles Annis, P.E. >>> >>> [EMAIL PROTECTED] >>> phone: 561-352-9699 >>> eFax: 614-455-3265 >>> http://www.StatisticalEngineering.com >>> >>> >>> __ >>> 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-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel