[R] Problem with sample(...,size = 1000000000,...)

Huy Nguyễn quanghuy1258 at gmail.com
Sat Oct 15 18:19:14 CEST 2016


When I ran this code:
"
x<-sample(1:5,1000000000,TRUE,c(0.1,0.2,0.4,0.2,0.1))
print(table(x)/1000000000)
plot(table(x)/1000000000,type="h",xlab="x",ylab="P(x)")
"
My laptop was frozen and didn't respond. Although I used ctrl+alt+del to
terminate r program, my laptop still did nothing. And I must restart my
laptop immediately or my laptop might be broken down.
Thus, I think in the future the program should have something to control
the memory and time when it is running and can be terminated if necessary.

	[[alternative HTML version deleted]]



More information about the R-help mailing list