All Forums Analytics
gbindra 4 posts Joined 06/12
21 Sep 2012
TeradataR Question

Hi,
 
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.

 

Thanks

Gorav Bindra

toddb 13 posts Joined 10/10
29 May 2013

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.
 

plapomarda 1 post Joined 09/15
29 Oct 2015

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])

You must sign in to leave a comment.