ID EN
System & OS

.Platform

R Base 3.6.2 🇮🇩 Bahasa Indonesia

.Platform adalah daftar dengan beberapa detail platform tempat R dibangun. Ini menyediakan sarana untuk menulis kode R portabel OS.

Syntax

R
.Platform

Return Value

Daftar dengan setidaknya komponen berikut: OS.typecharacter string, yang memberikan Sistem Operasi (keluarga) komputer. Salah satu dari "unix" atau "windows". string file.sepcharacter, memberikan pemisah file yang digunakan pada platform Anda: "/" pada versi Unix dan Windows (tetapi tidak pada port sebelumnya ke Mac OS Klasik). string dynlib.extcharacter, memberikan ekstensi nama file dari perpustakaan yang dapat dimuat secara dinamis, misalnya, ".dll" pada Windows dan ".so" atau ".sl" pada sejenis Unix. (Catatan untuk pengguna macOS: ini ar

Contoh

Example
R
# NOT RUN {
## Note: this can be done in a system-independent way by dir.exists()
if(.Platform$OS.type == "unix") {
   system.test <- function(...) system(paste("test", ...)) == 0L
   dir.exists2 <- function(dir)
       sapply(dir, function(d) system.test("-d", d))
   dir.exists2(c(R.home(), "/tmp", "~", "/NO")) # > T T T F
}
# }

See Also

R.version and Sys.info give more details about the OS. In particular R.version$platform is the canonical name of the platform under which R was compiled. .Machine for details of the arithmetic used and system for invoking platform-specific system commands. capabilities and extSoftVersion (and links there) for availability of capabilities partly external to R but used from R functions.