[R] Compilation errors when installing gee

2011-01-26 Thread adam_pgsql

Hi,

I am trying to install gee on our server but I get the error below. I do not 
have root on this machine so no control on how R was installed itself. It looks 
like it cannot find blas libs, the only ones i can find on the machine are:

/usr/lib64/libblas.so.3 -> libblas.so.3.0.3
/usr/lib64/libblas.so.3.0 -> libblas.so.3.0.3
/usr/lib64/libblas.so.3.0.3

and :

$ R CMD config BLAS_LIBS
-lblas

Any ideas how to get this package to install? (sessionInfo() at the bottom of 
email)

thanks for any help

adam

> install.packages("gee")
Installing package(s) into 
‘/homedirs4/sghms/medmicro/users/awitney/R/x86_64-redhat-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://www.stats.bris.ac.uk/R/src/contrib/gee_4.13-16.tar.gz'
Content type 'application/x-gzip' length 55712 bytes (54 Kb)
opened URL
==
downloaded 54 Kb

* installing *source* package ‘gee’ ...
** libs
gfortran   -fpic  -O2 -g -c dgedi.f -o dgedi.o
gfortran   -fpic  -O2 -g -c dgefa.f -o dgefa.o
gcc -I/usr/lib64/R/include  -I/usr/local/include-fpic  -O3 -g -std=gnu99 -c 
ugee.c -o ugee.o
gcc -shared -Bdirect,--hash-stype=both,-Wl,-O1 -o gee.so dgedi.o dgefa.o ugee.o 
-lblas -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status
make: *** [gee.so] Error 1
ERROR: compilation failed for package ‘gee’
* removing 
‘/homedirs4/sghms/medmicro/users/awitney/R/x86_64-redhat-linux-gnu-library/2.12/gee’

The downloaded packages are in
‘/tmp/RtmpD8sZiL/downloaded_packages’
Warning message:
In install.packages("gee") :
  installation of package 'gee' had non-zero exit status


> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C  
 [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8   LC_NAME=C 
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.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.12.0

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] how to divide each element of a matrix by a specific value per column

2011-01-27 Thread adam_pgsql

Hi,

I'd like to divide each element of a matrix by a specific value per column. 
These specific values are stored in a list. For example:

> x <- c(1,2,3,4,5)
> y <- matrix(c(1:30), nrow = 6)

Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have 
tried this

> my_function <- function(data, ind) data/ind
> apply(y, 2, my_function, x)
 [,1] [,2] [,3] [,4] [,5]
[1,]1  7.0 13.0 19.0 25.0
[2,]1  4.0  7.0 10.0 13.0
[3,]1  3.0  5.0  7.0  9.0
[4,]1  2.5  4.0  5.5  7.0
[5,]1  2.2  3.4  4.6  5.8
[6,]6 12.0 18.0 24.0 30.0
Warning messages:
1: In data/ind :
  longer object length is not a multiple of shorter object length
2: In data/ind :
  longer object length is not a multiple of shorter object length
3: In data/ind :
  longer object length is not a multiple of shorter object length
4: In data/ind :
  longer object length is not a multiple of shorter object length
5: In data/ind :
  longer object length is not a multiple of shorter object length

but as you can see it is applying them by row rather than column. Any ideas how 
to do this? Is there a variable within 'apply' that can be used to determine 
which column of y is being processed?

thanks for any help

adam

> sessionInfo()
R version 2.11.1 (2010-05-31) 
x86_64-apple-darwin9.8.0 

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Perl-R bridge

2009-01-19 Thread adam_pgsql


you could take a look at this:

http://www.omegahat.org/RSPerl/

but I'm not sure how well maintained it is currently.

adam

On 19 Jan 2009, at 02:00, ANJAN PURKAYASTHA wrote:


Hi,
I'm planning to access R from my perl scripts.
The only noteworthy bridge seems to be
Statistics-R-0.03.

Would anyone like to share their experience with this Perl-R bridge?
I'd like to install it in a Mac OS X.
Suggestions on alternate solutions will be appreciated.
Thanks in advance,
Anjan

--
=
anjan purkayastha, phd
bioinformatics analyst
whitehead institute for biomedical research
nine cambridge center
cambridge, ma 02142

purkayas [at] wi [dot] mit [dot] edu
703.740.6939

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.