Problems with spaces in paths when calling a batch file from R

前端 未结 2 1197
耶瑟儿~
耶瑟儿~ 2021-01-22 14:46

I have some problems to call a command line program called molconvert from R using system() in Windows. molconvert is located in \"C:\\Program Files\\ChemAxon

2条回答
  •  星月不相逢
    2021-01-22 15:11

    You want to use shQuote to quote the path to the executable, not the entire command line. Depending on what your molconvert program expects, you may also want to quote paths that are arguments to it.

    system(paste(shQuote(file.path(dirmolconvert, "molconvert.exe")),
                 "pdb",
                 shQuote("C:\\molecule conversions\\cembrene A.mol"))
    

提交回复
热议问题