added r code from listoflines to connecivitynetwork