【发布时间】:2021-06-23 17:56:19
【问题描述】:
当单独粘贴到命令行中时,这一直有效:
sprintf("Your maximum allowed investment for a period of %g years in the first year equals %g", current_nr_of_years, max_invest_year_zero_vec[current_nr_of_years])
当在脚本文件的 for 循环中运行时,这不会打印任何输出...:
loop_index_vec
for (current_nr_of_years in loop_index_vec) {
sprintf("Your maximum allowed investment for a period of %g years in the first year equals %g", current_nr_of_years, max_invest_year_zero_vec[current_nr_of_years])
# browser()
}
【问题讨论】:
-
您需要将
wrap与print或cat作为sprintf的返回值与print不同
标签: r