From edd at debian.org  Sun Jan 24 03:58:33 2016
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sat, 23 Jan 2016 20:58:33 -0600
Subject: [Rd] URL for a vignette on CRAN?
In-Reply-To: <56A43697.4070408@prodsyse.com>
References: <56A43697.4070408@prodsyse.com>
Message-ID: <22180.15833.65105.538323@max.nulle.part>


Spencer,

On 23 January 2016 at 20:27, Spencer Graves wrote:
|        How can I get a full URL for anything on CRAN?
|
|        Using Safari, Google Chrome, and Firefox under OS X 10.11.2, I 
| select a CRAN mirror from "www.r-project.org" and get a URL like 
| "https://cran.rstudio.com/".  Then I select "packages" and get a 
| different web page, but the URL displayed doesn't change.  I'd like to 
| access the full URL of a vignette in a package, but modern web browsers 
| hide that detail.

1)  All CRAN mirrors use the same layout.

2)  Using a CDN such as cran.rstudio.com, or now the equivalent
    cloud.r-project.org is 'A Good Thing (TM)' because the resulting location
    will almost always be close to any reader -- as it adapts based on the
    reader location. See Wikipedia on 'Content Deliver Networks' for more details.

3)  http://cloud.r-project.org/package=sos is preferred for any pkg, here
    your sos package

4)  It flattens to https://cloud.r-project.org/web/packages/sos/index.html

5)  You can derive the vignette from that page or just construct it:
        https://cloud.r-project.org/web/packages/sos/vignettes/sos.pdf
    This is of the form ${SERVER}/web/packages/${PACKAGE}/${VIGNETTE}

I have been using url such as the one in 5) for a long while. Works like a charm.

Now, from your vague text above, maybe you prefer NOT to use a CDN. In that
case, insert an _explicit_ server, say Berkeley's mirror and you get
       https://cran.cnr.berkeley.edu/web/packages/sos/vignettes/sos.pdf
but that is _still_ of the form ${SERVER}/web/packages/${PACKAGE}/${VIGNETTE}
yet simple uses a different value for ${SERVER}.

Makes sense?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] URL for a vignette on CRAN?
Dirk Eddelbuettel