R integration tutorial?

Moderator: NorbertKrupa

Post Reply
greeness
Newbie
Newbie
Posts: 9
Joined: Mon Jun 25, 2012 7:08 am

R integration tutorial?

Post by greeness » Tue Jul 24, 2012 7:10 pm

Can anyone point me to any manual or tutorial on this topic? I only find a mention for this new feature in Vertica 6's release notes. Any further introduction is appreciated. Thanks.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1778
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: R integration tutorial?

Post by JimKnicely » Tue Jul 24, 2012 8:45 pm

Hi,

I'm just starting to read about R. There's hardly anything written about Vertica and R, but here are a few links that discuss connecting to other databases and since the connections are made via ODBC the information should be generally applicable to Vertica...

http://www.oracle.com/technetwork/datab ... 501628.pdf

http://www.google.com/url?sa=t&rct=j&q= ... V0ZewWJgkA

http://cran.r-project.org/web/packages/RODBC/index.html
http://cran.r-project.org/web/packages/RODBC/RODBC.pdf

Hopefully this helps a little.

Thanks!
Jim Knicely

Image

Note: I work for HPE. My views, opinions, and thoughts expressed here do not represent those of my employer.

greeness
Newbie
Newbie
Posts: 9
Joined: Mon Jun 25, 2012 7:08 am

Re: R integration tutorial?

Post by greeness » Tue Jul 24, 2012 10:04 pm

Thanks Jim. That helps a lot!

I was able to connect to vertica via odbc now. e.g., I could send queries in R and get response.

Code: Select all

>library("RODBC")
> con <- odbcConnect("vertica")
>sqlQuery(con, 'select count(*) from open_session_fact')
     count
1 87915596


However, this is not my original motivation to use R. From the release note of Vertica 6, it claims
Developers can create custom R language functions of their own, or leverage the thousands of contributed packages from CRAN. R functions are automatically distributed and executed in parallel across your selected window of data.
I am still wondering how I can call a customized R function in Vertica instead of getting data from Vertica and running R function in memory. This way we do not utilize the ability of parallelism of Vertica, right? For example, I have some R codes to do wavelet transform for a given vector. I want to apply this function to millions of vectors in Vertica.

Anyone can point me to something useful? Thanks again.

greeness
Newbie
Newbie
Posts: 9
Joined: Mon Jun 25, 2012 7:08 am

Re: R integration tutorial?

Post by greeness » Thu Jul 26, 2012 12:27 am

I found some brief introduction in Vertica's online documentation for version 6 under the section named "Developing a User Defined Function in R".
http://my.vertica.com/docs/CE/6.0.0-1/H ... #17794.htm

The above forum does need to create an account for access though.

Hope it helps for later reference.

Post Reply

Return to “R Language Integration”