r - 在R中的while循环内打印绘图
问题描述
在 R 工作室中,我无法打印 while 循环的每次迭代。
while(i < 10){
print(plot(x, c(U[nx], U, U[1])))
i = i + 1
Sys.sleep(0.01)
flush.console()
}
无论是否使用 flush.console(),都不会显示任何内容,但它会在循环之外显示一个绘图。
解决方案
也许只是使用“for”循环。像这样的东西应该工作......
for(i in 1:10){
print('hello')
flush.console()
i = i + 1
}
推荐阅读
- react-native - 通过 App 的后台服务 React Native 本地通知
- java - Spring Security:未调用自定义 UserDetailsService(使用 Auth0 身份验证)
- angular - 想要验证 Angular 表单,无论出现什么错误,按钮都会提交
- java - 从 Java 使用 IBM MQ
- django - Centos nginx + django + gunicorn 403 禁止
- php - 最新的 Laravel 和最新的 WAMP 问题
- camera - libuvc_ros 错误:无法启动 [libuvc_camera/camera_node] 类型的节点
- ios - 无法通过命令行在模拟器上安装 .app
- laravel-5 - Vue自定义v-model值从axios get请求获取后不更新值
- java - 使用没有注释的杰克逊将列表序列化为xml?