Some possibilities include:
Sys.info()["machine"] == "x86-64"
.Platform$r_arch == "x64"
version$arch == "x86_64"
Is there any reason to prefer one method over another?
Related: detecting operating system in R (e.g. for adaptive .Rprofile files)
Actually none of those methods would be canonical, which I take to mean "what would Brian Ripley say". Try this:
?.Machine
sizeof.pointer........the number of bytes in a C SEXP type. Will be 4 on 32-bit builds and 8 on 64-bit builds of R.
64bit <- .Machine$sizeof.pointer == 8
64bit
#[1] TRUE
As for your nominations only one of them returns TRUE on my machine:
> Sys.info()["machine"] == "x86-64"
machine
FALSE
> .Platform$r_arch == "x64"
[1] FALSE
> version$arch == "x86_64"
[1] TRUE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With