similar to: Inconsistency in treating NaN-results?

Displaying 20 results from an estimated 30000 matches similar to: "Inconsistency in treating NaN-results?"

2015 Nov 30
1
Inconsistency in treating NaN-results?
As a side note, Splus makes sin(x) NA, with a warning, for abs(x)>1.6*2^48 (about 4.51e+14) because more than half the digits are incorrect in sin(x) for such x. E.g., in R we get: > options(digits=16) > library(Rmpfr) > sin(4.6e14) [1] -0.792253849684354 > sin(mpfr(4.6e14, precBits=500)) 1 'mpfr' number of precision 500 bits [1]
2015 Nov 30
0
Inconsistency in treating NaN-results?
R and the S language that it is based on has evolved as much as it has been designed, so there are often inconsistencies due similar functionality evolving from different paths. In some cases these inconsistencies are resolved, but generally only once someone notices and care enough to do something about it. In some other cases the inconsistencies are left for historical reasons and for back
2018 Mar 16
2
Apparent bug in behavior of formulas with '-' operator for lm
Joris, the point is that 'z' is NOT used as a predictor in the model. Therefore it should not affect predictions. Also, I find it suspicious that the error only occurs when the response variable conitains missings and 'z' is unique (I have tested several other cases to confirm this). -Mark Op vr 16 mrt. 2018 om 13:03 schreef Joris Meys <jorismeys at gmail.com>: >
2018 Mar 16
2
Apparent bug in behavior of formulas with '-' operator for lm
Dear R-developers, In the 'lm' documentation, the '-' operator is only specified to be used with -1 (to remove the intercept from the model). However, the documentation also refers to the 'formula' help file, which indicates that it is possible to subtract any term. Indeed, the following works with no problems (the period '.' stands for 'all terms except the
2009 Mar 27
3
how to get all iterations if I meet NaN?
hi, everybody, please help me with this question: If I want to do iteration for 1000 times, however, for the 500th iteration, there is NaN appears. Then the iteration will stop. If I don't want the stop and want the all the 1000 iterations be done. What shall I do? suppose I have x[1:1000] and z[1:1000],I want to do some calculation for all x[1] to x[1000]. z=rep(0,1000) for (i in 1:1000){
2009 Dec 31
2
Benefit of treating NA and NaN differently for numerics
Hello, I notice in main/arithmetic.c, that NA and NaN are encoded differently(since every numeric NA comes from R_NaReal which is defined via ValueOfNA) . What is the benefit of treating these two differently? Why can't NA be a synonym for NaN? Thank you Saptarshi (R-2.9)
2017 Apr 01
1
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
On Fri, Mar 31, 2017 at 10:14 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: > From ?NA > > Numerical computations using ?NA? will normally result in ?NA?: a > possible exception is where ?NaN? is also involved, in which case > either might result. > > and ?NaN > > Computations involving ?NaN? will return ?NaN? or perhaps ?NA?: >
2009 Aug 30
1
Infinite != NaN?
Greetings. I somehow had the impression that an infinite number, as obtained by dividing by zero, for instance, would be flagged as both missing ("NA") and not a number ("NaN"). It appears that I was wrong on both counts, although the is.finite function correctly returns FALSE in such a case. Please see the appended for some details. I guess that the bottom line is that R
2001 Aug 24
1
Reading Inf and NaN values under windows (PR#1072)
Under windows, R supports IEEE floating point arithmetic, but doesn't allow conversion of Inf and NaN from character to numeric. R> is.nan(NaN) [1] TRUE R> as.numeric(as.character(NaN)) [1] NA Warning message: NAs introduced by coercion R> is.infinite(Inf) [1] TRUE R> as.numeric(as.character(Inf)) [1] NA Warning message: NAs introduced by coercion whereas under Linux R>
2005 Mar 21
2
NaN
Dear R What does NaN mean? I recently did a correlation on a batch of data for some reason it didn't like one column cor(sleep,use="complete.obs") BodyWt BrainWt SlowSleep ParaSleep TotalSleep BodyWt 1.00000000 0.95584875 -0.3936373 -0.07488845 -0.3428373 BrainWt 0.95584875 1.00000000 -0.3867947 -0.07427740 -0.3370815 SlowSleep -0.39363729
2011 May 26
2
NaN, Inf to NA
Hi, I want to recode all Inf and NaN values to NA, but I;m surprised to see the result of the following code. Could anybody enlighten me about this? > df <- data.frame(a=c(NA, NaN, Inf, 1:3)) > df[is.infinite(df) | is.nan(df)] <- NA > df a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 > Thanks! Cheers!! Albert-Jan
2011 May 26
2
NaN, Inf to NA
Hi, I want to recode all Inf and NaN values to NA, but I;m surprised to see the result of the following code. Could anybody enlighten me about this? > df <- data.frame(a=c(NA, NaN, Inf, 1:3)) > df[is.infinite(df) | is.nan(df)] <- NA > df a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 > Thanks! Cheers!! Albert-Jan
2015 Dec 16
2
Mystifying SEGFAULT on 3.2.3 but not 3.2.2
Dear R developers, (Apologies about previous incomplete e-mail, I fat-fingered a keyboard shortcut)?? I recently upgraded to 3.2.3 and am getting mystifying errors with my in-development code (available at https://github.com/gertvv/gemtc/tree/feature/regression). Every few hundred LPs that I solve using the rcdd package will result in a SEGFAULT in the garbage collector (address 0x10, cause
2011 Sep 11
2
how to remove NA/NaN/Inf in a matrix??
Hi all.. I'm very new R, and i'm analyzing microarray data using Bioconductor.. Recently i was given microarray data to analyze. The problem is whenever i run MAS5 presence calls algorithm, it throws an error saying NA/NaN/Inf in foreign function. How do i remove such NA/NaN/Inf's ?? I tried na.omit(dataframe) but stil problem exists. dimension of matrix (data) is 35556 7. >
2010 Aug 27
3
predict.loess and NA/NaN values
Hi! In a current project, I am fitting loess models to subsets of data in order to use the loess predicitons for normalization (similar to what is done in many microarray analyses). While working on this I ran into a problem when I tried to predict from the loess models and the data contained NAs or NaNs. I tracked down the problem to the fact that predict.loess will not return a value at all
2010 Mar 31
2
Should as.complex(NaN) -> NA?
I'm having trouble grokking complex NaN's. This first set examples using complex(re=NaN,im=NaN) give what I expect > Re(complex(re=NaN, im=NaN)) [1] NaN > Im(complex(re=NaN, im=NaN)) [1] NaN > Arg(complex(re=NaN, im=NaN)) [1] NaN > Mod(complex(re=NaN, im=NaN)) [1] NaN > abs(complex(re=NaN, im=NaN)) [1] NaN and so do the following > Re(complex(re=1,
2012 Jul 31
3
Help with NaN when 0 divided by 0
Hi All, I have some data where I am doing fairly simple calculations, nothing more than adding, subtracting, multiplying and dividing. I’m running into a problem when I divide one variable by another and when they’re both 0 I get NaN. I realize that if you divide a non-zero by 0 then you get Inf, which is, of course, correct. But in my case I never get Inf, just NaN because of the structure
2011 Dec 13
1
NA/NaN/Inf in foreign function call question
Dear all, I have a datafile where I run haplo.GLM analyses using several variables (a matrix). However, when I include a certain binary variable (0,1) I get this message Error: NA/NaN/Inf in foreign function call (arg 4) I don't get an error when I include another binary variable, again with only 0,1. Both variables don't have missing values, they only have 0 and 1. Why do I get an
2017 Apr 01
3
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
In R 3.3.3, I observe the following on Ubuntu 16.04 (when building from source as well as for the sudo apt r-base build): > x <- c(NA, NaN) > mean(x) [1] NA > mean(rev(x)) [1] NaN > rowMeans(matrix(x, nrow = 1, ncol = 2)) [1] NA > rowMeans(matrix(rev(x), nrow = 1, ncol = 2)) [1] NaN > .rowMeans(x, m = 1, n = 2) [1] NA > .rowMeans(rev(x), m = 1, n = 2) [1] NaN >
2008 Oct 25
1
0 ^ NaN == Inf, why?
In R, 0 ^ NaN yields Inf. I would have expected NaN or perhaps 0. Is this behaviour intended? >sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils