I have a csv file that has the following format:

```
                          1           3           1          4
1415670_at  1   8.512147859 8.196725061 8.174426394 8.62388149
1415671_at  2   9.119200527 9.190318548 9.149239039 9.211401637
1415672_at  3   10.03383593 9.575728316 10.06998673 9.735217522
1415673_at  4   5.925999419 5.692092375 5.689299161 7.807354922

```

I had made some manipulation of this data by deleting columns that are not 1 or 2:

```
m<-read.csv("table.csv")
smallerdat <- m[ c(1,2, grep("^X1$|^X2$|X1\\.|X2\\." , names(m) ) ) ]

```

Now I want to save this results again to a csv file, so I do this:

```
write.csv(smallerdat,"tablemodified.csv",ncolumns=length(smallerdat),sep=",")

```

but I got an error that says:

```
Error in cat(list(...), file, sep, fill, labels, append) : 
  argument 1 (type 'list') cannot be handled by 'cat'

```

The question that I have is how I can store into a csv file the modified table. 
Any help?