When reading in a tab delimited file using args I keep getting the error:

Error: unexpected symbol in "Name index"

Execution halted

The code is this:

a <- read.table(args[1],sep="\t",header=T, stringsAsFactors=F)

When inputting the file directly, as follows, this produces no errors:

a <- read.table("/path/to/file/filename.txt", header=T,sep="\t",
stringsAsFactors=F).

The file is such:

Name               index
Bob                  1
George             2
Dave                3
Eric                  4
.
.
.
.
Andrew            20

Is there anything I should be looking out for that might be producing
this error.   Any help will be greatly appreciated.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to