For connecting R
with Tableau, there are various steps, Please find the steps below.
The main reason the
write up is that to note down the steps since we are not so techie guys, most
of the times we just want the job done… so I believe I have captured the points
at detailed level.
Manage R connection
in the tableau helps to connect the R, you can connect the LocalHost in it. But
the local host cannot be connect straight forward, you should be having a web
server to have local host running…
I don’t want to
complicate further, we need to install a web server, now you can install Python
which has very easy way to publish the HTTP server.
Once the Python
installed, the following command helps to run the Localhost web server but you
need to do the following to run the command.
- Suppose your Python installation path is 'c:\Python27'
Then
open windows command line and enter path
= %path%;c:\Python27;
Now
we have added the Python installation path to the Path variable so that now we
can invoke the python commands easily.
- As we going to invoke localhost, we need to create a directory which will be published and all the files in the folder will be accessible if we type the 'http://127.0.0.1:8000/' in the browser
Therefore
just create a sample directory like C:\sampledirectory
- In the windows command prompt, go that folder
c:\sampledirectory>
python -m Simple HTTPServer
- Congrats you have started the localhost as a web service, you will get the following message
Serving
HTTP on 0.0.0.0 port 8000 …
- Now all the files in the folder will be accessible if we type the following address in the browser
- Now we would need install following package in the R Studio
install.packages("Rserve")
- Then you would need to execute the following commands such as
>Library(Rserve)
>
Rserve()
Starting
Rserve...
"c:\Users\aa\My
Documents\R\win-library\3.1\Rserve\libs\x64\Rserve.exe"
- In the tableau, select 'Manage R connection' in the Help -> Settings and Performance
Enter
a server name of “Localhost” (or “127.0.0.1”) and a port of “6311” and uncheck
the authentication option