similar to: orderVector1 (sort.c): Tiny improvement concerning nalast

Displaying 20 results from an estimated 200 matches similar to: "orderVector1 (sort.c): Tiny improvement concerning nalast"

2009 Jul 14
1
Incorrect comment about ISNA(x) in Arith.h (PR#13826)
R-2.9.0/include/R_ext/Arith.h has: int R_IsNA(double); /* True for R's NA only */ int R_IsNaN(double); /* True for special NaN, *not* for NA */ int R_finite(double); /* True if none of NA, NaN, +/-Inf */ #define ISNA(x) R_IsNA(x) /* True for *both* NA and NaN. The first and last lines are contradictory - if R_IsNA is true only for NA, not NaN, then ISNA should be the same.
2008 Oct 01
0
Simulating random draws
Hi, I have a data frame containing a column of human judgments, some of which are missing: > pr[3] label 1 4 2 4 3 4 4 4 5 NA 6 3 7 3 8 3 9 3 10 NA 11 NA 12 NA 13 2 14 2 15 2 16 NA 17 1 18 -1 19 -1 20 -1 Accompanying this is a matrix containing multinomial probabilities for the missing values, note that they
2007 Mar 03
0
2 bugs in max.col() (PR#9542)
Dear R-Developers, I think I found two bugs in max.col(). Ties between zeros are not broken, which might affect simulations. -Inf and Zero can be treated the same, which can give completely wrong results, e.g. when the second max is sought by replacing all maxs by -Inf. To fix max.col I do offer the C-code behind my function rowMax(), which also handles NAs and seems to be faster. However,
2006 Dec 16
1
max.col oddity
I've noticed that the max.col function with the default "random" option often gives unexpected results. For instance, in this test, it seems clear what the answer should be: > # second col should always be max > x1 = cbind(1:10, 2:11, -Inf) > > # this works fine > max.col(x1, "first") [1] 2 2 2 2 2 2 2 2 2 2 > > # this gives random answers >
2006 Dec 14
0
max.col: bug or just oddity?
I've noticed that the max.col function with the default "random" option often gives unexpected results. For instance, in this test, it seems clear what the answer should be: > # second col should always be max > x1 = cbind(1:10, 2:11, -Inf) > > # this works fine > max.col(x1, "first") [1] 2 2 2 2 2 2 2 2 2 2 > > # this gives random answers >
2011 Nov 30
1
Error adding Bigmemory package
I am trying to add the bigmemory packages but I get the following error message: In file included from bigmemory.cpp:14:0: ../inst/include/bigmemory/isna.hpp: In function 'bool neginf(double)': ../inst/include/bigmemory/isna.hpp:22:57: error: 'isinf' was not declared in this scope make: *** [bigmemory.o] Error 1 ERROR: compilation failed for package 'bigmemory' * removing
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in patch-vec-subset. I've fixed this (I now see one does need to duplicate index vectors sometimes, though one can avoid it most of the time). I also split this patch in two, since it really has two different and independent parts. The patch-vec-subset patch now has only some straightforward (locally-checkable) speedups for
2005 Jan 05
1
Standalone Mathlib, C++ and ISNAN()
In the hope of some meaningful response and ignoring the risk of further abuse, let me try to clarify the issue here. I have re-read the 'Writing R Extensions' manual. It seems to me that it clearly says R API functions can be called from from C++ programs, and the API includes the special values ISNAN() and R_FINITE() and the missing test ISNA(). R_FINITE is no problem. It is
2015 May 28
1
Fix for bug in arima function
>>>>> Patrick Perry <pperry at stern.nyu.edu> >>>>> on Wed, 27 May 2015 23:19:09 -0400 writes: {@PP, you forgot this part:} >>>>> peter dalgaard <pdalgd at gmail.com> >>>>> on Thu, 21 May 2015 14:36:03 +0200 writes: >> I suspect that what we really need is >> >> fitI <- lm(x ~
2008 Oct 07
4
sort a list?
I am trying to sort a list and the data is obiously not in the right format. I am trying: x <- list() x[["A"]] <- 1 x[["B"]] <- 2 order(x) But am getting: Error in order(x) : unimplemented type 'list' in 'orderVector1' How should I change the list so that it can be sorted? What kinds of objects (classes of objects) can be sorted? Thank you. Kevin
2006 May 08
1
Help on zoo and datetime series
Hello, i would like to import this txt file: Giorno;PM10 2006-01-01 10:10;10.3 2006-02-02 20:22;50.3 2006-03-03 23:33;20.1 ......... As it's an irregular time series i use zoo as follow: require(zoo) z <- read.table("c:\\1.csv", sep=";", na.strings="-999", header=TRUE) q <- zoo(z$PM10, strptime(as.character(z$Giorno),"%Y-%m-%d %H:%M")) At this
2008 Nov 13
1
Error in Quantile function
If anyone can assist with this problem you have my great thanks: I am trying to establish and plot confidence intervals on a bootstrapped function. I have a more complicated function that has no problems with determining the confidence intervals using the quantile command. This is outside the bootstrap portion of the code that is working fine it is just determining everything for the more
2008 Sep 22
4
sort a data matrix by all the values and keep the names
Dear all, If I have a data frame x<-data.frame(x1=c(1,7),x2=c(4,6),x3=c(8,2)): x1 x2 x3 1 4 8 7 6 2 I want to sort the whole data and get this: x1 1 x3 2 x2 4 x2 6 x1 7 x3 8 If I do sort(X), R reports: Error in order(list(x1 = c(1, 7), x2 = c(4, 6), x3 = c(8, 2)), decreasing = FALSE) : unimplemented type 'list' in 'orderVector1' The only way
2006 Jun 27
1
order() (PR#9039)
Full_Name: Murray Smith Version: 2.2.1 OS: Windows XP Submission from: (NULL) (202.36.29.1) order() will not allow a complex vector for its first argument. This contrasts with sort() which will happily sort a complex vector. While this may not be regarded as a bug by some, it is annoying for anyone who makes frequent use of complex numbers. The problem occured in the Windows version 2.2.1 of
2017 Mar 20
2
IO error when writing to disk
Hello, Here a small improvement for R. When you use the function write.table, if the disk is full for example, the function doesn't return an error and the file is written but truncated. It can be a source of mistakes because you can then copy the output file and think everything is ok. How to reproduce ------------------------- >> write.csv(1:10000000, 'path') You must have
2008 Feb 21
2
Unable to create/index a zoo irregular timeseries
In the text file pressione2008.csv I have the following "Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" which is a collection of blood pressure data at different time of the day. I would
2009 Jun 18
2
Argument as.integer(NA) to a function C
Hi the list, I am writing a R function that call a C function. The C function needs integers but I do not manage to give a NA integer as argument : --- C code --- void essai(int *t){ Rprintf("\nT0=%i T1=%i T2=%i T3=%i",t[0],t[1],t[2],t[3]); } --- R --- boub <- c(1,2,3,4) .C("pour",as.integer(boub),NAOK=TRUE) # T0=1 T1=2 T2=3 T3=4[[1]] # [1] 1 2 3 4 boub <-
2017 Jan 20
1
NaN behavior of cumsum
Hi! I noticed that cumsum behaves different than the other cumulative functions wrt. NaN values: > values <- c(1,2,NaN,1) > for ( f in c(cumsum, cumprod, cummin, cummax)) print(f(values)) [1] 1 3 NA NA [1] 1 2 NaN NaN [1] 1 1 NaN NaN [1] 1 2 NaN NaN The reason is that cumsum (in cum.c:33) contains an explicit check for ISNAN. Is that intentional? IMHO, ISNA would be better
2020 May 18
2
order function called on a data.frame?
I guess we could make it do the equivalent of do.call(order, df). On Mon, May 18, 2020 at 8:32 AM Rui Barradas <ruipbarradas at sapo.pt> wrote: > > Hello, > > There is a result with lists? I am getting > > > order(list(letters, 1:26)) > #Error in order(list(letters, 1:26)) : > # unimplemented type 'list' in 'orderVector1' > >
2020 Jan 01
2
New R function is.nana = is.na & !is.nan
Hello R-devel, Best wishes in the new year. I am writing to kindly request new R function so NA_real_ can be more easily detected. Currently if one wants to test for NA_real_ (but not NaN) then extra work has to be done: `is.na(x) & !is.nan(x)` Required functionality is already at C level so to address my request there is not that much to do. Kevin Ushey made a nice summary of current R C api