TeradataR Question


TeradataR Question


I am trying to run some functions in R use TeradataR. IT seems like some of the funcitons does not work or limit the number of rows to top 50. HEre is one of the error which I am receiving 

Error in as.data.frame.td.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 

unused argument(s) (optional = TRUE, stringsAsFactors = stringsAsFactors)"


Can't we use dataframe created using teradataR sa a normal dataframe.



Gorav Bindra

Tags (3)
Teradata Employee

Re: TeradataR Question

You should be able to use as.data.frame with a td.data.frame as input to retrieve rows from the database into R.  It would look like this:

tdf <- td.data.frame('mytable');

df <- as.data.frame(tdf, size=1000000);

There is a default size of 100 just to protect from bring back millions or rows by accident but you can override but setting the size to whatevery you want, say size=1000000.

Not applicable

Re: TeradataR Question

You can also just do it dynamically using the dim.td.data.frame and coercing with as.data.frame.td.data.frame:

df<- as.data.frame.td.data.frame(tdf,size=dim.td.data.frame(tdf)[1])