Re: [R] NA values for "col"

2021-09-27 Thread Rolf Turner
On Mon, 27 Sep 2021 14:54:53 -0700 Bert Gunter wrote: > ... and also note in the *Color Specification* section of ?par, to > which ?points points, > > "Additionally, "transparent" is transparent, useful for filled areas > (such as the background!), and just invisible for things like lines or > t

Re: [R] NA values for "col"

2021-09-27 Thread Bert Gunter
... and also note in the *Color Specification* section of ?par, to which ?points points, "Additionally, "transparent" is transparent, useful for filled areas (such as the background!), and just invisible for things like lines or text. In most circumstances (integer) NA is equivalent to "transparen

Re: [R] NA values for "col"

2021-09-27 Thread Bert Gunter
?text says "... NA values of font are replaced by par("font"), and similarly for col." Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Sep 27, 2021 at 2:

[R] NA values for "col"

2021-09-27 Thread Rolf Turner
I've just noticed what seems to me to be somewhat peculiar behaviour in respect of how different plotting functions treat a specification "col=NA". Consider: plot(1:10) text(4,6,labels="o",col=NA) points(6,4,col=NA) The symbol produced by the call to text() shows up (is black). The symbol prod

[R] NA values in package KFAS or SSPIR

2010-11-04 Thread feder
Hi, I tried to manage exponential family state-space model with the packages KFAS and sspir. The problem is that my data set includes some NA observation and it seems not working. Any suggestion? Thanks in advance, Federico -- View this message in context: http://r.789695.n4.nabble.com/NA-val

[R] NA values

2010-11-04 Thread feder
Hi, I tried to manage exponential family state-space model with the packages KFAS. The problem is that my data set includes some NA observation and it seems not working. Any suggestion? Thanks in advance, Federico -- View this message in context: http://r.789695.n4.nabble.com/R-pkgs-New-packa

Re: [R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
On Fri, Mar 26, 2010 at 4:15 PM, Matthew Dowle wrote: > The type of 'NA' is logical. So x[NA] behaves more like x[TRUE] i.e. silent > recycling. > >> class(NA) > [1] "logical" >> x=101:108 >> x[NA] > [1] NA NA NA NA NA NA NA NA >> x[c(TRUE,NA)] > [1] 101  NA 103  NA 105  NA 107  NA > >> x[as.integ

Re: [R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
On Fri, Mar 26, 2010 at 4:15 PM, Bert Gunter wrote: > Is this, from the man page, relevant? > > "An empty index selects all values: this is most often used to replace all > the entries but keep the attributes. " No, I think that means doing "x[]", and only in replacement: > x=101:105 > attr(x,"

Re: [R] NA values in indexing

2010-03-26 Thread Bert Gunter
-boun...@r-project.org] On Behalf Of Barry Rowlingson Sent: Friday, March 26, 2010 5:10 AM To: r-help@r-project.org Subject: [R] NA values in indexing If you index a vector with a vector that has NA in it, you get NA back: > x=101:107 > x[c(NA,4,NA)] [1] NA 104 NA > x[c(4,NA)] [1] 104 NA

Re: [R] NA values in indexing

2010-03-26 Thread Gabor Grothendieck
Try > x <- 101:107 > x[c(NA_integer_, NA_integer_)] [1] NA NA On Fri, Mar 26, 2010 at 8:09 AM, Barry Rowlingson wrote: > If you index a vector with a vector that has NA in it, you get NA back: > >  > x=101:107 >  > x[c(NA,4,NA)] >  [1]  NA 104  NA >  > x[c(4,NA)] >  [1] 104  NA > > All well and

Re: [R] NA values in indexing

2010-03-26 Thread Matthew Dowle
The type of 'NA' is logical. So x[NA] behaves more like x[TRUE] i.e. silent recycling. > class(NA) [1] "logical" > x=101:108 > x[NA] [1] NA NA NA NA NA NA NA NA > x[c(TRUE,NA)] [1] 101 NA 103 NA 105 NA 107 NA > x[as.integer(NA)] [1] NA HTH Matthew "Barry Rowlingson" wrote in message news

[R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
If you index a vector with a vector that has NA in it, you get NA back: > x=101:107 > x[c(NA,4,NA)] [1] NA 104 NA > x[c(4,NA)] [1] 104 NA All well and good. ?"[" says, under NAs in indexing: When extracting, a numerical, logical or character ‘NA’ index picks an unknown element

[R] NA values in Standard Error for zeroinfl()

2009-10-30 Thread Chris Fowler
I am fitting a model using zeroinfl() and it runs without errors, returning results that are generally consistent with my hypotheses. One of my variables is percent black (pblack). This variable was highly significant in some of the other count models I ran on the way to my current formulation

Re: [R] NA values trimming

2009-07-06 Thread nyk
Thanks again for all the help, now I was able to write the function I need: namax <- function(m,mp) { # arguments: matrix, maximum percentage of NA values allowed in rows/colums c1 <- 0 c2 <- 0 repeat { nas1 <- rowMeans(is.na(m)) nas2 <- col

Re: [R] NA values trimming

2009-07-06 Thread nyk
Thanks a lot, this works! The one I used before was wrong: > data_matrix [,1] [,2] [,3] [,4] [,5] [1,]11 NA11 [2,]22222 [3,]33333 [4,] NA NA NA NA NA [5,]55555 [6,] NA66 NA6 [7,] NA NA

Re: [R] NA values trimming

2009-07-06 Thread hadley wickham
On Mon, Jul 6, 2009 at 12:12 AM, nyk wrote: > > Thanks for your reply! This is what I was looking for! > I'm using > nas1 <- apply(data_matrix,1,function(x)sum(is.na(x))/nrow(data_matrix)) > nas2 <- apply(data_matrix,2,function(x)sum(is.na(x))/ncol(data_matrix)) You can simplify this a little: pe

Re: [R] NA values trimming

2009-07-06 Thread nyk
Thanks for your reply! This is what I was looking for! I'm using nas1 <- apply(data_matrix,1,function(x)sum(is.na(x))/nrow(data_matrix)) nas2 <- apply(data_matrix,2,function(x)sum(is.na(x))/ncol(data_matrix)) The thing about "significantly more" isn't really a helpful as I look at the data now. I

Re: [R] NA values trimming

2009-07-05 Thread David Winsemius
On Jul 4, 2009, at 9:22 PM, nyk wrote: I have a data matrix containing quite a lot of missing values (NA). I know how to remove all column or rows containing NA values, but is there a some standard method for removing not all NA containing rows/column, but only those which have signific

[R] NA values trimming

2009-07-05 Thread nyk
I have a data matrix containing quite a lot of missing values (NA). I know how to remove all column or rows containing NA values, but is there a some standard method for removing not all NA containing rows/column, but only those which have significantly more NAs than others? -- View this message

[R] NA-values and logical operation

2009-01-13 Thread Patrick Hausmann
Dear list, as a result of a logical operation I want to assign a new variable to a DF with NA-values. z <- data.frame( x = c(5,6,5,NA,7,5,4,NA), y = c(1,2,2,2,2,2,2,2) ) p <- (z$x <= 5) & (z$y == 1) p z[p, "p1"] <-5 z # ok, this works fine z <- z[,-3] p <- (z$x <= 5) & (z$y =

Re: [R] NA values

2007-11-21 Thread Eleni Christodoulou
Yes, thanks a lot! It works fine! Eleni On Nov 21, 2007 2:03 PM, Ted Harding <[EMAIL PROTECTED]> wrote: > > On 21-Nov-07 11:15:32, Eleni Christodoulou wrote: > > Hi all! > > I am new to R and I would like to ask you the following question: > > How can I substitute the NA values with 0 in a data f

Re: [R] NA values

2007-11-21 Thread Ted Harding
On 21-Nov-07 11:15:32, Eleni Christodoulou wrote: > Hi all! > I am new to R and I would like to ask you the following question: > How can I substitute the NA values with 0 in a data frame? > I cannot find a command to check if a value is NA... > > Thank you very much! > Eleni As has been said, is

Re: [R] NA values

2007-11-21 Thread Jared O'Connell
?is.na On Nov 21, 2007 12:15 PM, Eleni Christodoulou <[EMAIL PROTECTED]> wrote: > Hi all! > > I am new to R and I would like to ask you the following question:How > can I substitute the NA values with 0 in a data frame? I cannot find a > command to check if a value is NA... > > Thank you very muc

Re: [R] NA values

2007-11-21 Thread Gabor Csardi
Eleni, this question appears about every month on this list, try using the RSiteSearch command before posting. Thanks. RSiteSearch("replace NA") http://finzi.psych.upenn.edu/R/Rhelp02a/archive/109176.html Gabor On Wed, Nov 21, 2007 at 01:15:32PM +0200, Eleni Christodoulou wrote: > Hi all! > >

[R] NA values

2007-11-21 Thread Eleni Christodoulou
Hi all! I am new to R and I would like to ask you the following question:How can I substitute the NA values with 0 in a data frame? I cannot find a command to check if a value is NA... Thank you very much! Eleni __ R-help@r-project.org mailing list htt