[R] Error: unexpected symbol in [with read.table]
Bert Gunter
bgunter.4567 at gmail.com
Fri Jun 26 19:39:25 CEST 2015
??
Are you expecting us to guess what your code was from
"reading in a tab delimited file using args" ?
You've posted here before and should know by now that explicit code
should be provided whenever possible.
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Fri, Jun 26, 2015 at 10:32 AM, Kate Ignatius <kate.ignatius at gmail.com> wrote:
> 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 at 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.
More information about the R-help
mailing list