Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know if R is running on 64 bits versus 32?

My version output is:

> version                _                             platform       x86_64-w64-mingw32            arch           x86_64                        os             mingw32                       system         x86_64, mingw32               status                                       major          2                             minor          15.2                          year           2012                          month          10                            day            26                            svn rev        61015                         language       R                             version.string R version 2.15.2 (2012-10-26) nickname       Trick or Treat     

where os is mingw32. Does that mean I'm using only 32 bits? How can I change that?

like image 278
maziar Avatar asked Aug 06 '13 22:08

maziar


People also ask

How do you check if my R is 32 or 64-bit?

If you do not know whether you have a 32- or 64-bit system: Type “system information” in the “Search Windows” box on the lower left part of the screen/ “Start” menu area. Select the “system information” app. If you have see “x64” under “System type” in the list, you have a 64-bit system.

Is RStudio 32 or 64-bit?

RStudio requires a 64-bit operating system. If you are on a 32 bit system, you can use an older version of RStudio.

Do I need both 32 and 64-bit R?

If your computer has a 64-bit operating system then both the 32-bit and 64-bit versions of R will be installed and two shortcuts, R i386 3.5. 1 and Rx64 3.5. 1, can be moved to your Desktop. It is good to have both versions of R because sometimes the 32-bit version is faster to run, but it is limited to 3Gb of RAM.

What is the difference between R 64-bit and 32-bit?

Simply put, a 64-bit processor is more capable than a 32-bit processor because it can handle more data at once. A 64-bit processor can store more computational values, including memory addresses, which means it can access over 4 billion times the physical memory of a 32-bit processor. That's just as big as it sounds.


2 Answers

Here are a few ways:

  • Sys.getenv("R_ARCH") returns either "/i386" or "/x64" at least on my Windows system (but not on my Ubuntu system where it returns an empty string)

  • Sys.info()[["machine"]] returns "x86_32" or "x86_64" on my Windows and Ubuntu systems.

Updated: With additional method.

like image 146
G. Grothendieck Avatar answered Oct 14 '22 09:10

G. Grothendieck


Rather than needing to remember the designations of various OS's, the canonical cross-platform method is to look at:

> .Machine$sizeof.pointer [1] 8   # 8 bytes for address is 64 bits. 

This is the address space for R objects. (It's not the address space for the OS.)

like image 27
IRTFM Avatar answered Oct 14 '22 10:10

IRTFM