Re: [R] re-code missing value

2009-09-16 Thread Jorge Ivan Velez
Hi Steve, Here is a suggestion using your original df1: # Create a copy -- you can avoid this newdf1 <- df1 # Process newdf1[,2:4] <- apply(newdf1[,2:4], 2, function(x) as.numeric(x)) # Removing df1 rm(df1) # Result newdf1 # str() str(newdf1) # 'data.frame': 18 obs. of 4 variables: # $ s

[R] re-code missing value

2009-09-16 Thread Steve Hong
Dear all, I have partial data set with four colums. First column is "site" with three factors (i.e., A, B, and C). From second to fourth columns (v1 ~ v3) are my observations. In the observations of the data set, "." indicates missing value. I replaced "." with NA. To replace "." with NA, I u