title: Taking data JSON format files in R
body: <p>I have imported a JSON file in R with the following format:</p>
  
  <pre><code>$ Singapore                                   : chr [1:34] "Singapore" "Yishun New Town" "Bedok New Town" "Ayer Raja New Town" ...
  $ Indonesia                                   : chr [1:273] "Bandung" "Jakarta" "Samarinda" "Pekanbaru" ...
  $ Nepal                                       : chr [1:6] "Patan" "Jawlakhel" "Kathmandu" "Bharatpur" ...
  </code></pre>
  
  <p>And I have another data.frame which has text variable:</p>
  
  <pre><code>1                                   "yishun"
  2                                    "patan"
  3                           "samarinda city"
  4                         "kathmandu center"
  5                           "Bedok new town"
  </code></pre>
  
  <p>So what I want is to go through the JSON file check if this city exist and assign the country to a new variable, like the following:</p>
  
  <pre><code>1                                   "yishun"    Singapure
  2                                    "patan"        Nepal
  3                           "samarinda city"      donesia 
  4                         "kathmandu center"        Nepal
  5                                 "New york"           NA
  </code></pre>
  
  <p>I was thinking to use: <code>unlist()</code> the JSON file -> use <code>grepl</code> to find if there is a city in the value. Any other idea?</p>