Displaying 20 results from an estimated 5000 matches similar to: "noncommutative addition: NA+NaN != NaN+NA"
2009 Apr 30
2
NA_real_ <op> NaN -> NA or NaN, should we care?
On Linux when I compile R 2.10.0(devel) (src/main/arithmetic.c in
particular)
with gcc 3.4.5 using the flags -g -O2 I get noncommutative behavior when
adding NA and NaN:
> NA_real_ + NaN
[1] NaN
> NaN + NA_real_
[1] NA
If I compile src/main/arithmetic.c without optimization (just -g)
then both of those return NA.
On Windows, using a precompiled R 2.8.1 from CRAN I get
NA for
2005 Feb 05
2
Problem installing Hmisc (more info)
Frank Harrell suggested I re-post with information about the version of
R
Heres's the information:
> > version
> _
> platform powerpc-apple-darwin6.8
> arch powerpc
> os darwin6.8
> system powerpc, darwin6.8
> status
> major 2
> minor 0.1
> year 2004
> month 11
> day 15
> language R
Here's what happens
2004 Nov 01
2
Compilation error on mgcv_1.1-7 on OS X (10.3)
Greetings
I run into a compilation error when updating to mgcv_1.1-7 in R 2.0.0 on
OS X 10.3. Note that other pacakges have compiled nicely.
Some details are given below, but in short it looks like it's seeking for
/usr/local/lib/powerpc-apple-darwin6.8/3.4.2/
which I don't have. But I do have
/usr/lib/gcc/darwin/3.3
i.e a lower version of GCC in a different directory. More
2004 Nov 18
0
Fwd: Re: 3d scatter plot with drop line
Hi
try this:
p3dpairs <- function(x,x1,
xlim=NULL,ylim=NULL,zlim=NULL,col=par("col"), pch=par("pch"),
cex=par("cex"), ...){
if(is.matrix(x)){
z <- x[,3]
y <- x[,2]
x <- x[,1]
}
if(is.matrix(x1)){
z1 <- x1[,3]
y1 <- x1[,2]
x1 <- x1[,1]
}
if(missing(zlim)) {
z.grid <-
2004 May 12
1
convert.times in chron, error when 59 < seconds < 60 (PR#6878)
Full_Name: Dennis Wolf
Version: 1.9.0
OS: Mac OS 10.3.3
Submission from: (NULL) (160.91.76.23)
platform powerpc-apple-darwin6.8
arch powerpc
os darwin6.8
system powerpc, darwin6.8
status
major 1
minor 9.0
year 2004
month 04
day
2005 Mar 24
2
problem with pdf() on Mac Os X
Hello R helpers,
I am quite new as a R user, and even more on a Mac Os. I am running R
under Emacs 21.3.30.5 through ESS.
I have some problems with the pdf() device : when sent to it, plots
don't come out with any
labels, titles or whatever written. I don't have that problem when
plots are sent to X11 or postscript devices.
As pdf is the native format on Mac Os X, i find it sad to
2018 Jul 02
2
base::mean not consistent about NA/NaN
And for a starker example of this (documented) inconsistency,
arithmetic addition is not commutative:
> NA + NaN
[1] NA
> NaN + NA
[1] NaN
On Mon, Jul 2, 2018 at 5:32 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 02/07/2018 11:25 AM, Jan Gorecki wrote:
>> Hi,
>> base::mean is not consistent in terms of handling NA/NaN.
>> Mean should not
2004 Nov 15
2
Problems installing packages on MacOS with R 2.00
Dear all,
I have a problem installing a package required by Hmisc on MacOS 10.3.5
with R 2.00.
g77 -fno-common -g -O2 -c avas.f -o avas.o
g77 -fno-common -g -O2 -c rlsmo.f -o rlsmo.o
gcc -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o
acepack.so ace.o avas.o rlsmo.o -L/usr/local/lib
-L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2
2004 Oct 23
2
R_LIBS and R Cocoa GUI for Mac OS X (PR#7308)
Full_Name: David Firth
Version: 2.0.0
OS: Mac OS 10.3.5
Submission from: (NULL) (81.178.234.156)
When running R in R Cocoa GUI 1.0 (v2004-10-14), I have
> Sys.getenv()[["R_LIBS"]]
[1] "/Users/david/Library/R"
> .libPaths()
[1] "/Users/david/Library/R/library"
[2] "/Library/Frameworks/R.framework/Resources/library"
The pasting of
2004 Nov 23
4
data.frame into vector
Hi
I want to extract a row from a data.frame but I want that object to
be a vector . After trying some different ways I end up always with a
data.frame or with the wrong vector. Any pointers?
x <- data.frame(a = factor(c('a',2,'b')), b = c(4,5,6))
I want to get
"a" "4"
I tried:
as.vector(x[1,])
a b
1 a 4
(resulting in a data.frame even after in my
2004 Mar 30
1
Console/command line output
Hi all,
I am working on Macos x 10.3 (Panther) to build a package consisting of
C/C++ code that is called from R. In the C/C++-sources I use several
commands to print info to the console:
std::cout << "info" << endl;
and:
Rprintf("info\n");
Both work fine when R is run on the command line but neither works when
running Raqau (I did check the preference boxes
2005 Sep 12
2
heatmap question
I'm having trouble with the heatmap function in R. When I try and
heatmap something, my graphics window does not open. Does anyone
know if this is a glitch in the version of R that I'm using? I've
listed my version of R below, as well as a simple heatmap command.
I'm running the program on a Mac, OS 10 v 10.3.9. Any suggestions??
Thanks!
Peter
> version
_
2004 Oct 18
2
concatenating lists elementwise
Hi
How do I concatenate two lists element-by-element?
Example:
list.1 <- list(temperature=c("hot","cold") , size=c("big","medium"))
list.2 <- list(temperature=c("lukewarm") , size=c("massive","tiny"))
list.wanted <- list(temperature=c("hot","cold","lukewarm") ,
2004 Jan 14
1
arrows on contour lines
Hello everybody
I'm using contour() to draw streamlines of potential flow, eg
jj <- seq(from= -4, to=4,len=20)
jj <- outer(jj,jj,function(x,y){x})+1i*outer(jj,jj,function(x,y){y})
f <- function(x){x^2}
contour(Im(f(jj)), nlevels=44 , labels="")
How best to put arrows on the contour lines to show the direction of flow?
(ie I want contour lines looking like
2004 Nov 11
1
axis lines crossing at origin
Hi
how do I make my axes cross at the origin?
x <- seq(from=-pi,to=pi,len=30)
plot(x,sin(x))
makes the axes cross at about (-pi,-1).
How do I get my x and y axes to cross in the centre of the graph,
with the sine curve passing through
the intersection?
I couldn't find anything in ?par or ?axis; searching R-FAQ for "axis"
didn't help.
--
Robin Hankin
Uncertainty
2004 Jun 11
4
rownames of single row matrices
Hi
I want to extract rows of a matrix, and preserve rownames even if only
one row is selected. Toy example:
R> a <- matrix(1:9,3,3)
R> rownames(a) <- letters[1:3]
R> colnames(a) <- LETTERS[1:3]
R> a
A B C
a 1 4 7
b 2 5 8
c 3 6 9
Extract the first two rows:
R> wanted <- 1:2
R> a[wanted,]
A B C
a 1 4 7
b 2 5 8
rownames come through fine. Now extract just
2004 Sep 08
3
do.call("[", ...) question
Hi again everyone
I have an arbitrarily dimensional array "a" and a list "jj" of length
length(dim(a)). The elements of jj are vectors of indexes.
How do I use do.call() to extract a[ jj[[1]], jj[[2]], jj[[3]], ...] ?
Toy example follows:
a <- matrix(1:30,5,6)
jj <- list(5:1,6:1)
I want the following
a[ jj[[1]],jj[[2]] ]
How do I do this?
OBAttempts:
2004 Nov 15
2
argument rationalization
Hi
I am writing a bunch of functions that take two, three or four
arguments. These functions operate on vectors of the same length;
but I want the function
to behave sensibly if one or more arguments are scalars. "+" does
this for two arguments:
"+"(1:10,3) # interpreted as "+"(1:10,rep(3,10))
But my functions can take more arguments. Say f() takes three:
2018 Jul 18
1
base::mean not consistent about NA/NaN
Yes, the performance overhead of fixing this at R level would be too
large and it would complicate the code significantly. The result of
binary operations involving NA and NaN is hardware dependent (the
propagation of NaN payload) - on some hardware, it actually works the
way we would like - NA is returned - but on some hardware you get NaN or
sometimes NA and sometimes NaN. Also there are C
2004 Sep 13
1
Rd files with "%" (was: permuting dimensions)
Professor Ripley
thanks for this. Very much appreciated.
The original subject line reflected my late-night conviction
that the answer might involve passing a strange list to do.call().
Anyway, package magic is broken (only in R-devel, I might add) because I have
a function called "%eq%".
R-2.0.0 CMD check is stopping (I think) because it interprets the
"%" as a