We might be receiving the above error because R may be failing to obtain memory, either because the size might have exceeded the address-space limit for a process or it can also be because the system was unable to provide the memory.

Hence I would suggest you to work by using a smaller dataset and check.