[R] Re: R vrs S
Heberto Ghezzo
HEBERTO at MEAKINS.Lan.McGill.CA
Wed Oct 14 08:47:40 CEST 1998
Hi, I am relatively new to R programming. I have Guido's version on a
Win95 Pentium with 32 Mb RAM.
I tried to compile the Package MIXREG of Rolf Turner in S to R
almost everything works OK but he has a function po = partial outer
product as follows:
po <- function(a,b) {
array(apply(b,2,"*",a),dim=c(dim(a),dim(b)[2]))) }
in S-Plus given
x = ( 1 1
1 2
1 3
1 4 )
po(x,x) gives
[,,1] = 1 1
1 2
1 3
1 4
[,,2] = 1 1
2 4
3 9
4 16
ie a collection of flats of outer products, now in R the same
function gives an error for un conmensurable arrays. I have to re-
write po as
po <- function(a,b) {
bb <- array(0,dim=c(dim(a),dim(b)[2])
for (i in 1:dim(a)[1]) {
bb[i,,] <= outrer(a[i,],b[i,]) }
bb
}
Am I missing something? . The help files for 'apply' in R and is S+
are exaclty the same, but the implementations obviously are
different. . .
Another, tring again to port FUNFITS i get a lot of errors for
missing i-o something, I deleted all the 'write(*,*)' from the
fortran sources but there remain some 'write(2,*)...' writings to
temporary files which the compiler library does not like. I am using
MINGW32 1.02
Is there a way to bypass this error and add the proper library to the
link list?
Thanks to all.
..
R. Heberto Ghezzo Ph.D.
Meakins-Christie Labs
McGill University
Montreal - Canada
heberto at meakins.lan.mcgill.ca
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list