how to retrieve list of all datasets of flow with R

domantas
domantas Registered Posts: 6 ✭✭✭✭

I have built shiny web app with R, it works fine with manully preset dataset, but I would like to add an ability for user to choose a dataset from flow. So what I would like to do is to retrieve a list of all datasets in flow and then let the user to choose which dataset to upload into app.

Best Answer

  • domantas
    domantas Registered Posts: 6 ✭✭✭✭
    Answer ✓

    Since I have not found a straight forward solution I come up with one.

    So since I wanted to get all the dataset names as list I used dkuManagedFolderPartitionPaths which retrieves all dataset paths from managed folder. The paths look something like this "\dataset_name\.csv.gz". since paths are saved as a list all I had to do was to extract substring between first two "\" and then save it as list.

    paths <- dkuManagedFolderPartitionPaths(name)
    res <- str_match(paths, "/\\s*(.*?)\\s*/")
    data_list = as.list(res[,2])

Setup Info
    Tags
      Help me…