Dealing with R and HANA

[This article was first published on Blag's bag of rants, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.


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






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




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.




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




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…




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


Greetings,

Blag.

To leave a comment for the author, please follow the link and comment on their blog: Blag's bag of rants.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)