title: Assigning a column value from one data frame to another in R
body: <p>I have created an empty data frame using another data frame with the below code.</p>
  
  <pre><code>compare&lt;-data.frame(nrow=nrow(test_email),ncol=ncol(test_data))
  colnames(compare)&lt;-c("email", "gender")
  </code></pre>
  
  <p>Now, I am trying to assign value to the columns of compare data frame based on some conditions using simple assignment statement.</p>
  
  <pre><code>compare[1,1]&lt;-test_email[1,1]
  compare[1,2]&lt;-test_data[1,2]
  </code></pre>
  
  <p>In the above, <code>test_email[1,1]</code> has an email ID like"abc@gmail.com"
  But, after assignment <code>compare[1,1]</code> has value 81 and not the email ID. 
  I am not able to get it why the email is not getting assigned and some numeric vlaue is getting assigned. Can anyone let me know this reason and how to solve. Structure of test_email is below:</p>
  
  <pre><code>structure(list(email = structure(c(81L, 75L, 57L, 61L, 79L, 76L),
  .Label = "ajay.bansal@siemens.com", "amanmeet.bhalla@gmail.com",
  "aoneshp@gmail.com", "aparna_anand@msn.com", "ar.ashwani@gmail.com",
  "ar.parulbansal@gmail.com", "ar.preet02@gmail.com",
  "asdawsd@yahoo.com", "assd@yopmail.com",
  "avijeet_yadav@rediffmail.com", "avneng1.negi@gmail.com",
  "avnihatnagar@yahoo.com", "bansalanuj007@yahoo.com.au",
  "bhanu5877@yahoo.co.in"), class = "factor")), .Names = "email",
  w.names = c(NA, 6L), class = "data.frame")
  </code></pre>
  
  <p>I am not able to find out why R is converting email into some numeric values during assignment.</p>