[R] Re placing null values (#NULL!)

PDXRugger J_R_36 at hotmail.com
Fri Jul 17 22:37:33 CEST 2009


I am stumped.  I have a data set with multiple columns and about 65,000 case. 
Some of the cases have a "#NULL!" value so for dataframe "Props_":

access_emp       pct_vacant  TAVAIL park PARKACRES      totlandare
4538       52.15     #NULL!      0        1     22.99    74,129.70400
4539       52.15        .09       0        1     22.99    982,850.80400
10292      54.20     #NULL!      1        0      0.00   212,382.82400
11235      52.93     #NULL!      1        1     15.57   1,355,691.04700
14294      55.42     .09           0        0      0.00    36,693.81700
14295      55.42     #NULL!      0        0      0.00    97,526.17400
14296      55.42     #NULL!      0        0      0.00   125,131.20300
14297      55.42     #NULL!      0        0      0.00   209,691.18400
14298      55.42     .09           0        0      0.00    #NULL!
14299      55.42     #NULL!      0        0      0.00    26,161.29100

So i need to replace the the #NULL! with 0.  I have tried:

Props_pct_vacant<-Props_pct_vacant[Props_$pct_vacant !="#NULL!"]

Which seems to be deleting the #Null! cases but then the vectors are of
different lengths and i think it casues problems.  Ideally i would load the
data and remove all the cases with #NULL! values no matter what column there
in or at least specify the column.  So question one is since the NULL value
is actually a "#NULL!" value do the same commands apply becuase it seems
like they dont work.  The main question is how can i remove the #NULL! value
from each of the columns (entire cases is fine)  or specified columns. 
Thanks in advance.

Josh 
-- 
View this message in context: http://www.nabble.com/Replacing-null-values-%28-NULL%21%29-tp24540921p24540921.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list