All Forums Analytics
gstoel 2 posts Joined 12/12
03 May 2013
teradataR package and R 3.0.0

Hi All,
 
I am new to Teradata and trying to get my connection from R to work... I am running R 3.0.0 and installing the package through 
install.packages("~/Downloads/teradataR_1.0.1.zip", repos = NULL)
throws a warning that package ‘~/Downloads/teradataR_1.0.1.zip’ is not available (for R version 3.0.0)
What are the compatible R versions for teradataR? The documentation PDF mentions R 2.11 and later
Are there any plans to release teradataR for R3.0.0?
 
 

toddb 13 posts Joined 10/10
29 May 2013

It will work on any version >= 2.11 and < 3.0.0.

ulrich 816 posts Joined 09/09
30 May 2013

I know - but why doesn't TD release a new version? 
Or release the source code as open source and someone could move this forward?

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

dclark 2 posts Joined 05/11
28 Jun 2013

I have a similar issue with the latest RODBC 1.3-6.     It states that it was build under R 3.0.0.   The RODBC archive has RODBC_1.3-5.tar.gz.   I'm hopeful that once gunzip'ed it will install.

dave.clark
(858)451-4745

dlabar 5 posts Joined 06/11
28 Aug 2013

Yes Teradata, please support R by updating the package or releasing the source code.

DouglasTD 1 post Joined 03/13
09 Sep 2013

I experienced the issue with TeraData ODBC not working with R version 3.0, but started using R 3.0 and RStudio 3.0.1 because it's a better environment.  Figured I would find a way to connect them or revert the R once the code was developed.
I combined a couple of posts and this is what just worked on my windows 7 laptop.  I also have TeraData Studio open with an active connection to the same database, so that may have something to do with R version 3.0.1 using RODBC and successfully querying TeraData v14.  This is an initial post, as I will investigate the connectivity with more complex queries in the coming days.

library(RODBC)
odbcDataSources()

#                                             dBASE Files 
#   "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)" 
#...
#                                                TestData 
#                                              "Teradata" 

channel <- odbcDriverConnect("dsn=testData;uid=user;pwd=password;")

sqlStr <- "select top 5 qty_sold from DataBase.Table ;"

sqlQuery(channel, sqlStr, believeNRows = FALSE);

#  qty_sold
#1        0
#2       12
#3        1
#4        1
#5        3

 

DouglasM 2 posts Joined 03/13
16 Sep 2013

I discovered that R v3.0.1 (2013-05-16) and RStudio 0.97.551 (which uses R v3.01 packages) both communicate via RODBC with TeraData v14on a Windows 7 PC if you have TeraData Studio open and logged in.  The SQL shown below works in both R applications, as does a SQL query that is 8 pages long in Word.
NOTE: THE SQL COMMANDS CANNOT CONTAIN ANY TAB CHARACTERS. (Tab characters are automatically removed during execution, so white space between words can be lost and the SQL command fails.)
STEP 1:  Install TeraData Studio, open it and log into the TeraData system.
STEP 2: Perform the following steps in an updated [R] application (RStudio has a great UI - try it!)

library(RODBC)
odbcDataSources()

#                                             dBASE Files 
#   "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)" 
#...
#                                                TestData 
#                                              "Teradata" 

# Use the connection labeled "Teradata" along with you userID and password
channel <- odbcDriverConnect("dsn=TestData;uid=userID;pwd=password;")

#Change the quesry to communicate with your database and table(s).
sqlStr <- "select top 5 qty_sold from DataBase.Table ;"

sqlQuery(channel, sqlStr, believeNRows = FALSE);

#  qty_sold
#1        0
#2       12
#3        1
#4        1
#5        3

 

20 Sep 2013

I'm also trying to sort this out.  I wonder if the success DouglasM reports is due to his R code referencing RODBC functions rather than TeradataR functions.  That is, success with odbcDriverConnect() is showing that RODBC works, while success with tdConnect() would show that TeradataR is working.  Right? 
I'm forced to put all this in the form of a question as I have yet to be successful getting RODBC to recognize my (64-bit) connections.  Studio and SQL-A connect just fine.  Sigh.

clarkfitzg 1 post Joined 05/12
30 Sep 2013

+1 Please update this package.

diegomenara 1 post Joined 10/13
07 Oct 2013

Please update this package for R version 3.0.
Thank you

ygg 1 post Joined 07/12
11 Oct 2013

+1 Please update this package

rikard 1 post Joined 04/13
22 Oct 2013

+1 Please update this package

sm94588 2 posts Joined 04/13
24 Oct 2013

getting the same error while installing the package. Can Teradata point to updated package?

swami

sm94588 2 posts Joined 04/13
25 Oct 2013

I am using R 3.0.2. Not sure if TeradataR supports this version. Will try with R 2.15.3.

swami

Mitch 1 post Joined 10/13
27 Oct 2013

Please update this package
 

nonsleepr 1 post Joined 09/11
02 Dec 2013

Hi, you can find the latest teradataR package, compiled for R 3.0 on Github: https://github.com/Teradata/teradataR/tree/master/build

ulrich 816 posts Joined 09/09
02 Dec 2013

Hi,
great!!! It's working fine.
I used git clone https://github.com/Teradata/teradataR/ to download it.
The package required RODBC package to be installed but it works also fine with JDBC on a mac.
Thanks for sharing this!
Ulrich

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

03 Dec 2013

I am new to R (and also new to github) and need to get the data from Teradata. I have R Version 3.0.2. I went to
https://github.com/Teradata/teradataR/
but could not identify the download link.
The zip file that I get from the "Download Zip" is TeradataR-master.zip and this does not work.
Thanks in advance.

Michael Rieder 1 post Joined 04/11
07 Feb 2014

When can we expect an update for this package?
The R community tends to be doing their upgrades frequently and the step from < 3 to > 3 happened quite a while ago. It would be great if we could see an updated version soon which suits R 3.0.2 [as of Feb 2014].

ulrich 816 posts Joined 09/09
07 Feb 2014

Just verified the package at (see message from nonsleeper above)
git clone https://github.com/Teradata/teradataR/
is just working fine.
What kind of message to you get?

R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin10.8.0 (64-bit)

R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' für Details dazu.

R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
Tippen Sie 'contributors()' für mehr Information und 'citation()',
um zu erfahren, wie R oder R packages in Publikationen zitiert werden können.

Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder
'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.
...
> .jaddClassPath("/mypath/terajdbc4.jar")
> .jaddClassPath("/mypath/tdgssconfig.jar")
> library(teradataR)
> tdConnect("system","useri","password","sys_calendar","jdbc")
> tdf <- td.data.frame("calendar")
> my.stats <- td.stats(tdf,"year_of_calendar", c("cnt","min","max","mean"))
> my.stats
               col  xcnt xmin xmax xmean
1 year_of_calendar 73414 1900 2100  2000
> 

 

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

rkbinani 1 post Joined 05/13
19 Feb 2014

I tried to install package locally from the nonsleepr's link(https://github.com/Teradata/teradataR/) mentioned above. However while installing on R3.0.2, I am receiving the following error. The package still needs an update. TD group, please update soon!
 

install.packages("D:/R-Packages/teradataR-master.zip", repos = NULL)
Warning in install.packages :
package ‘D:/R-Packages/teradataR-master.zip’ is not available (for R version 3.0.2)
 

Raj

Alexander K 22 posts Joined 09/13
20 Feb 2014

Dear all,
 
Here is a sequence of steps that worked for me:
 
1. As stated at
http://downloads.teradata.com/download/applications/teradata-r
an updated TeradataR package (works with R 3.0) is available from https://github.com/Teradata/teradataR
I followed the link, and under the "Build" tab I downloaded file "build/teradataR_1.1.0.tar.gz"; simply click on the "Raw" icon.
 
2. Extract the folder "teradataR" from the TAR & GZipped archive (for example, use the 7z open source program).
 
3. After doing so, I launched R. I have R v.3.0.2. To install TeradataR within R, one needs devtools and a few more packages. I found out I needed to install the following, which you can easily find and install with the tools under the R menu "Packages"):
DBI
RODBC
RJDBC
rJava
devtools

Note that upon installing devtools, the following are also installed:
stringr
bitops
httr
RCurl
memoise
whisker
evaluate
digest
 
4. I loaded RODBC for ODBC access, and then went on to load devtools. I typed at the R prompt:
> library(devtools)
 
5. Finally, I guided R to the folder where the "teradataR" folder resides (use the R menu "File" > "Change dir"). Then, I typed:
> install('teradataR')
and loaded (use the R menu "Packages" > "Load package") teradataR
 
Bests,
Alexander.

sudheerkamboji 1 post Joined 04/14
22 Apr 2014

Thanks Alexander, it worked for me.

Andron 1 post Joined 03/15
08 Apr 2015

Hi, I tried to install teradataR on my laptop and had R error: "cannot install to srcdir for package 'teradataR'. teradataR/DESCRIPTION -- 'No such file or directory'". Does anybody had this problem before?

You must sign in to leave a comment.