Re: [Rd] rep fails on pairlist

2012-07-26 Thread Dirk Eddelbuettel

On 26 July 2012 at 15:55, Gabor Grothendieck wrote:
| This code which has worked for years in R but fails under R-devel:
| 
|  R.version.string
| [1] R Under development (unstable) (2012-07-25 r59963)
| 
|  n - 3
|  f - function(x) {}
|  formals(f) - rep(formals(f), n) ##
| Error in rep(formals(f), n) : replication of pairlists is defunct
| 
| The message suggests that the change was intentional.
| Why was this functionality removed?
| What code should be used in its place?

FWIW there are changes happening right now to rep() so that may be spillage
from code under development.  To keep abreast of these changes, I follow the
RSS feed Duncan set up a few years ago -- it is also as html at

   http://developer.r-project.org/blosxom.cgi/R-devel

and summarizes changes committed to the NEWS file, ie high-level changes
worth knowing about.

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com

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


Re: [Rd] rep fails on pairlist

2012-07-26 Thread Gabor Grothendieck
On Thu, Jul 26, 2012 at 4:24 PM, Dirk Eddelbuettel e...@debian.org wrote:

 On 26 July 2012 at 15:55, Gabor Grothendieck wrote:
 | This code which has worked for years in R but fails under R-devel:
 |
 |  R.version.string
 | [1] R Under development (unstable) (2012-07-25 r59963)
 | 
 |  n - 3
 |  f - function(x) {}
 |  formals(f) - rep(formals(f), n) ##
 | Error in rep(formals(f), n) : replication of pairlists is defunct
 |
 | The message suggests that the change was intentional.
 | Why was this functionality removed?
 | What code should be used in its place?

 FWIW there are changes happening right now to rep() so that may be spillage
 from code under development.  To keep abreast of these changes, I follow the
 RSS feed Duncan set up a few years ago -- it is also as html at

http://developer.r-project.org/blosxom.cgi/R-devel

 and summarizes changes committed to the NEWS file, ie high-level changes
 worth knowing about.

That page says:

Calling ‘rep()’ or ‘rep.int()’ on a pairlist or other non-vector
object is now an error.

so it again seems to be intentional.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] rep fails on pairlist

2012-07-26 Thread Duncan Murdoch

On 12-07-26 3:55 PM, Gabor Grothendieck wrote:

This code which has worked for years in R but fails under R-devel:


R.version.string

[1] R Under development (unstable) (2012-07-25 r59963)


n - 3
f - function(x) {}
formals(f) - rep(formals(f), n) ##

Error in rep(formals(f), n) : replication of pairlists is defunct

The message suggests that the change was intentional.
Why was this functionality removed?
What code should be used in its place?




rep() on a pairlist didn't return a pairlist, it coerced to a list and 
then rep'd that.  So you could do the same explicitly if that's what you 
really want:


formals(f) - rep(as.list(formals(f)), n)

This works because the formals- code is forgiving; other uses of 
pairlists would not accept the result of rep on a pairlist.


Duncan Murdoch

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


Re: [Rd] rep fails on pairlist

2012-07-26 Thread Gabor Grothendieck
On Thu, Jul 26, 2012 at 7:29 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
 On 12-07-26 3:55 PM, Gabor Grothendieck wrote:

 This code which has worked for years in R but fails under R-devel:

 R.version.string

 [1] R Under development (unstable) (2012-07-25 r59963)


 n - 3
 f - function(x) {}
 formals(f) - rep(formals(f), n) ##

 Error in rep(formals(f), n) : replication of pairlists is defunct

 The message suggests that the change was intentional.
 Why was this functionality removed?
 What code should be used in its place?



 rep() on a pairlist didn't return a pairlist, it coerced to a list and then
 rep'd that.  So you could do the same explicitly if that's what you really
 want:

 formals(f) - rep(as.list(formals(f)), n)

 This works because the formals- code is forgiving; other uses of pairlists
 would not accept the result of rep on a pairlist.


Thanks. I will use that instead.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] Problem in vignette packaging of Sweave in utils package

2012-07-26 Thread Paul Johnson
New help request below

On Sat, Jul 7, 2012 at 7:25 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote:
 On 12-07-03 1:21 PM, Paul Johnson wrote:

 In ?Sweave, it refers to Sweave User Manual. In the doc folder of
 utils package, I see Sweave.pdf.

 However, I can't find it from within R


 vignette(Sweave User Manual)

 Warning message:
 vignette ‘Sweave User Manual’ not found


 Turns out there was a bug in the code to install from tarballs, so base
 package vignettes weren't fully installed.  I've fixed it; installs from
 R-patched or R-devel revisions after 59750 should be okay.

 Duncan Murdoch



Thanks, Duncan

Can I ask you to check this one again?

I just built RPMS for R-2.15.1-patched 2012-07-25 on a Rocks Cluster
(Centos 5.3).  I still see the trouble that the vignette for Sweave is
missing from the vignette index.

Below I'm showing everything I can think of that is related to this,
hoping it will give you an idea if the problem is on my end.

 sessionInfo()
R version 2.15.1 Patched (2012-07-25 r59963)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.15.1

 browseVignettes(utils)
No vignettes found by browseVignettes(utils)

 vignette(Sweave)
Warning message:
vignette ‘Sweave’ not found

As far as I can tell, the vignette WAS built and installed, as evidenced:

$ pwd
/usr/lib64/R/library/utils/doc
[pauljohn@devel doc]$ ls
Sweave.pdf

But it is not found by the vignette indexing system, it's not in the
output from
help(package=utils)

Maybe I did something to break the install when making the RPM.  But I
don't know what:)  I also built R the old fashioned way in the shell
and the result is the same.

For the RPM, I used a spec file I've slightly adapted from Tom Spot
Calloway's spec file that is used to build R for EPEL and Fedora.
Here's a copy:

http://pj.freefaculty.org/misc/R-2.15.1-patch.spec

And the output (stdout and stderr) from the build process, obtained from

$ rpmbuild -ba R-2.15.1-patch.spec --define dist kurocks53 
R-2.15.1-patch.txt 21

http://pj.freefaculty.org/misc/R-2.15.1-patch.txt

In order to make this work, I did one unsavory thing.  I took the
contents of this R-patched_2012-07-25.tar.gz and re-named the
directory R-2.15.1 and then repackaged that as R-2.15.1.tar.gz.  I
know this is unsavory to rename somebody else's packaging, but it was
the only way I could get the RPM build system to accept the version
number and file name. I put the date in the release version to reduce
confusion.  The RPMs have names like:

R-core-2.15.1-20120725kurocks53.x86_64.rpm

Oh, heck. I'm just uploading them all to the same folder as the spec
file, on the off chance you can see what's wrong.

libRmath-2.15.1-20120725kurocks53.x86_64.rpm
libRmath-devel-2.15.1-20120725kurocks53.x86_64.rpm
libRmath-static-2.15.1-20120725kurocks53.x86_64.rpm
R-2.15.1-20120725kurocks53.x86_64.rpm
R-core-2.15.1-20120725kurocks53.x86_64.rpm
R-debuginfo-2.15.1-20120725kurocks53.x86_64.rpm
R-devel-2.15.1-20120725kurocks53.x86_64.rpm

And the SRPM:

R-2.15.1-20120725kurocks53.src.rpm

pj

-- 
Paul E. Johnson
Professor, Political ScienceAssoc. Director
1541 Lilac Lane, Room 504 Center for Research Methods
University of Kansas   University of Kansas
http://pj.freefaculty.orghttp://quant.ku.edu

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