To whom it may concern,
I am a new user to R and I need help in my if and for statements as I need a 
place marker.

I would like to convert the following table:
Observation | Variable 1
--------------------|-------------
1 | 10000
2 | A 
3 | 631 

Into :
Observation| Variable 1 | Variable 1 Flag
----------------|------------------|------------------
1 |  10000 | NA
2 | NA | A
3 | 631 | NA


please note |  represents another column.

this is for a large data set and I cannot manually go through this:
my attempt to this was :
l=0 # placeholder
m<-c() #newvariable 1
v<-c() #newvariable flag
for (z in tablename1$Variable_1)
(if (is.numeric(z) ) m[z:l] l=l+1 else v[z:1] l=l+1

Can you please guide me as to how to approach this problem?
Any help would be greatly appreciated.
Tarun Manchanda


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to