Reading a dat file in R



I want to read a .dat file in R as a string. I tried all the options in the read.csv() funciton and the read.table() function but I am still unable to do that.
Can someone suggest me the way to do this?


@Harshita_Dudhe-you can readlines if you want to check starting few lines
readLines(" ",n=6)

Hope this helps!