I am trying to upload data as a Table into Synapse and was getting errors so I decided to check the online tutorial here: [Tables tutorial](http://docs.synapse.org/articles/tables.html) However, when I attempt to call the function `Table` with the following commands (per the tutorial)...
```
dat <- data.frame("n"=c(1.1, 2.2, 3.3),
"c"=c("foo", "bar", "bar"),
"i"=as.integer(c(10,10,20)))
tcresult <- as.tableColumns(dat)
syncols <- tcresult$tableColumns
test.schema <- TableSchema(name="testTableSchema", columns=syncols, parent=myProject)
table2 <- Table(test.schema, syncols)
```
All works fine until I get to the `Table` function in the last line which throws the following error message:
```
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ?Table? for signature ?"TableSchema", "list"
```
I'm running R 3.3.1 on a Mac. Any ideas what's going on? Bug? User error?
Any help would be appreciated!
Cheers,
Darren
Created by Darren Tyson darrentyson That is a good thing to note, but it seems to only affect the R client *if* you use `as.tableColumns`. The underlying REST API supports column names with periods. I'm not sure why. I tested by overriding the `name` of `syncols` for a single column data frame, and storing that `Table`, similar to your example:
```
dat <- data.frame("foo.bar"=c(1.1, 2.2, 3.3))
tcresult <- as.tableColumns(dat)
syncols <- tcresult$tableColumns
syncols[[1]]$name <- 'foo.bar'
test.schema <- TableSchema(name="testTableSchema", columns=syncols, parent=myProject)
table2 <- Table(test.schema, dat)
```
I'll look into the code and/or ask one of the engineers what's happening there with the column name conversion. Thanks Daren. We made a note of it in the tutorial under Changing columns. Ahh. Yes, user error. lol. Thanks for clearing that up with such a super-speedy response! Got the Table upload to work now.
I did, however, notice that a common practice of having dots in column names in R (e.g. `cell.line.name`) is not acceptable in Synapse. The `as.tableColumns` function automatically strips out the dots from the names, making it no longer match the actual data.frame column names, which get passed to the `Table` function. When I replaced the dots with underscores in the column names prior to running the rest of the code, it all worked. Not sure if the naming conventions/requirements are explicit in the tutorials anywhere, but it would probably be good if they were.
Thanks again!
Darren It's the second parameter you're providing to the `Table` constructor - it should be your data (`dat`), not `syncols` (the column definitions). I tested with your code and that change and was successful! So, the fix is:
```
table2 <- Table(test.schema, dat)
```
Drop files to upload
Table tutorial in R appears broken page is loading…