I need to buy good computer to work with R for looping 20 millions rows without problems of memory, or cpu.
Hardware Recommendations Stack Exchange is a question and answer site for people seeking specific hardware recommendations. It only takes a minute to sign up.Sign up to join this community
32GB of RAM is $300-400 which you could add to any computer and load 24GB into RAM and of course this is the fastest.
From there M.2 NVM SSD 128GB or larger would be easy to come by and fast.
The new AMD Ryzen chips support PCIe 4 so a PCIe 4.0 M.2 NVM SSD would be the fastest. Nearly 5gb/s read and 4.4 write.
Obviously you can RAID them together, and achieve even higher speeds.
A ryzen 3000 series, motherboard, and RAM are around $1000 depending on which CPU you get.
If you don't already have them a video card,case,power supply, and misc would be even more.