r - system2 命令没有结果
问题描述
我有一个脚本,用于分析 R Studio 中的一些音频数据。该脚本运行没有错误,但是当我执行它时,它什么也不做。我认为这可能是 system2 命令的问题。任何帮助都非常感谢,我什至没有错误信息就不知所措
这是我的代码-
# Set the directory containing the files
directory <- "D://Alto//Audio 1//Day 2//"
# The directory to store the results
base_output_directory <- "D://Ecoacoustics//Output//indices_output//"
# Get a list of audio files inside the directory
# (Get-ChildItem is just like ls, or dir)
files <- list.files(directory, pattern = "*.wav", full.names = TRUE)
# iterate through each file
for(file in files) {
message("Processing ", file)
# get just the name of the file
file_name <- basename(file)
# make a folder for results
output_directory <- normalizePath(file.path(base_output_directory, file_name))
dir.create(output_directory, recursive = TRUE)
# prepare command
command <- sprintf('audio2csv "%s" "Towsey.Acoustic.yml" "%s" ', file, output_directory)
# finally, execute the command
system2('C://Ecoacoustics//AnalysisPrograms//AnalysisPrograms.exe//', command)
}
解决方案
推荐阅读
- java - 设置 IntelliJ 时字符显示不正确
- python - 打印输出看起来在长循环中拉伸
- c# - 如何防止用户访问其他用户的个人资料?
- django - 我可以在 django-models 中添加颜色选择器吗
- reactjs - 使用 Winterfell 响应表单
- firebase - 如何在不使用(已弃用)数据库机密的情况下将 Firebase 集成到 Google Apps 脚本中
- asp.net-core - 在具有 EF Core 迁移的 Net Core 类库上使用 settings.json
- matlab - 如何在 MATLAB 中调整条形绝对宽度
- c++ - Qt 对于我的带宽上限来说太大了。我的替代方案是什么?
- uitableview - 设置 UITableViewCellAccessory 的左 X 位置