If you're doing a basic linear regression then you don't necessarily need R, you can use Tableau's built-in trend lines Add Trend Lines to a Visualization or use a series of calculated fields Covariance, Trend Lines, Correlation Coefficient R and R-Squared .
If you really need to use R then my first question would be whether the connection has been configured properly: When you do a Test Connection (see External Services Connection) is it passing or not? If not, then what is the error message you are getting? And do you have any firewalls or port mapping that might be getting in the way?
Also check out Tableau and R Integration, it's got a bunch of helpful links (thought not necessarily for troubleshooting TCP errors like the one you're getting).
This message is appearing every time that I use the connection, also for other functions that I need, so it would be helpful to have it solved.
Yes I write the code:
"Extract all files."
On R, maybe the problem could be "—no-save" but without it R ask me for -save, -no-save or -vanilla and does not run.
Testing the connection it says that ut is successfully connected. I don’t know what a port mapping is, maybe is it related with my internet connection? I think that I don’t have any, but how can I verify?
Thank you so much for your help Johnathan!
Thanks in advance to others that may help me in any way!
Il giorno 28 lug 2018, alle ore 00:55, Jonathan Drummey <firstname.lastname@example.org> ha scritto:
Tableau Community Forums <https://community.tableau.com/?et=watches.email.thread>
Problem while doing Linear Regression, integrating R and Tableau
reply from Jonathan Drummey <https://community.tableau.com/people/jonathandrummey?et=watches.email.thread> in Forums - View the full discussion <https://community.tableau.com/message/797523?et=watches.email.thread#797523>
If you're doing a basic linear regression then you don't necessarily need R, you can use Tableau's built-in trend lines Add Trend Lines to a Visualization <https://community.tableau.com/external-link.jspa?url=https%3A%2F%2Fonlinehelp.tableau.com%2Fcurrent%2Fpro%2Fdesktop%2Fen-us%2Ftrendlines_add.html> or use a series of calculated fields Covariance, Trend Lines, Correlation Coefficient R and R-Squared <https://community.tableau.com/docs/DOC-6451> .
If you really need to use R then my first question would be whether the connection has been configured properly: When you do a Test Connection (see External Services Connection <https://community.tableau.com/external-link.jspa?url=https%3A%2F%2Fonlinehelp.tableau.com%2Fcurrent%2Fpro%2Fdesktop%2Fen-us%2Fr_connection_manage.html>) is it passing or not? If not, then what is the error message you are getting? And do you have any firewalls or port mapping that might be getting in the way?
Also check out Tableau and R Integration <https://community.tableau.com/docs/DOC-5313>, it's got a bunch of helpful links (thought not necessarily for troubleshooting TCP errors like the one you're getting).
Reply to this message by replying to this email, or go to the message on Tableau Community Forums <https://community.tableau.com/message/797523?et=watches.email.thread#797523>
Start a new discussion in Forums by email <mailto:email@example.com> or at Tableau Community Forums <https://community.tableau.com/choose-container.jspa?contentType=1&containerType=14&container=2003&et=watches.email.thread>
Following Problem while doing Linear Regression, integrating R and Tableau <https://community.tableau.com/message/797523?et=watches.email.thread#797523> in these streams: Inbox
This email was sent by Tableau Community Forums because you are a registered user.
You may unsubscribe <https://community.tableau.com/unsubscribe.jspa?email=franchini.nico%40gmail.com&token=325ecac76cc7ac667709d1fafe6d7b0a3ab557090951cfceeb38223fe1986949> instantly from Tableau Community Forums, or adjust email frequency in your email preferences <https://community.tableau.com/user-preferences!input.jspa>
Can you take screenshots of:
- your R window
- Tableau's external services connection configuration window
- the calculated field using the R script
- the entire Tableau view with the pills
- the error screen with all the details
and post them here? Thanks!
2 of 2 people found this helpful
I had the same issue when trying to do regression. I just fixed it last night, after finding a very helpful stack overflow thread. If your problem is the same as mine, try the following steps:
- Close any projects or instances that are using R.
- type the following command into whatever program you are using to run R code (could be the default R program, Rstudio, etc.) - packageVersion("Rserve")
- This is assuming you are running OS. If not, you'll have to type the windows or linux equivalent.
- If the version is 1.7.3, then you need to update it to 1.8.6. You can do this (once again this code is for OS, but you get the idea) to update quickly -
- This fixed it for me. Just in case, I quit tableau and Rstudio before trying my regression again. You may want to consider rebooting as well.
Here is a link to the stackoverflow option as well. https://stackoverflow.com/questions/50410289/running-r-script-from-java-rconnection-eval-exception/50622263#50622263
Hope this helps!
1 of 1 people found this helpful
Thank you for replying this.
However, when I tried to install the Rserve 1.8.6 version, I encounter some problems.
The code is shown as below:
> install.packages("Rserve", "Rserve_1.8-6.tgz", "http://www.rforge.net/")
Warning in install.packages :
'lib = "Rserve_1.8-6.tgz"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) yes
Warning in install.packages :
unable to access index for repository http://www.rforge.net/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'http://www.rforge.net/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘Rserve’
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source package ‘Rserve’
Content type 'application/x-gzip' length 497829 bytes (486 KB)
downloaded 486 KB
* installing *source* package ‘Rserve’ ...
checking whether to compile the server... yes
configure: error: R was configured without --enable-R-shlib or --enable-R-static-lib
*** Rserve requires R (shared or static) library. ***
*** Please install R library or compile R with either --enable-R-shlib ***
*** or --enable-R-static-lib support ***
Alternatively use --without-server if you wish to build only Rserve client.
ERROR: configuration failed for package ‘Rserve’
* removing ‘/Users/***/Library/R/3.5/library/Rserve’
* restoring previous ‘/Users/***/Library/R/3.5/library/Rserve’
Warning in install.packages :
installation of package ‘Rserve’ had non-zero exit status
The downloaded source packages are in
I have checked many articles but still cannot solve it.
Please let me know if you have any idea. Thank you so much!
Hunter Maxfield THANK YOU! This worked for me. I had to upgrade Rserve from 1.7.3 to 1.8.6 and am no longer getting the error message. I'd suspect this issue should be resolved for others getting this same error message "IPC_SocketConnection::Read(len=16, connection=""->""): The connection was closed by the peer in IPC_Socket::Recv(len=16)"
I have the same problem.
" 'lib = "Rserve_1.8-6.tgz"' is not writable"
The version does not get updated.
Elaine and Tim
What operating system are you using? Please share all relevant info on versions of R, OS, etc.
Thanks so much for replying! I am using R studio, it's version 1.1.453, combined with OS, which is macOS Mojave version 10.14.2. Hope it helps.
R version 3.5.2
Mojave Version 10.14.2
I found a way to solve this, but I still don't know the root cause.
When I launch Rserver from Studio with this syntax I get the error:
Yet when I launch it from mac terminal with R CMD Rserve from terminal it just works perfectly.
Thanks to everyone for their contributions to this thread. We will look into why there might be issues with RStudio.
This is mainly due to the fact that I did not succeed to upgrade Rserve() to latest version via Rstudio (I literally tried everything I could find) while I could easily via the Mac terminal.