Description Usage Arguments Value References See Also Examples
Is the operating system in this machine Windows/Unix/Mac based.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | assert_is_64_bit_os(severity = getOption("assertive.severity", "stop"))
assert_is_32_bit(severity = getOption("assertive.severity", "stop"))
assert_is_64_bit(severity = getOption("assertive.severity", "stop"))
assert_is_bsd(severity = getOption("assertive.severity", "stop"))
assert_is_linux(severity = getOption("assertive.severity", "stop"))
assert_is_mac(severity = getOption("assertive.severity", "stop"))
assert_is_osx(severity = getOption("assertive.severity", "stop"))
assert_is_osx_cheetah(severity = getOption("assertive.severity", "stop"))
assert_is_osx_puma(severity = getOption("assertive.severity", "stop"))
assert_is_osx_jaguar(severity = getOption("assertive.severity", "stop"))
assert_is_osx_panther(severity = getOption("assertive.severity", "stop"))
assert_is_osx_tiger(severity = getOption("assertive.severity", "stop"))
assert_is_osx_leopard(severity = getOption("assertive.severity", "stop"))
assert_is_osx_snow_leopard(severity = getOption("assertive.severity", "stop"))
assert_is_osx_lion(severity = getOption("assertive.severity", "stop"))
assert_is_osx_mountain_lion(severity = getOption("assertive.severity", "stop"))
assert_is_osx_mavericks(severity = getOption("assertive.severity", "stop"))
assert_is_osx_yosemite(severity = getOption("assertive.severity", "stop"))
assert_is_osx_el_capitan(severity = getOption("assertive.severity", "stop"))
assert_is_macos_sierra(severity = getOption("assertive.severity", "stop"))
assert_is_macos_high_sierra(severity = getOption("assertive.severity", "stop"))
assert_is_macos_mojave(severity = getOption("assertive.severity", "stop"))
assert_is_macos_catalina(severity = getOption("assertive.severity", "stop"))
assert_is_macos_big_sur(severity = getOption("assertive.severity", "stop"))
assert_is_solaris(severity = getOption("assertive.severity", "stop"))
assert_is_unix(severity = getOption("assertive.severity", "stop"))
assert_is_windows(severity = getOption("assertive.severity", "stop"))
assert_is_windows_vista(severity = getOption("assertive.severity", "stop"))
assert_is_windows_7(severity = getOption("assertive.severity", "stop"))
assert_is_windows_8(severity = getOption("assertive.severity", "stop"))
assert_is_windows_8.1(severity = getOption("assertive.severity", "stop"))
assert_is_windows_10(severity = getOption("assertive.severity", "stop"))
assert_is_windows_server_2008(
severity = getOption("assertive.severity", "stop")
)
assert_is_windows_server_2008_r2(
severity = getOption("assertive.severity", "stop")
)
assert_is_windows_server_2012(
severity = getOption("assertive.severity", "stop")
)
assert_is_windows_server_2012_r2(
severity = getOption("assertive.severity", "stop")
)
is_64_bit_os()
is_32_bit()
is_64_bit()
is_bsd()
is_linux()
is_mac()
is_osx()
is_osx_cheetah()
is_osx_puma()
is_osx_jaguar()
is_osx_panther()
is_osx_tiger()
is_osx_leopard()
is_osx_snow_leopard()
is_osx_lion()
is_osx_mountain_lion()
is_osx_mavericks()
is_osx_yosemite()
is_osx_el_capitan()
is_macos_sierra()
is_macos_high_sierra()
is_macos_mojave()
is_macos_catalina()
is_macos_big_sur()
is_solaris()
is_unix()
is_windows()
is_windows_vista()
is_windows_7()
is_windows_8()
is_windows_8.1()
is_windows_10()
is_windows_server_2008()
is_windows_server_2008_r2()
is_windows_server_2012()
is_windows_server_2012_r2()
is_windows_server_2016()
is_windows_server_2019()
|
severity |
How severe should the consequences of the assertion be?
Either |
is_windows
returns TRUE
if the OS on the current
platform is Microsoft windows-based. is_unix
returns TRUE
if
the OS is Unix based (pretty much anything that isn't Windows, including OS
X).
is_mac
, is_linux
, is_bsd
, is_solaris
return
TRUE
if the OS is Apple OS X, Linux, FreeBSD/NetBSD, or Solaris
respectively.
is_64_bit_os
returns TRUE
when the operating system is 64-bit.
The assert_*
functions return nothing but throw an error if the
corresponding is_*
functions return FALSE
.
With the exception of is_windows
and is_unix
that
use .Platform$OS.type
, the OS is determined from
Sys.info()[["sysname"]]
, which (not on Windows) is calculated via the
OS uname
program. GNU has more information on the return value:
https://www.gnu.org/software/libc/manual/html_node/Platform-Type.html
and Wikipedia has a nice list of possible values:
https://en.wikipedia.org/wiki/Uname#Examples
The names for different versions of Windows are decribed in:
http://svn.r-project.org/R/trunk/src/library/utils/src/windows/util.c
.Platform
, Sys.info
,
version
, and win.version
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | is_unix()
is_linux()
is_bsd()
is_solaris()
if(is_windows())
{
assertive.base::dont_stop({
assert_is_windows_vista()
assert_is_windows_7()
assert_is_windows_8()
assert_is_windows_8.1()
assert_is_windows_10()
assert_is_windows_server_2008()
assert_is_windows_server_2008_r2()
assert_is_windows_server_2012()
assert_is_windows_server_2012_r2()
})
}
if(is_osx()) # is_mac is a synonym
{
assertive.base::dont_stop({
assert_is_osx_cheetah()
assert_is_osx_puma()
assert_is_osx_jaguar()
assert_is_osx_panther()
assert_is_osx_tiger()
assert_is_osx_leopard()
assert_is_osx_snow_leopard()
assert_is_osx_lion()
assert_is_osx_mountain_lion()
assert_is_osx_mavericks()
assert_is_osx_yosemite()
assert_is_osx_el_capitan()
assert_is_macos_sierra() # note the change from OSX to macOS
})
}
is_32_bit()
is_64_bit()
assertive.base::dont_stop(assert_is_windows())
assertive.base::dont_stop(assert_is_unix())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.