【问题标题】:Running a windows executable within R using wine in ubuntu在 ubuntu 中使用 wine 在 R 中运行 Windows 可执行文件
【发布时间】:2017-06-04 20:57:18
【问题描述】:

我正在尝试在 Ubuntu 上的 Rstudio 中执行名为(FUSION 的 groundfilter.exe)的仅限 Windows 的可执行文件。 我可以使用 wine 从终端运行 groundfilter.exe,如下所示:

wine C:/FUSION/groundfilter.exe /gparam:0 /wparam:1 /tolerance:1    /iterations:10 test_Grnd.las 1 test.las

执行良好并生成文件 test_Grnd.las OK。 但是,当我尝试在 Rstudio 中使用 system() 执行此操作时,它并不能正常工作,并且不会生成输出文件(与终端不同)。我这样做:

command<-paste("wine C:/FUSION/groundfilter.exe",
           "/gparam:0 /wparam:1 /tolerance:1 /iterations:10",
           "/home/martin/Documents/AUAV_Projects/test_FUSION/test_FUSION/test_GroundPts.las", 
           "1", 
           "/home/martin/Documents/AUAV_Projects/test_FUSION/test_FUSION/test.las",sep=" ")
system(command)

可执行文件似乎在 Rstudio 控制台中调用 OK,但运行时好像没有提供文件名。输出(截断)是:

system(command)
GroundFilter v1.75 (FUSION v3.60) (Built on Oct  6 2016 08:45:14) DEBUG
--Robert J. McGaughey--USDA Forest Service--Pacific Northwest Research    Station
Filters a point cloud to identify bare-earth points

Syntax: GroundFilter [switches] outputfile cellsize datafile1 datafile2   ...
outputfile   Name for the output point data file (stored in LDA format)

如果文件名被省略,这与终端的输出相同,所以我在 R 中的系统调用不正确?

【问题讨论】:

    标签: r ubuntu rstudio wine


    【解决方案1】:

    我认为 wine 不会找到像 /home/martin/.... 这样的路径

    一种可能性是将groundfilter.exe(可能还有它需要的dll)放入您要使用的目录中,然后使用setwd() 将R 工作目录设置为该目录。

    我看到的另一种可能性是提供一条葡萄酒可以理解的路径,例如Z:/home/martin/...

    这不是一个权威的答案,只是我的想法,所以请参考文档了解真实情况。

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 2011-12-26
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 1970-01-01
      • 2013-04-21
      • 1970-01-01
      • 2011-04-05
      相关资源
      最近更新 更多