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

[R] missing values error in if statement

2022-05-19 Thread Neha gupta
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 TRUE/FALSE needed Best regards [[alternative HTML version deleted]] __

Re: [R] nMDS with R: missing values

2018-04-22 Thread Jari Oksanen
Are you missing values coded as missing values? That is, are they NA? Such NA-values should be handled by vegan::monoMDS. Naturally, it can be possible that your data set cannot be meaningfully analysed if you have too many missing values or missing values are grouped in peculiar ways. Zero-valu

Re: [R] nMDS with R: missing values

2018-04-18 Thread David L Carlson
AM To: David L Carlson Subject: RE: nMDS with R: missing values Dear Prof Carlson, Thank you for your reply. I'm using 'vegan' with 'vegdist' and 'bray'. I have a selection of datasets that cover different time periods (converted to z-scores), so a record that start

Re: [R] nMDS with R: missing values

2018-04-17 Thread David L Carlson
sity College Station, TX 77843-4352 0-Original Message- From: R-help On Behalf Of Jessie Woodbridge Sent: Tuesday, April 17, 2018 2:05 PM To: r-help@r-project.org Subject: [R] nMDS with R: missing values Dear All, I was wondering whether anyone might be able to provide some advice with an

[R] nMDS with R: missing values

2018-04-17 Thread Jessie Woodbridge
Dear All, I was wondering whether anyone might be able to provide some advice with an nMDS / R problem. I’m trying to run nMDS on a dataset that contains many missing values and was wondering how I can account for the missing values when running nMDS? It seems as though the data are being group

[R] nMDS with R: missing values

2018-04-17 Thread Jessie Woodbridge
Dear All, I was wondering whether anyone might be able to provide some advice with an nMDS / R problem. I'm trying to run nMDS on a dataset that contains many missing values and was wondering how I can account for the missing values when running nMDS? It seems as though the data are being group

Re: [R] Missing Values in Logical Expressions

2016-04-26 Thread PIKAL Petr
project.org] On Behalf Of > g.maub...@weinwolf.de > Sent: Tuesday, April 26, 2016 10:10 AM > To: r-help@r-project.org > Subject: [R] Missing Values in Logical Expressions > > Hi All, > > I need to evaluate missing values in my data. I am able to filter these values > and

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

[R] Missing Values in Logical Expressions

2016-04-26 Thread G . Maubach
Hi All, I need to evaluate missing values in my data. I am able to filter these values and do simple statistics on it. But I do need new variables based on variables with missing values in my dataset: Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1, 1, 0) Check_Kunde_20

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

[R] missing values in csv file

2016-02-17 Thread Jan Kacaba
In my original data a csv file I have missing values. If I use read.table the missing values are replaced by NAs. Is it possible to get object where missing values aren't replaced with NAs? Is it possible to replace NAs with empty space? [[alternative HTML version deleted]] _

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 highli

[R] Missing Values in Table Statement

2015-06-11 Thread Shivi82
HI All, I need help on 2 issues as highlighted below" A)I have 2 variables:- Sch_Time & Origin Name. Now there are multiple instances where Scheduled time i.e. Sch_Time is missing from each location hence i need to count how many instances do i have split on location. the code i have is : table(

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
rch 15, 2013 12:08 PM Subject: [R] missing values in an array 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. Best regards, Ray     [[alternative HTML vers

[R] missing values in an array

2013-03-15 Thread Ray Cheung
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. Best regards, Ray [[alternative HTML version deleted]] __ R-help@r-

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

2013-01-21 Thread arun
ta3,4)  #    commNo  Col2 #1   787  9.397092 #2   789  9.527834 #4   787  9.714226 #5 Name of the Community 10.138108 A.K. - Original Message - From: David Studer To: r-help@r-project.org Cc: Sent: Monday, January 21, 2013 1

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

2013-01-21 Thread arun
ar to the ones that you got. A.K. - Original Message - From: David Studer To: r-help@r-project.org Cc: Sent: Monday, January 21, 2013 10:35 AM Subject: [R] missing values are not allowed in subscripted assignments of data frames Hello everybody! I am trying to replace community number

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

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

2013-01-21 Thread David Studer
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" Unfortunately, I get the error message missing values are not allowed in subscripted assignments of data frames

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

[R] Missing Values

2012-09-13 Thread grond
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 = True, conf = 90,nrep = 1000) -- View this message in context: http://r.789695.n4.nabble.com/M

[R] Missing values and geeglm

2011-07-18 Thread E
Dear all I am struggling with how to deal with missing values using geeglm. I know that geeglm only works with complete datasets, but I cannot seem to get the na.omit function to work. For example assuming DataMiss contains 3 columns, each of which has missing observations, and an id column with

[R] missing values and error message

2011-06-09 Thread Anglin, Morris
Hello forum, I am using R to do some Exploratory analysis on my data resulting in the following 4 plots. #1- Histogram of the variable; #2- Kernel density estimation of the variable; #3- Normal Q-Q plot ; #4- Box-plot of the variable. The error message comes in when i try to plot # 2 above when

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

[R] missing values in party::ctree

2011-02-17 Thread Andrew Ziem
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 are not listed in either set of factors. (

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

[R] missing values

2010-12-01 Thread Iasonas Lamprianou
Dear all, i have spent a lot of time trying to solve this problem, but I am sure that there must be a simple solution. So, as a last resort, I am coming back to you again. I have a dataset with some (almost random) values in many variables. Lets say that the dataset represents the scores of stu

Re: [R] Missing values in function calls

2010-08-18 Thread Greg Snow
t 17, 2010 6:22 AM > To: r-help@r-project.org > Subject: [R] Missing values in function calls > > > 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 > > f > >

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

[R] Missing values in function calls

2010-08-17 Thread vojta
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 f __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

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

[R] Missing values

2010-08-17 Thread Stephen Liu
Hi folks, Could you please help me to understand; An Introduction to R http://cran.r-project.org/doc/manuals/R-intro.html#Logical-vectors The function is.na(x) gives a logical vector of the same size as x with value TRUE if and only if the corresponding element in x is NA. > z <- c(1:3

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

[R] missing values in autocorelation

2010-05-31 Thread nuncio m
Hi all, I am trying to find the autocorrelation of some time series. I have say 100 files, some files have only missing values(-99.99, say). I dont want to exclude these files as they represent some points in a grid. But when the acf command is issued i get an error. Error in plot.window

[R] missing values in 'ncdf', integer versus byte

2010-02-25 Thread Albert Vernon Smith
I'm working with the ncdf package, and I'm seeing a behavior which I am unsure whether it is a bug or a feature. I am creating a variable, which I make with the precision of "byte" and also set a missing value, When I put into this variable, all my NA values are put in properly as the missing val

[R] missing values at a combination of two factors

2009-09-18 Thread Timothy Clough
Dear All, I have two factors: GROUP and PATIENT, where PATIENT is nested within GROUP. >levels(example$GROUP) [1] "0" "1" "2" "3" "4" > levels(example$PATIENT) [1] "1" "2" "3" There are three observations at each combination of these factors. However, there are no observations for PATIEN

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

[R] missing values in document

2008-04-30 Thread Monna Nygård
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//TRFLP1.txt",col.name

[R] Missing Values in Design Package

2008-01-15 Thread sj
I am using psm to fit a survival model with a dataset that has missing values, e.g., DS <-psm(Surv(los,DSCHRG) ~AGE + SEX + ACUITY, data=LOS,dist='weibull',x=TRUE,y=TRUE) and I notice that when I look at the output there are 0 missing values and when I use the summary function e.g., summary(DS)

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

[R] missing values: a question

2007-11-23 Thread lamack lamack
Dear all, Is there a best way to do the following task? x = rep(c("A","B"),5)y = rnorm(10)data = data.frame(x,y)data$y[1:2] = c(NA,NA)means = ave(data$y,as.character(data$x),FUN=function(x)mean(x,na.rm=T))aux = which(is.na(data$y))d

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

[R] missing values

2007-11-23 Thread lamack lamack
Dear all, there is a best way to do the following task? x = rep(c("A","B"),5) y = rnorm(10) data = data.frame(x,y) data$y[1:2] = c(NA,NA) means = ave(data$y,as.character(data$x),FUN=function(x)mean(x,na.rm=T)) aux = which(is.na(data$y)

[R] missing values in mixed model

2007-10-21 Thread Irene Mantzouni
Dear all, I have a mixed model of the form: y[it]=a+b*z[i]+ai+(c+c[i])*x[it] ("i" refers to group and "t" to observation in group). zi are group-specific variables available only for a number of groups and "ai", "ci" denote the random effects on the intercept and slope respectively. Is the