Skip to content

zeros in table() output in version 1.3.1

9 messages · Peter Dalgaard, Mark Myatt, Brian Ripley +4 more

#
Are the following differences in table() output
between versions 1.3.0 and 1.3.1 a feature, a bug
or a problem with my implementation?

(I am running under Solaris 2.7 SPARC, built using the
Sun C and FORTRAN compilers.)

Version 1.3.1:
1
  1 1

Version 1.3.0:
0 1
  0 1 0
  1 0 1


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Steve Shiboski <steve at biostat.ucsf.edu> writes:
That'll be a bug, but it is not there when R is built with GNU tools:
0 1
  0 1 0
  1 0 1
_                   
platform sparc-sun-solaris2.7
arch     sparc               
os       solaris2.7          
system   sparc, solaris2.7   
status                       
major    1                   
minor    3.1                 
year     2001                
month    08                  
day      31                  
language R
#
Steve Shiboski <steve at biostat.ucsf.edu> writes:
Odd. I don't get this behaviour on my Windows box. I think that,
perhaps, it is down to how the binary was compiled. Did you use the Sun
tools or the GNU tools?

Mark


--
Mark Myatt


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
1 day later
#
On Wed, 24 Oct 2001, Mark Myatt wrote:

            
I don't see it on Solaris 2.7 built with Sun's C and Fortran using either
Sun or GNU tools.   So it seems definitely a priblem with one specific
installation.
#
It turns out to be associated with the compilation flags
I put in the config.site file for the Sun C compiler.
Recompiling with the default flags chosen by R eliminates
the problem.

I put the following flags in config.site before building:

 CFLAGS=-fast 
 SHLIB_CFLAGS=-lsunmath 
 CPICFLAGS=-xcode=pic32

Not sure which caused the problem with table(), but
R's defaults eliminate -fast, -xcode=pic32 and -lsunmath.

Thanks for the responses.

-S
#
On Fri, 26 Oct 2001, Steve Shiboski wrote:

            
-fast disables IEEE 754 arithmetic. For me R fails make check with that.
(You did run make check, didn't you ...?)

I use -xO5 -xlibmil -dalign (some libraries need -dalign), and f90 which
picks up -lsunmath too.
#
I hope somebody can help me out with this. Let's say I have a matrix with
i rows and j columns and I want to find the index of the row AND column of
the maximum value in the matrix. I tried to play around with the which()
command, but couldn't find an easy solution that didn't involve loops and
various other inelegant approaches. I hope that there is an easy way of
doing this. Thanks in advance for any suggestions!

------------------------------------------------------------------------
Wolfgang Viechtbauer                       wviechtb at s.psych.uiuc.edu
Department of Quantitative Psychology      viechtba at students.uiuc.edu

University of Illinois, Champaign-Urbana   [Virus  based  on  an honors-
Room 409, Psychology Building              system:  Forward  this  to 10
603 E. Daniel Street                       random  people  and  delete a
Champaign, IL 61820                        bunch of your files. Thanks.]

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
which(x,arr.ind=TRUE)
On Fri, 26 Oct 2001, Wolfgang Viechtbauer wrote:

            

  
    
2 days later
#
[,1] [,2] [,3] [,4] [,5]
[1,]    1    4    3    2    4
[2,]    1    4    4    2    1
[3,]    4    3    3    2    3
[4,]    3    2    2    2    1
[5,]    2    2    3    2    2
[1] 4
row col
[1,]   3   1
[2,]   1   2
[3,]   2   2
[4,]   2   3
[5,]   1   5


Kjetil Halvorsen
Wolfgang Viechtbauer wrote:
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._