Commit 46f6525c authored by Nico Mack's avatar Nico Mack

r.workingDir may now be specified as a relative path

parent d1b49287
......@@ -16,6 +16,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Array;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -72,9 +74,14 @@ public class RExecutor extends Executor implements RMainLoopCallbacks {
LOGGER.debug("JRI Path => {}", properties.getProperty(JRI_PATH)); //$NON-NLS-1$
}
StringBuilder workingDir = new StringBuilder("setwd(\"").append(properties.getProperty(R_WORKING_DIR)).append("\")"); //$NON-NLS-1$ //$NON-NLS-2$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("R Working Dir => {}", properties.getProperty(R_WORKING_DIR)); //$NON-NLS-1$
Path currentRelativePath = Paths.get(""); //$NON-NLS-1$
StringBuilder workingDir = new StringBuilder("setwd(\"") //$NON-NLS-1$
.append(currentRelativePath.toAbsolutePath())
.append("/")
.append(properties.getProperty(R_WORKING_DIR))
.append("\")"); //$NON-NLS-1$
if (LOGGER.isInfoEnabled()) {
LOGGER.info("R Working Dir => {}", workingDir); //$NON-NLS-1$
}
engine = new Rengine(R_ARGS, false, this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment