小编use*_*754的帖子

如果在R中进行模拟后使用鼠标滚轮,Windows 7将无响应

我在Windows 7 64位中使用R 3.0.2.运行模拟输出大于约100000的长度后,如果我在R控制台中使用鼠标滚轮,Windows会无限期冻结.

我曾经让它坐了一个多星期没有回应.强制关闭是唯一的出路,它不会在Windows事件日志中注册.我试图在其他程序中复制该问题,但它似乎只在R中出现.我已经尝试了几个版本的R,每个都卸载并重新安装,使用了几个不同的计算机鼠标和驱动程序,甚至重新安装了Windows.什么都没有解决问题.

我能想到的其他一些共同方面(但尚未确定是因素)就是这样

  1. 模拟通常在模拟期间(flush.console()例如使用)向控制台打印迭代次数等,以及

  2. 在模拟期间(但不是在完成时)内存使用很高.计算机具有32GB RAM和两个Intel Xeon E5-2687W CPU(8核,3.1GHz).

可能导致此问题的一个示例是:

    foo<-function(X, SD, N, sims){
    output<-vector("list")
    for(i in 1:sims){
        output[[i]]<-rnorm(N, X, SD)
        flush.console()
        cat(paste("Iteration", i, ":", "\n",
            "mean = ", round(mean(output[[i]]),1), "\n",
            "sd   = ", round(sd(output[[i]]), 1), "\n"))
    }
    return(output)
    }

    result<-foo(X=20, SD=2, N=100, sims=100) # but increase N or sims to > 100000

    # Now used the mouse scroll wheel in the R console.  Computer freezes.
    # Can also do rm(list=ls()) after the …
Run Code Online (Sandbox Code Playgroud)

mouse scroll r freeze windows-7

6
推荐指数
1
解决办法
378
查看次数

标签 统计

freeze ×1

mouse ×1

r ×1

scroll ×1

windows-7 ×1