Re: [R] Installing GO 1.7.0

2005-05-03 Thread Christian Lederer
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

2005-02-22 Thread Christian Lederer

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?)

2005-02-16 Thread Christian Lederer
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

2005-02-07 Thread Christian Lederer
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


[R] Evaluating code in a sandbox

2005-01-30 Thread lederer

Dear R-Gurus,

is it possible to evaluate foreign R code in such a safe way, that it has
no chance to confuse the global environment?

The follwing does not suffice, because the untrusted code might e.g.
contain a superassignment ("<<-"):

connection <- textConnection(some.untrusted.code)
try(eval(parse(connection), envir=new.env()))
close(connection)


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] switching to Linux, suggestions?

2004-12-12 Thread lederer
Hi,

recently, i installed Gentoo in addition to SuSE on my Laptop.
In order to see whether it was worth the effort, i did a small
benchmark for R under SuSE and Gentoo.
I guess, that the benchmarks under SuSE are also approximately
valid for other binary distributions.

As a consequence, depending on your Unix/Linux experience,
i would recommend Gentoo for optimal performance.
If you are new to Linux and want to avoid the relatively complicated
Gentoo setup, i recommend that you should least compile R from source,
which should be easy also for a Linux newbie.

The benchmark (see below for the script) consisted of
i) Generating random normals and plotting density plots.
ii) Cox model
iii) Inverting random 200x200 matrices.

I used different versions of R, since 2.0.1 is not yet included in the
Gentoo portage tree. Here are my results:

A) SuSE 9.2, R 2.0.1 (from i586 rpm):
 benchmark cpu.user cpu.system
1benchmark.density   222.22   6.76
11  benchmark.survival   133.69   0.27
12 benchmark.linearalgebra   365.25   3.64

B) R 1.9.0 compiled under SuSE 9.2, without additional CFLAGS
(i.e. using CFLAGS from the configure script):
 benchmark cpu.user cpu.system
1benchmark.density   217.31   6.12
11  benchmark.survival   101.77   0.14
12 benchmark.linearalgebra   165.49   3.34

C) R 1.9.0 compiled under SuSE 9.2, using the same CFLAGS
as in Gentoo (see below for my CFLAGS):
 benchmark cpu.user cpu.system
1benchmark.density   199.16   5.96
11  benchmark.survival94.26   0.15
12 benchmark.linearalgebra   159.17   4.93

D) R 1.9.0-r1 under Gentoo, using the CFLAGS for the whole system,
not just for R.
 benchmark cpu.user cpu.system
1benchmark.density   176.08   6.10
11  benchmark.survival84.20   0.14
12 benchmark.linearalgebra   134.72   6.54

My CFLAGS (for a centrino) are:
CFLAGS="-pipe -O3 -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse,387
-maccumulate-outgoing-args -mno-align-stringops -fomit-frame-pointer
-ffast-math -fsched-spec-load -fprefetch-loop-arrays -ftracer
-fmove-all-movables"

Question to the Gurus: Would it be allowed, to use
-funsafe-math-optimizations?


Here is my benchmark script:

--
require(survival)

benchmark.density <- function()
{
for (i in 1:1000)
{
x <- rnorm(10)
plot(density(x), type="l", xlim=c(-10,10), main=i)
}
}

benchmark.survival <- function()
{
for (i in 1:1000)
{
time <- c(rexp(800, 1), rexp(800, 0.8), rexp(800, 0.9),
  rexp(800, 0.7), rexp(800, 0.5))
time <- round(time, digits=2)  # introduce ties
event <- as.integer(time <= 1)
time[time > 1] <- 1
group <- c(rep(0, 800), rep(1, 800), rep(2, 800),
   rep(3, 800), rep(4, 800))
plot(survfit(Surv(time,event) ~ group), xlim=c(0,1))
title(main=i)
dummy <- coxph(Surv(time,event) ~ group)
}
}


benchmark.linearalgebra <- function()
{
for (i in 1:1000)
{
A <- matrix(rnorm(200*200), nrow=200, ncol=200)
AI <- solve(A)
residual <- A %*% AI - diag(1, 200)
hist(residual, main=i)
}
}


my.benchmark <- function(func)
{
   funcname <- (as.character(sys.call()[[2]]))
   cat(funcname, "\n")
   times <- system.time(func())
   return(data.frame(benchmark=funcname,
 cpu.user=times[1],
 cpu.system=times[2]))
}

result <- my.benchmark(benchmark.density)
result <- rbind(result, my.benchmark(benchmark.survival))
result <- rbind(result, my.benchmark(benchmark.linearalgebra))

sink("benchmark.out")
cat(Sys.info(), "\n")
print(result)
sink()
--

Christian


> Dear List,
> I have acquired a new desktop and wanted to put a free OS on it.  I am
> trying Fedora Core 1, but not sure what the best Linux OS is for using R
> 2.0.1?
>
> Thank you in advance for your input,
> Tom Volscho
>
> 
> Thomas W. Volscho
> Graduate Student
> Dept. of Sociology U-2068
> University of Connecticut
> Storrs, CT 06269
> Phone: (860) 486-3882
> http://vm.uconn.edu/~twv1
>
> __
> [EMAIL PROTECTED] mailing list
> https://stat.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://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Covariance bug in R-1.8.0

2004-11-04 Thread lederer
R-1.8.0 seems to calculate wrong covariances, when the argument of cov()
is a matrix or a data frame.
The following should produce a matrix of zeroes and NaNs:

x <- matrix(c(NA ,NA ,0.9068995 ,NA ,-0.3116229,
  -0.0607 ,0.7310134 ,NA ,1.738362 ,0.6276125,
  0.6615581 ,NA ,NA ,-2.646011 ,-2.126105,
  NA ,1.081825 ,NA ,1.253795 ,1.520708,
  0.2822814 ,NA ,NA ,NA ,NA,
  0.03291028 ,NA ,NA ,NA ,NA,
  NA ,NA ,NA ,-0.5462126 ,-0.1997394,
  NA ,-0.3419413 ,-0.2675226 ,-1.000133 ,-0.1346234,
  NA ,NA ,-0.411743 ,1.301612 ,NA,
  0.922197 ,NA ,0.9513522 ,0.2357021 ,NA),
nrow=10, ncol=5)

c1 <- cov(x, use="pairwise.complete")

c2 <- matrix(nrow=5, ncol=5)
for (i in 1:5)
{
for (j in 1:5)
{
c2[i,j] <- cov(x[,i], x[,j], use="pairwise.complete")
}
}

c2-c1

Instead, R-1.8.0 produces this result:

[,1][,2]   [,3]  [,4][,5]
[1,]  0. -0.03053828 NA -0.0144996353 -0.03485883
[2,] -0.03053828 -0.01649857 NA  0.0137259383 -0.02960707
[3,]  NA  NA -0.1296134NA  NA
[4,] -0.01449964  0.01372594 NA -0.0003152629  0.08717648
[5,] -0.03485883 -0.02960707 NA  0.0871764791  0.04961190

This happens as well under Linux (Suse 9.1) as well as under Windows NT.

Under 1.9.1 (Linux) and 1.9.0 (Windows) i get the expected matrix of
zeroes and NaNs.

This example is not very special. Under R-1.8.0 cov produced wrong result
for any random matrix i tried.

Doesn't this mean, that *any* result obtained under R 1.8.0 is unreliable?

By the way, i just recompiled R-1.8.0 from source under Linux and tried
'make check'. All tests were ok.
Does there exist a more detailed set of tests, which could insure that
at least the most basic R functions work correctly?


Christian

__
[EMAIL PROTECTED] 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

2004-07-28 Thread Christian Lederer
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

2004-07-28 Thread Christian Lederer
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

2004-06-02 Thread Christian Lederer
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

2004-05-23 Thread Christian Lederer
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

2004-05-10 Thread Christian Lederer
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

2004-05-06 Thread Christian Lederer
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

2004-05-02 Thread Christian Lederer
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

2004-03-02 Thread Christian Lederer
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

2004-01-24 Thread Christian Lederer
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