[R-pkg-devel] -fbounds-check on develop version of Win-builder

2017-06-09 Thread Benjamin Christoffersen
Dear sirs

I am writing regarding a question for the package dynamichazard which
I am the author of and the -fbounds-check flag used in R develop in
Win-Builder.

R develop version has following flags added to the Fortran rule
compared with R release on Win-builder: -pedantic -fbounds-check

Particularly, the line for dchur.o when building dynamichazard on the
release version is:
d:/Compiler/gcc-4.9.3/mingw_32/bin/gfortran -O3 -mtune=core2 -c
dchur.f -o dchur.o

and the line on the develop version is:
d:/Compiler/gcc-4.9.3/mingw_32/bin/gfortran -pedantic -fbounds-check
-O3 -mtune=core2 -c dchur.f -o dchur.o

The latter causes the following error when the tests on the package is run:
  At line 1 of file dchur.f
  Fortran runtime error: Actual string length is shorter than the
declared one for dummy argument 'uplo' (0/1)

The version of dynamichazard I submitted to the Win-Builder is at:
https://github.com/boennecd/dynamichazard/tree/d3a8b7d5f39fbfcc14df008f1fdd71f4f38ac25a

The relevant code in dynamichazard/src/LAPACK_BLAS_wrapper.cpp is:
#include 
#include 
#include 

extern "C"
{
  void F77_NAME(dchur)(
  const char *,   // UPLO
  const char *,   // TRANS
  int*,// N
  int*,// M
  double*, // R
  int*,// LDR
  double*, // X
  double*, // Z
  int*,// LDZ
  double*, // Y
  double*, // RHO
  double*, // C
  double*, // S
  int* // INFO
  );
}

void ddhazard_dchur(double *R, double *x, int n, int ldr){
  int info;

  double *c = new double[n];
  double *s = new double[n];

  int m = 0;
  int ldz = 1;
  double z, y, rho;

  F77_CALL(dchur)(
  "L",
  "N",
  , , R, ,
  x, , , , , c, s, );

  // code abbreviated
};

// code abbreviated

I have tried to re-produce the error with R release on my own laptop
running Windows but failed to do so. Here is an example:
$ ./tmp.sh
+ cat foo.cpp
#include 

extern "C" {
void bar_(const char *in);
}

int main()
{
std::cout << "Running main" << std::endl;
bar_("F");
return 0;
}
+ cat bar.f
  subroutine bar(INPUT)
  CHARACTER INPUT

  print *, input
  end
+ c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -O2 -Wall -mtune=core2 -c
foo.cpp -o foo.o
+ c:/Rtools/mingw_32/bin/gfortran -pedantic -fbounds-check -O3 -c bar.f -o bar.o
+ c:/Rtools/mingw_32/bin/g++ -o foo foo.o bar.o -lgfortran -lm -lquadmath
+ ./foo.exe
Running main
 F
+ Rscript.exe -e R.version
   _
platform   x86_64-w64-mingw32
arch   x86_64
os mingw32
system x86_64, mingw32
status
major  3
minor  4.0
year   2017
month  04
day21
svn rev72570
language   R
version.string R version 3.4.0 (2017-04-21)
nickname   You Stupid Darkness
+ head -1 c:/Rtools/Rtools.txt
  Rtools Collection 3.4.0.1962

The example is not with a dynamic link library but comparable to the
example here: 
https://code.launchpad.net/~fluidity-core/fluidity/gmsh-on-sphere/+merge/99395/comments/216834

I stupidly tried to solve the problem in the current version 0.3.1 of
dynamichazard on CRAN by adding this rule in Makevars.win:
dchur.o:
$(F77) $(filter-out -fbounds-check,$(ALL_FFLAGS)) -c dchur.f -o dchur.o

This makes all my tests pass including those that uses the
ddhazard_dchur C++ function on the develop version of Win-builder.
However, it violates the second paragraph of "1.2.1 Using Makevars" in
"Writing R Extensions".

Please, let me know if I have made an obvious mistake or if there is a
straightforward solution.

Sincerely yours
Benjamin Christoffersen

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [Rd] [bug] droplevels() also drop object attributes (comment…)

2017-06-09 Thread Martin Maechler
> Suharto Anggono Suharto Anggono via R-devel 
> on Thu, 8 Jun 2017 16:43:48 + writes:

> * Be careful with "contrasts" attribute. If the number of levels is 
reduced, the original contrasts matrix is no longer valid.
> Example case:
> x <- factor(c("a", "a", "b", "b", "b"), levels = c("a", "b", "c"))
> contrasts(x) <- contr.treatment(levels(x), contrasts=FALSE)[, -2, 
drop=FALSE]
> droplevels(x)

> * If function 'factor' is changed, make sure that as.factor(x) and 
factor(x) is the same for 'x' where is.integer(x) is TRUE. Currently, 
as.factor() is treated specially.

> * It is possible that names(x) is not attr(x, "names"). For example, 'x' 
is a "POSIXlt" object.
> Look at this example, which works in R 3.3.2.
> x <- as.POSIXlt("2017-01-01", tz="UTC")
> factor(x, levels=x)


> By the way, in NEWS, in "CHANGES IN R 3.4.0", in "SIGNIFICANT 
USER-VISIBLE CHANGES", there is "factor() now uses order() to sort its levels". 
It is false. Code of function 'factor' in R 3.4.0 
(https://svn.r-project.org/R/tags/R-3-4-0/src/library/base/R/factor.R) still 
uses 'sort.list', not 'order'.

> 
> Martin Maechler 
> on Tue, 16 May 2017 11:01:23 +0200 writes:

> Serge Bibauw 
> on Mon, 15 May 2017 11:59:32 -0400 writes:

>>> Hi,

>>> Just reporting a small bug… not really a big deal, but I
>>> don’t think that is intended: droplevels() also drops all
>>> object’s attributes.

>> Yes.  The help page for droplevels (or the simple
>> definition of 'droplevels.factor') clearly indicate that
>> the method for factors is really just a call to factor(x,
>> exclude = *)

>> and that _is_ quite an important base function whose
>> semantic should not be changed lightly. Still, let's
>> continue :

>> Looking a bit, I see that the current behavior of factor()
>> {and hence droplevels} has been unchanged in this respect
>> for the whole history of R, well, at least for more than
>> 17 years (R 1.0.1, April 2000).

>> I'd agree there _is_ a bug, at least in the documentation
>> which does *not* mention that currently, all attributes
>> are dropped but "names", "levels" (and "class").

>> OTOH, factor() would only need a small change to make it
>> preserve all attributes (but "class" and "levels" which
>> are set explicitly).

>> I'm sure this will break some checks in some packages.  Is
>> it worth it?

>> e.g., our own R  QC checks currently check (the printing of) the
>> following (in tests/reg-tests-2.R ):

>> > ## some tests of factor matrices
>> > A <- factor(7:12)
>> > dim(A) <- c(2, 3)
>> > A
>> [,1] [,2] [,3]
>> [1,] 7911  
>> [2,] 810   12  
>> Levels: 7 8 9 10 11 12
>> > str(A)
>> factor [1:2, 1:3] 7 8 9 10 ...
>> - attr(*, "levels")= chr [1:6] "7" "8" "9" "10" ...
>> > A[, 1:2]
>> [,1] [,2]
>> [1,] 79   
>> [2,] 810  
>> Levels: 7 8 9 10 11 12
>> > A[, 1:2, drop=TRUE]
>> [1] 7  8  9  10
>> Levels: 7 8 9 10
>> 
>> with the proposed change to factor(),
>> the last call would change its result:
>> 
>> > A[, 1:2, drop=TRUE]
>> [,1] [,2]
>> [1,] 79   
>> [2,] 810  
>> Levels: 7 8 9 10

>> because 'drop=TRUE' calls factor(..) and that would also
>> preserve the "dim" attribute.  I would think that the
>> changed behavior _is_ better, and is also according to
>> documentation, because the help page for [.factor explains
>> that 'drop = TRUE' drops levels, but _not_ that it
>> transforms a factor matrix into a factor (vector).

>> Martin

> I'm finally coming back to this.
> It still seems to make sense to change factor() and hence
> droplevels() behavior here, and plan to commit this change
> within a day.

I had committed these (including regression checks and *.Rd
changes) as  svn rev 72771  to R-devel..

As Suharto also warned, this change had more severe effects in
package space than I expected.

Notably the fact that the "dim" attribute was kept there, lead
to several errors in CRAN packages / their checks.

Of course, I could have patched the change by explicitely *not*
keeping certain attributes such as "dim" and "contrasts".

But I've decided that in this case it seems more rational,
notably for back compatibility reasons, to keep factor()'s and hence
droplevel()'s behaviour  and rather document it.
So the "bug" is solved differently, by documenting the behavior
that has been in place "forever".

With svn's 72773, we are back to the previous state with the
addition of mentioning in help(factor) that attributes are "lost".

Martin Maechler
ETH Zurich

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Bioc-devel] Question about creating a bulleted list without bullets in rstudio

2017-06-09 Thread Martin Morgan

On 06/09/2017 11:08 AM, Aimin Yan wrote:

I have a question about making R package documentation.

I use rstudio to make this package. In my test.R file, I have code like the
following:

...

#' @return Returns a dataframe with several following variables (columns)
#'   \itemize{
#'  \item geneID: Gene ID
#'  \item geneWisePvalue: each gene is represented by the smallest
p-value among its features
#'  \item sig.gene: a gene is significant (1) or not (0)
#'  \item mostSigDeFeature: the most significant gene feature
#'  \item numFeature: number of gene features within the gene
#' }

...

After rebuild, I get help documentation like the following:
Value

Returns a dataframe with several following variables (columns)

-

geneID: Gene ID
-

geneWisePvalue: each gene is represented by the smallest p-value among
its features
-

sig.gene: a gene is significant (1) or not (0)
-

mostSigDeFeature: the most significant gene feature
-

numFeature: number of gene features within the gene


Now, I want to get the following:
Value

Returns a dataframe with several following variables (columns)

  geneID: Gene ID

  geneWisePvalue: each gene is represented by the smallest
p-value among its features

  sig.gene: a gene is significant (1) or not (0)

  mostSigDeFeature: the most significant gene feature

  numFeature: number of gene features within the gene

That is to say, to create a a bulleted list without bullets.

Does anyone has idea on how to change settings in test.R file?


I looked at

https://github.com/wch/r-source/blob/trunk/src/library/stats/man/lm.Rd#L122

which leads me to

 #' @return
 #' \item{foo}{bar}

works.

Also, from RShowDoc("R-exts")

  \describe{
\item{foo}{bar}
  }

might also be relevant in non-\value sections.

Martin




Thank you,

Aimin

[[alternative HTML version deleted]]

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel




This email message may contain legally privileged and/or...{{dropped:2}}

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Bioc-devel] Question about creating a bulleted list without bullets in rstudio

2017-06-09 Thread James W. MacDonald
https://stackoverflow.com/questions/9267584/when-documenting-in-roxygen-how-do-i-make-an-itemized-list-in-details

See last answer. It's not clear to me if you can have bulletted lists in
all of the sections of an Rd file or not, so it may be that the 'value'
section can't have bulletted lists. I don't see anything in the R-exts
manual that precludes it, however.

On Fri, Jun 9, 2017 at 11:08 AM, Aimin Yan  wrote:

> I have a question about making R package documentation.
>
> I use rstudio to make this package. In my test.R file, I have code like the
> following:
>
> ...
>
> #' @return Returns a dataframe with several following variables (columns)
> #'   \itemize{
> #'  \item geneID: Gene ID
> #'  \item geneWisePvalue: each gene is represented by the smallest
> p-value among its features
> #'  \item sig.gene: a gene is significant (1) or not (0)
> #'  \item mostSigDeFeature: the most significant gene feature
> #'  \item numFeature: number of gene features within the gene
> #' }
>
> ...
>
> After rebuild, I get help documentation like the following:
> Value
>
> Returns a dataframe with several following variables (columns)
>
>-
>
>geneID: Gene ID
>-
>
>geneWisePvalue: each gene is represented by the smallest p-value among
>its features
>-
>
>sig.gene: a gene is significant (1) or not (0)
>-
>
>mostSigDeFeature: the most significant gene feature
>-
>
>numFeature: number of gene features within the gene
>
>
>Now, I want to get the following:
>Value
>
>Returns a dataframe with several following variables (columns)
>
>  geneID: Gene ID
>
>  geneWisePvalue: each gene is represented by the smallest
>p-value among its features
>
>  sig.gene: a gene is significant (1) or not (0)
>
>  mostSigDeFeature: the most significant gene feature
>
>  numFeature: number of gene features within the gene
>
>That is to say, to create a a bulleted list without bullets.
>
>Does anyone has idea on how to change settings in test.R file?
>
>
>Thank you,
>
>Aimin
>
> [[alternative HTML version deleted]]
>
> ___
> Bioc-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>



-- 
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099

[[alternative HTML version deleted]]

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


[Bioc-devel] Question about creating a bulleted list without bullets in rstudio

2017-06-09 Thread Aimin Yan
I have a question about making R package documentation.

I use rstudio to make this package. In my test.R file, I have code like the
following:

...

#' @return Returns a dataframe with several following variables (columns)
#'   \itemize{
#'  \item geneID: Gene ID
#'  \item geneWisePvalue: each gene is represented by the smallest
p-value among its features
#'  \item sig.gene: a gene is significant (1) or not (0)
#'  \item mostSigDeFeature: the most significant gene feature
#'  \item numFeature: number of gene features within the gene
#' }

...

After rebuild, I get help documentation like the following:
Value

Returns a dataframe with several following variables (columns)

   -

   geneID: Gene ID
   -

   geneWisePvalue: each gene is represented by the smallest p-value among
   its features
   -

   sig.gene: a gene is significant (1) or not (0)
   -

   mostSigDeFeature: the most significant gene feature
   -

   numFeature: number of gene features within the gene


   Now, I want to get the following:
   Value

   Returns a dataframe with several following variables (columns)

 geneID: Gene ID

 geneWisePvalue: each gene is represented by the smallest
   p-value among its features

 sig.gene: a gene is significant (1) or not (0)

 mostSigDeFeature: the most significant gene feature

 numFeature: number of gene features within the gene

   That is to say, to create a a bulleted list without bullets.

   Does anyone has idea on how to change settings in test.R file?


   Thank you,

   Aimin

[[alternative HTML version deleted]]

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Rd] Usage of PROTECT_WITH_INDEX in R-exts

2017-06-09 Thread Kirill Müller

On 09.06.2017 13:23, Martin Maechler wrote:

Kirill Müller 
 on Thu, 8 Jun 2017 12:55:26 +0200 writes:

 > On 06.06.2017 22:14, Kirill Müller wrote:
 >>
 >>
 >> On 06.06.2017 10:07, Martin Maechler wrote:
  Kirill Müller  on
  Mon, 5 Jun 2017 17:30:20 +0200 writes:
 >>> > Hi I've noted a minor inconsistency in the
 >>> documentation: > Current R-exts reads
 >>>
 >>> > s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env),
 >>> );
 >>>
 >>> > but I believe it has to be
 >>>
 >>> > PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env),
 >>> );
 >>>
 >>> > because PROTECT_WITH_INDEX() returns void.
 >>>
 >>> Yes indeed, thank you Kirill!
 >>>
 >>> note that the same is true for its partner
 >>> function|macro REPROTECT()
 >>>
 >>> However, as PROTECT() is used a gazillion times and
 >>> PROTECT_WITH_INDEX() is used about 100 x less, and
 >>> PROTECT() *does* return the SEXP, I do wonder why
 >>> PROTECT_WITH_INDEX() and REPROTECT() could not behave
 >>> the same as PROTECT() (a view at the source code seems
 >>> to suggest a change to be trivial).  I assume usual
 >>> compiler optimization would not create less efficient
 >>> code in case the idiom PROTECT_WITH_INDEX(s = ...)  is
 >>> used, i.e., in case the return value is not used ?
 >>>
 >>> Maybe this is mainly a matter of taste, but I find the
 >>> use of
 >>>
 >>> SEXP s = PROTECT();
 >>>
 >>> quite nice in typical cases where this appears early in
 >>> a function.  Also for that reason -- but even more for
 >>> consistency -- it would also be nice if
 >>> PROTECT_WITH_INDEX() behaved the same.
 >> Thanks, Martin, this sounds reasonable. I've put together
 >> a patch for review [1], a diff for applying to SVN (via
 >> `cat | patch -p1`) would be [2]. The code compiles on my
 >> system.
 >>
 >>
 >> -Kirill
 >>
 >>
 >> [1] https://github.com/krlmlr/r-source/pull/5/files
 >>
 >> [2]
 >> https://patch-diff.githubusercontent.com/raw/krlmlr/r-source/pull/5.diff

 > I forgot to mention that this patch applies cleanly to r72768.

Thank you, Kirill.
I've been a bit busy so did not get to reply more quickly.

Just to be clear: I did not ask for a patch but was _asking_ /
requesting comments about the possibility to do that.

In the mean time, within the core team, the opinions were
mixed and costs of the change (recompilations needed, C source level
check tools would need updating / depend on R versions) are
clearly non-zero.

As a consquence, we will fix the documentation, rather than changing the API.
Thanks for looking into this. The patch was more a proof of concept, I 
don't mind throwing it away.



-Kirill

Martin


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Creating a private CRAN with webpages

2017-06-09 Thread Zhian Kamvar
Hi Josh,

If you aren't opposed to using bootstrap, you could check out pkgdown: 
http://hadley.github.io/pkgdown/index.html 


>From my experience, it works pretty well out of the box. 

HTH,
Zhian

-
Zhian N. Kamvar, Ph. D.
Postdoctoral Researcher (Everhart Lab)
Department of Plant Pathology
University of Nebraska-Lincoln

> On Jun 8, 2017, at 16:29 , Joshua Bradley  wrote:
> 
> Hello,
> 
> I am trying to setup a private CRAN for work (behind a firewall). The best
> options available include miniCRAN
> , drat
>  and packrat
> . One problem is these packages do not
> automatically generate the web pages that are on the CRAN.
> 
> Examples:
> https://cran.r-project.org/web/packages/index.html
> https://cran.r-project.org/web/packages/available_packages_by_name.html
> 
> Each time the CRAN adds a package, there must be an automated process in
> place to regenerate the pages again with the new package added (example - A3
> ). I read somewhere
> (possibly on stackoverflow) that the CRAN html pages are statically built.
> I would like for users to be able to explore the packages in my private
> CRAN just like the public CRAN without having to open R and search for
> packages/documentation through the command line.
> 
> The R Manual includes a small section
> 
> on setting up a repository but it only discusses the structure of the
> directories needed to host packages. Nothing is mentioned about how the
> CRAN creates/updates the /web directory. What is the best way to
> generate/maintain the web pages for a private CRAN?
> 
> P.S. Let me know if this question is best answered on one of the other
> mailing lists.
> 
> Josh Bradley
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Creating a private CRAN with webpages

2017-06-09 Thread Prof Brian Ripley

On 09/06/2017 07:44, Joshua Bradley wrote:

I'm not trying to create a mirror of the CRAN. I also do not want to create
a "subset" of CRAN packages. Sorry if my explanation was confusing. There
are internal proprietary R packages that I would like to host on a private
repo. I like the CRAN web pages that allow a user to browse the various
packages from a browser without having to first install them. I want to
duplicate the process that CRAN goes through when it generate the webpages.


But for a repository of your own packages, not CRAN's packages? 
Everyone who has replied so far seems to have assumed the latter 


The scripts CRAN uses to make its 'web' area are not public.  If you can 
formulate a crystal-clear message, you could ask them for a copy.




Josh Bradley

[[alternative HTML version deleted]]


Please do follow the posting guide: CRAN too does not appreciate HTML mail.

--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Bioc-devel] devel build report

2017-06-09 Thread Obenchain, Valerie
Hi,

Just a heads up we got some wires crossed with yesterday's (June 8)
devel build report. It should refresh normally today.

Sorry about that.

Valerie



This email message may contain legally privileged and/or confidential 
information.  If you are not the intended recipient(s), or the employee or 
agent responsible for the delivery of this message to the intended 
recipient(s), you are hereby notified that any disclosure, copying, 
distribution, or use of this email message is prohibited.  If you have received 
this message in error, please notify the sender immediately by e-mail and 
delete this email message from your computer. Thank you.
___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


[Bioc-devel] complete set of OrgDb packages have been added to AnnotationHub

2017-06-09 Thread Shepherd, Lori
Hello all,

The complete set of OrgDb packages have been added to AnnotationHub and are now 
available in both release and devel versions of Bioconductor.



The following example is for release:

> library(AnnotationHub)

> hub <- AnnotationHub()
updating metadata: retrieving 1 resource

|==|
100%
snapshotDate(): 2017-04-25
> query(hub, "OrgDb")
AnnotationHub with 940 records



The following is for devel:

> library(AnnotationHub)

> hub <- AnnotationHub()

snapshotDate(): 2017-06-08

> length(query(hub, "OrgDb"))
[1] 940



Cheers,


Lori Shepherd

Bioconductor Core Team

Roswell Park Cancer Institute

Department of Biostatistics & Bioinformatics

Elm & Carlton Streets

Buffalo, New York 14263


This email message may contain legally privileged and/or confidential 
information.  If you are not the intended recipient(s), or the employee or 
agent responsible for the delivery of this message to the intended 
recipient(s), you are hereby notified that any disclosure, copying, 
distribution, or use of this email message is prohibited.  If you have received 
this message in error, please notify the sender immediately by e-mail and 
delete this email message from your computer. Thank you.
[[alternative HTML version deleted]]

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Rd] Creating a private CRAN with webpages

2017-06-09 Thread Dirk Eddelbuettel

On 9 June 2017 at 02:44, Joshua Bradley wrote:
| repo. I like the CRAN web pages that allow a user to browse the various
| packages from a browser without having to first install them. I want to
| duplicate the process that CRAN goes through when it generate the webpages.

As your initial email correctly identified, none of miniCRAN, drat, ... do
this currently.

So this is how open source works: you identified a need, now you can go off
and fill it. ;-) You have the PACKAGES{,.gz,.rds} files from your repo. So
accessing packageDescription() for each package is a given.  I do so in
CRANberries for new packages, and while that (ugly) code is (still) not
public, the relevant function for that is

writeNewBlogEntry <- function(curPkg, curVer, reposurl) {
## and compute some sort of output for new package -- maybe get description 
? NB does NOT work for BioC
blogpost <- file.path(blogInputDir, "new", paste(curPkg, "_", curVer, 
".txt", sep=""))
con <- file(blogpost, "wt")
cat("New package", curPkg, "with initial version", curVer,"\n\n", file=con)
dcf <- read.dcf( url(getDescriptionUrl(curPkg, reposurl)) )
for (i in 1:ncol(dcf)) {
cat("", colnames(dcf)[i], ": ", htmlEscape(dcf[1,i]), 
"\n", sep="", file=con)
}
closeBlogPost(con, reposurl, curPkg)
}

(The read.dcf() off the package URL is no longer needed with CRAN_package_db().)

A corresponding file for the most recent 'new' package:

-
New package Risk with initial version 1.0 

Package: Risk
Type: Package
Title: Computes 26 Financial Risk Measures for Any Continuous
Distribution
Version: 1.0
Date: 2017-06-05
Author: Saralees Nadarajah, Stephen Chan
Maintainer: Saralees Nadarajah 
mbbss...@manchester.ac.uk
Depends: R (= 3.0.1)
Description: Computes 26 financial risk measures for any 
continuous distribution.  The 26 financial risk measures  include value at 
risk, expected shortfall due to Artzner et al. (1999) 
DOI:10.1007/s10957-011-9968-2, tail conditional median due to Kou et 
al. (2013) DOI:10.1287/moor.1120.0577, expectiles due to Newey and 
Powell (1987) DOI:10.2307/1911031, beyond value at risk due to Longin 
(2001) DOI:10.3905/jod.2001.319161, expected proportional shortfall due 
to Belzunce et al. (2012) DOI:10.1016/j.insmatheco.2012.05.003, 
elementary risk measure due to Ahmadi-Javid (2012) 
DOI:10.1007/s10957-011-9968-2, omega due to Shadwick and Keating 
(2002), sortino ratio due to Rollinger and Hoffman (2013), kappa  due to Kaplan 
and Knowles  (2004), Wang (1998)'s DOI:10.1080/10920277.1998.10595708 
risk measures, Stone (1973)'s DOI:10.2307/2978638 risk measures, Luce 
(1980)'s DOI:10.1007/BF00135033 risk measures
 , Sarin (1987)'s DOI:10.1007/BF00126387 risk measures, Bronshtein and 
Kurelenkova (2009)'s risk measures.
License: GPL (= 2)
Packaged: 2017-06-08 13:57:28 UTC; mbbsssn2
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2017-06-08 15:19:54 UTC


https://cran.r-project.org/package=Risk;>More information about Risk 
at CRAN
-

If I did it today, I'd start with markdown, but you get the idea.  The page
is the (current) top of http://dirk.eddelbuettel.com/cranberries/cran/new/

I write these as minimal html (as I wrote that code ~ 10 years ago in the
pre-pandoc days) which then get fed into the blog engine.  That helps keeping
content and presentation (css, ...) separate.

I think you have everything you need in the PACKAGES.rds which you get back
as a (large) data.frame from tools::CRAN_package_db().

Hope this helps,  Dirk



-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Creating a private CRAN with webpages

2017-06-09 Thread Joshua Bradley
I'm not trying to create a mirror of the CRAN. I also do not want to create
a "subset" of CRAN packages. Sorry if my explanation was confusing. There
are internal proprietary R packages that I would like to host on a private
repo. I like the CRAN web pages that allow a user to browse the various
packages from a browser without having to first install them. I want to
duplicate the process that CRAN goes through when it generate the webpages.

Josh Bradley

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Creating a private CRAN with webpages

2017-06-09 Thread Rainer Krug
If I understand you correctly, you want to have a mirror of CRAN on a private 
server behind your firewall. Check out 
https://cran.rstudio.com/mirror-howto.html 
 which gives instructions on how to 
do this.

Cheers,

Rainer

> On 8 Jun 2017, at 23:29, Joshua Bradley  wrote:
> 
> Hello,
> 
> I am trying to setup a private CRAN for work (behind a firewall). The best
> options available include miniCRAN
> , drat
>  and packrat
> . One problem is these packages do not
> automatically generate the web pages that are on the CRAN.
> 
> Examples:
> https://cran.r-project.org/web/packages/index.html
> https://cran.r-project.org/web/packages/available_packages_by_name.html
> 
> Each time the CRAN adds a package, there must be an automated process in
> place to regenerate the pages again with the new package added (example - A3
> ). I read somewhere
> (possibly on stackoverflow) that the CRAN html pages are statically built.
> I would like for users to be able to explore the packages in my private
> CRAN just like the public CRAN without having to open R and search for
> packages/documentation through the command line.
> 
> The R Manual includes a small section
> 
> on setting up a repository but it only discusses the structure of the
> directories needed to host packages. Nothing is mentioned about how the
> CRAN creates/updates the /web directory. What is the best way to
> generate/maintain the web pages for a private CRAN?
> 
> P.S. Let me know if this question is best answered on one of the other
> mailing lists.
> 
> Josh Bradley
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

University of Zürich

Cell:   +41 (0)78 630 66 57

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug



signature.asc
Description: Message signed with OpenPGP
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel