title: 'Con not a connection' Error in R program
body: <p>I am trying to use readLines in R but I am getting below error</p>
  
  <pre><code>orders1&lt;-readLines(orders,2)
  # Error in readLines(orders, 2) : 'con' is not a connection
  </code></pre>
  
  <h2>Code :</h2>
  
  <pre><code>orders&lt;-read.csv("~/orders.csv")
  
  orders 
  
  orders1&lt;-readLines(orders,2)
  
  orders1
  </code></pre>
  
  <h2>Data:</h2>
  
  <pre><code>id,item,quantity_ordered,item_cost
  1,playboy roll,1,12
  1,rockstar roll,1,10
  1,spider roll,1,8
  1,keystone roll,1,25
  1,salmon sashimi,6,3
  1,tuna sashimi,6,2.5
  1,edamame,1,6
  2,salmon skin roll,1,8
  2,playboy roll,1,12
  2,unobtanium roll,1,35
  2,tuna sashimi,4,2.5
  2,yellowtail hand roll,1,7
  4,california roll,1,4
  4,cucumber roll,1,3.5
  5,unagi roll,1,6.5
  5,firecracker roll,1,9
  5,unobtanium roll,1,35
  ,chicken teriaki hibachi,1,7.95
  ,diet coke,1,1.95
  </code></pre>