title: How to convert an atomic vector to a recursive vector where I can use "$" symbol in R?
body: <pre><code>money_supply &lt;-matrix(c(1,2.25,2.81,2,2.27,2.84,3,2.28,2.86,4,2.29,2.88,5,2.31,2.90,6,2.32,2.92,7,2.35,2.96,8,2.37,2.99,9,2.40,3.02,10,2.42,3.04,11,2.43,3.05,12,2.42,3.05,13,2.44,3.08,14,2.47,3.10,15,2.49,3.10,16,2.51,3.13,17,2.53,3.17,18,2.53,3.18,19,2.54,3.19,20,2.55,3.20),ncol=3,byrow=TRUE)
  colnames(money_supply)&lt;-c("Month","M2","M3")
  rownames(money_supply)&lt;-c(" ")
  money_supply &lt;- as.table(money_supply)
  money_supply
  
  money_supply&lt;-as.data.frame(t(money_supply))
  </code></pre>
  
  <p>That is my code, I am trying to create a 3x3 table from those data. It pops out as a table but then I cannot compute the data. I want to find the mean for the column M2 by using mean$M2, but it doesn't work, an error saying $ operator is invalid for atomic vector, so I convert "money_supply" to a recursive vector, but then I still can't compute data from column M1, and M2. Can anyone helps me with this?</p>