title: Couldn't quit R session or couldn't quit RStudio
body: <p>New to R and RStudio, got problem in operating RStudio.</p>
  
  <p>I have a code sample about 53 lines, I could quit by typing "q()" or "quit()", 
  but after I run any code(selected section or all codes), "q()" will not work as pic showing below
  <a href="https://i.stack.imgur.com/nOw7K.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/nOw7K.jpg" alt="enter image description here"></a></p>
  
  <p>Or if I try to close RStudio browser, then a notification show up as below but never quit.
  <a href="https://i.stack.imgur.com/sUqC9.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/sUqC9.jpg" alt="enter image description here"></a></p>
  
  <p>Any hint? </p>
  
  <p>Thanks very much! </p>
  
  <p>PS: RStudio verson: 0.99.948</p>
  
  <p>-----1st Update------
  @Mike Wise</p>
  
  <p>Tried to get session info by typing "sessionInfo()" in console,
   unfortunately no response...pic below
  <a href="https://i.stack.imgur.com/qr9yY.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qr9yY.jpg" alt="enter image description here"></a></p>
  
  <h2>Again, this case only happens after I run my code</h2>
  
  <p>-----2nd Update-------
  do the sessionInfo() before you run the code:</p>
  
  <p>Info as below:</p>
  
  <blockquote>
    <p>R version 3.2.3 (2015-12-10) Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 7 x64 (build 7601) Service Pack 1</p>
    
    <p>locale: <a href="https://i.stack.imgur.com/nOw7K.jpg" rel="noreferrer">1</a> LC_COLLATE=English_United States.1252 
    LC_CTYPE=English_United States.1252    LC_MONETARY=English_United
    States.1252 [4] LC_NUMERIC=C<br>
    LC_TIME=English_United States.1252    </p>
    
    <p>attached base packages: <a href="https://i.stack.imgur.com/nOw7K.jpg" rel="noreferrer">1</a> stats     graphics  grDevices utils<br>
    datasets  methods   base     </p>
    
    <p>loaded via a namespace (and not attached): <a href="https://i.stack.imgur.com/nOw7K.jpg" rel="noreferrer">1</a> tools_3.2.3</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code># Linear Regression in R
  # Copyright 2013 by Ani Katchova
  
  mydata &lt;- read.csv(file="E:\\Econometric Academy\\Linear Regression\\regression_auto.csv", header=TRUE, sep=",")
  attach(mydata)
  
  # Define variables
  Y &lt;- cbind(mpg)
  X1 &lt;- cbind(weight1)
  X &lt;- cbind(weight1, price, foreign)
  
  # Descriptive statistics
  summary(Y)
  summary(X)
  
  # Correlation among variables
  cor(Y, X)
  
  # Plotting data on a scatter diagram
  plot(Y ~ X1, data = mydata)
  
  # Simple linear regression 
  olsreg1 &lt;- lm(Y ~ X1)
  summary(olsreg1)
  confint(olsreg1, level=0.95)
  anova(olsreg1)
  
  # Plotting regression line
  abline(olsreg1)
  
  # Predicted values for dependent variable
  Y1hat &lt;- fitted(olsreg1)
  summary(Y1hat)
  plot(Y1hat ~ X1)
  
  # Regression residuals
  e1hat &lt;- resid(olsreg1)
  summary(e1hat)
  plot(e1hat ~ X1)
  
  # Multiple linear regression
  olsreg2 &lt;- lm(Y ~ X)
  summary(olsreg2)
  confint(olsreg2, level=0.95)
  anova(olsreg2)
  
  # Predicted values for dependent variable
  Yhat &lt;- fitted(olsreg2)
  summary(Yhat)
  
  # Regression residuals
  ehat &lt;- resid(olsreg2)
  summary(ehat)
  </code></pre>
  
  <hr>