Importing RData Files in DataIku

OrsonWelles
OrsonWelles Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 3 ✭✭✭

Hi,

Is it possible to import from an RData file (usually with extension . rdata or . rda) a DataIku dataset ?.

If not what is the proper way to deal with .rda files and integrate them in a flow ?

Thanks in advance. Best Jean-Daniel

Tagged:

Best Answer

  • AlexandreL
    AlexandreL Dataiker, Registered Posts: 36 Dataiker
    edited July 17 Answer ✓

    Hi,

    RData is not a table and needs to be loaded prior to extracting the table you need to write in your dataset, so there is no builtin way to do it.

    However, you can create a managed folder on your flow in which you can store your RData file. From this folder, create an R recipe that takes your folder as input, and a dataset as output. The code in your R recipe should look like this:

    # Load R Data
    r_folder <- dkuManagedFolderPath("folder_id")
    path <- paste(r_folder, 'filename.rda', sep="/")
    load(path)
    
    # Get the dataframe of interest
    df = dataframe_of_interest
    
    dkuWriteDataset(df,"dataset_name")

    Where folder_id is your input folder's id, dataframe_of_interest is the name of your dataset when it was saved in your .rda file, and dataset_name is the name of your recipe's output dataset.

Answers

  • OrsonWelles
    OrsonWelles Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 3 ✭✭✭

    Dear AlexanderL,

    It works like a charm. Great Explanation. Managed Folder is a Nice feature I had not thought of.

    Thanks, Best Jean-Daniel

Setup Info
    Tags
      Help me…