Skip to content

Instantly share code, notes, and snippets.

@ImkeF
Last active March 26, 2019 20:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImkeF/ea234e7a77f2ccae9d798f2a9ad76701 to your computer and use it in GitHub Desktop.
Save ImkeF/ea234e7a77f2ccae9d798f2a9ad76701 to your computer and use it in GitHub Desktop.
M functions
// Exports the current table to csv. Pass full PathFile specification as parameter
(path as text, dataset as table) =>
let
ConvertedPath = Text.Replace(path, "\", "/"),
RScript = R.Execute("write.csv(dataset,"""&ConvertedPath&""")
output <- dataset
",[dataset=dataset]),
output = RScript{[Name="output"]}[Value]
in
output
@smartretailbuyer
Copy link

Thank you Imke. I used your technique and it is very useful, all of it: the conversion of the parameter and the R.Execute to write the file out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment