Create dataset in r code

Von1974
Level 2
Create dataset in r code

Hi

I have a webapp in Shiny and i would like users to be able to press a button that then create a copy of a dataset that is suffixed with their user name. See code below;

user <- Sys.getenv("USER")

dfRules_live <- dkuReadDataset("Rules")

dkuWriteDatasetSchema(dfRules_live , paste0("Rules_",user))

However, the error tells me that "Warning: Error in dkuWriteDatasetSchema: Failed to write dataset: dataset does not exist"

I know in a workflow i have to create an empty dataset to populate, but how do i do this in r code?

TIA!

0 Kudos
3 Replies
Marlan

Hi @Von1974,

The following post describes creating a dataset from Python rather than R but may still be of some help:

https://community.dataiku.com/t5/Plugins-Extending-Dataiku-DSS/Create-a-Dataset-with-Python-Code/m-p...

Marlan

0 Kudos
Von1974
Level 2
Author

Thanks @Marlan . This is helpful but there doesn't seem to be a R equivalent for the python function project.create_dataset, not that I can locate anyway!

0 Kudos
Von1974
Level 2
Author

@Marlan  looks like i cant do this in R, so ive used the link you sent me to convert the r code to python...now to work out how to reference this python code in the r script to run it!

 

0 Kudos