How to import a large CSV File to SAP HANA from HANA Studio / HANA Tools

In this post, I’ll introduce how to import a CSV (and also Microsoft Excel (.xls, .xlsx)) File to SAP HANA from your Eclipse based development tool HANA Studio / HANA Tools.

1. Select “File” > “Import” from menu

2. Select “SAP HANA Content” > “Data From Local File”

3. Select target System (Database)

4. Specify File location, file layout and table name.
(In this case, First row has each column name)

5. Check table definition and data mapping

6. Check upload progress and table content

(* You can open table content by right-click and select “Open Data Preview”)

These steps are very easy and you can do export dataset from SAP HANA by HANA Studio / HANA Tools as well.

See also

HANA Academy – Importing Data from CSV file – YouTube

Posted in SAP HANA

RForcecom Demo Video

Recently, I have created a demo video of an R package named RForcecom which connect to the and from R.

The video consists of 4 parts.

  1. Install and load RForcecom
  2. Sign into the
  3. Get opportunity list from
  4. Visualize opportunities as decision tree (using rpart and rpart.plot package)

This tutorial can be utilized as win probability analysis if your organization uses Also, demonstation code is available on the GitHub.


Posted in R,

Tokyo-based R Meetup TokyoR #45

Last week, I attended a Tokyo-based Statistical Software R meetup named “TokyoR #45” held on Jan 17 at VOYAGE GROUP office in Shibuya, Tokyo. Almost all presentations were given in Japanese, but in this post I’ll share brief a summary of those presentations in English.

2015-01-17 22.01.26

The meetup consists of 3 sections. Beginner sessions, Advanced sessions and Lightning Talks (LT).

Beginner sessions

Nobuaki Oshiro (@doradora09) gave a three minutes version of his “Learning R in 10 minutes” presentation which includes what is R, who should use R, how to install R, how to code R and where to acquire information about R on the web.

Takashi Minoda (@aad34210)’s session was about fundamental R such as if statement, Loop and plot graphs. Also he mentioned how to visualize data using rCharts and googleVis package.

Advanced sessions

Tetsuro Ito (@tetsuroito) talked about “Hot topics of R in 2015”. He introduced some packages, such as “anomalydetection” by Twitter, “ver 1.0 of ggplot2” by Hadley Wickham. Also he stated nowadays most of hot packages are stored in github, not CRAN. Additionally, he introduced the newly released book “The Lean Analytics“, a methodology for data scientists.

Shinya Uryu (@u_ribo)’s presentation was “Data pretreatment for Data pretreatment”. According to his presentation, to reduce data pretreatment time enables expanding time for data analysis. That makes us get high-quality output. Also, he recommended to use R project file (.RProj) and R markdown file (.Rmd) on the Rstudio that integrate team members and their deliverables.

Yatsuta Toshihisa (@tyatsuta) talked about “Typed Function”. As you may know, to process huge size of dataset on R requires too long CPU time, however the “Typed Function” enables fast processing with efficient memory allocation. The “Typed Function” is 250 times faster than normal loop.

Yohei Sato (@yokkuns) talked about Kernel-Multivariate analysis. As you can see the background of his slides are a Colonel Sanders. Actually, the character of the KFC “Colonel Sanders” is known as “Kernel Ojisan” in Japanese.

Lightning Talks (Short presentations)

Yoshio Tokorosawa (@dichika); also known as Serial Package Creator (Seripac) developed an project schedule management system on R. His system utilize some R packages sinchokuR, AnomalyDetection and twitteR. SinchokuR retrieves the schedule data from github and AnomalyDetection checks is schedule behind or not. When the system caught behind schedule, then notify it to developer via twitter. Also, he announced he is translating the book “Advanced R” with some folks and it will be released in Japanese.

K Mori (@wonder_zone) developed a favorite anime character recommendation system with SVM (Support Vector Machine) using dplyr and e1071 packages. Source code of his system are available at his github repository.

I, Takekatsu Hiramura (@hiratake55) talked about the newly released book “R and cloud computing” written by Ajay Ohri and myself. I introduced some cloud service providers which are compatible with R such as Amazon Web Service, Google Prediction API, BigML, Microsoft Azure ML, and Yhat.

Tatsuya Tojima (@salinger001101) shared an idea of using the continuous integration tool Jenkins as an analytical reporting tool. His project makes daily reports using R and Jenkins on batch processing automatically.

@ksmzn developed a web application for learning probability distribution with shiny, rCharts and nvd3.js. His app is available at

Networking Event

There were more than 80 R users from software, consulting, banking, social media and other industries. They shared idea, talked and drank a lot.

2015-01-17 19.54.09

Next meetup TokyoR #46 was scheduled on Feb 21. When you have any opportunities to visit Tokyo, please join our meetup. If you have any questions or requests please feel free to contact me.

Posted in Meetup, R

How to do a silent install of R

In this post, I’ll introduce how to do a silent install of R. Assume that you are a faculty member at an R course and need to prepare R environments for each students’ PC. In this case, you can install R, RStudio and R package in just one-click by their silent install mode.

1. R silent installation
According to the R FAQ, the R installer has command line options for silent installation “/SILENT” and “/VERYSILENT“. Download the R installer and run the command “R-3.1.0-win.exe /SILENT” from your command prompt enables you to do silent install.


2. RStudio silent installation
RStudio also has silent installation option. This support page describes how to run as a silent mode. According to the page the Rstudio installer has silent option “/S” and the command “RStudio-0.98.507.exe /S” enables you to do a silent install.


3. R package silent installation
R packages such as ggplot2 or plyr are installable from the command line.

3-1. Download the R packages from CRAN site
Download packages and all required/dependent packages(s) mentioned in CRAN page.


3-2. Run a silent installation command
Below is an example of the command.

"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL


4. Making a silent installation script
Create a silent installation script to enable one-click installation.

4-1. Download installers and R packages and store them into the same folder

4-2. Make a BAT file
Below is a code example, and save it as BAT file (ex: Rinstall.bat).

R-3.1.0-win.exe /SILENT
RStudio-0.98.507.exe /S
"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL
"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL


4-3. Run the BAT file as an administrator

These procedures are quite simple and also available when you are updating your R environment. Let’s try when you become an R lecturer.

Posted in R

Today is my 10,000 days old birthday

I’ve been calculated my day of 10,000 days old birthday in R since few days ago.
I found that to calculate this in R is quite simple.

My birthday to 10,000 days old birthday:

> as.Date("1986-09-21") + 10000
[1] "2014-02-06"

Birthday to days since my birthday:

> Sys.Date() - as.Date("1986-09-21")
Time difference of 10000 days

Just for reference, below is an R function to convert a birthday to age.

# Birthday to age
birthday2age <- function(birthday){
  td.y <- as.integer(format.Date(Sys.Date(),"%Y"))
  td.m <- as.integer(format.Date(Sys.Date(),"%m"))
  td.d <- as.integer(format.Date(Sys.Date(),"%d"))
  bd.y <- as.integer(format.Date(birthday,"%Y"))
  bd.m <- as.integer(format.Date(birthday,"%m"))
  bd.d <- as.integer(format.Date(birthday,"%d"))
> birthday2age("1986-09-21")
[1] 27

Happy birthday with R.


Posted in R

RForcecom – An R package provides the connection between R and

In this post, I’ll introduce an R package RForcecom and its usage. As you may know, R statistical computing environment is the most populous statistical computing software, and is the world’s most innovative cloud-computing based SaaS (Software-as-a-Service) CRM package.

RForcecom enables you to connect to from R. It is provided as an add-on package of R and its source code are available at github.

1. Install the latest version of R
You can download the latest R statistical computing environment from the R-Project website.

2. Install and load the RForcecom
Type the commands from your R console to install and load the RForcecom.


3. Sign in to or
To sign in to the, use rforcecom.login() function. Set your username, password, instance URL, API version as follows.
Note: DO NOT FORGET your security token in password field.

username <- ""
password <- "YourPasswordSECURITY_TOKEN"
instanceURL <- ""
apiVersion <- "26.0"
(session <- rforcecom.login(username, password, instanceURL, apiVersion))


4. Retrieving records
To retrieve the dataset, use rforcecom.retrieve() function. Set parameters as follows.

objectName <- "Account"
fields <- c("Id", "Name", "Phone")
rforcecom.retrieve(session, objectName, fields)


5. Execute a SOQL
To retrieve the dataset using SOQL (Salesforce Object Query Language), use rforcecom.query() function. Set parameters as follows.

soqlQuery <- "SELECT Id, Name, Phone FROM Account WHERE AnnualRevenue > 50000 LIMIT 5"
rforcecom.query(session, soqlQuery)


6. Create a record
To Create a record, use rforcecom.insert() function.

objectName <- "Account"
fields <- c(Name="R Analytics Service Ltd", Phone="5555-5555-5555")
rforcecom.create(session, objectName, fields)


7. Retrieve a server timestamp
To retrieve a server timestamp from server, use rforcecom.getServerTimestamp() function.



These procedures are very easy and are very useful for projects using R and Next post, I’ll introduce an example of a use case of RForcecom.

RForcecom website

Posted in R,
Takekatsu Hiramura

Takekatsu Hiramura

Software Engineer, IT consultant and Data scientist


Get every new post delivered to your Inbox.