title: Replacing NAs from onle list by NAs in second list in equal positions in R
body: <p>here is the problem. I have two lists of vectors. Those vectors have same length in same positions. But there are some NAs in those vectors. Data may looks like</p>
  
  <pre><code>HH
  [[1]]
  [1]  2  1  5 NA
  
  [[2]]
  [1] 2 0 5
  
  [[3]]
  [1] NA  1 NA
  
  JJ
  [[1]]
  [1] 0 5 8 9
  
  [[2]]
  [1] NA  1  3
  
  [[3]]
  [1] 2 8 3
  </code></pre>
  
  <p>My goal is: have NAs in equal positions in both lists in all vectors. More exactly, write code, which will find NA in first list, nad replace value by NA in second list in equal position. I succesfully wrote similar function for vector, but i failed here. Can you help me? Here is my code.</p>
  
  <pre><code>D&lt;-NULL
  for(j in 1:length(PH)){
  + for(i in 1:length(PH[[j]])){
  + if(is.na(PH[[j]][i])==FALSE){
  + D[[j]][i]=AB[[j]][i]}
  + else{
  + D[[j]][i]=NA}}
  + }
  </code></pre>