Dear all,

I would like to apply a function to two vectors 

For example,

A<-c(NA,1,2,3,NA)
B<-6:10

I would like C to be equal to A but if any A element is NA that
corresponding c element is equal to B, i.e.

C = c(6,1,2,3,10)

Please note that this is a simplified example and the real vectors are
large so I would like to avoid loop as much as possible. Thank you 


Best Regards,

Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: +662-305-9179   
Email: supha...@phatrasecurities.com



        [[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