简体   繁体   English

如何从R脚本获取输出

[英]How to Get Output from R Scripts

I have a .R Script and I am using deployR . 我有一个.R脚本,正在使用deployR My application is in Java and I have a client code interacting with the R code. 我的应用程序使用Java,并且我有一个与R代码交互的客户端代码。 The R code works fine and running it through deployR it generates a csv file too. R代码运行良好,并且通过deployR运行它deployR生成一个csv文件。 This file is the output data that I need in my application. 该文件是我在应用程序中需要的输出数据。

I tried using the following : 我尝试使用以下内容:

RProjectExecution Execution = project.executeScript("XYZ.R", "root", "user", "", ExecutionOptions);
RData rDataOut =  Execution.about().workspaceObjects.get(0);

but the value of rDataOut results to NULL . 但是rDataOut的值导致为NULL I cannot share the whole code due to company policy. 由于公司政策,我无法共享整个代码。

Any help will be appreciated. 任何帮助将不胜感激。

Output files named in the API as artifacts: API中命名为工件的输出文件:

List<RProjectFile> files = exec.about().artifacts;

Read more about https://msdn.microsoft.com/en-us/microsoft-r/deployr-client-library 阅读有关https://msdn.microsoft.com/zh-cn/microsoft-r/deployr-client-library的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM