Re: [R] missing values error in if statement

2022-05-20 Thread Rui Barradas
Hello, I'm getting an error when running your code: learner = lrn("classif.randomForest", predict_type = "prob") #> Error: Element with key 'classif.randomForest' not found in DictionaryLearner! Rui Barradas Às 14:12 de 20/05/2022, Neha gupta escreveu: When I run print(fc) it shows 'Inf'.

Re: [R] missing values error in if statement

2022-05-20 Thread PIKAL Petr
factor function. You probably modified the code from help page but in that case you should check if all your objects are the same mode and structure as the objects in help page code. Cheers Petr From: Neha gupta Sent: Friday, May 20, 2022 3:22 PM To: PIKAL Petr Cc: r-help mailing list Subject: R

Re: [R] missing values error in if statement

2022-05-20 Thread Neha gupta
Actually it's found in a library (mlr3extralearners). I have already imported this library in my code. On Friday, May 20, 2022, Rui Barradas wrote: > Hello, > > I'm getting an error when running your code: > > learner = lrn("classif.randomForest", predict_type = "prob") > #> Error: Element with

Re: [R] missing values error in if statement

2022-05-20 Thread Neha gupta
When I run print(fc) it shows 'Inf'. It mean it doesn't calculate the bias/fairness, maybe due to missing values. RF passes 1/5 metrics Total loss : Inf On Fri, May 20, 2022 at 3:06 PM Rui Barradas wrote: > Hello, > > This is a frequent way of coding and a source for questions. > > > ifels

Re: [R] missing values error in if statement

2022-05-20 Thread PIKAL Petr
f Neha gupta > Sent: Friday, May 20, 2022 10:16 AM > To: Jeff Newmiller > Cc: r-help mailing list > Subject: Re: [R] missing values error in if statement > > I am sorry.. The code is here and data is provided at the end of this > email. > > data = readARFF("aho

Re: [R] missing values error in if statement

2022-05-19 Thread Jeff Newmiller
Not reproducible. Posted HTML. On May 19, 2022 2:30:58 PM PDT, Neha gupta wrote: >Why do I get the following error when my variable in the 'if statement' has >no missing values. > >I check with is.na(my variable) and it has no missing values > >Error in if (fraction <= 1) { : missing value where

Re: [R] Missing Values in Logical Expressions

2016-04-26 Thread PIKAL Petr
Hm Based on Jim's data your construction gives me correct result. > Umsatz_2011<-c(1,2,3,4,5,NA,7,8,NA,10) > Kunde_2011<-rep(0:1,5) > Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1, 1, 0) > Check_Kunde_2011 <- factor(Check_Kunde_2011, levels = c(1,0), labels = > c("Check

Re: [R] Missing Values in Logical Expressions

2016-04-26 Thread Jim Lemon
Hi Georg, You could just use this: Umsatz_2011<-c(1,2,3,4,5,NA,7,8,NA,10) Kunde_2011<-rep(0:1,5) Check_Kunde_2011<- c("OK","Check")[as.numeric(is.na(Umsatz_2011) & Kunde_2011 == 1)+1] Check_Kunde_2011 will be a vector of strings. Jim On Tue, Apr 26, 2016 at 6:09 PM, wrote: > Hi All, > > I n

Re: [R] missing values in csv file

2016-02-17 Thread William Dunlap via R-help
You can add the argument na.print=" " to print() to make the missing values print as " " instead of as NA. Some, but not all print methods support this. E.g., > print(c(1,2,NA,4,5,NA), na.print="-") [1] 1 2 - 4 5 - > print(matrix(c(1,2,NA,4,5,NA),2), na.print="-") [,1] [,2] [,3] [1,]

Re: [R] missing values in csv file

2016-02-17 Thread S Ellison
> Is it possible to get object where missing values aren't replaced with NAs? Not with read.table, if they are really missing. But you can replace them later - see below - and if they are marked you can change what read.table considers to be 'missing'. > Is it possible to replace NAs with empty

Re: [R] missing values in csv file

2016-02-17 Thread Michael Dewey
Assuming it is a character variable test <- c("a", NA, "b") > test [1] "a" NA "b" > test[is.na(test)] <- " " > test [1] "a" " " "b" but if it is numeric this as, as others have said, almost certainly not what you really wanted to do On 17/02/2016 10:04, Jan Kacaba wrote: In my original data

Re: [R] missing values in csv file

2016-02-17 Thread PIKAL Petr
, February 17, 2016 2:01 PM > To: Jan Kacaba > Cc: r-help@r-project.org > Subject: Re: [R] missing values in csv file > > On Wed, Feb 17, 2016 at 12:04 PM, Jan Kacaba > wrote: > > > In my original data a csv file I have missing values. If I use > > read.table the mi

Re: [R] missing values in csv file

2016-02-17 Thread Adrian Dușa
On Wed, Feb 17, 2016 at 12:04 PM, Jan Kacaba wrote: > In my original data a csv file I have missing values. If I use read.table > the missing values are replaced by NAs. > That is the normal way of dealing with missing values, in R. Is it possible to get object where missing values aren't repl

Re: [R] Missing Values in Table Statement

2015-06-16 Thread PIKAL Petr
nsole. It will create object named temp as you can easily check. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi82 > Sent: Tuesday, June 16, 2015 8:20 AM > To: r-help@r-project.org > Subject: Re: [R] Missing Values i

Re: [R] Missing Values in Table Statement

2015-06-15 Thread Shivi82
HI Petr,There is no reason for holding back the data from dput format. The reason for not supplying is that i tried multiple times but it the output what comes is not really user friendly is what i think.Not sure if i am missing a trick somewhere as i tried both the dput and dget options. Though as

Re: [R] Missing Values in Table Statement

2015-06-15 Thread PIKAL Petr
; table(is.na(test)) FALSE TRUE 7 3 test[5:7]<-"" str(test) chr [1:10] "b" "a" "d" "e" "" "" "" "d" "d" "c" table(is.na(test)) FALSE 10 Cheers Petr > -----Origina

Re: [R] Missing Values in Table Statement

2015-06-12 Thread Shivi82
HI Don, This is the exact result i need. However in my case i am not getting any value under TRUE whereas FALSE captures total observations in each variable. Please find the syntax and output from the code: table(test$ORIGIN_NAME,is.na(test$SCH_TIME)) Output FALSE

Re: [R] Missing Values in Table Statement

2015-06-12 Thread MacQueen, Don
Maybe it will help if I create some fake data to illustrate what I think you want: set.seed(25) tmp <- data.frame(origin=sample( letters[1:3], 25, replace=TRUE), schd= sample( 1:5, 25, replace=TRUE) ) tmp$schd[ c(5,7,18,22) ] <- NA print(tmp) table( tmp$origi

Re: [R] Missing Values in Table Statement

2015-06-12 Thread John Kane
If possible always supply data in dput() form. John Kane Kingston ON Canada > Kindly let me know if i need to supply dput data. Thank you!!! FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!

Re: [R] Missing Values in Table Statement

2015-06-12 Thread Shivi82
Hi Petr, Please see the output from dget as follows. ORIGIN ORIGIN_NAME DESTINATION DESTINATION_NM RPS_NO VENDOR_NAME CR_DT SCHD_MRKT VHL_NO vhl_cap 1 DLI11DELHI-11 NDA50NOIDA-50 1350760

Re: [R] Missing Values in Table Statement

2015-06-11 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi82 > Sent: Friday, June 12, 2015 8:28 AM > To: r-help@r-project.org > Subject: Re: [R] Missing Values in Table Statement > > Hi Petr, > > Probably i did not explain my

Re: [R] Missing Values in Table Statement

2015-06-11 Thread Shivi82
Hi Petr, Probably i did not explain my scenario clearly. table(test$ORIGIN_NAME,is.na(test$SCH_TIME)) is the syntax with which i am trying to find per destination wise how many instances are there where system failed to enter the scheduled delivery time & there are multiple cases of these. I am e

Re: [R] Missing Values in Table Statement

2015-06-11 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi82 > Sent: Friday, June 12, 2015 7:41 AM > To: r-help@r-project.org > Subject: [R] Missing Values in Table Statement > > HI All, > > I need help on 2 issues as highlighted below" > > A)I have 2 v

Re: [R] missing values in an array

2013-03-15 Thread Ray Cheung
Thank you very much. Arun's reply is exactly what I need. Thank you once again!~ ray On Sat, Mar 16, 2013 at 12:31 AM, Berend Hasselman wrote: > > On 15-03-2013, at 17:08, Ray Cheung wrote: > > > Dear All, > > > > I've an array with some missing values (NA) in between. I want to remove > > tha

Re: [R] missing values in an array

2013-03-15 Thread Berend Hasselman
On 15-03-2013, at 17:08, Ray Cheung wrote: > Dear All, > > I've an array with some missing values (NA) in between. I want to remove > that particular matrix if a missing value is detected. How can I do so? > Thank you very much. It is not clear what the dimension of your array is. If your ar

Re: [R] missing values in an array

2013-03-15 Thread arun
HI, Try this: set.seed(25) arr1<- array(sample(c(1:40,NA),60,replace=TRUE),dim=c(5,4,3)) arr1[,,sapply(seq(dim(arr1)[3]),function(i) all(!is.na(arr1[,,i])))] # [,1] [,2] [,3] [,4] #[1,]    2   13   34   17 #[2,]   19    3   15   39 #[3,]    4   25   10   16 #[4,]    7   22    5    7 #[5,]   12 

Re: [R] missing values are not allowed in subscripted assignments of data frames

2013-01-21 Thread arun
Hi, I guess there should be missing values. set.seed(5) data1<-data.frame(commNo=sample(786:789,10,replace=TRUE),Col2=rnorm(10,10)) set.seed(5) data2<-data.frame(commNo=sample(c(786:789,NA),10,replace=TRUE),Col2=rnorm(10,10)) data1[data1$commNo==786, "commNo"]<-"Name of the Community" data2[data

Re: [R] missing values are not allowed in subscripted assignments of data frames

2013-01-21 Thread arun
Hi, If 'commNo` is factor. set.seed(5) data1<-data.frame(commNo=sample(786:789,10,replace=TRUE),Col2=rnorm(10,10)) set.seed(5) data2<-data.frame(commNo=sample(c(786:789,NA),10,replace=TRUE),Col2=rnorm(10,10)) data4<-within(data1,{commNo<-factor(commNo)}) data4[data4$commNo==786, "commNo"]<-"Name

Re: [R] missing values are not allowed in subscripted assignments of data frames

2013-01-21 Thread David Winsemius
On Jan 21, 2013, at 7:35 AM, David Studer wrote: Hello everybody! I am trying to replace community numbers with community names (character). I am using the following code: data[data$commNo==786, "commNo"]<-"Name of the Community" data$commNo is probably a factor. As such the equality te

Re: [R] missing values are not allowed in subscripted assignments of data frames

2013-01-21 Thread S Ellison
> I am trying to replace community numbers with community > names (character). > I am using the following code: > > data[data$commNo==786, "commNo"]<-"Name of the Community" > > Unfortunately, I get the error message > missing values are not allowed in subscripted assignments of > data frame

Re: [R] Missing values and geeglm

2012-11-13 Thread joann
model<-geeglm(outcome~predictor+confounder, family=binomial(link = "logit"), data=na.omit(DataMiss), corstr='ar1', id=id, std.err="san.se") There could be other variables in DataMiss that have many missing values, so when you apply na.omit() on DataMiss, you may be ending up with an empty data.f

Re: [R] Missing Values

2012-09-13 Thread grond
t.org] On Behalf Of Jeff Newmiller > Sent: Thursday, September 13, 2012 1:46 PM > To: grond; [hidden email] > Subject: Re: [R] Missing Values > > Don't give it any. Instead of banks$two, use na.omit(banks$two). > ---

Re: [R] Missing Values

2012-09-13 Thread grond
this worked bootmean(na.omit(Xt$Y), conf = 90,nrep = 1000) thanks From: "Jeff Newmiller [via R]" To: grond Date: 09/13/2012 04:48 PM Subject: Re: Missing Values Don't give it any. Instead of banks$two, use na.omit(banks$two). --

Re: [R] Missing Values

2012-09-13 Thread Allen C Gellis
thank you for the help So will the entire syntax appear as bootmean(na.omit(banks$two),na.rm = TRUE, conf = 90,nrep = 1000) From: Jeff Newmiller To: grond , r-help@r-project.org Date: 09/13/2012 04:46 PM Subject: Re: [R] Missing Values Don't give it any. Instead of banks$two

Re: [R] Missing Values

2012-09-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Jeff Newmiller > Sent: Thursday, September 13, 2012 1:46 PM > To: grond; r-help@r-project.org > Subject: Re: [R] Missing Values > > Don't give it a

Re: [R] Missing Values

2012-09-13 Thread Jeff Newmiller
Don't give it any. Instead of banks$two, use na.omit(banks$two). --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Missing Values

2012-09-13 Thread Bert Gunter
True != TRUE ## All CAPS! -- Bert On Thu, Sep 13, 2012 at 12:41 PM, grond wrote: > I am using bootstrap and cannot figure how to tell R to ignore missing values > (NA) > > I tried this syntax and it did not work. The name of the file is banks the > column two. > > bootmean(banks$two,na.rm = Tru

Re: [R] missing values in party::ctree

2011-02-18 Thread Torsten Hothorn
On Thu, 17 Feb 2011, Andrew Ziem wrote: After ctree builds a tree, how would I determine the direction missing values follow by examining the BinaryTree-class object? For instance in the example below Bare.nuclei has 16 missing values and is used for the first split, but the missing values

Re: [R] missing values

2010-12-01 Thread Iasonas Lamprianou
an...@uni-hamburg.de" ; Rhelp Sent: Wed, 1 December, 2010 18:39:42 Subject: RE: [R] missing values You can also explore the classical() function in the MiscPsycho package that does item analysis. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun..

Re: [R] missing values

2010-12-01 Thread Doran, Harold
gt; To: Michael Bedward; ivan.calan...@uni-hamburg.de; Rhelp > Subject: Re: [R] missing values > > thank you, I'll have a go and let you know if i have problems > Dr. Iasonas Lamprianou > > > > > Assistant Professor (Educational Research and Evaluation) > Depa

Re: [R] missing values

2010-12-01 Thread Iasonas Lamprianou
ed, 1 December, 2010 11:40:13 Subject: Re: [R] missing values And just to add to Ivan's comment, if you are using the rowSums or colSums functions with a matrix or data.frame they also have the na.rm argument. Michael On 1 December 2010 20:16, Ivan Calandra wrote: > Hi, > > (a) sum(

Re: [R] missing values

2010-12-01 Thread Michael Bedward
And just to add to Ivan's comment, if you are using the rowSums or colSums functions with a matrix or data.frame they also have the na.rm argument. Michael On 1 December 2010 20:16, Ivan Calandra wrote: > Hi, > > (a) sum() and mean() have a na.rm argument that should be set to TRUE. > > (b) let'

Re: [R] missing values

2010-12-01 Thread Ivan Calandra
Hi, (a) sum() and mean() have a na.rm argument that should be set to TRUE. (b) let's try with an example: x <- c(1:5, NA, NA, 6:10, NA) x[is.na(x)] <- 0 ## replace NAs by 0 HTH, Ivan Le 12/1/2010 10:00, Iasonas Lamprianou a écrit : Dear all, i have spent a lot of time trying to solve this p

Re: [R] Missing values in function calls

2010-08-18 Thread Greg Snow
?missing -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of vo...@cbox.cz > Sent: Tuesday, August 17, 2010 6:22

Re: [R] Missing values

2010-08-17 Thread Stephen Liu
- Original Message From: Robert Baer To: Stephen Liu ; r-help@r-project.org Sent: Wed, August 18, 2010 2:43:27 AM Subject: Re: [R] Missing values Hi Robert, - snip - >> z <- c(1:3,NA); ind <- is.na(z) ># To see the logical vector the same size as the original prin

Re: [R] Missing values

2010-08-17 Thread Robert Baer
- Original Message - From: "Stephen Liu" To: Sent: Tuesday, August 17, 2010 8:25 AM Subject: Re: [R] Missing values - Original Message From: Michael Bedward To: Stephen Liu Cc: r-help@r-project.org Sent: Tue, August 17, 2010 3:57:05 PM Subject: Re: [R] Miss

Re: [R] Missing values in function calls

2010-08-17 Thread David Winsemius
On Aug 17, 2010, at 8:22 AM, wrote: Hello, I would like to ask you how to determine if function value is missing for particular function call. I mean if I define function ?is.na f David Winsemius, MD West Hartford, CT __ R-help@r-projec

Re: [R] Missing values

2010-08-17 Thread Stephen Liu
- Original Message From: Michael Bedward To: Stephen Liu Cc: r-help@r-project.org Sent: Tue, August 17, 2010 3:57:05 PM Subject: Re: [R] Missing values >NA is a value that you can use for "missing" or inapplicable. It is >also the value returned by R functions to indic

Re: [R] Missing values

2010-08-17 Thread Michael Bedward
NA is a value that you can use for "missing" or inapplicable. It is also the value returned by R functions to indicate missing (e.g. if you use the match function to search a vector for a particular value, but the value isn't present, match will return NA). NaN means that the value wasn't missing

Re: [R] missing values in autocorelation

2010-05-31 Thread Joris Meys
Could you specify the problem and give a minimal example that represents your datastructure and reproduces the error? See also the posting guides : http://www.R-project.org/posting-guide.html Cheers Joris On Mon, May 31, 2010 at 1:12 PM, nuncio m wrot

Re: [R] missing values in document

2008-04-30 Thread jim holtman
How are the 'empty' cell identified? It appears that you are using the default of read.table which says blanks are the delimiters. How are two or more empty cells identified? Can you output a CSV file so that you have commas as separators so you can identify the empty fields? On Wed, Apr 30, 20

Re: [R] missing values in document

2008-04-30 Thread Jim Lemon
Monna Nygård wrote: No matter how I´ve tried o find a solution for this simple question, I can´t. Sorry for bothering with such a matter. I have an excel-files with some empty cells=missing values. How do I tell R that these should be NA´s? TRFLP1 <-(read.table(file="S://SEDIM//Kokeilu//T

Re: [R] missing values in document

2008-04-30 Thread S Ellison
What exactly is on line 1743? Genuinely empty cells will probably read as NA anyway. Excel errors, prefixed # in excel, will be read as comment markers and cause the remainder of the line to be ignored. This often causes this kind of error. Steve E >>> Monna Nygård <[EMAIL PROTECTED]> 30/04/20

Re: [R] missing values

2007-11-23 Thread Charilaos Skiadas
Here's my take on it, don't know if you cared at all about optimizing the first couple of lines: data <- data.frame(x=rep(c("A","B"),5), y=c(NA,NA,rnorm(8))) means <- with(data,ave(y, as.character(x), FUN=function(x) mean(x, na.rm=TRUE))) data$y <- ifelse(is.na(data$y),means,data$y) I tend to

Re: [R] missing values

2007-11-23 Thread jim holtman
you could use this instead of the last two statements; don't know if it makes any simpler since it is just combining into one statement what you had in two: data$y[is.na(data$y)] <- means[is.na(data$y)] On Nov 23, 2007 1:49 PM, lamack lamack <[EMAIL PROTECTED]> wrote: > > > > Dear all, there is