[R] Customizing x-axis with stripchart

Gabor Grothendieck ggrothendieck at gmail.com
Sun Nov 25 04:53:41 CET 2007


On Nov 24, 2007 10:37 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>
> On 24/11/2007 9:07 PM, Gabor Grothendieck wrote:
> > On Nov 24, 2007 8:56 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> >>>> But it really isn't that hard to do:  just type fix(stripchart), and it
> >>>> will be pretty clear what to delete (the calls to box(), axis(), and
> >>>> Axis()).
> >>> or download it from:
> >>>
> >>> https://svn.r-project.org/R/trunk/src/library/graphics/R/stripchart.R
> >>>
> >>> and then
> >>>
> >>> source("stripchart.R")
> >> Note that there are other changes in that version too:  stripchart() is
> >> a generic function, and it handles formulas more like boxplot() does
> >> than in 2.6.x or earlier.
> >>> (Is there some way to source it directly without downloading it and
> >>> then sourcing it?
> >>> source() does not appear to work directly with https:)
> >> In Windows if you start R with the --internet2 option (which uses IE
> >> APIs instead of regular networking) and Windows trusts the certificate
> >> authority, then https urls can be handled.  But svn.r-project.org is
> >> self-signed, so it doesn't help in this case.
> >>
> >
> > Thanks.  It would be nice if some way could be developed/determined
> > to allow sourcing from the R svn to happen.
> >
> > I can think of other situations too where I wanted just one file from it
> > without moving to the new R version.
>
> Does wget support https?  If so, you could probably put together
> something involving a pipe.
>

I just tried it and you are right -- wget works.  So this does it:

my.source <- function(url) {
   on.exit(unlink(tmp))
   tmp <- tempfile()
   download.file(url, dest = tmp, method = "wget")
   source(tmp)
}

stripchart.url <-
"https://svn.r-project.org/R/trunk/src/library/graphics/R/stripchart.R"
my.source(stripchart.url)

Maybe source could be modified to have a method= argument so that this could be
done without a custom source function?



More information about the R-help mailing list