Re: [R] missing value where TRUE/FALSE needed with R ipolygrowth

2025-05-09 Thread Jeff Newmiller via R-help
Your example is not reproducible. I recommend using the reprex package to get your examples in shape. You don't have to have NA in your data to encounter a problem... all you need is transformations during your analysis that runs into domain violations to create NA along the way... negative num

Re: [R] missing value where TRUE/FALSE needed ERROR

2016-02-09 Thread Maram SAlem
Thanks for helping thanoon. I used the if() { } else { . } and it worked better On 9 February 2016 at 15:56, thanoon younis wrote: > Hi, > > Try to check the function only > if (runif

[R] missing value where TRUE/FALSE needed ERROR

2016-02-09 Thread Maram SAlem
Hi all, I'm trying to write a function to implement a Metropolis-within-Gibbs algorithm for two parameters.I'm including a naive version here so as to be able to spot the error I got. So I first generate the vectors, X and R, that will help to start the algorithm using (for example): n=8; m=5; p=

Re: [R] Missing value handling for felm function in lfe package

2013-09-25 Thread sgaure
megha patnaik wrote > Dear All, > > I am trying to use the felm function in the lfe package. However it does > not seem to deal with missing values the way the lm function does. I wish > to tell it na.omit or na.action = na.omit but it does not recognize this. > I > need to allow for missing value

[R] Missing value handling for felm function in lfe package

2013-08-29 Thread Megha Patnaik
Dear All, I am trying to use the felm function in the lfe package. However it does not seem to deal with missing values the way the lm function does. I wish to tell it na.omit or na.action = na.omit but it does not recognize this. I need to allow for missing values as I have different specificatio

[R] Missing value or an infinity produced when evaluating the model

2013-07-06 Thread tong
Dear all, I want to estimate a nlrq using normal copula.The model is I want to estimate the delta in the above formula. The full codes I use are as following: > NormModel<-function(x, delta, mu, sigma, tau){ + z<

Re: [R] missing value where TRUE/FALSE needed

2011-12-23 Thread jim holtman
Given that the maximum floating point value is: $double.xmax [1] 1.797693e+308 and the number you are trying to calculate is 5E323 you are exceeding the size of numbers you can process. Have a happy holiday and glad I could help. On Fri, Dec 23, 2011 at 11:24 AM, Michael Pearmain wrote: > Tha

Re: [R] missing value where TRUE/FALSE needed

2011-12-23 Thread Michael Pearmain
Apologies, I was using top = 0.0001 I had looked at browser and did show notconverged = NA. But I couldn't understand why it worked for one and not the other? On Friday, 23 December 2011, jim holtman wrote: > Does this look similar to the error you are getting: > >> while(NA == TRUE) 1 > Erro

Re: [R] missing value where TRUE/FALSE needed

2011-12-23 Thread jim holtman
Does this look similar to the error you are getting: > while(NA == TRUE) 1 Error in while (NA == TRUE) 1 : missing value where TRUE/FALSE needed SO 'notconverged' is probably equal to NA. BTW, what is the value of 'tol'; I do not see it defined. So when computing 'notconverged' you have generat

[R] missing value where TRUE/FALSE needed

2011-12-23 Thread Michael Pearmain
Merry Xmas to all, I am writing a function and curiously this runs sometimes on one data set and fails on another and i cannot figure out why. Any help much appreciated. If i run the code below with data <- iris[ ,1:4] The code runs fine, but if i run on a large dataset i get the following error

Re: [R] MISSING VALUE IN R

2010-07-22 Thread stephen sefick
sum() has a na.rm argument sum(x, na.rm=TRUE) On Thu, Jul 22, 2010 at 7:19 PM, jd6688 wrote: > > I have a DF > > ID   VALUE > 100  120 > 101  100 > 102  100 > 103 > 104 > 105 > > > when i calculate the sum of the values, it returned NA. should I populate > the blank value as 0? > > Thanks, >

[R] MISSING VALUE IN R

2010-07-22 Thread jd6688
I have a DF ID VALUE 100 120 101 100 102 100 103 104 105 when i calculate the sum of the values, it returned NA. should I populate the blank value as 0? Thanks, -- View this message in context: http://r.789695.n4.nabble.com/MISSING-VALUE-IN-R-tp2299586p2299586.html Sent from

Re: [R] Missing value

2010-07-19 Thread jim holtman
do 'str(t1)' to see what the value returned is. Most likely one of the comparisons in the 'if' statement is evaluating to NA. Also PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. 2010/7/19 A. Fırat ÖZ

[R] Missing value

2010-07-19 Thread A . Fırat ÖZDEMİR
Hi, i have such a code tau<-0 for (i in 1:10) { x<-rnorm(20,0,1) # t1=onesampb(x,est=tauloc,SEED=F)$conf.interval if(t1[1]>0 ||t1[2]<0)tau=tau+1 } print (tau) this code gives me Error in if (t1[1] > 0 || t1[2] < 0) tau = tau + 1 : missing value where TRUE/FALSE needed what can be done

[R] missing value in Elastic Net

2009-08-05 Thread ram basnet
Dear R users,    Does Elasticnet (package "elasticnet") handle the missing value in predictors ? If some one can provide the way to hadle missing value, it will great. Thanks in advance.   Sincerely, Ram Kumar Basnet Wageningen University, The Netherlands   [[alternative HTML ver

Re: [R] missing value where TRUE/FALSE needed

2008-11-08 Thread Ray Brownrigg
To answer the actual question, your i and j indices are not what you expect (but are what you specify). Consider the following, which follows your algorithm: > vector1 <- sample(1:100,2) > vector2 <- sample(1:100,2) > for (i in vector1) { + for (j in vector2) { + show(c(i, j)) + } + } [

Re: [R] missing value where TRUE/FALSE needed

2008-11-07 Thread Erik Iverson
They may be the same length; that's not what the error message is complaining about: it says there is a missing value (i.e., an NA) where a TRUE/FALSE value is needed, therefore the 'if' doesn't know what to do, since it is not TRUE or FALSE. So, try summary(vector1) summary(vector2) sum(is.

Re: [R] missing value where TRUE/FALSE needed

2008-11-07 Thread jim holtman
It would be useful to learn how to use debug/browser. Here is the state of the machine when the error occurs: > test() Error in if (vector1[i] == vector2[j]) { : missing value where TRUE/FALSE needed Enter a frame number, or 0 to exit 1: test() Selection: 1 Called from: eval(expr, envir, enc

Re: [R] missing value where TRUE/FALSE needed

2008-11-07 Thread cruz
is this what you want? > vector1 [1] 65 1 34 100 42 20 79 43 89 10 > vector2 [1] 34 65 47 91 48 32 23 74 92 86 > > for (i in 1:10) { + for (j in 1:10) { + if (vector1[i] == vector2[j]) + show(c(i,j)) + } + } [1] 1 2 [1] 3 1 On Sat, Nov 8, 2008

[R] missing value where TRUE/FALSE needed

2008-11-07 Thread David Croll
Hello dear R people, for my MSc thesis I need to program some functions, and some of them simply do not work. In the following example, I made sure both vectors have the same length (10), but R gives me the following error: Error in if (vector1[i] == vector2[j]) { : missing value where TRUE

Re: [R] missing value with sign observed

2008-04-05 Thread Ben Bolker
kate uiuc.edu> writes: [snip] > > When I read this txt file into R and attach this data, I found the output of y is as the follows > [1] 8 5 3 + -1 + > Levels: -1 + 3 5 8 > > Could I get rid of Levels in the output? Because I need to use the observed y and x run regression first and t

[R] missing value with sign observed

2008-04-05 Thread kate
Hi, I have (x, y) data as the follows (saved in the txt file): x y 1 8 2 5 3 3 4 + 5 -1 6 + When I read this txt file into R and attach this data, I found the output of y is as the follows [1] 8 5 3 + -1 + Levels: -1 + 3 5 8 Could I get rid of Levels in the output? Because I need

[R] Missing value analysis in time series

2007-10-03 Thread Megh Dal
Hi all R user, Suppose I have daily time series value for two assets. However for some days value of 1 asset is missing whereas for some of the other days values of other asset are missing. Can anyone tell me what would be effective way by using statistical analysis to fill up those gaps b