I am trying define a constant as a coefficient from an r regression. I.e. trying to define elasticity as the number -1.64431 that you can see in the photo.
reg <- lm(ln_q ~ ln_price, data=df) 
elasticity <- reg[["coefficients","ln_price"]]
print(elasticity)
I get the error:
Error in reg[["coefficients", "ln_price"]] : 
  incorrect number of subscripts
Any help much appreciated! :)

 
     
    