similar to: ignoring objects containing NaN's in a recursive function

Displaying 20 results from an estimated 10000 matches similar to: "ignoring objects containing NaN's in a recursive function"

2004 Jul 13
12
Permutations
Dear R users, I?m a beginner user of R and I?ve a problem with permutations that I don?t know how to solve. I?ve 12 elements in blocks of 3 elements and I want only to make permutations inter-blocks (no intra-blocks) (sorry if the terminology is not accurate), something similar to: 1 2 3 | 4 5 6 | 7 8 9 | 10 11 12 ----------1st permutation 1 3 2 | 4 5 6 | 7 8 9 | 10 11 12 NO - - 3 2 1
2010 Mar 23
2
Saving tab/csv delimited data with NaN's
Hello, I am working multiple simulated data sets with missing values, I would like to store these data sets in either tab delimited format for .csv format with missing values marked as NaN's instead of NA's. I read the import/export document which mentions that write.table command converts NaN's to NA. Is there any other way I can store the NaN's. I tried the write syntax
2003 Apr 24
1
bca ci's and NaN's in boot.out
Dear All, I am trying to use the bca.ci function on a boot.out object which consists a few NaN's and I want to ignore those NaN's, and get a ci only for the "normal" values. boot.out$t has R number of values for 3000 different statistics, so when I use boot.ci(boot.out, index=i) and i happens to be a column in boot.out$t with some NaN's in there I get an error message. I
2009 Nov 22
1
how to generate balanced sample from two normal distribution
Good afternoon, I have a question on generating simple randomization data. Thanks for any suggestions. Two normal distribution N(0,1) and N(1,1) A: I want to generate 20 data, 10 from N(0,1) and 10 from (1,1). each observation's indicator (either is from N(0,1) or N(1,1) ) is randomized. I need use the frist 10 data from the generated 20 dataset. (it is not necessary 5 from N(0,1) and 5
2007 Oct 02
1
permutations of a binary matrix with fixed margins
J?r?me, As a first attempt, how about the function below. It works (or not) by randomly sorting the rows and columns, then searching the table for "squares" with the corners = matrix(c(1,0,0,1),ncol=2) and subtracting them from 1 to give matrix(c(0,1,1,0),ncol=2) (and vice versa). Randomized matrices can be produced as a chain where each permutation is seeded with the previous one.
2008 Aug 16
4
Dealing with NaN's in data frames
I am looking for the most efficient way to replace all occurrences of NaN in a data frame with NA. I can do this with a double loop, but it seems that there should be a higher level and more efficient way. With is.na, I could use ifelse, but if.nan seems not to have similar capabilities. TIA, Jon Peck Jon K. Peck jkpeck@aya.yale.edu [[alternative HTML version deleted]]
2013 Aug 29
3
[LLVMdev] Adding diversity for security (and testing)
On 08/28/2013 02:37 PM, Nick Lewycky wrote: > 1. I'm concerned about the deployment problem. I realize that being in > the compiler means you can transform the program in more exciting > ways, but it gives you a much worse deployment story than something > which modifies the program on disk like "prelink". Yes, definitely. Deployment is an issue which users will need
2007 Apr 24
2
Error in clusterApply(): recursive default argument reference
Hi, I want to compute a distribution of the intersection of a graph and 'randomized' graphs induced by the permutations of node labels (to preserve the graph topology). Since I ll have many permutations to perform, I was thinking of using the snow package and in particular "parSapply" to divide the work between my 4 CPUs. But I get the following error message : Error in
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
2008 Apr 19
1
resampling from distributions
Hello All, Once again thanks for all of the help to date. I am climbing my R learning curve. I've got a few more questions that I hope I can get some guidance on though. I am not sure whether the etiquette is to break up multiple questions or not but I'll keep them together here for now as it may help put the questions in context despite the fact that the post may get a little long.
2009 Nov 03
2
Re place only first NA in column
Dear All, I am trying to fill in a blank vector ("a") with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is " a[1st NA,]=nz" such that this will run until all of my NAs are replaced with an integer value based on randomizations.
2006 Apr 19
1
apply(table) miss factor structure
Hi, all. I didn't find something similar to this problem in past list. I have a data frame (named restr) where some columns are factors, like you can see: > table(restr[,"p1"]) 0 1 2 3 4 5 0 26 1 0 1 0 > table(restr[,"p2"]) 0 1 2 3 4 5 6 0 13 11 1 2 1 0 When I use apply, the factor structure is missed: >
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 Mar 04
0
Matrix Package, sparseMatrix, more NaN's than zeros
Hello, I have a lot of data and it has a lot of NaN values. I want to compress the data so I don't have memory issues later. Using the Matrix package, sparseMatrix function, and some fiddling around, I have successfully reduced the 'size' of my data (as measured by object.size()). However, NaN values are found all over in my data and zeros are important, but zeros are found very
2011 Sep 27
3
remove NaN from element in a vector in a list
Hello, What is the best way to turn a matrix into a list removing NaN's? I'm new to R... Start: > mt = matrix(c(1,4,NaN,5,3,6),2,3) > mt [,1] [,2] [,3] [1,] 1 NaN 3 [2,] 4 5 6 Desired result: > lst [[1]] [1] 1 3 [[2]] [1] 4 5 6 Thanks! Ben [[alternative HTML version deleted]]
2012 Jun 09
2
Help with permutation function from Turner et al. 2010 (Ecology)
Hello, I'm using R code that includes a residual permutation that was written as a supplement to the paper: Turner et al. 2010. A general hypothesis-testing framework for stable isotopes ratios in ecological studies. Ecology 91:2227-2233. The supplemental code is available at: http://www.esapubs.org/archive/ecol/E091/157/suppl-1.htm When I execute the function, no warnings are given
2020 Aug 31
1
make check fails due to NA / NaN mismatch
Thank you for the introduction to these recent changes, Martin. I think this was the second time I ran "make check" on that platform (Raspberry Pi 32-bit), and the first time (some months ago) it worked fine. So, that makes it kind of "suddenly", although I must say that my use of "make check" is very irregular. I compared code before and after the split you are
2008 Apr 09
3
permutation/randomization
Hello, I have what I suspect might be an easy problem but I am new to R and stumped. I have a data set that looks something like this b<-c(2,3,4,5,6,7,8,9) x<-c(2,3,4,5,6,7,8,9) y<-c(9,8,7,6,5,4,3,2) z<-c(9,8,7,6,1,2,3,4) data<-cbind(x,y,z) row.names(data)<-c('a','b','c','d','e','f','g','h') which gives: x y z
2008 Nov 30
2
Randomization of a two-way ANOVA?
Hello list, I wish to perform a randomization test on the F-statistics of a 2 way ANOVA but have not been able to find out how to do so - is there a package / function that can perform this that I am unaware of? FactorA has 6 levels (0,1,2,3,4,5) whereas FactorB has 3 (1,2,3). A sample: Resp. FactorA FactorB 2 0 2 3 1 2 1 2 2 0 3 2 0 4 2 0 5 2 4 0 1 6 1 1 1 2 1 0 3 1 1 4 1 0 5 1 2 0 2 3 1 2 1
2003 Oct 24
5
how to remove NaN columns ?
How can I remove columns with NaN entries ? Here is my simple example: > data <- read.csv("test.csv") > xdata <- data[3:length(data)] > xs <- lapply(xdata, function(x){(x - mean(x))/sqrt(var(x))}) > x <- data.frame(xs) > x C D E F 1 -0.7071068 NaN -0.7071068 -0.7071068 2 0.7071068 NaN 0.7071068 0.7071068