Berwin A Turlach | 18 May 2013 08:54
Picon

R CMD config for R >= 3.0.1

Dear all,

When installing the usual packages that I use, after installing R
3.0.1, I noticed that the installation of some packages that query R about
its configuration did not succeed.  The problem is exemplified by:

berwin <at> bossiaea:~$ R-3.0.1 CMD config CC
/opt/R/R-3.0.1/lib/R/bin/config: 222: .: Can't open /opt/R/R-3.0.1/lib/R/etc/Renviron

Prior to R 3.0.1 such commands worked fine:

berwin <at> bossiaea:~$ R-3.0.0 CMD config CC
gcc -std=gnu99

I noticed now that my installations of the development and
patched version of R have the same problem (since I usually do not install
packages in those versions that query the configuration, I hadn't
noticed the issue earlier).  

The problem seems to be line 222 of `R RHOME`/bin/config (when R is R
3.0.1) which reads:

	. ${R_HOME}/etc/Renviron

The file ${R_HOME}/etc/Renviron does not necessarily exists if one has
opted for 32/64-bit builds and installed both as sub-architectures,
which I have.  In my installation ${R_HOME}/etc/32/Renviron and
${R_HOME}/etc/64/Renviron exist, but no ${R_HOME}/etc/Renviron.

Is it necessary for R >= 3.0.1 to have one build as
(Continue reading)

Tal Galili | 17 May 2013 20:01
Picon
Gravatar

R 3.0.1: wrong MD5 checksums for Windows?

Hello dear R-devel,

I am not sure if this issue is tracked or not, but in case it isn't:
It appears that R 3.0.1 reproduces the error reported for R 3.0.0 here:
http://r.789695.n4.nabble.com/R-3-0-0-wrong-MD5-checksums-for-Windows-td4663348.html

That is, that when installing R 3.0.1 on Windows 7, and then running:

require(tools)
checkMD5sums(dir=R.home())

It produces the error:
files ‘etc/Rconsole’, ‘etc/Rprofile.site’ have the wrong MD5 checksums
[1] FALSE

With regards,
Tal

----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili <at> gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

	[[alternative HTML version deleted]]

Hello dear R-devel,
(Continue reading)

Jeroen Ooms | 16 May 2013 20:12
Favicon

setTimeLimit sometimes fails to terminate idle call in R

I would like to use setTimeLimit to abort operations that are stuck
waiting (idle) after n seconds. Below a toy example in which Sys.sleep
is a placeholder call that is idle:

testlimit <- function(){
  setTimeLimit(elapsed=3, transient=TRUE);
  Sys.sleep(10);
}
system.time(testlimit());

However this is giving inconsistent results. On windows and in
r-studio server (linux) the call is correctly aborted after 3 seconds.
However, when I run this in a terminal session in either on linux or
osx, the timeout is not triggered until after Sys.sleep() returns and
the total script takes 10+ seconds to complete.

What causes this difference? Is there something I can set in my
terminal R session such that the time limit is triggered? I am using
Ubuntu 13.04 (x64), and osx 10.8. Below three videos to illustrate the
issue:

  [1]: http://www.youtube.com/watch?v=d1qxbp2W2mY&hd=1
  [2]: http://www.youtube.com/watch?v=S0r-O9er4kU&hd=1
  [3]: http://www.youtube.com/watch?v=2D7TgtXUa3o&hd=1

> sessionInfo()
R version 3.0.1 RC (2013-05-10 r62729)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
(Continue reading)

McGehee, Robert | 16 May 2013 15:06
Favicon

Substitute / delayedAssign (was: Substitute unaware when promise objects are evaluated)

Duncan, Thank you for the clarification on how delayedAssign works. Should R-level interfaces to promise
objects ever become available, I expect they would at time come in handy.

On the subject of substitute and delayedAssign, I do have a follow-up question for the list. I'm trying to
convert a named list of expression objects into an environment of promise objects. After conversion,
each expression in the list will be automatically evaluated when the variable with the same name is
accessed in the environment. Effectively, I'm trying to create a hash table of promise objects.

Here's the code I wrote that works just fine.

x <- list(a=3, b=expression(a+2), sleep=expression(Sys.sleep(2)))
env <- new.env()
for (i in seq(x)) {
	key <- names(x)[i]
	.Internal(delayedAssign(key,
				   eval(substitute(x[[i]], list(x=x, i=i)))[[1]],
				   eval.env=env, assign.env=env))
}	
env$b     # 3+2
[1] 5
env$sleep # Sleeps for 2 seconds
NULL  

The "problem" is that R CMD check complains that I shouldn't be using .Internal() to access the
delayedAssign function. However, if I don't use .Internal(), then delayedAssign puts another
substitute around my call that prevents the 'i' iterator variable from being evaluated at the correct
time, which causes all variables to get the value x[[i]] for the very last value of 'i'.

Can I safely ignore this R CMD check warning about .Internal, or is there a better way to write this code?

(Continue reading)

andfra | 16 May 2013 14:03
Picon
Favicon

tools to document ReferenceClasses

Dear all,

Do anybody know whether  tools have been developed to help writing suitable documentation for
ReferenceClasses ?
Given that in the ReferenceClasses is now possible to insert the documentation inside the method, I am
wondering whether anybody have developed something similar to javadoc  (i.e. an annotation convention +
a tool to format it an produce a report).

Thankyou very much,
Best Regards,
Andrea Franceschini

----------------------------------------------------------------------
Andrea Franceschini
Swiss Institute of Bioinformatics ( http://www.isb-sib.ch )
andrea.franceschini <at> isb-sib.ch
Tel: +41 44 6353148
Mobile: +41 78 6298386
Bioinformatics Group ( Prof. Von Mering),  UZH Zurich

	[[alternative HTML version deleted]]

Ingo Korb | 16 May 2013 11:26
Picon
Favicon

Incorrect target file name for gramLatex.c

Hi!

The attached patch changes the rule that describes the actions for
gramLatex.c in src/library/tools/src/Makefile.in so it actually
generates that file instead of "gramLatex." (no extension). The
file name without extension is not referenced anywhere else and
in R-2.12 the same rule still used the full name, so it appears
that the "c" was lost in editing somewhere along the way.

The patch was generated for R-3.0.1, but also applies cleanly to
R-devel_2013-05-14.

-ik
Hi!

The attached patch changes the rule that describes the actions for
gramLatex.c in src/library/tools/src/Makefile.in so it actually
generates that file instead of "gramLatex." (no extension). The
file name without extension is not referenced anywhere else and
in R-2.12 the same rule still used the full name, so it appears
that the "c" was lost in editing somewhere along the way.

The patch was generated for R-3.0.1, but also applies cleanly to
R-devel_2013-05-14.

-ik
(Continue reading)

McGehee, Robert | 15 May 2013 17:54
Favicon

Substitute unaware when promise objects are evaluated

R-devel,
I used the 'substitute' function to create labels for objects inside an environment, without actually
evaluating the objects, as the objects might be promises.

However, I was surprised to see that 'substitute' returns the expression slot of the original promise even
after the promise has been forcibly evaluated. (Doesn't the promise go away after evaluation?) This
behavior probably falls under the "...no guarantee that the resulting expression makes any sense"
clause of the ?substitute documentation, but in case there's something actually wrong here, I thought
I'd send an example.

Here's an example showing how the evaluated expression returned by substitute does not match the actual
variable value:

> env <- new.env()
> z <- 0
> delayedAssign("var", z+2, assign.env=env)
> substitute(var, env=env)
z + 2
> force(env$var)
[1] 2
> z <- 10
> substitute(var, env=env)
z + 2
> eval(substitute(var, env=env))
[1] 12
> force(env$var)
[1] 2

Is there any obvious way to code around this behavior, e.g. can I explicitly check if an object in an
environment is an unevaluated promise?
(Continue reading)

santoshdvn | 15 May 2013 08:05
Picon

Missing Dependency: tex(latex) is needed by package R-devel - Help Required

Hi ALl,

I am trying to install R on RHEL 5.4 

while install R i am getting the dependency errors ..

can you please help on this . 

[root <at> Rgraph ~]# yum install R
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package R.x86_64 0:2.15.2-1.el5 set to be updated
--> Processing Dependency: libRmath-devel = 2.15.2-1.el5 for package: R
--> Processing Dependency: R-devel = 2.15.2-1.el5 for package: R
--> Running transaction check
---> Package libRmath-devel.x86_64 0:2.15.2-1.el5 set to be updated
--> Processing Dependency: libRmath = 2.15.2-1.el5 for package:
libRmath-devel
---> Package R-devel.x86_64 0:2.15.2-1.el5 set to be updated
--> Processing Dependency: R-core = 2.15.2-1.el5 for package: R-devel
--> Processing Dependency: tk-devel for package: R-devel
--> Processing Dependency: texinfo-tex for package: R-devel
--> Processing Dependency: tex(latex) for package: R-devel
--> Processing Dependency: tcl-devel for package: R-devel
--> Processing Dependency: pcre-devel for package: R-devel
(Continue reading)

William Dunlap | 14 May 2013 21:23
Favicon

problem in add1's F statistic when data contains NAs?

Shouldn't the F statistic (and p value) for the x2 term in the following calls
to anova() and add1() be the same?  I think anova() gets it right and add1()
does not.

> d <- data.frame(y=1:10, x1=log(1:10), x2=replace(1/(1:10), 2:3, NA))
> anova(lm(y ~ x1 + x2, data=d))
Analysis of Variance Table

Response: y
          Df    Sum Sq   Mean Sq    F value     Pr(>F)    
x1         1 52.905613 52.905613 1108.61455 4.5937e-07 ***
x2         1  6.355775  6.355775  133.18256 8.5678e-05 ***
Residuals  5  0.238611  0.047722                          
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
> add1(lm(y ~ x1, data=d), y ~ x1 + x2, test="F")
Single term additions

Model:
y ~ x1
       Df Sum of Sq       RSS         AIC   F value     Pr(>F)    
<none>              6.5943869   2.4542182                         
x2      1 6.3557755 0.2386114 -22.0988844 186.45559 2.6604e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
Warning message:
In add1.lm(lm(y ~ x1, data = d), y ~ x1 + x2, test = "F") :
  using the 8/10 rows from a combined fit

It looks like add1 is using 7 instead of 5 for the denominator degrees of freedom,
(Continue reading)

cuiyan | 14 May 2013 03:16
Picon

Segmentation fault on Python+Rpy2+R

Hi, everyone
I met a trouble, not only about R, but Python+RPy2+R
When I run "from rpy2 import robjects" or other packages/codes,
I receive "Segmentation Fault" inevitably like this:

linux-yhwx:/ # python
Python 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpy2
>>> rpy2.__version__
'2.2.2'
>>> import rpy2.tests
Segmentation fault
linux-yhwx:/ # 

My OS on cluster is Suse family (not ubuntu or other linuxes),
R is 2.15.2-devel
Python 2.7.2 and RPy 2.2.2 as described above.

Where can I find how this happens or deal with this segment fault?

--
View this message in context: http://r.789695.n4.nabble.com/Segmentation-fault-on-Python-Rpy2-R-tp4666997.html
Sent from the R devel mailing list archive at Nabble.com.

Xiao He | 14 May 2013 06:42
Picon
Gravatar

invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.

Dear R-Developers,

I just started learning how to use Rcpp. Earlier while using it, I
encountered an error as shown below:

file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector
foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector,
Rcpp::Function, Rcpp::Function)Â’:
file74d8254b96d4.cpp:10: error: invalid operands of types ‘SEXPREC*’ and
‘R_len_t’ to binary ‘operator/’
make: *** [file74d8254b96d4.o] Error 1

Below is a mock function that can reproduce this error. I wonder if anyone
can tell me what is the problem here. Thank you in advance!!

foo<-cppFunction('
   NumericVector foo(NumericVector q, NumericVector shape1, NumericVector
shape2, Function pbeta, Function sequence){
         NumericVector output(q.size());
         output=pbeta(sequence(q.size())/q.size(), shape1, shape2);
        return output;
 }
 ')

Best,
Xiao

	[[alternative HTML version deleted]]

(Continue reading)


Gmane