title: What's a good strategy in R to store results in list form to access it later on by names rather than indices?
body: <p>I would like to automate the results creation process when I apply certain modeling techniques. So I'll have different parameters which will be applied (e.g. hierarchical clustering distances and linkage methods). The results will have a matrix form so that I can access individual results by specifying the model parameters (eg. single, euclidean). In a dataframe I could name  the columns and rows and access the elements simply by <code>df[rname[1],cname[1]]</code>. As far I as I read its not possible to use data frame objects to store list results. So I need lists for storing list-results. But in lists I can only specify <code>lst$cname[1]</code> and not both dimensions. Am I correct?</p>
  
  <pre><code># data frame layout for numeric results does not work with list results
  rname&lt;-c("u","v","w")
  cname&lt;-c("ave","single")
  
  # dataframe for results but does not work for results which are lists
  paste.1&lt;-function(x,y) paste(x,y,sep=".")
  df1&lt;-data.frame(lapply(cname,paste.1,x=rname),row.names=rname)
  colnames(df1)&lt;-cname
  
  # creating list for results - do not get a good idea to proceed from here Advices??
  lst&lt;-(lapply(cname,paste.1,x=rname))
  names(lst)&lt;-cname
  
  # results example - could be anything else 
  # with a dataframe I could use df1[rname,cname]&lt;-foo(rname,cname)
  # with lists I guess its not as easy
  require(graphics)
  ave.u &lt;- hclust(dist(USArrests,"euclidean"), cname[1])
  ave.v &lt;- hclust(dist(USArrests,"maximum"), cname[1])
  ave.w &lt;- hclust(dist(USArrests,"manhattan"), cname[1])
  single.u &lt;- hclust(dist(USArrests,"euclidean"), cname[2])
  single.v &lt;- hclust(dist(USArrests,"maximum"), cname[2])
  single.w &lt;- hclust(dist(USArrests,"manhattan"), cname[2])
  </code></pre>
  
  <p>Well I am not sure if there is a solution which I guess must exist. At the end I just want to access the list results via the row names and column names. I know I could transfer row/column names to numerical ones and then play with assigning proper indexes to find my results in a list of length(<code>rname</code>) x length(<code>cname</code>) but since the data frame is so nicely to use I am assuming it must be an easy way to store it more user friendly. It might also be the case that I did not really get well into the concept of lists since I am just starting to play around with R. So my question is: What would be a good strategy to store the structured results (which are lists) using R?</p>