[R] NA vs. <NA>

Muenchen, Robert A (Bob) muenchen at utk.edu
Fri Apr 4 18:00:13 CEST 2008


Dear R-Helpers,

Why does R show character missing values in vectors as NA and when
stored in a data frame as <NA>? I've searched but did not find an
explanation.

Thanks,
Bob

> gender <- c("f","f","f",NA,"m","m","m","m")
> gender
[1] "f" "f" "f" NA  "m" "m" "m" "m"  #here it lacks brackets.
> 
> q1 <- c(1,2,2,3,4,5,5,4)
> q1
[1] 1 2 2 3 4 5 5 4
> 
> myDF <- data.frame(q1,gender)
> myDF
  q1 gender
1  1      f
2  2      f
3  2      f
4  3   <NA>  #here it has brackets.
5  4      m
6  5      m
7  5      m
8  4      m

=========================================================
Bob Muenchen (pronounced Min'-chen), 
Manager, Statistical Consulting Center 
U of TN Office of Information Technology
Stokely Management Center, Suite 200
916 Volunteer Blvd., Knoxville, TN 37996-0520
Voice: (865) 974-5230
FAX: (865) 974-4810
Email: muenchen at utk.edu
Web: http://oit.utk.edu/scc
Map: http://www.utk.edu/maps 
News: http://listserv.utk.edu/archives/statnews.html
=========================================================



More information about the R-help mailing list