Hi,
Thanks for your help (andresrcs) but unfortunately I am still stuck with the problem.
I have categories variable that has 8 categories to 2 categories (0 and 1)by using the following codes:
da31381.0002$Q6008BR <- da31381.0002$Q6008
levels(da31381.0002$Q6008BR) <- c("0", "0", "1", "1", "1", NA,NA,NA)
summary(da31381.0002$Q6001BR)
0 1 NA's
14149 424 477
But in structure R mention it 1 and 2.
str(da31381.0002$Q6001BR)
Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
I need to change it to 0 and 1 so that its structure also changes to 0 and 1
Later on I need to change the variable(Q6001BR) to numeric to rowSum it with other similar variables. With above problem the sum results in summing the values as shown by the str() function.
Your help will be highly appreciated.Thanks