Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to reproduce the following command from my textbook on my system,

cat("2 3 4 5", "11 13 14 15", file="ex.dat", sep="\n")

but I keep getting this error:

bash: syntax error near unexpected token `"2 3 4 5"'
share|improve this question
2  
Please don't forget to accept the answer –  Ulrich Dangel May 16 '12 at 0:56
add comment

1 Answer 1

up vote 5 down vote accepted

This isn't bash syntax, but rather, is the syntax for the cat command in the R language (a programming language used for statistical computing):

Concatenate and Print

Outputs the objects, concatenating the representations. cat performs much less conversion than print. Usage

cat(... , file = "", sep = " ", fill = FALSE, labels = NULL,  append = FALSE)
share|improve this answer
1  
omg, I am actually learning R only; what happened is that when I saw cat I <somef####nhow> thought that perhaps the first line is creating a file using the linux cat command and the second one is showing how to read the input from the file using R's scan command. GOD; this is silly. –  Wildling May 15 '12 at 17:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.