KNOWLEDGE BASE

Error "The input RData file contains 0 members" Connecting to RData File


Published: 29 Dec 2016
Last Modified Date: 11 Apr 2017

Issue

When connecting to an RData file (.rda, .rdata) in Tableau Desktop, the following error message is received:
An error occurred while communicating with the data source.
Unable to connect to the Server. Check that the server is running and you have access privileges to the requested database.

The input RData file contains 0 members, there is no data to transfer, please check the log for further details.
Error reading file mydata.rda: error code=-1
The table "[...].[...]" does not exist.

Environment

  • Tableau Desktop 
  • R File

Resolution

Ensure that the RData file contains only a single data frame or matrix.
  1. This can be done using the str() function in RStudio. For example:
    > str(mydata)
    Classes ‘tbl_df’ and 'data.frame':    8 obs. of  9 variables:
    (--- lines of data ---)
    • Notice how the above RData file contains an extra 'tbl_df' class. This file will produce the above error message in Tableau Desktop.
  2. To extract only the data frame from the bove file, use the as.data.frame() function. For example:
  3. > TEMP <- as.data.frame(mydata)
  4. Now, if we were to use str() on TEMP, we get the following output:
  5. > str(TEMP)
    'data.frame':    8 obs. of  9 variables:
    (--- lines of data ---)
  6. We can now save the extracted data frame to a new RData file:
    > save(TEMP,file = "mydataNEW.rda")
  7. Now that mydataNEW.rda contains only the data frame object, it should load successfully in Tableau Desktop.

Cause

When connecting to an RData file in Tableau Desktop, the file must contain only one object, and that object must be a data frame or a matrix
Did this article resolve the issue?