I'm trying to use `aws.s3` library to read from AWS S3 from my Rstudio session. I'm following [this instructions](http://datascience.ibm.com/blog/read-and-write-data-to-and-from-amazon-s3-buckets-in-rstudio/). The following lines

```
obj <-get_object("s3://my_bucket/myfile.csv")  
csvcharobj <- rawToChar(obj)  
con <- textConnection(csvcharobj)  
data <- read.csv(file = con)

```

works just fine for reading `csv` files. But the following alternative returns error for `txt` files.

```
obj <-get_object("s3://my_bucket/myfile.txt")  
csvcharobj <- rawToChar(obj)  
con <- textConnection(csvcharobj)  
data <- read.table(file = con)  
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
line 1 did not have 6 elements

```

Any suggested solution to this issue? Thank you.