[R] Missing values

Robert Baer rbaer at atsu.edu
Tue Aug 17 20:43:27 CEST 2010


----- Original Message ----- 
From: "Stephen Liu" <satimis at yahoo.com>
To: <r-help at r-project.org>
Sent: Tuesday, August 17, 2010 8:25 AM
Subject: Re: [R] Missing values


> ----- Original Message ----
>
> From: Michael Bedward <michael.bedward at gmail.com>
> To: Stephen Liu <satimis at yahoo.com>
> Cc: r-help at 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 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).
>
> H Michael,
>
> I understand above explanation.
>
> I don't understand follow;
>
> 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,NA);  ind <- is.na(z)
> z <- c(1:3,NA);  ind <- is.na(z)

# To see the logical vector the same size as the original print them out
# z has four elements, one of which is "not available" or "not applicable"
z
  [1]  1  2  3 NA

# ind has four LOGICAL elements, the last of which is "not available"
#  so the function is.na() returns TRUE
ind  # logical elements
[1] FALSE FALSE FALSE  TRUE




>
>
>>?is.na
> ....
> Usage:
>
>     NA
>     is.na(x)
>     ## S3 method for class 'data.frame':
>     is.na(x)
>
>     is.na(x) <- value
> ....
>
>
>>NaN means that the value wasn't missing but can't be expressed as a
>>number. 0/0 is NaN because the result is mathematically undefined

# Are you reading zero divided by zero in the line above?

>>(sometimes called 'indeterminate').
>
> What is following expression;
>
>> Inf - Inf
# infinity and minus infinity


>
> ?
>
> TIA
>
>
> B.R.
> Stephen L
>
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list