First things first…what’s “R”? Simply put…is a programming language and software environment for statistical computing and graphics. More infomation can be found here R on Wikipedia

I have code in many programming languages, some of them very commercial, and some of them little known, but I got say, that from all, “R” is one of the most weird and awesome languages I have ever played with…and it has an amazing repository of custom add-ons.

If you have read the HANA Pocketbook you will realize that there’s a reference to “R” in the page 59. Now, that kind of integration between “R” and HANA haven’t been developed yet, but it doesn’t mean we can get our hands dirty doing some research and development.

What I did for this example was to simply show the information of my Analytic View on HANA and exported as an CSV file. From there, it’s easy to import it into “R” and start doing some nice things. (The idea is that we should be able to code “R” straight in the HANA environment…or at least that’s how I think it’s going to be…)

HANA_SBOOK_000.PNG

HANA_SBOOK_001.PNG

HANA_SBOOK_002.PNG

The first example that we’re going to build on “R” is a simple Pie graphic, using the information from the FORCURAM and CARRNAME fileds.

HANA_SBOOK_003.PNG

In this example, we’re basically reading the CSV file, including the header. And doing an aggregation of the two fields we want to interact with. After that, it’s just a matter of pass the values, the names and call the pie.

HANA_SBOOK_004.PNG

Next example is a little bit more complex…and uses a custom package call Word Clouds

HANA_SBOOK_005.PNG

Here, we have to load the required libraries, read the CSV file, do the aggregation, create a matrix with the aggregation values, sort the matrix, create a new vector, get it’s length, create an array containing the names and finally assign the values and call the wordcloud graphic method…

HANA_SBOOK_006.PNG

Hope you like it…and stay tuned for more “R”…

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

    1. Alvaro Tejada Galindo Post author
      Michelle:

      Grad you like it -:) “R” is really powerful and will be highly used I’m sure…so right now it’s a good time to start learning it -;)

      Greetings,
      Blag.

      (0) 
        1. Alvaro Tejada Galindo Post author

          Venkat, Tilak…I wrote this blog on old SCN and some images were lost during the migration to New SCN…being a somehow old blog, I will need sometime to build everything and get the images…will try to get everything ready for Monday morning

          Greetings,

          Blag.

          (0) 

Leave a Reply