1

Please help me solve this problem. I use R Studio in Windows 10 (cpu 6700hq, ram 16gb)

I run this command

v_Time <- substr(v1, 2, sapply(gregexpr("\\_", md$variable), head, 1)-1)

It will help me convert string from T12_xxxx_yyyy to T12 only.

v1 is a vector with 160 mil rows.

After run this command, my RAM up to 13gb and stopped, R studio session is still running but I wait a long time, no thing happended.

It was hang, because I saw my RAM is stoped at 13gb and it did not change. Free ram is more than 2gb.

Any one can help me solve this problem?

neilfws
  • 32,751
  • 5
  • 50
  • 63
Tuong Nguyen
  • 143
  • 1
  • 1
  • 9
  • Vectors don't have rows. Is `v1` just a vector with a *length* of 160M, or is it a `data.frame` or `matrix`? Your use of `gregexpr` is unnecessary, you might be able to use something like `gsub("_.*", "", v1)` instead. – r2evans Mar 13 '17 at 05:01
  • When you exceed the available physical memory the OS pages out to virtual memory. Windows has a reputation for doing this badly. "Free ram" is misleading because R requires coniguous memory and yours is probably fragmented. – IRTFM Mar 13 '17 at 05:47
  • sorry for my typo.V1 is vector length of 160M. – Tuong Nguyen Mar 13 '17 at 06:32
  • yes it can page out to virtual memory, but R does not alert anythings. How can i know extractly it is still running or it hang – Tuong Nguyen Mar 13 '17 at 06:34
  • You could [split your dataset](http://stackoverflow.com/questions/3302356/how-to-split-a-data-frame) and run the command on one slice at the time? – Therkel Mar 13 '17 at 08:33
  • My question is I dont know why and when it hang :) It does not put any alert. – Tuong Nguyen Mar 14 '17 at 09:19

0 Answers0