title: How to address data in a hierarchical data structure in R?
body: <p>I created a list containing two data lists (character array <code>region</code> and a list <code>results</code>) of the same length. (I tried to manage the data in data.frame, but it seems to be complicated to add data to a data.frame).</p>
  <pre><code>study = list(
      region  = character(),
      results = list()
  )
  
  study$region[1] = &quot;Hamburg&quot;
  study$results[[1]]  = data.frame(month=c(1:5), maxTemp=c(-12, -1, 3, 10, 23))
  
  
  study$region[2]    = &quot;Bremen&quot;
  study$results[[2]]  = data.frame(month=c(1:5), maxTemp=c(-9, -1, 6, 10, 21))
  
  str(study)
  
  print(&quot;Maximum temperature of all study regions:&quot;)
  max(study$results[[1:2]]$maxTemp)
  </code></pre>
  <p>I want to find out the maximum temperature of all timepoint of all regions. I can address each region after another by using e.g. <code>max(study$results[[1]]$maxTemp</code>, but when I try to address all regions <code>max(study$results[[1:2]]$maxTemp</code> I receive an error:</p>
  <blockquote>
  <p>Error in study$results[[1:2]]$maxTemp :</p>
  <p>$ operator is invalid for atomic vectors</p>
  </blockquote>
  <p>Where is my mistake? How can I address fields of a several <code>data.frame</code>s that are saved in a <code>list</code> of a <code>list</code>? And what are atomic vectors?</p>