Dear R-Helpers,

I have the following data set(y):

Years   Products
1          10
2          25
3          40
4          NA
5          35
<NA>   23
6         NA
7         67
8         NA

I want to create a new column into my dataset(y) under the following
conditions:
if years =NA and products >20 then new column=1 else new column=0;
to obtain the following results:

Years   Products New Column
1          10          0
2          25          0
3          40          0
4          NA         0
5          35          0
<NA>   23          1
6         NA          0
7         67           0
8         NA          0

Thank you in advance.


Serigo Della Franca

	[[alternative HTML version deleted]]

