I want assess how many components of v=rnorm(10^8)
are less than or equal to 0.5. So I wrote this
v=rnorm(10^8)
sum(v<=0.5)
Unfortunately, I'm getting this message
> v=rnorm(10^8)
Error: cannot allocate vector of size 762.9 Mb
> sum(v<=0.5)
Error: object 'v' not found
R(3446,0xa046b540) malloc: *** mmap(size=800002048) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
R(3446,0xa046b540) malloc: *** mmap(size=800002048) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Is there any way to do this given that I can't reduce the size of vector v? Thanks