Re: [R] Installing GO 1.7.0
Hi, is the announced solution for the GO 1.7.0 installation already publicly available? I am running into the same trouble as described in below, using 2.0.1 under Ubuntu Hoary. Thanks, Christian > Seth Falcon wrote: Hi Tom, I'm cc'ing to Bioconductor as that is probably a better place for the discussion. "Tom 'spot' Callaway" <[EMAIL PROTECTED]> writes: I'm in the process of packaging R (and R modules) for future inclusion in Fedora Extras, and I've managed to get several hundred modules installed without issue, however, the GO metadata package is refusing to comply. ERROR: installing package indices failed I let this run for over 6 hours, and it didn't seem to complete (or make any changes). We have a solution for this and will send or make available an updated GO package shortly. With the updated GO package you should be able to R CMD INSTALL without it taking much time. Best, + seth __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html I'm in the process of packaging R (and R modules) for future inclusion in Fedora Extras, and I've managed to get several hundred modules installed without issue, however, the GO metadata package is refusing to comply. Since I'm packaging this in rpm format, I can't use any of the automated functions for build, I've got to do it locally through R. The following steps work for other metadata packages (directory names changing, obviously), but not for GO: With the GO tarball unpacked into R-GO-1.7.0/GO... cd R-GO-1.7.0/ rm -rf /var/tmp/R-GO-1.7.0-1-root-root mkdir -p /var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library export R_LIBS=/var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library /usr/bin/R CMD INSTALL \ -l /var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library GO I get the following output: * Installing *source* package 'GO' ... ** R ** data ** preparing package for lazy loading ** help >>> Building/Updating help pages for package 'GO' Formats: text html latex example GOtexthtmllatex GOALLLOCUSID texthtmllatex example GOBPANCESTOR texthtmllatex example GOBPCHILDREN texthtmllatex example GOBPOFFSPRING texthtmllatex example GOBPPARENTS texthtmllatex example GOCCANCESTOR texthtmllatex example GOCCCHILDREN texthtmllatex example GOCCOFFSPRING texthtmllatex example GOCCPARENTS texthtmllatex example GOLOCUSID texthtmllatex example GOLOCUSID2ALLGO texthtmllatex example GOLOCUSID2GO texthtmllatex example GOMFANCESTOR texthtmllatex example GOMFCHILDREN texthtmllatex example GOMFOFFSPRING texthtmllatex example GOMFPARENTS texthtmllatex example GOQC texthtmllatex GOTERMtexthtmllatex example But I never get the "* DONE (GO)" that I'm expecting. Instead, all of the memory on the machine allocates (512MB), it starts to swap out, and never completes. When I look at the output from ps, I see: 8290 pts/5S+ 0:00 /bin/sh /usr/lib/R/bin/INSTALL -l /var/tmp/R-GO-1.7.0-1-root-root/us 8364 ?S 0:00 8421 pts/5D+ 1:11 /usr/lib/R/bin/exec/R --vanilla When I kill the 8421 process, I get: /usr/lib/R/bin/INSTALL: line 381: 8088 Doneecho "invisible(.libPaths(c(\"${lib}\", .libPaths(; tools:::.install_package_indices(\".\", \"${R_PACKAGE_DIR}\")" 8089 Killed | R_DEFAULT_PACKAGES=NULL LANG=C "${R_EXE}" --vanilla >/dev/null ERROR: installing package indices failed I let this run for over 6 hours, and it didn't seem to complete (or make any changes). Unfortunately, lots of Bioconductor seems to depend on GO... so any help on getting this to install is appreciated. Thanks, ~spot -- Tom "spot" Callaway: Red Hat Sales Engineer || GPG Fingerprint: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Package pixmap breaks try() under circumstances
Dear R users, in some circumstances, try() shows a strange behaviour, when the pixmap package is loaded. The following piece of code works as expected, if it is either sourced in an interactive session or invoked via R CMD BATCH (the try-error is printed). However, if i invoke R using ``R --vanilla < source.R'', the execution halts (without printing the try-error). # source.R library(pixmap) x <- numeric() y <- numeric() result <- try(plot(lm(x~y))) print(result) If i don't use library(pixmap), than also R --vanilla < source.R works as expected. This happens with R-2.0.1 and pixmap-0.4.2 under SuSE 9.2. Christian :-( P.S. The reason for preferring R --vanilla script.R over R CMD BATCH is, that i have to produce png images for a server and want to avoid the bitmap device for performance reasons. With R --vanilla < script.R, this is possible, using the xvnc virtual X server. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] socket problems (maybe bugs?)
Dear R Gurus, for some purpose i have to use a socket connection, where i have to read and write both text and binary data (each binary data package will be preceeded by a header line). When experimenting, i encountered some problems (with R-2.0.1 under different Linuxes (SuSE and Gentoo)). Since the default mode for socket connections is non-blocking, i first tried socketSelect() in order to see whether the socket is ready for reading: # Server: s <- socketConnection(port=, server=TRUE, open="w+b") writeLines("test", s) writeBin(1:10, s, size=4, endian="big") # Client, variation 1: s <- socketConnection(port=, server=FALSE, open="w+b") socketSelect(list(s)) readLines(s, n=1) # works, "test" is read socketSelect(list(s)) # does never return, although the server wrote 1:10 (This seems to happen only, when i mix text and binary reads.) However, without socketSelect(), R may crash if i try to read from an empty socket: Server: s <- socketConnection(port=, server=TRUE, open="w+b") writeLines("test", s) writeBin(1:10, s, size=4, endian="big") # Client, variation 2: s <- socketConnection(port=, server=FALSE, open="w+b") readLines(s, n=1) # works, "test" is read readBin(s, "int", size=4, n=10, endian="big") # works, 1:10 is read readBin(s, "int", size=4, n=10, endian="big") # second read leads to # segmentation fault If i omit the endian="big" option, the second read does not crash, but just gets 10 random numbers. On the first view, this does not seem to be a problem, since the data will be preeceded by a header, which contains the number of bytes in the binary block. However, due to race conditions, i cannot exclude this situation: timeserver client t0 sends header t1 reads header t2 tries to read binary, crashes t3 sends binary If i open the client socket in blocking mode, the second variation seems to work (the second read just blocks as desired). When using only one socket, i can do without socketSelect(), but i have the follwoing questions: 1. Can i be sure, the the blocking variation will also work for larger data sets, when e.g. the server starts writing before the client is reading? 2. How could i proceed, if i needed several sockets? Then i cannot use socketSelect due to the problem described in variation 1. I also cannot use blocking sockets, since reading from an empty socket would block the others. Without blocking and socketSelect(), i might run into the race condition described above. In any case, the readBin() crash with endian="big" is a bug in my eyes. For non-blocking sockets, readBin() should just return numeric(0), if no data are written on the socket. I also stronlgy suspect that the socketSelect() behaviour as described in variation 1 is a bug. Christian :-( __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Strange parsing behavior of an else condition
Dear R users, can anybody explain the reason, why the first piece of code below gives a parsing error, while the other two variations work? # Gives a parsing error x <- 1 if (x < 0) { y <- 1 } else # Error occurs at this line { y <- -1 } # This works x <- 1 { if (x < 0) { y <- 1 } else { y <- -1 } } # This works too x <- 1 if (x < 0) { y <- 1 } else { y <- -1 } Christian __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Gaussian frailty leads to segmentation fault
Dear Thomas, attached you find a data frame which produces the error. I am using survival 2.11-5 under R 1.9.1-1 and 1.9.0-1. By the way, if i randomly omit 50% of the data, i usually get no crash, but a warning message like this: Inner loop failed to coverge for iterations 1 2 3 in: coxpenal.fit(X, Y, strats, offset, init = init, control, weights = weights, Maybe, the model is not appropriate for this kind of data. But on the other hand, as soon the treatment group (study == 1, treatment == 1) is smaller than the randomized placebo group (study == 1, treatment == 0), the warnings disappear. and the model gives reasonable results in my first simulations with normally distributed study effects. Christian Thomas Lumley wrote: We really need a reproducible example to find segmentation faults. Can you make one? -thomas On Wed, 28 Jul 2004, Christian Lederer wrote: Dear R gurus, for a simulation concerning study effects and historical controls in survival analysis, i would like to experiment with a gaussian frailty model. The simulated scenario consists of a randomized trial (treatment and placebo) and historical controls (only placebo). So the simulated data frames consist of four columns $time, $cens, $study, $treat. $time, $cens are the usual survival data. For the binary thretment indicator we have $treat == 0 or 1, if $study == 1, $treat == 1 if $study > 1 Typical parameters for my simulations are: sample sizes (per arm): between 100 and 200 number of historical studies: between 7 and 15 hazard ratio treatment/placebo: between 0.7 and 1 variance of the study effekt: between 0 and 0.3 Depending on the sample sizes, the following call sometimes leads to a segmentation fault: coxph(Surv(time,cens) ~ as.factor(treatment) + frailty(study, distribution="gaussian"), data=data) I noticed, that this segmentation fault occures most frequently, if the number of randomized treatment patients is higher than the number of randomized placebo patients, and the number of historical studies is large. There seems to be no problem, if there are at least as many randomized placebo patients as treated patients. Unfortunately, this is not the situation i want to investigate (historical controls should be used to decrease the number of treated patients). Is there a way to circumwent this problem? Christian P.S. Is it allowed, to attach gzipped sample data sets in this mailing list? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Gaussian frailty leads to segmentation fault
Dear R gurus, for a simulation concerning study effects and historical controls in survival analysis, i would like to experiment with a gaussian frailty model. The simulated scenario consists of a randomized trial (treatment and placebo) and historical controls (only placebo). So the simulated data frames consist of four columns $time, $cens, $study, $treat. $time, $cens are the usual survival data. For the binary thretment indicator we have $treat == 0 or 1, if $study == 1, $treat == 1 if $study > 1 Typical parameters for my simulations are: sample sizes (per arm): between 100 and 200 number of historical studies: between 7 and 15 hazard ratio treatment/placebo: between 0.7 and 1 variance of the study effekt: between 0 and 0.3 Depending on the sample sizes, the following call sometimes leads to a segmentation fault: coxph(Surv(time,cens) ~ as.factor(treatment) + frailty(study, distribution="gaussian"), data=data) I noticed, that this segmentation fault occures most frequently, if the number of randomized treatment patients is higher than the number of randomized placebo patients, and the number of historical studies is large. There seems to be no problem, if there are at least as many randomized placebo patients as treated patients. Unfortunately, this is not the situation i want to investigate (historical controls should be used to decrease the number of treated patients). Is there a way to circumwent this problem? Christian P.S. Is it allowed, to attach gzipped sample data sets in this mailing list? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Sloppy argument checking for named arguments
Dear R Gurus, i recently noticed that R does sloppy argument checking for named arguments, if the argument contains a dot. Example: > f <- function(foo.bar=0) { print(foo.bar) } > f(foo=1) [1] 1 I guess, this should be considered as a bug. Anyway, the consequence is that bugs caused by typing errors of this kind may are *very* hard to discover in complex progams. Christian __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] coxph covariance matrix
Hi, when calculating the Cox model for a factor with n levels (using treatment contrasts), i noticed that the off diagonal elements of the estimated covariance matrix are always nearly (but not exactly) equal. On the one hand, this is plausible to me: If i could obtain estimates x_i, 1<=i<=n, for the log hazard ratios relative to the baseline hazard, then of course the off diagonal elements of the covariance matrix for the estimated contrasts y_i = x_i - x_1 would be exactly equal. On the other hand, the coxph model estimates the contrasts directly, and numerically the off diagonal elements are just very close, but not equal. Any explanation, hint or reference would be highly appreciated. Christian __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cgi/servlets/httpd in R
This was my point. Using RSPerl with ordinary CGI of course starts a new process for each request. But using fastcgi uses the same perl process for new requests. So, if you can use fastcgi in conjunction with RSPerl (which i did not try), there would be no startup overhead anymore. Christian Samuelson, Frank* wrote: Here's a related question: Do any of the mentioned R-web interfaces (Rweb, R-Online, CGIwithR, RSPerl) support reusing the same R process, eliminating the startup overhead? This would be useful to me as well. Currently I use such a method on my computing cluster: All 40 compute nodes run an R process/compute server that listens at a socket for any connection and subsequent commands from another computer. When the master process disconnects, the R processes go back to listening at the socket. Connecting to the R compute servers this way takes < 2 milliseconds rather than the typical ~2 second R startup time. Thanks for any tips. -Frank -Original Message- From: Christian Lederer [mailto:[EMAIL PROTECTED] Sent: Thursday, May 06, 2004 10:04 AM To: [EMAIL PROTECTED] Subject: Re: [R] cgi/servlets/httpd in R Hi, if found that the easiest way for me doing CGI with R was using the RSPerl package. So i could do all the CGI related things in Perl and call R functions from Perl to do the statistics. You can get RSPerl from http://www.omegahat.org. If loading the data each time gives a performance problem, i guess that you could use RSPerl together with fastcgi, so the R initialization and loading the data would happen only once. If you try this, i would be very interrested in your experiences. The RSPerl package is somewhat outdated, but it worked well together with R 1.6.0 (i didn't try newer versions). Christian :-) David Firth wrote: On Wednesday, May 5, 2004, at 18:09 Europe/London, foobar wrote: Hi R-helpers Has anyone had any experience doing CGI or Servlets or using an httpd server in R? yes. See the R FAQ, section 4. (Or maybe you already have, in which case I misunderstood the question...) Best wishes, David __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cgi/servlets/httpd in R
Hi, if found that the easiest way for me doing CGI with R was using the RSPerl package. So i could do all the CGI related things in Perl and call R functions from Perl to do the statistics. You can get RSPerl from http://www.omegahat.org. If loading the data each time gives a performance problem, i guess that you could use RSPerl together with fastcgi, so the R initialization and loading the data would happen only once. If you try this, i would be very interrested in your experiences. The RSPerl package is somewhat outdated, but it worked well together with R 1.6.0 (i didn't try newer versions). Christian :-) David Firth wrote: On Wednesday, May 5, 2004, at 18:09 Europe/London, foobar wrote: Hi R-helpers Has anyone had any experience doing CGI or Servlets or using an httpd server in R? yes. See the R FAQ, section 4. (Or maybe you already have, in which case I misunderstood the question...) Best wishes, David __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Build problems on Linux SuSE 9.1
Hi, did anybody succeed in building R on SuSE Linux 9.1? My compilation failed with the following error messages: make[4]: Entering directory `/home/lederer/Source/R-1.9.0/src/modules/X11' gcc -I. -I../../../src/include -I../../../src/include -I/usr/X11R6/include -I/us r/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c d ataentry.c -o dataentry.lo In file included from dataentry.c:31: /usr/X11R6/include/X11/Xlib.h:1400: error: parse error before "_Xconst" /usr/X11R6/include/X11/Xlib.h:1488: error: parse error before "char" /usr/X11R6/include/X11/Xlib.h:1516: error: parse error before "_Xconst" /usr/X11R6/include/X11/Xlib.h:1520: error: parse error before "char" /usr/X11R6/include/X11/Xlib.h:1542: error: parse error before "_Xconst" /usr/X11R6/include/X11/Xlib.h:1577: error: parse error before '*' token /usr/X11R6/include/X11/Xlib.h:1586: error: parse error before "_Xconst" ... lots more ... dataentry.c: In function `GetKey': dataentry.c:1272: warning: passing arg 4 of `XLookupString' from incompatible po inter type dataentry.c: In function `GetCharP': dataentry.c:1281: warning: passing arg 4 of `XLookupString' from incompatible po inter type dataentry.c: In function `doControl': dataentry.c:1302: warning: passing arg 4 of `XLookupString' from incompatible po inter type make[4]: *** [dataentry.lo] Fehler 1 make[4]: Leaving directory `/home/lederer/Source/R-1.9.0/src/modules/X11' make[3]: *** [R] Fehler 2 make[3]: Leaving directory `/home/lederer/Source/R-1.9.0/src/modules/X11' make[2]: *** [R] Fehler 1 make[2]: Leaving directory `/home/lederer/Source/R-1.9.0/src/modules' make[1]: *** [R] Fehler 1 make[1]: Leaving directory `/home/lederer/Source/R-1.9.0/src' make: *** [R] Fehler 1 The same happened for R-1.8.1. However, i cannot believe that SuSE 9.1 contains faulty Xlib.h, since i can compile other programs including this file. Fortunetely i could install the rpm for SuSE 9.0. Christian :-( __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Confusion about coxph and Helmert contrasts
Hi, perhaps this is a stupid question, but i need some help about Helmert contrasts in the Cox model. I have a survival data frame with an unordered factor `group' with levels 0 ... 5. Calculating the Cox model with Helmert contrasts, i expected that the first coefficient would be the same as if i had used treatment contrasts, but this is not true. I this a error in reasoning, or is it possible, that both contrasts use a different ordering of the levels? I am confused about the fact, that coefficients for different levels are calculated, depending on weather i include level 0 or not: If level 0 is included, with both contrasts coxph calculates coefficients for group 1 ... group 5. But if i exclude level 0, coxph calculates coeffficients for group 2 ... 5 with treatment and coefficients for group 1 ... 4 using helmert: > options(contrasts = c("contr.treatment", "contr.poly")) > cox.t <- coxph(Surv(time,cens) ~ as.factor(group), data=data) > options(contrasts = c("contr.helmert", "contr.poly")) > cox.h <- coxph(Surv(time,cens) ~ as.factor(group), data=data) > cox.t$coefficients as.factor(group)1 as.factor(group)2 as.factor(group)3 as.factor(group)4 -0.4301351 0.2078431-0.0694138 0.3442058 as.factor(group)5 0.1368716 > cox.h$coefficients as.factor(group)1 as.factor(group)2 as.factor(group)3 as.factor(group)4 -0.215067529 0.140970216 0.001170877 0.083426449 as.factor(group)5 0.021061935 > data <- data[data$group > 0,] > options(contrasts = c("contr.treatment", "contr.poly")) > cox.t <- coxph(Surv(time,cens) ~ as.factor(group), data=data) > options(contrasts = c("contr.helmert", "contr.poly")) > cox.h <- coxph(Surv(time,cens) ~ as.factor(group), data=data) > cox.t$coefficients as.factor(group)2 as.factor(group)3 as.factor(group)4 as.factor(group)5 0.639 0.3612753 0.7762236 0.5688559 > cox.h$coefficients as.factor(group)1 as.factor(group)2 as.factor(group)3 as.factor(group)4 0.31970.013758440.110616290.02489624 A am absolutely confused; any help is welcome. Christian :-) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] package question
Dear R-Gurus, is it possible, to define variables, which are only visible to functions belonging to a certain package? (For a certain package i would like to have something similar to static variables in C, which are only visible to functions defined in the same source file.) In the documentation (``Writing R Extensions") i found nothing appropriate. Christian :-) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html