0s autopkgtest [08:37:37]: starting date and time: 2024-05-24 08:37:37+0000 0s autopkgtest [08:37:37]: git checkout: 699e7f9f ssh-setup/nova: explicitely set 'fqdn' in cloud-init 0s autopkgtest [08:37:37]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.tl2_qqgc/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:r-cran-ggplot2 --apt-upgrade r-cran-matrixstats --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=r-cran-ggplot2/3.5.1+dfsg-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos02-ppc64el-7.secgroup --name adt-oracular-ppc64el-r-cran-matrixstats-20240524-083737-juju-7f2275-prod-proposed-migration-environment-3-014a47bf-10bd-42c1-bb53-d2ac18ba0068 --image adt/ubuntu-oracular-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-3 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 169s autopkgtest [08:40:26]: testbed dpkg architecture: ppc64el 169s autopkgtest [08:40:26]: testbed apt version: 2.7.14build2 169s autopkgtest [08:40:26]: @@@@@@@@@@@@@@@@@@@@ test bed setup 170s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 170s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 171s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 171s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [497 kB] 171s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [54.1 kB] 171s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main ppc64el Packages [160 kB] 171s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el Packages [489 kB] 171s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse ppc64el Packages [1968 B] 171s Fetched 1282 kB in 1s (1187 kB/s) 171s Reading package lists... 174s Reading package lists... 174s Building dependency tree... 174s Reading state information... 175s Calculating upgrade... 175s The following package was automatically installed and is no longer required: 175s libatm1t64 175s Use 'sudo apt autoremove' to remove it. 175s The following packages will be upgraded: 175s apparmor apport apport-core-dump-handler apt apt-utils bash-completion bc 175s curl dhcpcd-base dpkg dpkg-dev dracut-install eatmydata fwupd gcc-14-base 175s gir1.2-girepository-2.0 gir1.2-glib-2.0 groff-base initramfs-tools 175s initramfs-tools-bin initramfs-tools-core iproute2 klibc-utils less libacl1 175s libapparmor1 libapt-pkg6.0t64 libbpf1 libbsd0 libc-bin libc-dev-bin 175s libc-devtools libc6 libc6-dev libcap-ng0 libclang-cpp18 libclang1-18 175s libcurl3t64-gnutls libcurl4t64 libdpkg-perl libdw1t64 libeatmydata1 175s libelf1t64 libevent-core-2.1-7t64 libexpat1 libfwupd2 libgcc-s1 libgcrypt20 175s libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-data libgnutls30t64 175s libgpg-error-l10n libgpg-error0 libklibc libllvm18 liblocale-gettext-perl 175s liblz4-1 libnss3 libnvme1t64 libpam-modules libpam-modules-bin 175s libpam-runtime libpam0g libperl5.38t64 libsharpyuv0 libslang2 libsqlite3-0 175s libstdc++6 libtirpc-common libtirpc3t64 libuv1t64 libwebp7 libxcb1 locales 175s man-db pastebinit perl perl-base perl-modules-5.38 python-apt-common 175s python-babel-localedata python3-apport python3-apt python3-babel 175s python3-blinker python3-httplib2 python3-jinja2 python3-netaddr 175s python3-problem-report python3-pyparsing python3-six 175s python3-typing-extensions rsync tzdata ubuntu-pro-client 175s ubuntu-pro-client-l10n vim-common vim-tiny xxd 175s 100 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 175s Need to get 110 MB of archives. 175s After this operation, 3828 kB disk space will be freed. 175s Get:1 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-devtools ppc64el 2.39-0ubuntu8.1 [29.6 kB] 175s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6-dev ppc64el 2.39-0ubuntu8.1 [2104 kB] 176s Get:3 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-dev-bin ppc64el 2.39-0ubuntu8.1 [21.3 kB] 176s Get:4 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-14-base ppc64el 14.1.0-1ubuntu1 [48.4 kB] 176s Get:5 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgcc-s1 ppc64el 14.1.0-1ubuntu1 [39.2 kB] 176s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el libstdc++6 ppc64el 14.1.0-1ubuntu1 [893 kB] 176s Get:7 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6 ppc64el 2.39-0ubuntu8.1 [3275 kB] 176s Get:8 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgpg-error-l10n all 1.49-2 [8228 B] 176s Get:9 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgpg-error0 ppc64el 1.49-2 [89.2 kB] 176s Get:10 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgcrypt20 ppc64el 1.10.3-3 [742 kB] 176s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblz4-1 ppc64el 1.9.4-2 [105 kB] 176s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el libapt-pkg6.0t64 ppc64el 2.9.3 [1091 kB] 176s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el dpkg ppc64el 1.22.6ubuntu10 [1339 kB] 176s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el libperl5.38t64 ppc64el 5.38.2-4 [4938 kB] 176s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl ppc64el 5.38.2-4 [231 kB] 176s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl-base ppc64el 5.38.2-4 [1906 kB] 176s Get:17 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl-modules-5.38 all 5.38.2-4 [3110 kB] 176s Get:18 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-bin ppc64el 2.39-0ubuntu8.1 [751 kB] 176s Get:19 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt ppc64el 2.9.3 [1429 kB] 176s Get:20 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt-utils ppc64el 2.9.3 [231 kB] 176s Get:21 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgnutls30t64 ppc64el 3.8.5-2ubuntu1 [1060 kB] 176s Get:22 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam0g ppc64el 1.5.3-7ubuntu1 [75.7 kB] 176s Get:23 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-modules-bin ppc64el 1.5.3-7ubuntu1 [57.8 kB] 176s Get:24 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-modules ppc64el 1.5.3-7ubuntu1 [325 kB] 176s Get:25 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblocale-gettext-perl ppc64el 1.07-7 [15.8 kB] 176s Get:26 http://ftpmaster.internal/ubuntu oracular/main ppc64el libacl1 ppc64el 2.3.2-2 [21.1 kB] 176s Get:27 http://ftpmaster.internal/ubuntu oracular/main ppc64el rsync ppc64el 3.3.0-1 [485 kB] 177s Get:28 http://ftpmaster.internal/ubuntu oracular/main ppc64el python-apt-common all 2.9.0 [20.1 kB] 177s Get:29 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-apt ppc64el 2.9.0 [180 kB] 177s Get:30 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-pyparsing all 3.1.2-1 [86.4 kB] 177s Get:31 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-httplib2 all 0.22.0-1 [30.4 kB] 177s Get:32 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-problem-report all 2.28.1-0ubuntu4 [23.9 kB] 177s Get:33 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-apport all 2.28.1-0ubuntu4 [92.1 kB] 177s Get:34 http://ftpmaster.internal/ubuntu oracular/main ppc64el gir1.2-girepository-2.0 ppc64el 1.80.1-3 [24.6 kB] 177s Get:35 http://ftpmaster.internal/ubuntu oracular/main ppc64el gir1.2-glib-2.0 ppc64el 2.80.2-1ubuntu1 [182 kB] 177s Get:36 http://ftpmaster.internal/ubuntu oracular/main ppc64el libglib2.0-0t64 ppc64el 2.80.2-1ubuntu1 [1765 kB] 177s Get:37 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgirepository-1.0-1 ppc64el 1.80.1-3 [94.2 kB] 177s Get:38 http://ftpmaster.internal/ubuntu oracular/main ppc64el apport-core-dump-handler all 2.28.1-0ubuntu4 [16.9 kB] 177s Get:39 http://ftpmaster.internal/ubuntu oracular/main ppc64el apport all 2.28.1-0ubuntu4 [83.4 kB] 177s Get:40 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcap-ng0 ppc64el 0.8.5-1 [16.0 kB] 177s Get:41 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-runtime all 1.5.3-7ubuntu1 [40.8 kB] 177s Get:42 http://ftpmaster.internal/ubuntu oracular/main ppc64el dhcpcd-base ppc64el 1:10.0.6-5 [273 kB] 177s Get:43 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdw1t64 ppc64el 0.191-1 [303 kB] 177s Get:44 http://ftpmaster.internal/ubuntu oracular/main ppc64el libelf1t64 ppc64el 0.191-1 [68.0 kB] 177s Get:45 http://ftpmaster.internal/ubuntu oracular/main ppc64el libbpf1 ppc64el 1:1.4.1-1 [220 kB] 177s Get:46 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtirpc-common all 1.3.4+ds-1.3 [8106 B] 177s Get:47 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtirpc3t64 ppc64el 1.3.4+ds-1.3 [101 kB] 177s Get:48 http://ftpmaster.internal/ubuntu oracular/main ppc64el iproute2 ppc64el 6.9.0-1 [1399 kB] 177s Get:49 http://ftpmaster.internal/ubuntu oracular/main ppc64el less ppc64el 590-2ubuntu2.1 [170 kB] 177s Get:50 http://ftpmaster.internal/ubuntu oracular/main ppc64el libapparmor1 ppc64el 4.0.1-0ubuntu1 [55.1 kB] 177s Get:51 http://ftpmaster.internal/ubuntu oracular/main ppc64el libbsd0 ppc64el 0.12.2-1 [56.3 kB] 177s Get:52 http://ftpmaster.internal/ubuntu oracular/main ppc64el libexpat1 ppc64el 2.6.2-1 [98.5 kB] 177s Get:53 http://ftpmaster.internal/ubuntu oracular/main ppc64el libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 177s Get:54 http://ftpmaster.internal/ubuntu oracular/main ppc64el libslang2 ppc64el 2.3.3-5 [503 kB] 177s Get:55 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsqlite3-0 ppc64el 3.45.3-1 [803 kB] 177s Get:56 http://ftpmaster.internal/ubuntu oracular/main ppc64el locales all 2.39-0ubuntu8.1 [4234 kB] 177s Get:57 http://ftpmaster.internal/ubuntu oracular/main ppc64el tzdata all 2024a-4ubuntu1 [274 kB] 177s Get:58 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client-l10n ppc64el 32.1 [19.4 kB] 177s Get:59 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client ppc64el 32.1 [229 kB] 177s Get:60 http://ftpmaster.internal/ubuntu oracular/main ppc64el vim-tiny ppc64el 2:9.1.0377-1ubuntu1 [1043 kB] 177s Get:61 http://ftpmaster.internal/ubuntu oracular/main ppc64el vim-common all 2:9.1.0377-1ubuntu1 [385 kB] 177s Get:62 http://ftpmaster.internal/ubuntu oracular/main ppc64el xxd ppc64el 2:9.1.0377-1ubuntu1 [64.0 kB] 177s Get:63 http://ftpmaster.internal/ubuntu oracular/main ppc64el apparmor ppc64el 4.0.1-0ubuntu1 [748 kB] 177s Get:64 http://ftpmaster.internal/ubuntu oracular/main ppc64el bash-completion all 1:2.14.0-1 [206 kB] 177s Get:65 http://ftpmaster.internal/ubuntu oracular/main ppc64el groff-base ppc64el 1.23.0-4 [1106 kB] 177s Get:66 http://ftpmaster.internal/ubuntu oracular/main ppc64el libuv1t64 ppc64el 1.48.0-4 [115 kB] 177s Get:67 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb1 ppc64el 1.17.0-2 [57.0 kB] 177s Get:68 http://ftpmaster.internal/ubuntu oracular/main ppc64el man-db ppc64el 2.12.1-1 [1278 kB] 177s Get:69 http://ftpmaster.internal/ubuntu oracular/main ppc64el bc ppc64el 1.07.1-4 [93.3 kB] 177s Get:70 http://ftpmaster.internal/ubuntu oracular/main ppc64el curl ppc64el 8.5.0-2ubuntu10.1 [234 kB] 177s Get:71 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcurl4t64 ppc64el 8.5.0-2ubuntu10.1 [428 kB] 177s Get:72 http://ftpmaster.internal/ubuntu oracular/main ppc64el dpkg-dev all 1.22.6ubuntu10 [1074 kB] 177s Get:73 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdpkg-perl all 1.22.6ubuntu10 [269 kB] 177s Get:74 http://ftpmaster.internal/ubuntu oracular/main ppc64el dracut-install ppc64el 060+5-8ubuntu1 [35.2 kB] 177s Get:75 http://ftpmaster.internal/ubuntu oracular/main ppc64el libeatmydata1 ppc64el 131-2 [7522 B] 177s Get:76 http://ftpmaster.internal/ubuntu oracular/main ppc64el eatmydata all 131-2 [5576 B] 177s Get:77 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcurl3t64-gnutls ppc64el 8.5.0-2ubuntu10.1 [420 kB] 178s Get:78 http://ftpmaster.internal/ubuntu oracular/main ppc64el libfwupd2 ppc64el 1.9.20-1 [137 kB] 178s Get:79 http://ftpmaster.internal/ubuntu oracular/main ppc64el fwupd ppc64el 1.9.20-1 [4641 kB] 178s Get:80 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools all 0.142ubuntu27 [7898 B] 178s Get:81 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools-core all 0.142ubuntu27 [49.5 kB] 178s Get:82 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools-bin ppc64el 0.142ubuntu27 [21.6 kB] 178s Get:83 http://ftpmaster.internal/ubuntu oracular/main ppc64el klibc-utils ppc64el 2.0.13-4ubuntu1 [120 kB] 178s Get:84 http://ftpmaster.internal/ubuntu oracular/main ppc64el libklibc ppc64el 2.0.13-4ubuntu1 [54.2 kB] 178s Get:85 http://ftpmaster.internal/ubuntu oracular/main ppc64el libclang-cpp18 ppc64el 1:18.1.6-1 [14.4 MB] 178s Get:86 http://ftpmaster.internal/ubuntu oracular/main ppc64el libllvm18 ppc64el 1:18.1.6-1 [28.7 MB] 179s Get:87 http://ftpmaster.internal/ubuntu oracular/main ppc64el libclang1-18 ppc64el 1:18.1.6-1 [8673 kB] 179s Get:88 http://ftpmaster.internal/ubuntu oracular/main ppc64el libevent-core-2.1-7t64 ppc64el 2.1.12-stable-10 [108 kB] 179s Get:89 http://ftpmaster.internal/ubuntu oracular/main ppc64el libnss3 ppc64el 2:3.100-1 [1848 kB] 179s Get:90 http://ftpmaster.internal/ubuntu oracular/main ppc64el libnvme1t64 ppc64el 1.9-1 [100 kB] 179s Get:91 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsharpyuv0 ppc64el 1.4.0-0.1 [22.0 kB] 179s Get:92 http://ftpmaster.internal/ubuntu oracular/main ppc64el libwebp7 ppc64el 1.4.0-0.1 [309 kB] 179s Get:93 http://ftpmaster.internal/ubuntu oracular/main ppc64el pastebinit all 1.7.0-1 [14.9 kB] 179s Get:94 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-babel all 2.14.0-1 [96.4 kB] 179s Get:95 http://ftpmaster.internal/ubuntu oracular/main ppc64el python-babel-localedata all 2.14.0-1 [6385 kB] 180s Get:96 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-blinker all 1.8.2-1 [11.4 kB] 180s Get:97 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-jinja2 all 3.1.3-1 [107 kB] 180s Get:98 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-netaddr all 0.10.1-1 [322 kB] 180s Get:99 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-six all 1.16.0-6 [13.0 kB] 180s Get:100 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-typing-extensions all 4.11.0-1 [61.5 kB] 180s Preconfiguring packages ... 180s Fetched 110 MB in 4s (24.4 MB/s) 181s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 181s Preparing to unpack .../libc-devtools_2.39-0ubuntu8.1_ppc64el.deb ... 181s Unpacking libc-devtools (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 181s Preparing to unpack .../libc6-dev_2.39-0ubuntu8.1_ppc64el.deb ... 181s Unpacking libc6-dev:ppc64el (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 181s Preparing to unpack .../libc-dev-bin_2.39-0ubuntu8.1_ppc64el.deb ... 181s Unpacking libc-dev-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 181s Preparing to unpack .../gcc-14-base_14.1.0-1ubuntu1_ppc64el.deb ... 181s Unpacking gcc-14-base:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 181s Setting up gcc-14-base:ppc64el (14.1.0-1ubuntu1) ... 181s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 181s Preparing to unpack .../libgcc-s1_14.1.0-1ubuntu1_ppc64el.deb ... 181s Unpacking libgcc-s1:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 181s Setting up libgcc-s1:ppc64el (14.1.0-1ubuntu1) ... 181s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 181s Preparing to unpack .../libstdc++6_14.1.0-1ubuntu1_ppc64el.deb ... 181s Unpacking libstdc++6:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 182s Setting up libstdc++6:ppc64el (14.1.0-1ubuntu1) ... 182s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 182s Preparing to unpack .../libc6_2.39-0ubuntu8.1_ppc64el.deb ... 182s Unpacking libc6:ppc64el (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 182s Setting up libc6:ppc64el (2.39-0ubuntu8.1) ... 183s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 183s Preparing to unpack .../libgpg-error-l10n_1.49-2_all.deb ... 183s Unpacking libgpg-error-l10n (1.49-2) over (1.47-3build2) ... 183s Preparing to unpack .../libgpg-error0_1.49-2_ppc64el.deb ... 183s Unpacking libgpg-error0:ppc64el (1.49-2) over (1.47-3build2) ... 183s Setting up libgpg-error0:ppc64el (1.49-2) ... 183s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 183s Preparing to unpack .../libgcrypt20_1.10.3-3_ppc64el.deb ... 183s Unpacking libgcrypt20:ppc64el (1.10.3-3) over (1.10.3-2build1) ... 183s Setting up libgcrypt20:ppc64el (1.10.3-3) ... 183s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 183s Preparing to unpack .../liblz4-1_1.9.4-2_ppc64el.deb ... 183s Unpacking liblz4-1:ppc64el (1.9.4-2) over (1.9.4-1build1) ... 183s Setting up liblz4-1:ppc64el (1.9.4-2) ... 183s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 183s Preparing to unpack .../libapt-pkg6.0t64_2.9.3_ppc64el.deb ... 183s Unpacking libapt-pkg6.0t64:ppc64el (2.9.3) over (2.7.14build2) ... 183s Setting up libapt-pkg6.0t64:ppc64el (2.9.3) ... 183s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 183s Preparing to unpack .../dpkg_1.22.6ubuntu10_ppc64el.deb ... 183s Unpacking dpkg (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 183s Setting up dpkg (1.22.6ubuntu10) ... 184s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 184s Preparing to unpack .../libperl5.38t64_5.38.2-4_ppc64el.deb ... 184s Unpacking libperl5.38t64:ppc64el (5.38.2-4) over (5.38.2-3.2build2) ... 185s Preparing to unpack .../perl_5.38.2-4_ppc64el.deb ... 185s Unpacking perl (5.38.2-4) over (5.38.2-3.2build2) ... 185s Preparing to unpack .../perl-base_5.38.2-4_ppc64el.deb ... 185s Unpacking perl-base (5.38.2-4) over (5.38.2-3.2build2) ... 185s Setting up perl-base (5.38.2-4) ... 185s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 185s Preparing to unpack .../perl-modules-5.38_5.38.2-4_all.deb ... 185s Unpacking perl-modules-5.38 (5.38.2-4) over (5.38.2-3.2build2) ... 186s Preparing to unpack .../libc-bin_2.39-0ubuntu8.1_ppc64el.deb ... 186s Unpacking libc-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 186s Setting up libc-bin (2.39-0ubuntu8.1) ... 186s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 186s Preparing to unpack .../archives/apt_2.9.3_ppc64el.deb ... 186s Unpacking apt (2.9.3) over (2.7.14build2) ... 187s Setting up apt (2.9.3) ... 188s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 188s Preparing to unpack .../apt-utils_2.9.3_ppc64el.deb ... 188s Unpacking apt-utils (2.9.3) over (2.7.14build2) ... 188s Preparing to unpack .../libgnutls30t64_3.8.5-2ubuntu1_ppc64el.deb ... 188s Unpacking libgnutls30t64:ppc64el (3.8.5-2ubuntu1) over (3.8.3-1.1ubuntu3) ... 188s Setting up libgnutls30t64:ppc64el (3.8.5-2ubuntu1) ... 188s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 188s Preparing to unpack .../libpam0g_1.5.3-7ubuntu1_ppc64el.deb ... 188s Unpacking libpam0g:ppc64el (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 188s Setting up libpam0g:ppc64el (1.5.3-7ubuntu1) ... 188s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 188s Preparing to unpack .../libpam-modules-bin_1.5.3-7ubuntu1_ppc64el.deb ... 188s Unpacking libpam-modules-bin (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 192s Setting up libpam-modules-bin (1.5.3-7ubuntu1) ... 192s pam_namespace.service is a disabled or a static unit not running, not starting it. 203s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 203s Preparing to unpack .../libpam-modules_1.5.3-7ubuntu1_ppc64el.deb ... 203s Unpacking libpam-modules:ppc64el (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 203s Setting up libpam-modules:ppc64el (1.5.3-7ubuntu1) ... 203s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72148 files and directories currently installed.) 203s Preparing to unpack .../liblocale-gettext-perl_1.07-7_ppc64el.deb ... 203s Unpacking liblocale-gettext-perl (1.07-7) over (1.07-6ubuntu5) ... 203s Preparing to unpack .../libacl1_2.3.2-2_ppc64el.deb ... 203s Unpacking libacl1:ppc64el (2.3.2-2) over (2.3.2-1build1) ... 203s Setting up libacl1:ppc64el (2.3.2-2) ... 203s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72148 files and directories currently installed.) 203s Preparing to unpack .../00-rsync_3.3.0-1_ppc64el.deb ... 203s Unpacking rsync (3.3.0-1) over (3.2.7-1ubuntu1) ... 203s Preparing to unpack .../01-python-apt-common_2.9.0_all.deb ... 203s Unpacking python-apt-common (2.9.0) over (2.7.7ubuntu1) ... 203s Preparing to unpack .../02-python3-apt_2.9.0_ppc64el.deb ... 203s Unpacking python3-apt (2.9.0) over (2.7.7ubuntu1) ... 203s Preparing to unpack .../03-python3-pyparsing_3.1.2-1_all.deb ... 203s Unpacking python3-pyparsing (3.1.2-1) over (3.1.1-1) ... 203s Preparing to unpack .../04-python3-httplib2_0.22.0-1_all.deb ... 203s Unpacking python3-httplib2 (0.22.0-1) over (0.20.4-3) ... 203s Preparing to unpack .../05-python3-problem-report_2.28.1-0ubuntu4_all.deb ... 203s Unpacking python3-problem-report (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 203s Preparing to unpack .../06-python3-apport_2.28.1-0ubuntu4_all.deb ... 203s Unpacking python3-apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 203s Preparing to unpack .../07-gir1.2-girepository-2.0_1.80.1-3_ppc64el.deb ... 203s Unpacking gir1.2-girepository-2.0:ppc64el (1.80.1-3) over (1.80.1-1) ... 203s Preparing to unpack .../08-gir1.2-glib-2.0_2.80.2-1ubuntu1_ppc64el.deb ... 203s Unpacking gir1.2-glib-2.0:ppc64el (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 203s Preparing to unpack .../09-libglib2.0-0t64_2.80.2-1ubuntu1_ppc64el.deb ... 203s Unpacking libglib2.0-0t64:ppc64el (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 203s Preparing to unpack .../10-libgirepository-1.0-1_1.80.1-3_ppc64el.deb ... 203s Unpacking libgirepository-1.0-1:ppc64el (1.80.1-3) over (1.80.1-1) ... 203s Preparing to unpack .../11-apport-core-dump-handler_2.28.1-0ubuntu4_all.deb ... 203s Unpacking apport-core-dump-handler (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 203s Preparing to unpack .../12-apport_2.28.1-0ubuntu4_all.deb ... 203s Unpacking apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 203s Preparing to unpack .../13-libcap-ng0_0.8.5-1_ppc64el.deb ... 203s Unpacking libcap-ng0:ppc64el (0.8.5-1) over (0.8.4-2build2) ... 203s Setting up libcap-ng0:ppc64el (0.8.5-1) ... 203s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72150 files and directories currently installed.) 203s Preparing to unpack .../libpam-runtime_1.5.3-7ubuntu1_all.deb ... 203s Unpacking libpam-runtime (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 203s Setting up libpam-runtime (1.5.3-7ubuntu1) ... 203s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72150 files and directories currently installed.) 203s Preparing to unpack .../00-dhcpcd-base_1%3a10.0.6-5_ppc64el.deb ... 203s Unpacking dhcpcd-base (1:10.0.6-5) over (1:10.0.6-1ubuntu3) ... 203s Preparing to unpack .../01-libdw1t64_0.191-1_ppc64el.deb ... 203s Unpacking libdw1t64:ppc64el (0.191-1) over (0.190-1.1build4) ... 203s Preparing to unpack .../02-libelf1t64_0.191-1_ppc64el.deb ... 203s Unpacking libelf1t64:ppc64el (0.191-1) over (0.190-1.1build4) ... 203s Preparing to unpack .../03-libbpf1_1%3a1.4.1-1_ppc64el.deb ... 203s Unpacking libbpf1:ppc64el (1:1.4.1-1) over (1:1.3.0-2build2) ... 203s Preparing to unpack .../04-libtirpc-common_1.3.4+ds-1.3_all.deb ... 203s Unpacking libtirpc-common (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 203s Preparing to unpack .../05-libtirpc3t64_1.3.4+ds-1.3_ppc64el.deb ... 203s Unpacking libtirpc3t64:ppc64el (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 203s Preparing to unpack .../06-iproute2_6.9.0-1_ppc64el.deb ... 203s Unpacking iproute2 (6.9.0-1) over (6.1.0-1ubuntu6) ... 203s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_tables.d': Directory not empty 203s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_protos.d': Directory not empty 203s dpkg: warning: unable to delete old directory '/etc/iproute2': Directory not empty 203s Preparing to unpack .../07-less_590-2ubuntu2.1_ppc64el.deb ... 203s Unpacking less (590-2ubuntu2.1) over (590-2ubuntu2) ... 203s Preparing to unpack .../08-libapparmor1_4.0.1-0ubuntu1_ppc64el.deb ... 203s Unpacking libapparmor1:ppc64el (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 203s Preparing to unpack .../09-libbsd0_0.12.2-1_ppc64el.deb ... 203s Unpacking libbsd0:ppc64el (0.12.2-1) over (0.12.1-1build1) ... 203s Preparing to unpack .../10-libexpat1_2.6.2-1_ppc64el.deb ... 203s Unpacking libexpat1:ppc64el (2.6.2-1) over (2.6.1-2build1) ... 203s Preparing to unpack .../11-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 203s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 203s Preparing to unpack .../12-libslang2_2.3.3-5_ppc64el.deb ... 203s Unpacking libslang2:ppc64el (2.3.3-5) over (2.3.3-3build2) ... 203s Preparing to unpack .../13-libsqlite3-0_3.45.3-1_ppc64el.deb ... 203s Unpacking libsqlite3-0:ppc64el (3.45.3-1) over (3.45.1-1ubuntu2) ... 203s Preparing to unpack .../14-locales_2.39-0ubuntu8.1_all.deb ... 203s Unpacking locales (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 203s Preparing to unpack .../15-tzdata_2024a-4ubuntu1_all.deb ... 203s Unpacking tzdata (2024a-4ubuntu1) over (2024a-2ubuntu1) ... 203s Preparing to unpack .../16-ubuntu-pro-client-l10n_32.1_ppc64el.deb ... 203s Unpacking ubuntu-pro-client-l10n (32.1) over (31.2.3) ... 203s Preparing to unpack .../17-ubuntu-pro-client_32.1_ppc64el.deb ... 203s Unpacking ubuntu-pro-client (32.1) over (31.2.3) ... 203s Preparing to unpack .../18-vim-tiny_2%3a9.1.0377-1ubuntu1_ppc64el.deb ... 203s Unpacking vim-tiny (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 203s Preparing to unpack .../19-vim-common_2%3a9.1.0377-1ubuntu1_all.deb ... 203s Unpacking vim-common (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 203s Preparing to unpack .../20-xxd_2%3a9.1.0377-1ubuntu1_ppc64el.deb ... 203s Unpacking xxd (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 203s Preparing to unpack .../21-apparmor_4.0.1-0ubuntu1_ppc64el.deb ... 203s Unpacking apparmor (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 203s Preparing to unpack .../22-bash-completion_1%3a2.14.0-1_all.deb ... 203s Unpacking bash-completion (1:2.14.0-1) over (1:2.11-8) ... 203s Preparing to unpack .../23-groff-base_1.23.0-4_ppc64el.deb ... 203s Unpacking groff-base (1.23.0-4) over (1.23.0-3build2) ... 203s Preparing to unpack .../24-libuv1t64_1.48.0-4_ppc64el.deb ... 203s Unpacking libuv1t64:ppc64el (1.48.0-4) over (1.48.0-1.1build1) ... 203s Preparing to unpack .../25-libxcb1_1.17.0-2_ppc64el.deb ... 203s Unpacking libxcb1:ppc64el (1.17.0-2) over (1.15-1ubuntu2) ... 203s Preparing to unpack .../26-man-db_2.12.1-1_ppc64el.deb ... 203s Unpacking man-db (2.12.1-1) over (2.12.0-4build2) ... 203s Preparing to unpack .../27-bc_1.07.1-4_ppc64el.deb ... 203s Unpacking bc (1.07.1-4) over (1.07.1-3ubuntu4) ... 203s Preparing to unpack .../28-curl_8.5.0-2ubuntu10.1_ppc64el.deb ... 203s Unpacking curl (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 203s Preparing to unpack .../29-libcurl4t64_8.5.0-2ubuntu10.1_ppc64el.deb ... 203s Unpacking libcurl4t64:ppc64el (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 203s Preparing to unpack .../30-dpkg-dev_1.22.6ubuntu10_all.deb ... 203s Unpacking dpkg-dev (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 203s Preparing to unpack .../31-libdpkg-perl_1.22.6ubuntu10_all.deb ... 203s Unpacking libdpkg-perl (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 203s Preparing to unpack .../32-dracut-install_060+5-8ubuntu1_ppc64el.deb ... 203s Unpacking dracut-install (060+5-8ubuntu1) over (060+5-1ubuntu3) ... 203s Preparing to unpack .../33-libeatmydata1_131-2_ppc64el.deb ... 203s Unpacking libeatmydata1:ppc64el (131-2) over (131-1ubuntu1) ... 203s Preparing to unpack .../34-eatmydata_131-2_all.deb ... 203s Unpacking eatmydata (131-2) over (131-1ubuntu1) ... 203s Preparing to unpack .../35-libcurl3t64-gnutls_8.5.0-2ubuntu10.1_ppc64el.deb ... 203s Unpacking libcurl3t64-gnutls:ppc64el (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 203s Preparing to unpack .../36-libfwupd2_1.9.20-1_ppc64el.deb ... 203s Unpacking libfwupd2:ppc64el (1.9.20-1) over (1.9.16-1) ... 203s Preparing to unpack .../37-fwupd_1.9.20-1_ppc64el.deb ... 203s Unpacking fwupd (1.9.20-1) over (1.9.16-1) ... 203s Preparing to unpack .../38-initramfs-tools_0.142ubuntu27_all.deb ... 203s Unpacking initramfs-tools (0.142ubuntu27) over (0.142ubuntu25) ... 203s Preparing to unpack .../39-initramfs-tools-core_0.142ubuntu27_all.deb ... 203s Unpacking initramfs-tools-core (0.142ubuntu27) over (0.142ubuntu25) ... 203s Preparing to unpack .../40-initramfs-tools-bin_0.142ubuntu27_ppc64el.deb ... 203s Unpacking initramfs-tools-bin (0.142ubuntu27) over (0.142ubuntu25) ... 203s Preparing to unpack .../41-klibc-utils_2.0.13-4ubuntu1_ppc64el.deb ... 203s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 203s Preparing to unpack .../42-libklibc_2.0.13-4ubuntu1_ppc64el.deb ... 203s Unpacking libklibc:ppc64el (2.0.13-4ubuntu1) over (2.0.13-4) ... 203s Preparing to unpack .../43-libclang-cpp18_1%3a18.1.6-1_ppc64el.deb ... 203s Unpacking libclang-cpp18 (1:18.1.6-1) over (1:18.1.3-1) ... 203s Preparing to unpack .../44-libllvm18_1%3a18.1.6-1_ppc64el.deb ... 203s Unpacking libllvm18:ppc64el (1:18.1.6-1) over (1:18.1.3-1) ... 203s Preparing to unpack .../45-libclang1-18_1%3a18.1.6-1_ppc64el.deb ... 203s Unpacking libclang1-18 (1:18.1.6-1) over (1:18.1.3-1) ... 203s Preparing to unpack .../46-libevent-core-2.1-7t64_2.1.12-stable-10_ppc64el.deb ... 203s Unpacking libevent-core-2.1-7t64:ppc64el (2.1.12-stable-10) over (2.1.12-stable-9ubuntu2) ... 203s Preparing to unpack .../47-libnss3_2%3a3.100-1_ppc64el.deb ... 203s Unpacking libnss3:ppc64el (2:3.100-1) over (2:3.98-1build1) ... 203s Preparing to unpack .../48-libnvme1t64_1.9-1_ppc64el.deb ... 203s Unpacking libnvme1t64 (1.9-1) over (1.8-3build1) ... 203s Preparing to unpack .../49-libsharpyuv0_1.4.0-0.1_ppc64el.deb ... 203s Unpacking libsharpyuv0:ppc64el (1.4.0-0.1) over (1.3.2-0.4build3) ... 203s Preparing to unpack .../50-libwebp7_1.4.0-0.1_ppc64el.deb ... 203s Unpacking libwebp7:ppc64el (1.4.0-0.1) over (1.3.2-0.4build3) ... 203s Preparing to unpack .../51-pastebinit_1.7.0-1_all.deb ... 203s Unpacking pastebinit (1.7.0-1) over (1.6.2-1) ... 203s Preparing to unpack .../52-python3-babel_2.14.0-1_all.deb ... 203s Unpacking python3-babel (2.14.0-1) over (2.10.3-3build1) ... 203s Preparing to unpack .../53-python-babel-localedata_2.14.0-1_all.deb ... 203s Unpacking python-babel-localedata (2.14.0-1) over (2.10.3-3build1) ... 203s Preparing to unpack .../54-python3-blinker_1.8.2-1_all.deb ... 203s Unpacking python3-blinker (1.8.2-1) over (1.8.1-1) ... 203s Preparing to unpack .../55-python3-jinja2_3.1.3-1_all.deb ... 203s Unpacking python3-jinja2 (3.1.3-1) over (3.1.2-1ubuntu1) ... 203s Preparing to unpack .../56-python3-netaddr_0.10.1-1_all.deb ... 203s Unpacking python3-netaddr (0.10.1-1) over (0.8.0-2ubuntu1) ... 203s Preparing to unpack .../57-python3-six_1.16.0-6_all.deb ... 203s Unpacking python3-six (1.16.0-6) over (1.16.0-4) ... 203s Preparing to unpack .../58-python3-typing-extensions_4.11.0-1_all.deb ... 203s Unpacking python3-typing-extensions (4.11.0-1) over (4.10.0-1) ... 203s Setting up libexpat1:ppc64el (2.6.2-1) ... 203s Setting up libsharpyuv0:ppc64el (1.4.0-0.1) ... 203s Setting up libapparmor1:ppc64el (4.0.1-0ubuntu1) ... 203s Setting up libxcb1:ppc64el (1.17.0-2) ... 203s Setting up apt-utils (2.9.3) ... 203s Setting up libcurl4t64:ppc64el (8.5.0-2ubuntu10.1) ... 203s Setting up python3-problem-report (2.28.1-0ubuntu4) ... 203s Setting up libtirpc-common (1.3.4+ds-1.3) ... 203s Setting up libsqlite3-0:ppc64el (3.45.3-1) ... 203s Setting up libuv1t64:ppc64el (1.48.0-4) ... 203s Setting up libcurl3t64-gnutls:ppc64el (8.5.0-2ubuntu10.1) ... 203s Setting up less (590-2ubuntu2.1) ... 203s Setting up bc (1.07.1-4) ... 203s Setting up pastebinit (1.7.0-1) ... 203s Setting up libnss3:ppc64el (2:3.100-1) ... 203s Setting up locales (2.39-0ubuntu8.1) ... 203s Generating locales (this might take a while)... 203s en_US.UTF-8... done 203s Generation complete. 203s Setting up xxd (2:9.1.0377-1ubuntu1) ... 203s Setting up libelf1t64:ppc64el (0.191-1) ... 203s Setting up python-babel-localedata (2.14.0-1) ... 203s Setting up libdw1t64:ppc64el (0.191-1) ... 203s Setting up tzdata (2024a-4ubuntu1) ... 203s 203s Current default time zone: 'Etc/UTC' 203s Local time is now: Fri May 24 08:40:59 UTC 2024. 203s Universal Time is now: Fri May 24 08:40:59 UTC 2024. 203s Run 'dpkg-reconfigure tzdata' if you wish to change it. 203s 203s Setting up python3-six (1.16.0-6) ... 203s Setting up apparmor (4.0.1-0ubuntu1) ... 203s Installing new version of config file /etc/apparmor.d/abstractions/authentication ... 203s Installing new version of config file /etc/apparmor.d/abstractions/samba ... 203s Installing new version of config file /etc/apparmor.d/firefox ... 204s Reloading AppArmor profiles 205s Setting up libklibc:ppc64el (2.0.13-4ubuntu1) ... 205s Setting up python3-jinja2 (3.1.3-1) ... 206s Setting up libglib2.0-0t64:ppc64el (2.80.2-1ubuntu1) ... 206s No schema files found: doing nothing. 206s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 206s Setting up vim-common (2:9.1.0377-1ubuntu1) ... 206s Setting up libslang2:ppc64el (2.3.3-5) ... 206s Setting up python3-pyparsing (3.1.2-1) ... 206s Setting up libnvme1t64 (1.9-1) ... 206s Setting up bash-completion (1:2.14.0-1) ... 206s Installing new version of config file /etc/profile.d/bash_completion.sh ... 206s Setting up perl-modules-5.38 (5.38.2-4) ... 206s Setting up dhcpcd-base (1:10.0.6-5) ... 206s Setting up python3-typing-extensions (4.11.0-1) ... 206s Setting up gir1.2-glib-2.0:ppc64el (2.80.2-1ubuntu1) ... 206s Setting up libwebp7:ppc64el (1.4.0-0.1) ... 206s Setting up python3-netaddr (0.10.1-1) ... 206s Setting up python-apt-common (2.9.0) ... 206s Setting up dracut-install (060+5-8ubuntu1) ... 206s Setting up groff-base (1.23.0-4) ... 206s Setting up libeatmydata1:ppc64el (131-2) ... 206s Setting up python3-httplib2 (0.22.0-1) ... 207s Setting up libgirepository-1.0-1:ppc64el (1.80.1-3) ... 207s Setting up libevent-core-2.1-7t64:ppc64el (2.1.12-stable-10) ... 207s Setting up curl (8.5.0-2ubuntu10.1) ... 207s Setting up libperl5.38t64:ppc64el (5.38.2-4) ... 207s Setting up libc-dev-bin (2.39-0ubuntu8.1) ... 207s Setting up klibc-utils (2.0.13-4ubuntu1) ... 207s Setting up libbsd0:ppc64el (0.12.2-1) ... 207s Setting up libgpg-error-l10n (1.49-2) ... 207s Setting up liblocale-gettext-perl (1.07-7) ... 207s Setting up libbpf1:ppc64el (1:1.4.1-1) ... 207s Setting up rsync (3.3.0-1) ... 208s rsync.service is a disabled or a static unit not running, not starting it. 208s Setting up libc-devtools (2.39-0ubuntu8.1) ... 208s Setting up libllvm18:ppc64el (1:18.1.6-1) ... 208s Setting up initramfs-tools-bin (0.142ubuntu27) ... 208s Setting up python3-blinker (1.8.2-1) ... 208s Setting up libclang1-18 (1:18.1.6-1) ... 208s Setting up eatmydata (131-2) ... 208s Setting up libtirpc3t64:ppc64el (1.3.4+ds-1.3) ... 208s Setting up python3-babel (2.14.0-1) ... 208s Setting up python3-apt (2.9.0) ... 209s Setting up iproute2 (6.9.0-1) ... 209s Removing obsolete conffile /etc/iproute2/group ... 209s Removing obsolete conffile /etc/iproute2/rt_realms ... 209s Removing obsolete conffile /etc/iproute2/rt_scopes ... 209s Removing obsolete conffile /etc/iproute2/rt_tables ... 209s Removing obsolete conffile /etc/iproute2/rt_tables.d/README ... 209s Removing obsolete conffile /etc/iproute2/rt_protos.d/README ... 209s Removing obsolete conffile /etc/iproute2/rt_protos ... 209s Removing obsolete conffile /etc/iproute2/rt_dsfield ... 209s Removing obsolete conffile /etc/iproute2/nl_protos ... 209s Removing obsolete conffile /etc/iproute2/ematch_map ... 209s Removing obsolete conffile /etc/iproute2/bpf_pinning ... 209s Setting up libfwupd2:ppc64el (1.9.20-1) ... 209s Setting up vim-tiny (2:9.1.0377-1ubuntu1) ... 209s Setting up man-db (2.12.1-1) ... 209s Updating database of manual pages ... 212s man-db.service is a disabled or a static unit not running, not starting it. 212s Setting up python3-apport (2.28.1-0ubuntu4) ... 213s Setting up perl (5.38.2-4) ... 213s Setting up gir1.2-girepository-2.0:ppc64el (1.80.1-3) ... 213s Setting up libdpkg-perl (1.22.6ubuntu10) ... 213s Setting up libc6-dev:ppc64el (2.39-0ubuntu8.1) ... 213s Setting up initramfs-tools-core (0.142ubuntu27) ... 213s Setting up libclang-cpp18 (1:18.1.6-1) ... 213s Setting up ubuntu-pro-client (32.1) ... 213s Installing new version of config file /etc/apparmor.d/ubuntu_pro_apt_news ... 215s Setting up fwupd (1.9.20-1) ... 216s fwupd-offline-update.service is a disabled or a static unit not running, not starting it. 216s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 221s fwupd.service is a disabled or a static unit not running, not starting it. 221s Setting up ubuntu-pro-client-l10n (32.1) ... 221s Setting up initramfs-tools (0.142ubuntu27) ... 221s update-initramfs: deferring update (trigger activated) 221s Setting up dpkg-dev (1.22.6ubuntu10) ... 221s Setting up apport-core-dump-handler (2.28.1-0ubuntu4) ... 221s Setting up apport (2.28.1-0ubuntu4) ... 221s Installing new version of config file /etc/apport/crashdb.conf ... 221s apport-autoreport.service is a disabled or a static unit not running, not starting it. 221s Processing triggers for dbus (1.14.10-4ubuntu4) ... 221s Processing triggers for install-info (7.1-3build2) ... 221s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 221s Processing triggers for initramfs-tools (0.142ubuntu27) ... 221s update-initramfs: Generating /boot/initrd.img-6.8.0-31-generic 221s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 233s Reading package lists... 233s Building dependency tree... 233s Reading state information... 233s The following packages will be REMOVED: 233s libatm1t64* 233s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 233s After this operation, 136 kB disk space will be freed. 233s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72612 files and directories currently installed.) 233s Removing libatm1t64:ppc64el (1:2.5.1-5.1build1) ... 233s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 235s Hit:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 235s Hit:2 http://ftpmaster.internal/ubuntu oracular InRelease 235s Hit:3 http://ftpmaster.internal/ubuntu oracular-updates InRelease 235s Hit:4 http://ftpmaster.internal/ubuntu oracular-security InRelease 236s Reading package lists... 236s Reading package lists... 236s Building dependency tree... 236s Reading state information... 237s Calculating upgrade... 237s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 237s Reading package lists... 237s Building dependency tree... 237s Reading state information... 237s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 237s autopkgtest [08:41:34]: rebooting testbed after setup commands that affected boot 279s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 291s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 298s autopkgtest [08:42:35]: testbed running kernel: Linux 6.8.0-31-generic #31-Ubuntu SMP Sat Apr 20 00:05:55 UTC 2024 523s autopkgtest [08:46:20]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-matrixstats 548s Get:1 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (dsc) [2230 B] 548s Get:2 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (tar) [211 kB] 548s Get:3 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (diff) [4752 B] 549s gpgv: Signature made Mon Jan 8 21:38:59 2024 UTC 549s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 549s gpgv: issuer "tille@debian.org" 549s gpgv: Can't check signature: No public key 549s dpkg-source: warning: cannot verify inline signature for ./r-cran-matrixstats_1.2.0-1.dsc: no acceptable signature found 549s autopkgtest [08:46:46]: testing package r-cran-matrixstats version 1.2.0-1 576s autopkgtest [08:47:13]: build not needed 717s autopkgtest [08:49:34]: test run-unit-test: preparing testbed 719s Reading package lists... 720s Building dependency tree... 720s Reading state information... 720s Starting pkgProblemResolver with broken count: 0 720s Starting 2 pkgProblemResolver with broken count: 0 720s Done 720s The following additional packages will be installed: 720s fontconfig fonts-glyphicons-halflings fonts-mathjax libblas3 libcairo2 720s libdatrie1 libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 720s libjs-bootstrap libjs-highlight.js libjs-jquery libjs-jquery-datatables 720s libjs-mathjax liblapack3 libpango-1.0-0 libpangocairo-1.0-0 720s libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 libsm6 libtcl8.6 720s libthai-data libthai0 libtk8.6 libxcb-render0 libxcb-shm0 libxft2 720s libxrender1 libxss1 libxt6t64 node-normalize.css r-base-core 720s r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 720s r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 720s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 720s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 720s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 720s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 720s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 720s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 720s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 720s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 720s Suggested packages: 720s fonts-mathjax-extras fonts-stix libjs-mathjax-doc tk8.6 libjs-html5shiv 720s elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html r-cran-kernsmooth 720s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 720s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 720s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 720s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 720s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-cairo 720s r-cran-codetools r-cran-bench r-cran-blob r-cran-brio r-cran-callr 720s r-cran-crayon r-cran-here r-cran-hms r-cran-htmltools r-cran-pkgbuild 720s r-cran-pkgload r-cran-purrr r-cran-tidyr tcl-tclreadline 720s Recommended packages: 720s javascript-common r-recommended r-base-dev r-doc-html r-cran-callr 720s r-cran-covr r-cran-crayon r-cran-htmltools r-cran-htmlwidgets r-cran-mockery 720s r-cran-processx r-cran-ps r-cran-rmarkdown r-cran-rprojroot 720s r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl r-cran-xml2 720s r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc r-cran-mapproj 720s r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg r-cran-ragg 720s r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 720s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 720s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 720s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 720s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 720s r-cran-lubridate libjs-remark-slide r-cran-fs r-cran-usethis r-cran-bit64 720s r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table r-cran-mockr 720s r-cran-formattable r-cran-generics r-cran-pkgdown r-cran-zeallot r-cran-mime 720s r-cran-remotes r-cran-renv r-cran-jsonlite r-cran-runit 720s libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl x11-utils 720s x11-xserver-utils 721s The following NEW packages will be installed: 721s autopkgtest-satdep fontconfig fonts-glyphicons-halflings fonts-mathjax 721s libblas3 libcairo2 libdatrie1 libgfortran5 libgomp1 libgraphite2-3 721s libharfbuzz0b libice6 libjs-bootstrap libjs-highlight.js libjs-jquery 721s libjs-jquery-datatables libjs-mathjax liblapack3 libpango-1.0-0 721s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 721s libsm6 libtcl8.6 libthai-data libthai0 libtk8.6 libxcb-render0 libxcb-shm0 721s libxft2 libxrender1 libxss1 libxt6t64 node-normalize.css r-base-core 721s r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 721s r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 721s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 721s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 721s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 721s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 721s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 721s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 721s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 721s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 721s 0 upgraded, 87 newly installed, 0 to remove and 0 not upgraded. 721s Need to get 84.0 MB/84.0 MB of archives. 721s After this operation, 193 MB of additional disk space will be used. 721s Get:1 /tmp/autopkgtest.qJ9Arj/1-autopkgtest-satdep.deb autopkgtest-satdep ppc64el 0 [760 B] 721s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el fontconfig ppc64el 2.15.0-1.1ubuntu2 [192 kB] 721s Get:3 http://ftpmaster.internal/ubuntu oracular/universe ppc64el fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 721s Get:4 http://ftpmaster.internal/ubuntu oracular/main ppc64el fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 722s Get:5 http://ftpmaster.internal/ubuntu oracular/main ppc64el libblas3 ppc64el 3.12.0-3build1 [227 kB] 722s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpixman-1-0 ppc64el 0.42.2-1build1 [336 kB] 723s Get:7 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb-render0 ppc64el 1.17.0-2 [17.2 kB] 723s Get:8 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb-shm0 ppc64el 1.17.0-2 [5980 B] 723s Get:9 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxrender1 ppc64el 1:0.9.10-1.1build1 [23.1 kB] 723s Get:10 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcairo2 ppc64el 1.18.0-3build1 [751 kB] 723s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdatrie1 ppc64el 0.2.13-3build1 [22.7 kB] 723s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgfortran5 ppc64el 14.1.0-1ubuntu1 [573 kB] 723s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgomp1 ppc64el 14.1.0-1ubuntu1 [161 kB] 723s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgraphite2-3 ppc64el 1.3.14-2build1 [84.6 kB] 723s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el libharfbuzz0b ppc64el 8.3.0-2build2 [580 kB] 723s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el x11-common all 1:7.7+23ubuntu3 [21.7 kB] 723s Get:17 http://ftpmaster.internal/ubuntu oracular/main ppc64el libice6 ppc64el 2:1.0.10-1build3 [49.1 kB] 723s Get:18 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 723s Get:19 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 723s Get:20 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 723s Get:21 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 723s Get:22 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblapack3 ppc64el 3.12.0-3build1 [2804 kB] 724s Get:23 http://ftpmaster.internal/ubuntu oracular/main ppc64el libthai-data all 0.1.29-2build1 [158 kB] 724s Get:24 http://ftpmaster.internal/ubuntu oracular/main ppc64el libthai0 ppc64el 0.1.29-2build1 [21.8 kB] 724s Get:25 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpango-1.0-0 ppc64el 1.52.2+ds-1 [273 kB] 724s Get:26 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpangoft2-1.0-0 ppc64el 1.52.2+ds-1 [49.8 kB] 724s Get:27 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpangocairo-1.0-0 ppc64el 1.52.2+ds-1 [30.5 kB] 724s Get:28 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpaper1 ppc64el 1.1.29build1 [13.7 kB] 724s Get:29 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpaper-utils ppc64el 1.1.29build1 [8742 B] 724s Get:30 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsm6 ppc64el 2:1.2.3-1build3 [17.6 kB] 724s Get:31 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtcl8.6 ppc64el 8.6.14+dfsg-1build1 [1204 kB] 724s Get:32 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxft2 ppc64el 2.3.6-1build1 [61.5 kB] 724s Get:33 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxss1 ppc64el 1:1.2.3-1build3 [7980 B] 724s Get:34 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtk8.6 ppc64el 8.6.14-1build1 [944 kB] 724s Get:35 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxt6t64 ppc64el 1:1.2.1-1.2build1 [202 kB] 724s Get:36 http://ftpmaster.internal/ubuntu oracular/universe ppc64el node-normalize.css all 8.0.1-5 [10.8 kB] 724s Get:37 http://ftpmaster.internal/ubuntu oracular/main ppc64el zip ppc64el 3.0-13build1 [198 kB] 724s Get:38 http://ftpmaster.internal/ubuntu oracular/main ppc64el unzip ppc64el 6.0-28ubuntu4 [192 kB] 724s Get:39 http://ftpmaster.internal/ubuntu oracular/main ppc64el xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 724s Get:40 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-base-core ppc64el 4.4.0-2 [28.9 MB] 726s Get:41 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-base64enc ppc64el 0.1-3-3 [28.1 kB] 726s Get:42 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-cli ppc64el 3.6.2-1 [1405 kB] 726s Get:43 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-colorspace ppc64el 2.1-0+dfsg-1 [1542 kB] 726s Get:44 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-commonmark ppc64el 1.9.1-1 [142 kB] 726s Get:45 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-digest ppc64el 0.6.35-1 [220 kB] 726s Get:46 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-evaluate all 0.23-1 [90.2 kB] 726s Get:47 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-fansi ppc64el 1.0.5-1 [627 kB] 726s Get:48 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-farver ppc64el 2.1.1-2 [1385 kB] 727s Get:49 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-glue ppc64el 1.7.0-1 [155 kB] 727s Get:50 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-rlang ppc64el 1.1.3-1 [1696 kB] 727s Get:51 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 727s Get:52 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 727s Get:53 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-isoband ppc64el 0.2.7-1 [1486 kB] 727s Get:54 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-mass ppc64el 7.3-60.0.1-1 [1126 kB] 727s Get:55 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-lattice ppc64el 0.22-6-1 [1340 kB] 727s Get:56 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-nlme ppc64el 3.1.164-1build1 [2278 kB] 727s Get:57 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-matrix ppc64el 1.6-5-1 [4057 kB] 727s Get:58 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-mgcv ppc64el 1.9-1-1 [3393 kB] 727s Get:59 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-labeling all 0.4.3-1 [62.1 kB] 727s Get:60 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-munsell all 0.5.0-2build1 [208 kB] 727s Get:61 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r6 all 2.5.1-1 [99.0 kB] 727s Get:62 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 727s Get:63 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-viridislite all 0.4.2-2 [1088 kB] 727s Get:64 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-scales all 1.3.0-1 [603 kB] 727s Get:65 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-magrittr ppc64el 2.0.3-1 [154 kB] 727s Get:66 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-utf8 ppc64el 1.2.4-1 [148 kB] 727s Get:67 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-vctrs ppc64el 0.6.5-1 [1399 kB] 727s Get:68 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 727s Get:69 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 727s Get:70 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-tibble ppc64el 3.2.1+dfsg-2 [415 kB] 727s Get:71 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-withr all 2.5.0-1 [225 kB] 727s Get:72 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 727s Get:73 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-xfun ppc64el 0.44+dfsg-1 [516 kB] 727s Get:74 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-highr all 0.10+dfsg-2 [38.5 kB] 727s Get:75 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-yaml ppc64el 2.3.8-2 [122 kB] 728s Get:76 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 728s Get:77 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-knitr all 1.46+dfsg-1 [911 kB] 728s Get:78 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-markdown all 1.12+dfsg-2 [179 kB] 728s Get:79 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-matrixstats ppc64el 1.2.0-1 [530 kB] 728s Get:80 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.methodss3 all 1.8.2-1 [84.0 kB] 728s Get:81 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.oo all 1.26.0-1 [955 kB] 728s Get:82 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.utils all 2.12.3-1 [1386 kB] 728s Get:83 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.cache all 0.16.0-1 [113 kB] 728s Get:84 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.devices all 2.17.2+ds-1 [398 kB] 728s Get:85 http://ftpmaster.internal/ubuntu oracular/main ppc64el tcl8.6 ppc64el 8.6.14+dfsg-1build1 [14.8 kB] 728s Get:86 http://ftpmaster.internal/ubuntu oracular/main ppc64el tcl ppc64el 8.6.14build1 [4128 B] 728s Get:87 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r.rsp all 0.46.0+ds-1 [1412 kB] 729s Preconfiguring packages ... 729s Fetched 84.0 MB in 7s (11.5 MB/s) 729s Selecting previously unselected package fontconfig. 729s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72606 files and directories currently installed.) 729s Preparing to unpack .../00-fontconfig_2.15.0-1.1ubuntu2_ppc64el.deb ... 729s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 730s Selecting previously unselected package fonts-glyphicons-halflings. 730s Preparing to unpack .../01-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 730s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 730s Selecting previously unselected package fonts-mathjax. 730s Preparing to unpack .../02-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 730s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 730s Selecting previously unselected package libblas3:ppc64el. 730s Preparing to unpack .../03-libblas3_3.12.0-3build1_ppc64el.deb ... 730s Unpacking libblas3:ppc64el (3.12.0-3build1) ... 730s Selecting previously unselected package libpixman-1-0:ppc64el. 730s Preparing to unpack .../04-libpixman-1-0_0.42.2-1build1_ppc64el.deb ... 730s Unpacking libpixman-1-0:ppc64el (0.42.2-1build1) ... 730s Selecting previously unselected package libxcb-render0:ppc64el. 730s Preparing to unpack .../05-libxcb-render0_1.17.0-2_ppc64el.deb ... 730s Unpacking libxcb-render0:ppc64el (1.17.0-2) ... 730s Selecting previously unselected package libxcb-shm0:ppc64el. 730s Preparing to unpack .../06-libxcb-shm0_1.17.0-2_ppc64el.deb ... 730s Unpacking libxcb-shm0:ppc64el (1.17.0-2) ... 730s Selecting previously unselected package libxrender1:ppc64el. 730s Preparing to unpack .../07-libxrender1_1%3a0.9.10-1.1build1_ppc64el.deb ... 730s Unpacking libxrender1:ppc64el (1:0.9.10-1.1build1) ... 730s Selecting previously unselected package libcairo2:ppc64el. 730s Preparing to unpack .../08-libcairo2_1.18.0-3build1_ppc64el.deb ... 730s Unpacking libcairo2:ppc64el (1.18.0-3build1) ... 730s Selecting previously unselected package libdatrie1:ppc64el. 730s Preparing to unpack .../09-libdatrie1_0.2.13-3build1_ppc64el.deb ... 730s Unpacking libdatrie1:ppc64el (0.2.13-3build1) ... 731s Selecting previously unselected package libgfortran5:ppc64el. 731s Preparing to unpack .../10-libgfortran5_14.1.0-1ubuntu1_ppc64el.deb ... 731s Unpacking libgfortran5:ppc64el (14.1.0-1ubuntu1) ... 731s Selecting previously unselected package libgomp1:ppc64el. 731s Preparing to unpack .../11-libgomp1_14.1.0-1ubuntu1_ppc64el.deb ... 731s Unpacking libgomp1:ppc64el (14.1.0-1ubuntu1) ... 731s Selecting previously unselected package libgraphite2-3:ppc64el. 731s Preparing to unpack .../12-libgraphite2-3_1.3.14-2build1_ppc64el.deb ... 731s Unpacking libgraphite2-3:ppc64el (1.3.14-2build1) ... 731s Selecting previously unselected package libharfbuzz0b:ppc64el. 731s Preparing to unpack .../13-libharfbuzz0b_8.3.0-2build2_ppc64el.deb ... 731s Unpacking libharfbuzz0b:ppc64el (8.3.0-2build2) ... 731s Selecting previously unselected package x11-common. 731s Preparing to unpack .../14-x11-common_1%3a7.7+23ubuntu3_all.deb ... 731s Unpacking x11-common (1:7.7+23ubuntu3) ... 731s Selecting previously unselected package libice6:ppc64el. 731s Preparing to unpack .../15-libice6_2%3a1.0.10-1build3_ppc64el.deb ... 731s Unpacking libice6:ppc64el (2:1.0.10-1build3) ... 731s Selecting previously unselected package libjs-bootstrap. 731s Preparing to unpack .../16-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 731s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 731s Selecting previously unselected package libjs-highlight.js. 731s Preparing to unpack .../17-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 731s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 731s Selecting previously unselected package libjs-jquery. 731s Preparing to unpack .../18-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 731s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 731s Selecting previously unselected package libjs-jquery-datatables. 731s Preparing to unpack .../19-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 731s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 731s Selecting previously unselected package liblapack3:ppc64el. 731s Preparing to unpack .../20-liblapack3_3.12.0-3build1_ppc64el.deb ... 731s Unpacking liblapack3:ppc64el (3.12.0-3build1) ... 731s Selecting previously unselected package libthai-data. 731s Preparing to unpack .../21-libthai-data_0.1.29-2build1_all.deb ... 731s Unpacking libthai-data (0.1.29-2build1) ... 731s Selecting previously unselected package libthai0:ppc64el. 731s Preparing to unpack .../22-libthai0_0.1.29-2build1_ppc64el.deb ... 731s Unpacking libthai0:ppc64el (0.1.29-2build1) ... 731s Selecting previously unselected package libpango-1.0-0:ppc64el. 731s Preparing to unpack .../23-libpango-1.0-0_1.52.2+ds-1_ppc64el.deb ... 731s Unpacking libpango-1.0-0:ppc64el (1.52.2+ds-1) ... 732s Selecting previously unselected package libpangoft2-1.0-0:ppc64el. 732s Preparing to unpack .../24-libpangoft2-1.0-0_1.52.2+ds-1_ppc64el.deb ... 732s Unpacking libpangoft2-1.0-0:ppc64el (1.52.2+ds-1) ... 732s Selecting previously unselected package libpangocairo-1.0-0:ppc64el. 732s Preparing to unpack .../25-libpangocairo-1.0-0_1.52.2+ds-1_ppc64el.deb ... 732s Unpacking libpangocairo-1.0-0:ppc64el (1.52.2+ds-1) ... 732s Selecting previously unselected package libpaper1:ppc64el. 732s Preparing to unpack .../26-libpaper1_1.1.29build1_ppc64el.deb ... 732s Unpacking libpaper1:ppc64el (1.1.29build1) ... 732s Selecting previously unselected package libpaper-utils. 732s Preparing to unpack .../27-libpaper-utils_1.1.29build1_ppc64el.deb ... 732s Unpacking libpaper-utils (1.1.29build1) ... 732s Selecting previously unselected package libsm6:ppc64el. 732s Preparing to unpack .../28-libsm6_2%3a1.2.3-1build3_ppc64el.deb ... 732s Unpacking libsm6:ppc64el (2:1.2.3-1build3) ... 732s Selecting previously unselected package libtcl8.6:ppc64el. 732s Preparing to unpack .../29-libtcl8.6_8.6.14+dfsg-1build1_ppc64el.deb ... 732s Unpacking libtcl8.6:ppc64el (8.6.14+dfsg-1build1) ... 732s Selecting previously unselected package libxft2:ppc64el. 732s Preparing to unpack .../30-libxft2_2.3.6-1build1_ppc64el.deb ... 732s Unpacking libxft2:ppc64el (2.3.6-1build1) ... 732s Selecting previously unselected package libxss1:ppc64el. 732s Preparing to unpack .../31-libxss1_1%3a1.2.3-1build3_ppc64el.deb ... 732s Unpacking libxss1:ppc64el (1:1.2.3-1build3) ... 732s Selecting previously unselected package libtk8.6:ppc64el. 732s Preparing to unpack .../32-libtk8.6_8.6.14-1build1_ppc64el.deb ... 732s Unpacking libtk8.6:ppc64el (8.6.14-1build1) ... 732s Selecting previously unselected package libxt6t64:ppc64el. 732s Preparing to unpack .../33-libxt6t64_1%3a1.2.1-1.2build1_ppc64el.deb ... 732s Unpacking libxt6t64:ppc64el (1:1.2.1-1.2build1) ... 732s Selecting previously unselected package node-normalize.css. 732s Preparing to unpack .../34-node-normalize.css_8.0.1-5_all.deb ... 732s Unpacking node-normalize.css (8.0.1-5) ... 732s Selecting previously unselected package zip. 732s Preparing to unpack .../35-zip_3.0-13build1_ppc64el.deb ... 732s Unpacking zip (3.0-13build1) ... 732s Selecting previously unselected package unzip. 732s Preparing to unpack .../36-unzip_6.0-28ubuntu4_ppc64el.deb ... 732s Unpacking unzip (6.0-28ubuntu4) ... 732s Selecting previously unselected package xdg-utils. 732s Preparing to unpack .../37-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 732s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 732s Selecting previously unselected package r-base-core. 732s Preparing to unpack .../38-r-base-core_4.4.0-2_ppc64el.deb ... 732s Unpacking r-base-core (4.4.0-2) ... 733s Selecting previously unselected package r-cran-base64enc. 733s Preparing to unpack .../39-r-cran-base64enc_0.1-3-3_ppc64el.deb ... 733s Unpacking r-cran-base64enc (0.1-3-3) ... 733s Selecting previously unselected package r-cran-cli. 733s Preparing to unpack .../40-r-cran-cli_3.6.2-1_ppc64el.deb ... 733s Unpacking r-cran-cli (3.6.2-1) ... 733s Selecting previously unselected package r-cran-colorspace. 733s Preparing to unpack .../41-r-cran-colorspace_2.1-0+dfsg-1_ppc64el.deb ... 733s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 734s Selecting previously unselected package r-cran-commonmark. 734s Preparing to unpack .../42-r-cran-commonmark_1.9.1-1_ppc64el.deb ... 734s Unpacking r-cran-commonmark (1.9.1-1) ... 734s Selecting previously unselected package r-cran-digest. 734s Preparing to unpack .../43-r-cran-digest_0.6.35-1_ppc64el.deb ... 734s Unpacking r-cran-digest (0.6.35-1) ... 734s Selecting previously unselected package r-cran-evaluate. 734s Preparing to unpack .../44-r-cran-evaluate_0.23-1_all.deb ... 734s Unpacking r-cran-evaluate (0.23-1) ... 734s Selecting previously unselected package r-cran-fansi. 734s Preparing to unpack .../45-r-cran-fansi_1.0.5-1_ppc64el.deb ... 734s Unpacking r-cran-fansi (1.0.5-1) ... 734s Selecting previously unselected package r-cran-farver. 734s Preparing to unpack .../46-r-cran-farver_2.1.1-2_ppc64el.deb ... 734s Unpacking r-cran-farver (2.1.1-2) ... 734s Selecting previously unselected package r-cran-glue. 734s Preparing to unpack .../47-r-cran-glue_1.7.0-1_ppc64el.deb ... 734s Unpacking r-cran-glue (1.7.0-1) ... 734s Selecting previously unselected package r-cran-rlang. 734s Preparing to unpack .../48-r-cran-rlang_1.1.3-1_ppc64el.deb ... 734s Unpacking r-cran-rlang (1.1.3-1) ... 734s Selecting previously unselected package r-cran-lifecycle. 734s Preparing to unpack .../49-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 734s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 734s Selecting previously unselected package r-cran-gtable. 734s Preparing to unpack .../50-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 734s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 734s Selecting previously unselected package r-cran-isoband. 734s Preparing to unpack .../51-r-cran-isoband_0.2.7-1_ppc64el.deb ... 734s Unpacking r-cran-isoband (0.2.7-1) ... 734s Selecting previously unselected package r-cran-mass. 734s Preparing to unpack .../52-r-cran-mass_7.3-60.0.1-1_ppc64el.deb ... 734s Unpacking r-cran-mass (7.3-60.0.1-1) ... 734s Selecting previously unselected package r-cran-lattice. 734s Preparing to unpack .../53-r-cran-lattice_0.22-6-1_ppc64el.deb ... 734s Unpacking r-cran-lattice (0.22-6-1) ... 734s Selecting previously unselected package r-cran-nlme. 734s Preparing to unpack .../54-r-cran-nlme_3.1.164-1build1_ppc64el.deb ... 734s Unpacking r-cran-nlme (3.1.164-1build1) ... 734s Selecting previously unselected package r-cran-matrix. 734s Preparing to unpack .../55-r-cran-matrix_1.6-5-1_ppc64el.deb ... 734s Unpacking r-cran-matrix (1.6-5-1) ... 734s Selecting previously unselected package r-cran-mgcv. 734s Preparing to unpack .../56-r-cran-mgcv_1.9-1-1_ppc64el.deb ... 734s Unpacking r-cran-mgcv (1.9-1-1) ... 734s Selecting previously unselected package r-cran-labeling. 734s Preparing to unpack .../57-r-cran-labeling_0.4.3-1_all.deb ... 734s Unpacking r-cran-labeling (0.4.3-1) ... 734s Selecting previously unselected package r-cran-munsell. 734s Preparing to unpack .../58-r-cran-munsell_0.5.0-2build1_all.deb ... 734s Unpacking r-cran-munsell (0.5.0-2build1) ... 734s Selecting previously unselected package r-cran-r6. 734s Preparing to unpack .../59-r-cran-r6_2.5.1-1_all.deb ... 734s Unpacking r-cran-r6 (2.5.1-1) ... 734s Selecting previously unselected package r-cran-rcolorbrewer. 734s Preparing to unpack .../60-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 734s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 735s Selecting previously unselected package r-cran-viridislite. 735s Preparing to unpack .../61-r-cran-viridislite_0.4.2-2_all.deb ... 735s Unpacking r-cran-viridislite (0.4.2-2) ... 735s Selecting previously unselected package r-cran-scales. 735s Preparing to unpack .../62-r-cran-scales_1.3.0-1_all.deb ... 735s Unpacking r-cran-scales (1.3.0-1) ... 735s Selecting previously unselected package r-cran-magrittr. 735s Preparing to unpack .../63-r-cran-magrittr_2.0.3-1_ppc64el.deb ... 735s Unpacking r-cran-magrittr (2.0.3-1) ... 735s Selecting previously unselected package r-cran-utf8. 735s Preparing to unpack .../64-r-cran-utf8_1.2.4-1_ppc64el.deb ... 735s Unpacking r-cran-utf8 (1.2.4-1) ... 735s Selecting previously unselected package r-cran-vctrs. 735s Preparing to unpack .../65-r-cran-vctrs_0.6.5-1_ppc64el.deb ... 735s Unpacking r-cran-vctrs (0.6.5-1) ... 735s Selecting previously unselected package r-cran-pillar. 735s Preparing to unpack .../66-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 735s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 735s Selecting previously unselected package r-cran-pkgconfig. 735s Preparing to unpack .../67-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 735s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 735s Selecting previously unselected package r-cran-tibble. 735s Preparing to unpack .../68-r-cran-tibble_3.2.1+dfsg-2_ppc64el.deb ... 735s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 735s Selecting previously unselected package r-cran-withr. 735s Preparing to unpack .../69-r-cran-withr_2.5.0-1_all.deb ... 735s Unpacking r-cran-withr (2.5.0-1) ... 735s Selecting previously unselected package r-cran-ggplot2. 735s Preparing to unpack .../70-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 735s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 735s Selecting previously unselected package r-cran-xfun. 735s Preparing to unpack .../71-r-cran-xfun_0.44+dfsg-1_ppc64el.deb ... 735s Unpacking r-cran-xfun (0.44+dfsg-1) ... 735s Selecting previously unselected package r-cran-highr. 735s Preparing to unpack .../72-r-cran-highr_0.10+dfsg-2_all.deb ... 735s Unpacking r-cran-highr (0.10+dfsg-2) ... 736s Selecting previously unselected package r-cran-yaml. 736s Preparing to unpack .../73-r-cran-yaml_2.3.8-2_ppc64el.deb ... 736s Unpacking r-cran-yaml (2.3.8-2) ... 736s Selecting previously unselected package libjs-mathjax. 736s Preparing to unpack .../74-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 736s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 737s Selecting previously unselected package r-cran-knitr. 737s Preparing to unpack .../75-r-cran-knitr_1.46+dfsg-1_all.deb ... 737s Unpacking r-cran-knitr (1.46+dfsg-1) ... 737s Selecting previously unselected package r-cran-markdown. 737s Preparing to unpack .../76-r-cran-markdown_1.12+dfsg-2_all.deb ... 737s Unpacking r-cran-markdown (1.12+dfsg-2) ... 737s Selecting previously unselected package r-cran-matrixstats. 737s Preparing to unpack .../77-r-cran-matrixstats_1.2.0-1_ppc64el.deb ... 737s Unpacking r-cran-matrixstats (1.2.0-1) ... 737s Selecting previously unselected package r-cran-r.methodss3. 737s Preparing to unpack .../78-r-cran-r.methodss3_1.8.2-1_all.deb ... 737s Unpacking r-cran-r.methodss3 (1.8.2-1) ... 737s Selecting previously unselected package r-cran-r.oo. 737s Preparing to unpack .../79-r-cran-r.oo_1.26.0-1_all.deb ... 737s Unpacking r-cran-r.oo (1.26.0-1) ... 737s Selecting previously unselected package r-cran-r.utils. 737s Preparing to unpack .../80-r-cran-r.utils_2.12.3-1_all.deb ... 737s Unpacking r-cran-r.utils (2.12.3-1) ... 738s Selecting previously unselected package r-cran-r.cache. 738s Preparing to unpack .../81-r-cran-r.cache_0.16.0-1_all.deb ... 738s Unpacking r-cran-r.cache (0.16.0-1) ... 738s Selecting previously unselected package r-cran-r.devices. 738s Preparing to unpack .../82-r-cran-r.devices_2.17.2+ds-1_all.deb ... 738s Unpacking r-cran-r.devices (2.17.2+ds-1) ... 738s Selecting previously unselected package tcl8.6. 738s Preparing to unpack .../83-tcl8.6_8.6.14+dfsg-1build1_ppc64el.deb ... 738s Unpacking tcl8.6 (8.6.14+dfsg-1build1) ... 738s Selecting previously unselected package tcl. 738s Preparing to unpack .../84-tcl_8.6.14build1_ppc64el.deb ... 738s Unpacking tcl (8.6.14build1) ... 738s Selecting previously unselected package r-cran-r.rsp. 738s Preparing to unpack .../85-r-cran-r.rsp_0.46.0+ds-1_all.deb ... 738s Unpacking r-cran-r.rsp (0.46.0+ds-1) ... 738s Selecting previously unselected package autopkgtest-satdep. 738s Preparing to unpack .../86-1-autopkgtest-satdep.deb ... 738s Unpacking autopkgtest-satdep (0) ... 738s Setting up libgraphite2-3:ppc64el (1.3.14-2build1) ... 738s Setting up libpixman-1-0:ppc64el (0.42.2-1build1) ... 738s Setting up libpaper1:ppc64el (1.1.29build1) ... 739s 739s Creating config file /etc/papersize with new version 739s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 741s Regenerating fonts cache... done. 741s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 741s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 741s Setting up libxrender1:ppc64el (1:0.9.10-1.1build1) ... 741s Setting up libdatrie1:ppc64el (0.2.13-3build1) ... 741s Setting up libxcb-render0:ppc64el (1.17.0-2) ... 741s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 741s Setting up unzip (6.0-28ubuntu4) ... 741s Setting up x11-common (1:7.7+23ubuntu3) ... 742s Setting up libxcb-shm0:ppc64el (1.17.0-2) ... 742s Setting up libpaper-utils (1.1.29build1) ... 743s Setting up libgomp1:ppc64el (14.1.0-1ubuntu1) ... 743s Setting up libcairo2:ppc64el (1.18.0-3build1) ... 743s Setting up zip (3.0-13build1) ... 743s Setting up libblas3:ppc64el (3.12.0-3build1) ... 743s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/blas/libblas.so.3 to provide /usr/lib/powerpc64le-linux-gnu/libblas.so.3 (libblas.so.3-powerpc64le-linux-gnu) in auto mode 743s Setting up libtcl8.6:ppc64el (8.6.14+dfsg-1build1) ... 743s Setting up libgfortran5:ppc64el (14.1.0-1ubuntu1) ... 743s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 743s Setting up libharfbuzz0b:ppc64el (8.3.0-2build2) ... 743s Setting up libthai-data (0.1.29-2build1) ... 743s Setting up libxss1:ppc64el (1:1.2.3-1build3) ... 743s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 743s Setting up node-normalize.css (8.0.1-5) ... 743s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 743s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 743s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 743s Setting up libice6:ppc64el (2:1.0.10-1build3) ... 743s Setting up tcl8.6 (8.6.14+dfsg-1build1) ... 743s Setting up liblapack3:ppc64el (3.12.0-3build1) ... 743s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/powerpc64le-linux-gnu/liblapack.so.3 (liblapack.so.3-powerpc64le-linux-gnu) in auto mode 743s Setting up libxft2:ppc64el (2.3.6-1build1) ... 743s Setting up libtk8.6:ppc64el (8.6.14-1build1) ... 743s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 743s Setting up libthai0:ppc64el (0.1.29-2build1) ... 743s Setting up tcl (8.6.14build1) ... 743s Setting up libsm6:ppc64el (2:1.2.3-1build3) ... 743s Setting up libpango-1.0-0:ppc64el (1.52.2+ds-1) ... 743s Setting up libxt6t64:ppc64el (1:1.2.1-1.2build1) ... 743s Setting up libpangoft2-1.0-0:ppc64el (1.52.2+ds-1) ... 743s Setting up libpangocairo-1.0-0:ppc64el (1.52.2+ds-1) ... 743s Setting up r-base-core (4.4.0-2) ... 743s 743s Creating config file /etc/R/Renviron with new version 743s Setting up r-cran-labeling (0.4.3-1) ... 743s Setting up r-cran-lattice (0.22-6-1) ... 743s Setting up r-cran-nlme (3.1.164-1build1) ... 743s Setting up r-cran-farver (2.1.1-2) ... 743s Setting up r-cran-viridislite (0.4.2-2) ... 743s Setting up r-cran-commonmark (1.9.1-1) ... 743s Setting up r-cran-r6 (2.5.1-1) ... 743s Setting up r-cran-magrittr (2.0.3-1) ... 743s Setting up r-cran-rlang (1.1.3-1) ... 743s Setting up r-cran-matrixstats (1.2.0-1) ... 743s Setting up r-cran-xfun (0.44+dfsg-1) ... 743s Setting up r-cran-withr (2.5.0-1) ... 743s Setting up r-cran-base64enc (0.1-3-3) ... 743s Setting up r-cran-digest (0.6.35-1) ... 743s Setting up r-cran-yaml (2.3.8-2) ... 743s Setting up r-cran-evaluate (0.23-1) ... 743s Setting up r-cran-highr (0.10+dfsg-2) ... 743s Setting up r-cran-fansi (1.0.5-1) ... 743s Setting up r-cran-mass (7.3-60.0.1-1) ... 743s Setting up r-cran-glue (1.7.0-1) ... 743s Setting up r-cran-cli (3.6.2-1) ... 743s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 743s Setting up r-cran-r.methodss3 (1.8.2-1) ... 743s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 743s Setting up r-cran-utf8 (1.2.4-1) ... 743s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 743s Setting up r-cran-markdown (1.12+dfsg-2) ... 743s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 743s Setting up r-cran-isoband (0.2.7-1) ... 743s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 743s Setting up r-cran-matrix (1.6-5-1) ... 743s Setting up r-cran-knitr (1.46+dfsg-1) ... 743s Setting up r-cran-mgcv (1.9-1-1) ... 743s Setting up r-cran-vctrs (0.6.5-1) ... 743s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 743s Setting up r-cran-munsell (0.5.0-2build1) ... 743s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 743s Setting up r-cran-r.oo (1.26.0-1) ... 743s Setting up r-cran-scales (1.3.0-1) ... 743s Setting up r-cran-r.utils (2.12.3-1) ... 743s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 743s Setting up r-cran-r.devices (2.17.2+ds-1) ... 743s Setting up r-cran-r.cache (0.16.0-1) ... 743s Setting up r-cran-r.rsp (0.46.0+ds-1) ... 743s Setting up autopkgtest-satdep (0) ... 743s Processing triggers for man-db (2.12.1-1) ... 746s Processing triggers for install-info (7.1-3build2) ... 747s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 754s (Reading database ... 83658 files and directories currently installed.) 754s Removing autopkgtest-satdep (0) ... 755s autopkgtest [08:50:12]: test run-unit-test: [----------------------- 755s 755s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 755s Copyright (C) 2024 The R Foundation for Statistical Computing 755s Platform: powerpc64le-unknown-linux-gnu 755s 755s R is free software and comes with ABSOLUTELY NO WARRANTY. 755s You are welcome to redistribute it under certain conditions. 755s Type 'license()' or 'licence()' for distribution details. 755s 755s R is a collaborative project with many contributors. 755s Type 'contributors()' for more information and 755s 'citation()' on how to cite R or R packages in publications. 755s 755s Type 'demo()' for some demos, 'help()' for on-line help, or 755s 'help.start()' for an HTML browser interface to help. 755s Type 'q()' to quit R. 755s 756s > library("matrixStats") 756s > 756s > allocArray_R <- function(nrow, ncol, value = NA) { 756s + array(data = value, dim = dim) 756s + } 756s > 756s > values <- list( 756s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 756s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 756s + .Machine$double.xmin, .Machine$double.xmax, 756s + .Machine$double.eps, .Machine$double.neg.eps, 756s + FALSE, TRUE, NA 756s + ) 756s > 756s > dim <- c(2L, 4L, 3L) 756s > for (value in values) { 756s + x0 <- allocArray_R(dim, value = value) 756s + x <- allocArray(dim, value = value) 756s + if (!identical(x, x0)) { 756s + str(list(dim = dim, value = value, x = x, x0 = x0)) 756s + stopifnot(identical(x, x0)) 756s + } 756s + } 756s > 756s 756s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 756s Copyright (C) 2024 The R Foundation for Statistical Computing 756s Platform: powerpc64le-unknown-linux-gnu 756s 756s R is free software and comes with ABSOLUTELY NO WARRANTY. 756s You are welcome to redistribute it under certain conditions. 756s Type 'license()' or 'licence()' for distribution details. 756s 756s R is a collaborative project with many contributors. 756s Type 'contributors()' for more information and 756s 'citation()' on how to cite R or R packages in publications. 756s 756s Type 'demo()' for some demos, 'help()' for on-line help, or 756s 'help.start()' for an HTML browser interface to help. 756s Type 'q()' to quit R. 756s 756s > library("matrixStats") 756s > 756s > allocMatrix_R <- function(nrow, ncol, value = NA) { 756s + matrix(data = value, nrow = nrow, ncol = ncol) 756s + } 756s > 756s > values <- list( 756s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 756s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 756s + .Machine$double.xmin, .Machine$double.xmax, 756s + .Machine$double.eps, .Machine$double.neg.eps, 756s + FALSE, TRUE, NA 756s + ) 756s > 756s > nrow <- 2L 756s > ncol <- 3L 756s > for (value in values) { 756s + x0 <- allocMatrix_R(nrow, ncol, value = value) 756s + x <- allocMatrix(nrow, ncol, value = value) 756s + if (!identical(x, x0)) { 756s + str(list(nrow = nrow, ncol = ncol, value = value, x = x, x0 = x0)) 756s + stopifnot(identical(x, x0)) 756s + } 756s + } 756s > 756s 756s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 756s Copyright (C) 2024 The R Foundation for Statistical Computing 756s Platform: powerpc64le-unknown-linux-gnu 756s 756s R is free software and comes with ABSOLUTELY NO WARRANTY. 756s You are welcome to redistribute it under certain conditions. 756s Type 'license()' or 'licence()' for distribution details. 756s 756s R is a collaborative project with many contributors. 756s Type 'contributors()' for more information and 756s 'citation()' on how to cite R or R packages in publications. 756s 756s Type 'demo()' for some demos, 'help()' for on-line help, or 756s 'help.start()' for an HTML browser interface to help. 756s Type 'q()' to quit R. 756s 756s > library("matrixStats") 756s > 756s > allocVector_R <- function(length, value = NA) { 756s + x <- vector(mode = typeof(value), length = length) 756s + if (!is.finite(value) || value != 0) x[] <- value 756s + x 756s + } 756s > 756s > values <- list( 756s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 756s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 756s + .Machine$double.xmin, .Machine$double.xmax, 756s + .Machine$double.eps, .Machine$double.neg.eps, 756s + FALSE, TRUE, NA 756s + ) 756s > 756s > n <- 10L 756s > for (value in values) { 756s + x0 <- allocVector_R(n, value = value) 756s + x <- allocVector(n, value = value) 756s + if (!identical(x, x0)) { 756s + str(list(n = n, value = value, x = x, x0 = x0)) 756s + stopifnot(identical(x, x0)) 756s + } 756s + } 757s > 757s 757s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 757s Copyright (C) 2024 The R Foundation for Statistical Computing 757s Platform: powerpc64le-unknown-linux-gnu 757s 757s R is free software and comes with ABSOLUTELY NO WARRANTY. 757s You are welcome to redistribute it under certain conditions. 757s Type 'license()' or 'licence()' for distribution details. 757s 757s R is a collaborative project with many contributors. 757s Type 'contributors()' for more information and 757s 'citation()' on how to cite R or R packages in publications. 757s 757s Type 'demo()' for some demos, 'help()' for on-line help, or 757s 'help.start()' for an HTML browser interface to help. 757s Type 'q()' to quit R. 757s 757s > library("matrixStats") 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Setup 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > data <- data.frame( 757s + logical = c(TRUE, FALSE, TRUE), 757s + integer = 1:3, 757s + double = seq(from = 1.0, to = 3.0, by = 1.0), 757s + complex = seq(from = 1.0, to = 3.0, by = 1.0) + 1.0i, 757s + character = letters[1:3], 757s + stringsAsFactors = FALSE 757s + ) 757s > 757s > modes <- names(data) 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Special cases 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > cat("NULL...\n") 757s NULL... 757s > stopifnot(identical(anyMissing(NULL), FALSE)) 757s > cat("NULL...done\n") 757s NULL...done 757s > 757s > cat("raw...\n") 757s raw... 757s > stopifnot(identical(anyMissing(as.raw(0:2)), FALSE)) 757s > cat("raw...done\n") 757s raw...done 757s > 757s > cat("list(NULL)...\n") 757s list(NULL)... 757s > stopifnot(identical(anyMissing(list(NULL)), FALSE)) 757s > cat("list(NULL)...done\n") 757s list(NULL)...done 757s > 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Scalars, vectors, and matrices of various modes 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > for (mode in modes) { 757s + cat(sprintf("Mode: %s...\n", mode)) 757s + values <- data[[mode]] 757s + 757s + # Scalars 757s + cat(" scalar\n") 757s + x <- values[1L] 757s + print(x) 757s + stopifnot(identical(anyMissing(x), FALSE)) 757s + is.na(x) <- TRUE 757s + print(x) 757s + stopifnot(identical(anyMissing(x), TRUE)) 757s + 757s + # Vectors 757s + cat(" vector\n") 757s + x <- values 757s + print(x) 757s + stopifnot(identical(anyMissing(x), FALSE)) 757s + is.na(x)[2L] <- TRUE 757s + print(x) 757s + stopifnot(identical(anyMissing(x), TRUE)) 757s + 757s + # Matrices 757s + cat(" matrix\n") 757s + x <- matrix(c(values, values), ncol = 2L) 757s + print(x) 757s + stopifnot(identical(anyMissing(x), FALSE)) 757s + is.na(x)[2L] <- TRUE 757s + print(x) 757s + stopifnot(identical(anyMissing(x), TRUE)) 757s + 757s + cat(sprintf("Mode: %s...done\n", mode)) 757s + } # for (mode ...) 757s Mode: logical... 757s scalar 757s [1] TRUE 757s [1] NA 757s vector 757s [1] TRUE FALSE TRUE 757s [1] TRUE NA TRUE 757s matrix 757s [,1] [,2] 757s [1,] TRUE TRUE 757s [2,] FALSE FALSE 757s [3,] TRUE TRUE 757s [,1] [,2] 757s [1,] TRUE TRUE 757s [2,] NA FALSE 757s [3,] TRUE TRUE 757s Mode: logical...done 757s Mode: integer... 757s scalar 757s [1] 1 757s [1] NA 757s vector 757s [1] 1 2 3 757s [1] 1 NA 3 757s matrix 757s [,1] [,2] 757s [1,] 1 1 757s [2,] 2 2 757s [3,] 3 3 757s [,1] [,2] 757s [1,] 1 1 757s [2,] NA 2 757s [3,] 3 3 757s Mode: integer...done 757s Mode: double... 757s scalar 757s [1] 1 757s [1] NA 757s vector 757s [1] 1 2 3 757s [1] 1 NA 3 757s matrix 757s [,1] [,2] 757s [1,] 1 1 757s [2,] 2 2 757s [3,] 3 3 757s [,1] [,2] 757s [1,] 1 1 757s [2,] NA 2 757s [3,] 3 3 757s Mode: double...done 757s Mode: complex... 757s scalar 757s [1] 1+1i 757s [1] NA 757s vector 757s [1] 1+1i 2+1i 3+1i 757s [1] 1+1i NA 3+1i 757s matrix 757s [,1] [,2] 757s [1,] 1+1i 1+1i 757s [2,] 2+1i 2+1i 757s [3,] 3+1i 3+1i 757s [,1] [,2] 757s [1,] 1+1i 1+1i 757s [2,] NA 2+1i 757s [3,] 3+1i 3+1i 757s Mode: complex...done 757s Mode: character... 757s scalar 757s [1] "a" 757s [1] NA 757s vector 757s [1] "a" "b" "c" 757s [1] "a" NA "c" 757s matrix 757s [,1] [,2] 757s [1,] "a" "a" 757s [2,] "b" "b" 757s [3,] "c" "c" 757s [,1] [,2] 757s [1,] "a" "a" 757s [2,] NA "b" 757s [3,] "c" "c" 757s Mode: character...done 757s > 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Data frames 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > cat("data.frame...\n") 757s data.frame... 757s > x <- data 757s > stopifnot(identical(anyMissing(x), FALSE)) 757s > for (mode in modes) { 757s + x <- data 757s + is.na(x[[mode]])[2L] <- TRUE 757s + print(x) 757s + stopifnot(identical(anyMissing(x), TRUE)) 757s + } # for (mode ...) 757s logical integer double complex character 757s 1 TRUE 1 1 1+1i a 757s 2 NA 2 2 2+1i b 757s 3 TRUE 3 3 3+1i c 757s logical integer double complex character 757s 1 TRUE 1 1 1+1i a 757s 2 FALSE NA 2 2+1i b 757s 3 TRUE 3 3 3+1i c 757s logical integer double complex character 757s 1 TRUE 1 1 1+1i a 757s 2 FALSE 2 NA 2+1i b 757s 3 TRUE 3 3 3+1i c 757s logical integer double complex character 757s 1 TRUE 1 1 1+1i a 757s 2 FALSE 2 2 NA b 757s 3 TRUE 3 3 3+1i c 757s logical integer double complex character 757s 1 TRUE 1 1 1+1i a 757s 2 FALSE 2 2 2+1i 757s 3 TRUE 3 3 3+1i c 757s > cat("data.frame...done\n") 757s data.frame...done 757s > 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Lists 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > cat("list...\n") 757s list... 757s > x <- as.list(data) 757s > stopifnot(identical(anyMissing(x), FALSE)) 757s > for (mode in modes) { 757s + x <- as.list(data) 757s + is.na(x[[mode]])[2L] <- TRUE 757s + print(x) 757s + stopifnot(identical(anyMissing(x), TRUE)) 757s + } # for (mode ...) 757s $logical 757s [1] TRUE NA TRUE 757s 757s $integer 757s [1] 1 2 3 757s 757s $double 757s [1] 1 2 3 757s 757s $complex 757s [1] 1+1i 2+1i 3+1i 757s 757s $character 757s [1] "a" "b" "c" 757s 757s $logical 757s [1] TRUE FALSE TRUE 757s 757s $integer 757s [1] 1 NA 3 757s 757s $double 757s [1] 1 2 3 757s 757s $complex 757s [1] 1+1i 2+1i 3+1i 757s 757s $character 757s [1] "a" "b" "c" 757s 757s $logical 757s [1] TRUE FALSE TRUE 757s 757s $integer 757s [1] 1 2 3 757s 757s $double 757s [1] 1 NA 3 757s 757s $complex 757s [1] 1+1i 2+1i 3+1i 757s 757s $character 757s [1] "a" "b" "c" 757s 757s $logical 757s [1] TRUE FALSE TRUE 757s 757s $integer 757s [1] 1 2 3 757s 757s $double 757s [1] 1 2 3 757s 757s $complex 757s [1] 1+1i NA 3+1i 757s 757s $character 757s [1] "a" "b" "c" 757s 757s $logical 757s [1] TRUE FALSE TRUE 757s 757s $integer 757s [1] 1 2 3 757s 757s $double 757s [1] 1 2 3 757s 757s $complex 757s [1] 1+1i 2+1i 3+1i 757s 757s $character 757s [1] "a" NA "c" 757s 757s > cat("list...done\n") 757s list...done 757s > 757s 757s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 757s Copyright (C) 2024 The R Foundation for Statistical Computing 757s Platform: powerpc64le-unknown-linux-gnu 757s 757s R is free software and comes with ABSOLUTELY NO WARRANTY. 757s You are welcome to redistribute it under certain conditions. 757s Type 'license()' or 'licence()' for distribution details. 757s 757s R is a collaborative project with many contributors. 757s Type 'contributors()' for more information and 757s 'citation()' on how to cite R or R packages in publications. 757s 757s Type 'demo()' for some demos, 'help()' for on-line help, or 757s 'help.start()' for an HTML browser interface to help. 757s Type 'q()' to quit R. 757s 757s > library("matrixStats") 757s > 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > # Subsetted tests 757s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 757s > source("utils/validateIndicesFramework.R") 757s > x <- runif(4, min = -3, max = 3) 757s > x[2] <- NA 757s > for (mode in c("integer", "numeric")) { 757s + storage.mode(x) <- mode 757s + for (idxs in index_cases) { 757s + validateIndicesTestVector(x, idxs, 757s + ftest = anyMissing, fsure = function(x, ...) { 757s + anyValue(x, value = NA) 757s + }) 757s + } 757s + } 757s > 758s 758s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 758s Copyright (C) 2024 The R Foundation for Statistical Computing 758s Platform: powerpc64le-unknown-linux-gnu 758s 758s R is free software and comes with ABSOLUTELY NO WARRANTY. 758s You are welcome to redistribute it under certain conditions. 758s Type 'license()' or 'licence()' for distribution details. 758s 758s R is a collaborative project with many contributors. 758s Type 'contributors()' for more information and 758s 'citation()' on how to cite R or R packages in publications. 758s 758s Type 'demo()' for some demos, 'help()' for on-line help, or 758s 'help.start()' for an HTML browser interface to help. 758s Type 'q()' to quit R. 758s 758s > ## 1. Don't test with valgrind 758s > ## 2. Test only R (>= 3.0.2) because of that's what knitr requires 758s > if (getRversion() >= "3.0.2" && Sys.getenv("_R_CHECK_USE_VALGRIND_") == "") { 758s + 758s + ## 3. Make sure all suggested packages are installed / can be loaded 758s + pkgs <- c("base64enc", "ggplot2", "knitr", "markdown", "microbenchmark", 758s + "R.devices", "R.rsp") 758s + if (all(unlist(lapply(pkgs, FUN = requireNamespace)))) { 758s + html <- matrixStats:::benchmark("binCounts") 758s + print(html) 758s + } 758s + 758s + rm(list = "pkgs") 758s + 758s + } 758s Loading required namespace: base64enc 758s Loading required namespace: ggplot2 759s Loading required namespace: knitr 759s Loading required namespace: markdown 759s Loading required namespace: microbenchmark 759s Failed with error: ‘there is no package called ‘microbenchmark’’ 759s Loading required namespace: R.devices 759s Loading required namespace: R.rsp 759s > 759s 759s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 759s Copyright (C) 2024 The R Foundation for Statistical Computing 759s Platform: powerpc64le-unknown-linux-gnu 759s 759s R is free software and comes with ABSOLUTELY NO WARRANTY. 759s You are welcome to redistribute it under certain conditions. 759s Type 'license()' or 'licence()' for distribution details. 759s 759s R is a collaborative project with many contributors. 759s Type 'contributors()' for more information and 759s 'citation()' on how to cite R or R packages in publications. 759s 759s Type 'demo()' for some demos, 'help()' for on-line help, or 759s 'help.start()' for an HTML browser interface to help. 759s Type 'q()' to quit R. 759s 759s > library("matrixStats") 759s > library("stats") 759s > 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Local functions 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 759s + n0 <- graphics::hist(x, breaks = bx, right = right, 759s + include.lowest = TRUE, plot = FALSE)$counts 759s + } 759s > 759s > 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Non-sorted and sorted positions 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > nx <- 1000L # Number of data points 759s > nb <- 200L # Number of bins 759s > 759s > # Uniformely distributed bins 759s > bx <- seq(from = 0, to = 1, length.out = nb + 1L) 759s > bx <- c(-1, bx, 2) 759s > 759s > # Sample data points 759s > set.seed(0xBEEF) 759s > x <- runif(nx, min = 0, max = 1) 759s > 759s > for (kk in 1:2) { 759s + n0 <- binCounts_hist(x, bx = bx) 759s + n1 <- binCounts(x, bx = bx) 759s + # Sanity check 759s + stopifnot(identical(n1, n0)) 759s + 759s + # Check reversed 759s + n1r <- rev(binCounts(-x, bx = rev(-bx), right = TRUE)) 759s + stopifnot(identical(n1r, n1)) 759s + 759s + # Retry with a sorted vector 759s + x <- sort(x) 759s + } # for (kk in 1:2) 759s > 759s > 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Missing values 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > x <- 1:40 759s > x[20] <- NA_integer_ 759s > nx <- length(x) 759s > 759s > # Bins 759s > bx <- c(0.5, 50.5, 100.5, 150.5, 200.5) 759s > 759s > y_smooth0 <- binCounts_hist(x, bx = bx) 759s > y_smooth <- binCounts(x, bx = bx) 759s > # Sanity check 759s > stopifnot(all.equal(y_smooth, y_smooth0)) 759s > 759s > 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Border cases 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > x <- 1:10 759s > bx <- min(x) - c(10, 1) 759s > y_smooth <- binCounts(x, bx = bx) 759s > stopifnot(all.equal(y_smooth, 0L)) 759s > bx <- range(x) 759s > y_smooth <- binCounts(x, bx = bx) 759s > stopifnot(all.equal(y_smooth, length(x) - 1L)) 759s > bx <- max(x) + c(1, 10) 759s > y_smooth <- binCounts(x, bx = bx) 759s > stopifnot(all.equal(y_smooth, 0L)) 759s > 759s > # Every second empty 759s > x <- 1:10 759s > bx <- rep(x, each = 2L) 759s > y_smooth <- binCounts(x, bx = bx) 759s > stopifnot(all.equal(y_smooth, rep(c(0L, 1L), length.out = length(bx) - 1L))) 759s > ## NOTE: binCounts_hist() does not give the same last bin count 759s > 759s > 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Exception handling 759s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 759s > # Zero bin bounderies (invalid bin definition) 759s > bx <- double(0L) 759s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 759s > stopifnot(inherits(res, "try-error")) 759s > 759s > # One bin boundery (invalid bin definition) 759s > bx <- double(1L) 759s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 759s > stopifnot(inherits(res, "try-error")) 759s > 759s 759s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 759s Copyright (C) 2024 The R Foundation for Statistical Computing 759s Platform: powerpc64le-unknown-linux-gnu 759s 759s R is free software and comes with ABSOLUTELY NO WARRANTY. 759s You are welcome to redistribute it under certain conditions. 759s Type 'license()' or 'licence()' for distribution details. 759s 759s R is a collaborative project with many contributors. 759s Type 'contributors()' for more information and 759s 'citation()' on how to cite R or R packages in publications. 759s 759s Type 'demo()' for some demos, 'help()' for on-line help, or 759s 'help.start()' for an HTML browser interface to help. 759s Type 'q()' to quit R. 759s 760s > library("matrixStats") 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Local functions 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 760s + n0 <- graphics::hist(x, breaks = bx, right = right, 760s + include.lowest = TRUE, plot = FALSE)$counts 760s + } 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Subsetted tests 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > source("utils/validateIndicesFramework.R") 760s > x <- runif(6, min = -6, max = 6) 760s > storage.mode(x) <- "integer" 760s > bx <- c(-6, 0, 3, 4, 10) 760s > for (idxs in index_cases) { 760s + validateIndicesTestVector(x, idxs, 760s + ftest = binCounts, fsure = binCounts_hist, 760s + bx = bx, right = FALSE) 760s + validateIndicesTestVector(x, idxs, 760s + ftest = binCounts, fsure = binCounts_hist, 760s + bx = bx, right = TRUE) 760s + } 760s > 760s 760s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 760s Copyright (C) 2024 The R Foundation for Statistical Computing 760s Platform: powerpc64le-unknown-linux-gnu 760s 760s R is free software and comes with ABSOLUTELY NO WARRANTY. 760s You are welcome to redistribute it under certain conditions. 760s Type 'license()' or 'licence()' for distribution details. 760s 760s R is a collaborative project with many contributors. 760s Type 'contributors()' for more information and 760s 'citation()' on how to cite R or R packages in publications. 760s 760s Type 'demo()' for some demos, 'help()' for on-line help, or 760s 'help.start()' for an HTML browser interface to help. 760s Type 'q()' to quit R. 760s 760s > library("matrixStats") 760s > library("stats") 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Naive R implementation of binMeans() 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 760s + n_smooth <- length(bx) - 1L 760s + res <- double(n_smooth) 760s + counts <- rep(NaN, times = n_smooth) 760s + 760s + if (na.rm) { 760s + keep <- !is.na(x) & !is.na(y) 760s + x <- x[keep] 760s + y <- y[keep] 760s + } 760s + 760s + # For each bin... 760s + for (kk in seq_len(n_smooth)) { 760s + if (right) { 760s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 760s + } else { 760s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 760s + } 760s + y_kk <- y[idxs] 760s + res[kk] <- mean(y_kk) 760s + counts[kk] <- length(idxs) 760s + } # for (kk ...) 760s + 760s + if (count) attr(res, "count") <- counts 760s + res 760s + } 760s > 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Case #1 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > x <- 1:100 760s > nx <- length(x) 760s > y <- double(nx) 760s > y[1:25] <- 5 760s > y[51:75] <- -5 760s > y <- y + rnorm(nx) 760s > 760s > # Bins 760s > bx <- c(0.5, 25.5, 50.5, 75.5, 100.5) 760s > 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 760s > y_smooth <- binMeans(y, x = x, bx = bx) 760s > n_smooth <- binCounts(x, bx = bx) 760s > # Sanity check 760s > stopifnot(all.equal(y_smooth, y_smooth0)) 760s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 760s > 760s > y_smooth0r <- rev(binMeans0(y, x = -x, bx = rev(-bx), 760s + count = FALSE, right = TRUE)) 760s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx), 760s + count = FALSE, right = TRUE)) 760s > # Sanity check 760s > stopifnot(all.equal(y_smooth0r, y_smooth0, check.attributes = FALSE)) 760s > stopifnot(all.equal(y_smoothr, y_smooth0r)) 760s > 760s > 760s > # Integer input 760s > y <- as.integer(y) 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 760s > y_smooth <- binMeans(y, x = x, bx = bx) 760s > n_smooth <- binCounts(x, bx = bx) 760s > # Sanity check 760s > stopifnot(is.integer(y), 760s + all.equal(y_smooth, y_smooth0), 760s + all.equal(attr(y_smooth, "count"), n_smooth)) 760s > 760s > # Logical input 760s > y <- as.logical(y) 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 760s > y_smooth <- binMeans(y, x = x, bx = bx) 760s > n_smooth <- binCounts(x, bx = bx) 760s > # Sanity check 760s > stopifnot(is.logical(y), 760s + all.equal(y_smooth, y_smooth0), 760s + all.equal(attr(y_smooth, "count"), n_smooth)) 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Case #2 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > nx <- 1e3 760s > x <- runif(nx) 760s > y <- runif(nx) 760s > 760s > nb <- 10 760s > bx <- do.call(seq, c(as.list(range(x)), length.out = nb)) 760s > bx1 <- c(bx[-1], bx[nb] + 1) 760s > 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx1) 760s > y_smooth <- binMeans(y, x = x, bx = bx1) 760s > n_smooth <- binCounts(x, bx = bx1) 760s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx1), right = TRUE)) 760s > 760s > # Sanity check 760s > stopifnot(all.equal(y_smooth, y_smooth0)) 760s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 760s > stopifnot(all.equal(y_smoothr, y_smooth, check.attributes = FALSE)) 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Empty bins 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > x <- c(6:8, 16:19) 760s > nx <- length(x) 760s > y <- runif(nx) 760s > bx <- c(0, 5, 10, 15, 20, 25) 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 760s > y_smooth <- binMeans(y, x = x, bx = bx) 760s > n_smooth <- binCounts(x, bx = bx) 760s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 760s > stopifnot(all.equal(y_smooth, y_smooth0)) 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Missing values 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > x <- 1:100 760s > x[50] <- NA_integer_ 760s > nx <- length(x) 760s > y <- double(nx) 760s > y[1:25] <- 5 760s > y[51:75] <- -5 760s > y[82:92] <- NA_real_ 760s > y <- y + rnorm(nx) 760s > 760s > # Bins 760s > bx <- c(0.5, 25.5, 75.5, 82.5, 100.5) 760s > 760s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 760s > y_smooth <- binMeans(y, x = x, bx = bx) 760s > # Sanity check 760s > stopifnot(all.equal(y_smooth, y_smooth0)) 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Exception handling 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Zero bin bounderies (invalid bin definition) 760s > bx <- double(0L) 760s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 760s > stopifnot(inherits(res, "try-error")) 760s > 760s > # One bin boundery (invalid bin definition) 760s > bx <- double(1L) 760s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 760s > stopifnot(inherits(res, "try-error")) 760s > 760s 760s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 760s Copyright (C) 2024 The R Foundation for Statistical Computing 760s Platform: powerpc64le-unknown-linux-gnu 760s 760s R is free software and comes with ABSOLUTELY NO WARRANTY. 760s You are welcome to redistribute it under certain conditions. 760s Type 'license()' or 'licence()' for distribution details. 760s 760s R is a collaborative project with many contributors. 760s Type 'contributors()' for more information and 760s 'citation()' on how to cite R or R packages in publications. 760s 760s Type 'demo()' for some demos, 'help()' for on-line help, or 760s 'help.start()' for an HTML browser interface to help. 760s Type 'q()' to quit R. 760s 760s > library("matrixStats") 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Naive R implementation of binMeans() 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 760s + n_smooth <- length(bx) - 1L 760s + res <- double(n_smooth) 760s + counts <- rep(NaN, times = n_smooth) 760s + 760s + if (na.rm) { 760s + keep <- !is.na(x) & !is.na(y) 760s + x <- x[keep] 760s + y <- y[keep] 760s + } 760s + 760s + # For each bin... 760s + for (kk in seq_len(n_smooth)) { 760s + if (right) { 760s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 760s + } else { 760s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 760s + } 760s + y_kk <- y[idxs] 760s + res[kk] <- mean(y_kk) 760s + counts[kk] <- length(idxs) 760s + } # for (kk ...) 760s + 760s + if (count) attr(res, "count") <- counts 760s + res 760s + } 760s > 760s > 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > # Subsetted tests 760s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 760s > source("utils/validateIndicesFramework.R") 760s > y <- runif(6, min = -6, max = 6) 760s > x <- runif(6, min = -6, max = 6) 760s > storage.mode(x) <- "integer" 760s > bx <- c(-6, 0, 3, 4, 10) 760s > for (idxs in index_cases) { 760s + for (na.rm in c(TRUE, FALSE)) { 760s + validateIndicesTestVector_w(y, x, idxs, 760s + ftest = binMeans, fsure = binMeans0, 760s + bx = bx, na.rm = na.rm, 760s + count = TRUE, right = FALSE) 760s + validateIndicesTestVector_w(y, x, idxs, 760s + ftest = binMeans, fsure = binMeans0, 760s + bx = bx, na.rm = na.rm, 760s + count = TRUE, right = TRUE) 760s + } 760s + } 760s > 760s 760s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 760s Copyright (C) 2024 The R Foundation for Statistical Computing 760s Platform: powerpc64le-unknown-linux-gnu 760s 760s R is free software and comes with ABSOLUTELY NO WARRANTY. 760s You are welcome to redistribute it under certain conditions. 760s Type 'license()' or 'licence()' for distribution details. 760s 760s R is a collaborative project with many contributors. 760s Type 'contributors()' for more information and 760s 'citation()' on how to cite R or R packages in publications. 760s 760s Type 'demo()' for some demos, 'help()' for on-line help, or 760s 'help.start()' for an HTML browser interface to help. 760s Type 'q()' to quit R. 760s 761s > library("matrixStats") 761s > 761s > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 761s + if (is.na(value)) { 761s + counts <- sum(is.na(x)) 761s + } else { 761s + counts <- sum(x == value, na.rm = na.rm) 761s + } 761s + as.integer(counts) 761s + } 761s > 761s > 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > # Data type: integer and numeric 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > for (mode in c("integer", "double")) { 761s + x <- runif(20 * 5, min = -3, max = 3) 761s + x[sample.int(length(x), size = 7)] <- 0 761s + storage.mode(x) <- mode 761s + 761s + for (na.rm in c(FALSE, TRUE)) { 761s + # Count zeros 761s + n0 <- count_R(x, value = 0, na.rm = na.rm) 761s + n1 <- count(x, value = 0, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + all <- allValue(x, value = 0, na.rm = na.rm) 761s + any <- anyValue(x, value = 0, na.rm = na.rm) 761s + 761s + # Count NAs 761s + n0 <- count_R(x, value = NA, na.rm = na.rm) 761s + n1 <- count(x, value = NA, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + all <- allValue(x, value = NA, na.rm = na.rm) 761s + any <- anyValue(x, value = NA, na.rm = na.rm) 761s + 761s + if (mode == "integer") { 761s + ux <- unique(as.vector(x)) 761s + n0 <- n1 <- integer(length(x)) 761s + for (value in ux) { 761s + n0 <- n0 + count_R(x, value = value, na.rm = na.rm) 761s + n1 <- n1 + count(x, value = value, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + } 761s + stopifnot(all(n0 == ncol(x))) 761s + } # if (mode == "integer") 761s + 761s + } # for (na.rm ...) 761s + } # for (mode ...) 761s > 761s > # All NAs 761s > na_list <- list(NA_integer_, NA_real_, NaN) 761s > for (na_value in na_list) { 761s + x <- rep(na_value, times = 10L) 761s + for (na.rm in c(FALSE, TRUE)) { 761s + n0 <- count_R(x, na.rm = na.rm) 761s + n1 <- count(x, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + 761s + # Count NAs 761s + n0 <- count_R(x, value = NA, na.rm = na.rm) 761s + n1 <- count(x, value = NA, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + any <- anyValue(x, value = NA, na.rm = na.rm) 761s + all <- allValue(x, value = NA, na.rm = na.rm) 761s + stopifnot(any) 761s + stopifnot(all) 761s + } 761s + } # for (na_value ...) 761s > 761s > 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > # Data type: logical 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > x <- logical(length = 10L) 761s > x[3:7] <- TRUE 761s > 761s > # Row/column counts 761s > for (na.rm in c(FALSE, TRUE)) { 761s + n0 <- count_R(x, na.rm = na.rm) 761s + n1 <- count(x, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + 761s + n_true <- count(x, value = TRUE, na.rm = na.rm) 761s + n_false <- count(x, value = FALSE, na.rm = na.rm) 761s + stopifnot(n_true + n_false == ncol(x)) 761s + 761s + # Count NAs 761s + n0 <- count_R(x, value = NA, na.rm = na.rm) 761s + n1 <- count(x, value = NA, na.rm = na.rm) 761s + stopifnot(identical(n1, n0)) 761s + } 761s > 761s 761s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 761s Copyright (C) 2024 The R Foundation for Statistical Computing 761s Platform: powerpc64le-unknown-linux-gnu 761s 761s R is free software and comes with ABSOLUTELY NO WARRANTY. 761s You are welcome to redistribute it under certain conditions. 761s Type 'license()' or 'licence()' for distribution details. 761s 761s R is a collaborative project with many contributors. 761s Type 'contributors()' for more information and 761s 'citation()' on how to cite R or R packages in publications. 761s 761s Type 'demo()' for some demos, 'help()' for on-line help, or 761s 'help.start()' for an HTML browser interface to help. 761s Type 'q()' to quit R. 761s 761s > library("matrixStats") 761s > 761s > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 761s + if (is.na(value)) { 761s + counts <- sum(is.na(x)) 761s + } else { 761s + counts <- sum(x == value, na.rm = na.rm) 761s + } 761s + as.integer(counts) 761s + } 761s > 761s > 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > # Subsetted tests 761s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 761s > source("utils/validateIndicesFramework.R") 761s > x <- runif(6, min = -3, max = 3) 761s > storage.mode(x) <- "integer" 761s > for (idxs in index_cases) { 761s + validateIndicesTestVector(x, idxs, 761s + ftest = count, fsure = count_R, 761s + value = 0, na.rm = TRUE) 761s + validateIndicesTestVector(x, idxs, 761s + ftest = count, fsure = count_R, 761s + value = 0, na.rm = FALSE) 761s + validateIndicesTestVector(x, idxs, 761s + ftest = count, fsure = count_R, 761s + value = NA_integer_) 761s + } 761s > 761s 761s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 761s Copyright (C) 2024 The R Foundation for Statistical Computing 761s Platform: powerpc64le-unknown-linux-gnu 761s 761s R is free software and comes with ABSOLUTELY NO WARRANTY. 761s You are welcome to redistribute it under certain conditions. 761s Type 'license()' or 'licence()' for distribution details. 761s 761s R is a collaborative project with many contributors. 761s Type 'contributors()' for more information and 761s 'citation()' on how to cite R or R packages in publications. 761s 761s Type 'demo()' for some demos, 'help()' for on-line help, or 761s 'help.start()' for an HTML browser interface to help. 761s Type 'q()' to quit R. 761s 761s > library("matrixStats") 761s > 761s > diff2_R <- function(..., useNames = NA){ 761s + res <- diff(...) 761s + if (is.na(useNames) || !useNames) names(res) <- NULL 761s + res 761s + } 761s > 761s > set.seed(0x42) 761s > 761s > for (mode in c("integer", "double")) { 761s + x <- rnorm(10, sd = 5) 761s + storage.mode(x) <- mode 761s + str(x) 761s + 761s + for (has_na in c(FALSE, TRUE)) { 761s + for (setNames in c(TRUE, FALSE)) { 761s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 761s + if (has_na) { 761s + x[sample(1:10, size = 3)] <- NA 761s + } 761s + if (setNames) { 761s + names(x) <- LETTERS[1:10] 761s + } 761s + for (l in 1:3) { 761s + for (d in 1:4) { 761s + cat(sprintf("%s: NAs = %s, lag = %d, differences = %d, setNames = %d, useNames = %d\n", 761s + mode, has_na, l, d, setNames, useNames)) 761s + y0 <- diff2_R(x, lag = l, differences = d, useNames = useNames) 761s + str(y0) 761s + y1 <- diff2(x, lag = l, differences = d, useNames = useNames) 761s + str(y1) 761s + stopifnot(identical(y1, y0)) 761s + } 761s + } 761s + } 761s + } 761s + } # for (has_na ...) 761s + } 761s int [1:10] 11 1 2 0 -1 -3 -3 6 0 0 761s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 761s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 761s Named int [1:8] 11 -3 1 -1 2 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] 11 -3 1 -1 2 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 761s Named int [1:7] -14 4 -2 3 7 -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] -14 4 -2 3 7 -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 761s Named int [1:6] 18 -6 5 4 -31 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] 18 -6 5 4 -31 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 761s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 761s Named int [1:6] 6 -2 1 12 5 -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] 6 -2 1 12 5 -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 761s Named int [1:4] -5 14 4 -27 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] -5 14 4 -27 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 761s Named int [1:2] 9 -41 761s - attr(*, "names")= chr [1:2] "I" "J" 761s Named int [1:2] 9 -41 761s - attr(*, "names")= chr [1:2] "I" "J" 761s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 761s Named int [1:7] -11 -2 -5 -3 7 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] -11 -2 -5 -3 7 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 761s Named int [1:4] 8 9 8 6 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] 8 9 8 6 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 761s Named int -2 761s - attr(*, "names")= chr "J" 761s Named int -2 761s - attr(*, "names")= chr "J" 761s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 761s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 761s int [1:8] 11 -3 1 -1 2 9 -15 6 761s int [1:8] 11 -3 1 -1 2 9 -15 6 761s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 761s int [1:7] -14 4 -2 3 7 -24 21 761s int [1:7] -14 4 -2 3 7 -24 21 761s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 761s int [1:6] 18 -6 5 4 -31 45 761s int [1:6] 18 -6 5 4 -31 45 761s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 761s int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 761s int [1:6] 6 -2 1 12 5 -15 761s int [1:6] 6 -2 1 12 5 -15 761s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 761s int [1:4] -5 14 4 -27 761s int [1:4] -5 14 4 -27 761s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 761s int [1:2] 9 -41 761s int [1:2] 9 -41 761s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 761s int [1:7] -11 -2 -5 -3 7 3 3 761s int [1:7] -11 -2 -5 -3 7 3 3 761s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 761s int [1:4] 8 9 8 6 761s int [1:4] 8 9 8 6 761s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 761s int -2 761s int -2 761s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 761s int(0) 761s int(0) 761s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 761s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 761s Named int [1:8] 11 -3 1 -1 2 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] 11 -3 1 -1 2 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 761s Named int [1:7] -14 4 -2 3 7 -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] -14 4 -2 3 7 -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 761s Named int [1:6] 18 -6 5 4 -31 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] 18 -6 5 4 -31 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 761s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 761s Named int [1:6] 6 -2 1 12 5 -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] 6 -2 1 12 5 -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 761s Named int [1:4] -5 14 4 -27 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] -5 14 4 -27 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 761s Named int [1:2] 9 -41 761s - attr(*, "names")= chr [1:2] "I" "J" 761s Named int [1:2] 9 -41 761s - attr(*, "names")= chr [1:2] "I" "J" 761s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 761s Named int [1:7] -11 -2 -5 -3 7 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] -11 -2 -5 -3 7 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 761s Named int [1:4] 8 9 8 6 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] 8 9 8 6 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 761s Named int -2 761s - attr(*, "names")= chr "J" 761s Named int -2 761s - attr(*, "names")= chr "J" 761s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 761s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 761s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 761s int [1:8] 11 -3 1 -1 2 9 -15 6 761s int [1:8] 11 -3 1 -1 2 9 -15 6 761s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 761s int [1:7] -14 4 -2 3 7 -24 21 761s int [1:7] -14 4 -2 3 7 -24 21 761s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 761s int [1:6] 18 -6 5 4 -31 45 761s int [1:6] 18 -6 5 4 -31 45 761s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 761s int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s int [1:8] -9 -1 -3 -3 -2 9 3 -6 761s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 761s int [1:6] 6 -2 1 12 5 -15 761s int [1:6] 6 -2 1 12 5 -15 761s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 761s int [1:4] -5 14 4 -27 761s int [1:4] -5 14 4 -27 761s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 761s int [1:2] 9 -41 761s int [1:2] 9 -41 761s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 761s int [1:7] -11 -2 -5 -3 7 3 3 761s int [1:7] -11 -2 -5 -3 7 3 3 761s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 761s int [1:4] 8 9 8 6 761s int [1:4] 8 9 8 6 761s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 761s int -2 761s int -2 761s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 761s int(0) 761s int(0) 761s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 761s Named int [1:9] NA NA NA NA NA 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s Named int [1:9] NA NA NA NA NA 0 9 -6 0 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 761s Named int [1:8] NA NA NA NA NA 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] NA NA NA NA NA 9 -15 6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 761s Named int [1:7] NA NA NA NA NA -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] NA NA NA NA NA -24 21 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 761s Named int [1:6] NA NA NA NA NA 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] NA NA NA NA NA 45 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 761s Named int [1:8] -9 NA NA NA NA 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] -9 NA NA NA NA 9 3 -6 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 761s Named int [1:6] NA NA NA NA NA -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] NA NA NA NA NA -15 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 761s Named int [1:4] NA NA NA NA 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] NA NA NA NA 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 761s Named int [1:2] NA NA 761s - attr(*, "names")= chr [1:2] "I" "J" 761s Named int [1:2] NA NA 761s - attr(*, "names")= chr [1:2] "I" "J" 761s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 761s Named int [1:7] NA NA -5 NA NA 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] NA NA -5 NA NA 3 3 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 761s Named int [1:4] NA NA 8 NA 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s Named int [1:4] NA NA 8 NA 761s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 761s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 761s Named int NA 761s - attr(*, "names")= chr "J" 761s Named int NA 761s - attr(*, "names")= chr "J" 761s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s Named int(0) 761s - attr(*, "names")= chr(0) 761s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 761s int [1:9] NA NA NA NA NA 0 9 NA NA 761s int [1:9] NA NA NA NA NA 0 9 NA NA 761s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 761s int [1:8] NA NA NA NA NA 9 NA NA 761s int [1:8] NA NA NA NA NA 9 NA NA 761s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 761s int [1:7] NA NA NA NA NA NA NA 761s int [1:7] NA NA NA NA NA NA NA 761s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 761s int [1:6] NA NA NA NA NA NA 761s int [1:6] NA NA NA NA NA NA 761s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 761s int [1:8] NA NA NA NA NA 9 NA -6 761s int [1:8] NA NA NA NA NA 9 NA -6 761s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 761s int [1:6] NA NA NA NA NA -15 761s int [1:6] NA NA NA NA NA -15 761s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 761s int [1:4] NA NA NA NA 761s int [1:4] NA NA NA NA 761s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 761s int [1:2] NA NA 761s int [1:2] NA NA 761s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 761s int [1:7] NA NA NA NA NA NA 3 761s int [1:7] NA NA NA NA NA NA 3 761s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 761s int [1:4] NA NA NA NA 761s int [1:4] NA NA NA NA 761s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 761s int NA 761s int NA 761s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 761s int(0) 761s int(0) 761s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 761s Named int [1:9] NA NA NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s Named int [1:9] NA NA NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 761s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 761s Named int [1:8] NA NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s Named int [1:8] NA NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 761s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 761s Named int [1:7] NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s Named int [1:7] NA NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 761s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 761s Named int [1:6] NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s Named int [1:6] NA NA NA NA NA NA 761s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 761s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 762s Named int [1:8] NA NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named int [1:8] NA NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 762s Named int [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named int [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 762s Named int [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named int [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 762s Named int [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s Named int [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 762s Named int [1:7] NA NA NA NA NA NA 3 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named int [1:7] NA NA NA NA NA NA 3 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 762s Named int [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named int [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 762s Named int NA 762s - attr(*, "names")= chr "J" 762s Named int NA 762s - attr(*, "names")= chr "J" 762s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 762s Named int(0) 762s - attr(*, "names")= chr(0) 762s Named int(0) 762s - attr(*, "names")= chr(0) 762s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 762s int [1:9] NA NA NA NA NA NA NA NA NA 762s int [1:9] NA NA NA NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 762s int [1:8] NA NA NA NA NA NA NA NA 762s int [1:8] NA NA NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 762s int [1:7] NA NA NA NA NA NA NA 762s int [1:7] NA NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 762s int [1:6] NA NA NA NA NA NA 762s int [1:6] NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 762s int [1:8] NA NA NA NA NA NA NA NA 762s int [1:8] NA NA NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 762s int [1:6] NA NA NA NA NA NA 762s int [1:6] NA NA NA NA NA NA 762s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 762s int [1:4] NA NA NA NA 762s int [1:4] NA NA NA NA 762s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 762s int [1:2] NA NA 762s int [1:2] NA NA 762s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 762s int [1:7] NA NA NA NA NA NA 3 762s int [1:7] NA NA NA NA NA NA 3 762s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 762s int [1:4] NA NA NA NA 762s int [1:4] NA NA NA NA 762s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 762s int NA 762s int NA 762s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 762s int(0) 762s int(0) 762s num [1:10] 2.586 -0.344 0.33 9.155 -3.254 ... 762s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 762s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 762s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 762s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 762s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 762s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 762s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 762s Named num [1:4] 0.368 42.988 15.396 -29.313 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] 0.368 42.988 15.396 -29.313 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 762s Named num [1:2] 15 -72.3 762s - attr(*, "names")= chr [1:2] "I" "J" 762s Named num [1:2] 15 -72.3 762s - attr(*, "names")= chr [1:2] "I" "J" 762s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 762s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 762s Named num [1:4] -23.52 7.92 11.38 23.27 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] -23.52 7.92 11.38 23.27 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 762s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 762s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 762s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 762s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 762s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 762s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 762s num [1:4] 0.368 42.988 15.396 -29.313 762s num [1:4] 0.368 42.988 15.396 -29.313 762s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 762s num [1:2] 15 -72.3 762s num [1:2] 15 -72.3 762s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 762s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 762s num [1:4] -23.52 7.92 11.38 23.27 762s num [1:4] -23.52 7.92 11.38 23.27 762s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 762s num 46.8 762s num 46.8 762s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 762s num(0) 762s num(0) 762s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 762s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 762s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 762s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 762s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 762s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 762s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 762s Named num [1:4] 0.368 42.988 15.396 -29.313 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] 0.368 42.988 15.396 -29.313 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 762s Named num [1:2] 15 -72.3 762s - attr(*, "names")= chr [1:2] "I" "J" 762s Named num [1:2] 15 -72.3 762s - attr(*, "names")= chr [1:2] "I" "J" 762s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 762s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 762s Named num [1:4] -23.52 7.92 11.38 23.27 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] -23.52 7.92 11.38 23.27 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 762s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 762s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 762s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 762s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 762s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 762s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 762s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 762s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 762s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 762s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 762s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 762s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 762s num [1:4] 0.368 42.988 15.396 -29.313 762s num [1:4] 0.368 42.988 15.396 -29.313 762s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 762s num [1:2] 15 -72.3 762s num [1:2] 15 -72.3 762s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 762s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 762s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 762s num [1:4] -23.52 7.92 11.38 23.27 762s num [1:4] -23.52 7.92 11.38 23.27 762s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 762s num 46.8 762s num 46.8 762s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 762s num(0) 762s num(0) 762s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 762s Named num [1:9] -2.929 0.673 8.826 NA NA ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s Named num [1:9] -2.929 0.673 8.826 NA NA ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 762s Named num [1:8] 3.6 8.15 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] 3.6 8.15 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 762s Named num [1:7] 4.55 NA NA NA NA ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 4.55 NA NA NA NA ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 762s Named num [1:8] -2.26 9.5 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] -2.26 9.5 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 762s Named num [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s Named num [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 762s Named num [1:7] 6.57 NA NA -16.95 NA ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] 6.57 NA NA -16.95 NA ... 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 762s Named num [1:4] -23.5 NA NA 23.3 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] -23.5 NA NA 23.3 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s Named num 46.8 762s - attr(*, "names")= chr "J" 762s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 762s num [1:9] NA 0.673 8.826 NA NA ... 762s num [1:9] NA 0.673 8.826 NA NA ... 762s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 762s num [1:8] NA 8.15 NA NA NA ... 762s num [1:8] NA 8.15 NA NA NA ... 762s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 762s num [1:7] NA NA NA NA NA NA NA 762s num [1:7] NA NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 762s num [1:6] NA NA NA NA NA NA 762s num [1:6] NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 762s num [1:8] NA 9.5 NA NA NA ... 762s num [1:8] NA 9.5 NA NA NA ... 762s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 762s num [1:6] NA NA NA NA NA NA 762s num [1:6] NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 762s num [1:4] NA NA NA NA 762s num [1:4] NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 762s num [1:2] NA NA 762s num [1:2] NA NA 762s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 762s num [1:7] NA NA NA NA NA NA NA 762s num [1:7] NA NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 762s num [1:4] NA NA NA NA 762s num [1:4] NA NA NA NA 762s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 762s num NA 762s num NA 762s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 762s num(0) 762s num(0) 762s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 762s Named num [1:9] NA 0.673 8.826 NA NA ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s Named num [1:9] NA 0.673 8.826 NA NA ... 762s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 762s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 762s Named num [1:8] NA 8.15 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] NA 8.15 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 762s Named num [1:7] NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 762s Named num [1:8] NA 9.5 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s Named num [1:8] NA 9.5 NA NA NA ... 762s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 762s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s Named num [1:6] NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 762s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 762s Named num [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s Named num [1:2] NA NA 762s - attr(*, "names")= chr [1:2] "I" "J" 762s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 762s Named num [1:7] NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s Named num [1:7] NA NA NA NA NA NA NA 762s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 762s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s Named num [1:4] NA NA NA NA 762s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 762s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 762s Named num NA 762s - attr(*, "names")= chr "J" 762s Named num NA 762s - attr(*, "names")= chr "J" 762s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s Named num(0) 762s - attr(*, "names")= chr(0) 762s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 762s num [1:9] NA 0.673 8.826 NA NA ... 762s num [1:9] NA 0.673 8.826 NA NA ... 762s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 762s num [1:8] NA 8.15 NA NA NA ... 762s num [1:8] NA 8.15 NA NA NA ... 762s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 762s num [1:7] NA NA NA NA NA NA NA 762s num [1:7] NA NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 762s num [1:6] NA NA NA NA NA NA 762s num [1:6] NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 762s num [1:8] NA 9.5 NA NA NA ... 762s num [1:8] NA 9.5 NA NA NA ... 762s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 762s num [1:6] NA NA NA NA NA NA 762s num [1:6] NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 762s num [1:4] NA NA NA NA 762s num [1:4] NA NA NA NA 762s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 762s num [1:2] NA NA 762s num [1:2] NA NA 762s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 762s num [1:7] NA NA NA NA NA NA NA 762s num [1:7] NA NA NA NA NA NA NA 762s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 762s num [1:4] NA NA NA NA 762s num [1:4] NA NA NA NA 762s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 762s num NA 762s num NA 762s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 762s num(0) 762s num(0) 762s > 762s 762s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 762s Copyright (C) 2024 The R Foundation for Statistical Computing 762s Platform: powerpc64le-unknown-linux-gnu 762s 762s R is free software and comes with ABSOLUTELY NO WARRANTY. 762s You are welcome to redistribute it under certain conditions. 762s Type 'license()' or 'licence()' for distribution details. 762s 762s R is a collaborative project with many contributors. 762s Type 'contributors()' for more information and 762s 'citation()' on how to cite R or R packages in publications. 762s 762s Type 'demo()' for some demos, 'help()' for on-line help, or 762s 'help.start()' for an HTML browser interface to help. 762s Type 'q()' to quit R. 762s 762s > library("matrixStats") 762s > 762s > diff2_R <- function(..., useNames=NA){ 762s + res <- diff(...) 762s + if (is.na(useNames) || !useNames) names(res) <- NULL 762s + res 762s + } 762s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 762s > # Subsetted tests 762s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 762s > source("utils/validateIndicesFramework.R") 762s > x <- runif(6, min = -6, max = 6) 762s > for (setNames in c(TRUE, FALSE)) { 762s + if (setNames) names(x) <- LETTERS[1:6] 762s + else names(x) <- NULL 762s + for (l in 1:2) { 762s + for (d in 1:2) { 762s + for (idxs in index_cases) { 762s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 762s + validateIndicesTestVector(x, idxs, 762s + ftest = diff2, fsure = diff2_R, 762s + lag = l, differences = d, useNames = useNames) 762s + } 762s + } 762s + } 762s + } 762s + } 762s > 762s 762s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 762s Copyright (C) 2024 The R Foundation for Statistical Computing 762s Platform: powerpc64le-unknown-linux-gnu 762s 762s R is free software and comes with ABSOLUTELY NO WARRANTY. 762s You are welcome to redistribute it under certain conditions. 762s Type 'license()' or 'licence()' for distribution details. 762s 762s R is a collaborative project with many contributors. 762s Type 'contributors()' for more information and 762s 'citation()' on how to cite R or R packages in publications. 762s 762s Type 'demo()' for some demos, 'help()' for on-line help, or 762s 'help.start()' for an HTML browser interface to help. 762s Type 'q()' to quit R. 762s 763s > library("matrixStats") 763s > 763s > indexByRow_R1 <- function(dim, idxs = NULL, ...) { 763s + n <- prod(dim) 763s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 763s + if (!is.null(idxs)) 763s + x <- x[idxs] 763s + as.vector(x) 763s + } 763s > 763s > 763s > indexByRow_R2 <- function(dim, idxs = NULL, ...) { 763s + n <- prod(dim) 763s + if (is.null(idxs)) { 763s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 763s + as.vector(x) 763s + } else { 763s + idxs <- idxs - 1L 763s + cols <- idxs %/% dim[2L] 763s + rows <- idxs %% dim[2L] 763s + cols + dim[1L] * rows + 1L 763s + } 763s + } 763s > 763s > 763s > dim <- c(5L, 4L) 763s > x <- matrix(NA_integer_, nrow = dim[1L], ncol = dim[2L]) 763s > y <- t(x) 763s > idxs_by_cols <- seq_along(x) 763s > 763s > # Assign by columns 763s > x[idxs_by_cols] <- idxs_by_cols 763s > print(x) 763s [,1] [,2] [,3] [,4] 763s [1,] 1 6 11 16 763s [2,] 2 7 12 17 763s [3,] 3 8 13 18 763s [4,] 4 9 14 19 763s [5,] 5 10 15 20 763s > 763s > # Truth 763s > y0 <- t(x) 763s > idxs_by_rows <- as.vector(y0) 763s > 763s > # Assert 763s > idxs <- indexByRow(dim) 763s > stopifnot(all.equal(idxs, idxs_by_rows)) 763s > y <- x 763s > y[idxs_by_rows] <- idxs 763s > print(y) 763s [,1] [,2] [,3] [,4] 763s [1,] 1 6 11 16 763s [2,] 2 7 12 17 763s [3,] 3 8 13 18 763s [4,] 4 9 14 19 763s [5,] 5 10 15 20 763s > stopifnot(all(as.vector(y) == as.vector(x))) 763s > 763s > idxs_R1 <- indexByRow_R1(dim) 763s > stopifnot(all.equal(idxs_R1, idxs_by_rows)) 763s > 763s > idxs_R2 <- indexByRow_R2(dim) 763s > stopifnot(all.equal(idxs_R2, idxs_by_rows)) 763s > 763s > # Assert 763s > idxs_by_cols <- seq(from = 1, to = length(x), by = 3L) 763s > idxs_by_rows <- as.vector(t(x)[idxs_by_cols]) 763s > 763s > idxs <- indexByRow(dim, idxs = idxs_by_cols) 763s > stopifnot(all(idxs == idxs_by_rows)) 763s > 763s > idxs_R1 <- indexByRow_R1(dim, idxs = idxs_by_cols) 763s > stopifnot(all(idxs_R1 == idxs_by_rows)) 763s > 763s > idxs_R2 <- indexByRow_R2(dim, idxs = idxs_by_cols) 763s > stopifnot(all(idxs_R2 == idxs_by_rows)) 763s > 763s > 763s > ## DEFUNCT: Backward compatibility 763s > res <- tryCatch({ 763s + idxs1 <- indexByRow(x) 763s + }, error = identity) 763s > stopifnot(inherits(res, "error")) 763s > 763s > 763s > ## Exceptions: 763s > ## Too large matrices are not supported, which happens 763s > ## when prod(dim) > .Machine$integer.max 763s > dim_too_large <- c(.Machine$integer.max, 2L) 763s > res <- tryCatch({ 763s + idxs <- indexByRow(dim_too_large, idxs = 1L) 763s + }, error = identity) 763s > stopifnot(inherits(res, "error")) 763s > 763s > ## Non-positive indices are not supported 763s > res <- tryCatch({ 763s + idxs <- indexByRow(c(1,1), idxs = 0L) 763s + }, error = identity) 763s > stopifnot(inherits(res, "error")) 763s > 763s > res <- tryCatch({ 763s + idxs <- indexByRow(c(1,1), idxs = -1L) 763s + }, error = identity) 763s > stopifnot(inherits(res, "error")) 763s > 763s 763s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 763s Copyright (C) 2024 The R Foundation for Statistical Computing 763s Platform: powerpc64le-unknown-linux-gnu 763s 763s R is free software and comes with ABSOLUTELY NO WARRANTY. 763s You are welcome to redistribute it under certain conditions. 763s Type 'license()' or 'licence()' for distribution details. 763s 763s R is a collaborative project with many contributors. 763s Type 'contributors()' for more information and 763s 'citation()' on how to cite R or R packages in publications. 763s 763s Type 'demo()' for some demos, 'help()' for on-line help, or 763s 'help.start()' for an HTML browser interface to help. 763s Type 'q()' to quit R. 763s 763s > library("matrixStats") 763s > library("stats") 763s > 763s > logSumExp_R <- function(lx, na.rm = FALSE) { 763s + log(sum(exp(lx), na.rm = na.rm)) 763s + } 763s > 763s > ## R-help thread \emph{'[R] Beyond double-precision?'} on May 9, 2009. 763s > 763s > for (mode in c("integer", "double")) { 763s + cat("mode: ", mode, "\n", sep = "") 763s + 763s + set.seed(1) 763s + x <- runif(20, min = 1.0, max = 3.0) 763s + storage.mode(x) <- mode 763s + str(x) 763s + 763s + ## The logarithm of the harmonic mean 763s + y0 <- log(1 / mean(1 / x)) 763s + print(y0) ## -1.600885 763s + 763s + lx <- log(x) 763s + y1 <- log(length(x)) - logSumExp(-lx) 763s + print(y1) ## [1] -1.600885 763s + 763s + # Sanity check 763s + stopifnot(all.equal(y1, y0)) 763s + 763s + y2 <- log(length(x)) - logSumExp_R(-lx) 763s + # Sanity check 763s + stopifnot(all.equal(y2, y0)) 763s + } # for (mode ...) 763s mode: integer 763s int [1:20] 1 1 2 2 1 2 2 2 2 1 ... 763s [1] 0.3215836 763s [1] 0.3215836 763s mode: double 763s num [1:20] 1.53 1.74 2.15 2.82 1.4 ... 763s [1] 0.6673156 763s [1] 0.6673156 763s > 763s > 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > # Missing values 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > ## NA values 763s > lx <- c(1, 2, 3) 763s > lx[2] <- NA_real_ 763s > y0 <- logSumExp_R(lx, na.rm = FALSE) 763s > y <- logSumExp(lx, na.rm = FALSE) 763s > print(y) 763s [1] NA 763s > stopifnot(identical(y, NA_real_)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > y0 <- logSumExp_R(lx, na.rm = TRUE) 763s > y <- logSumExp(lx, na.rm = TRUE) 763s > print(y) 763s [1] 3.126928 763s > stopifnot(all.equal(y, y0)) 763s > 763s > ## NaN values 763s > lx <- c(1, 2, 3) 763s > lx[2] <- NaN 763s > y0 <- logSumExp_R(lx, na.rm = FALSE) 763s > y <- logSumExp(lx, na.rm = FALSE) 763s > print(y) 763s [1] NA 763s > stopifnot(identical(y, NA_real_)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > y0 <- logSumExp_R(lx, na.rm = TRUE) 763s > y <- logSumExp(lx, na.rm = TRUE) 763s > print(y) 763s [1] 3.126928 763s > stopifnot(all.equal(y, y0)) 763s > 763s > 763s > 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > # Corner cases 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > ## Zero-length vectors 763s > lx <- numeric(0L) 763s > y0 <- logSumExp_R(lx) 763s > y <- logSumExp(lx) 763s > print(y) 763s [1] -Inf 763s > stopifnot(identical(y, -Inf)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > ## Vectors of length one 763s > lx <- 1.0 763s > y0 <- logSumExp_R(lx) 763s > y <- logSumExp(lx) 763s > print(y) 763s [1] 1 763s > stopifnot(identical(y, lx)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > lx <- NA_real_ 763s > y0 <- logSumExp_R(lx, na.rm = TRUE) 763s > y <- logSumExp(lx, na.rm = TRUE) 763s > print(y) 763s [1] -Inf 763s > stopifnot(identical(y, -Inf)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > ## All missing values 763s > lx <- c(NA_real_, NA_real_) 763s > y0 <- logSumExp_R(lx, na.rm = TRUE) 763s > y <- logSumExp(lx, na.rm = TRUE) 763s > print(y) 763s [1] -Inf 763s > stopifnot(identical(y, -Inf)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > lx <- c(NA_real_, NA_real_) 763s > y0 <- logSumExp_R(lx, na.rm = FALSE) 763s > y <- logSumExp(lx, na.rm = FALSE) 763s > print(y) 763s [1] NA 763s > stopifnot(identical(y, NA_real_)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > 763s > ## +Inf values 763s > lx <- c(1, 2, +Inf) 763s > y0 <- logSumExp_R(lx) 763s > y <- logSumExp(lx) 763s > print(y) 763s [1] Inf 763s > stopifnot(identical(y, +Inf)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > ## First element is a missing value, cf. PR #33 763s > lx <- c(NA_real_, 1) 763s > y0 <- logSumExp_R(lx) 763s > print(y0) 763s [1] NA 763s > y <- logSumExp(lx, na.rm = FALSE) 763s > print(y) 763s [1] NA 763s > stopifnot(identical(y, NA_real_)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > y0 <- logSumExp_R(lx, na.rm = TRUE) 763s > print(y0) 763s [1] 1 763s > y <- logSumExp(lx, na.rm = TRUE) 763s > print(y) 763s [1] 1 763s > stopifnot(identical(y, 1)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > ## Multiple -Inf values, cf. issue #84 763s > lx <- c(-Inf, -Inf) 763s > y0 <- logSumExp_R(lx) 763s > y <- logSumExp(lx) 763s > print(y) 763s [1] -Inf 763s > stopifnot(identical(y, -Inf)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s > lx <- c(-Inf, 5, -Inf) 763s > y0 <- logSumExp_R(lx) 763s > y <- logSumExp(lx) 763s > print(y) 763s [1] 5 763s > stopifnot(identical(y, 5)) 763s > stopifnot(all.equal(y, y0)) 763s > 763s 763s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 763s Copyright (C) 2024 The R Foundation for Statistical Computing 763s Platform: powerpc64le-unknown-linux-gnu 763s 763s R is free software and comes with ABSOLUTELY NO WARRANTY. 763s You are welcome to redistribute it under certain conditions. 763s Type 'license()' or 'licence()' for distribution details. 763s 763s R is a collaborative project with many contributors. 763s Type 'contributors()' for more information and 763s 'citation()' on how to cite R or R packages in publications. 763s 763s Type 'demo()' for some demos, 'help()' for on-line help, or 763s 'help.start()' for an HTML browser interface to help. 763s Type 'q()' to quit R. 763s 763s > library("matrixStats") 763s > 763s > logSumExp_R <- function(lx, na.rm = FALSE) { 763s + log(sum(exp(lx), na.rm = na.rm)) 763s + } 763s > 763s > 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > # Subsetted tests 763s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 763s > source("utils/validateIndicesFramework.R") 763s > x <- runif(6, min = -6, max = 6) 763s > for (idxs in index_cases) { 763s + validateIndicesTestVector(x, idxs, 763s + ftest = logSumExp, fsure = logSumExp_R, 763s + na.rm = FALSE) 763s + validateIndicesTestVector(x, idxs, 763s + ftest = logSumExp, fsure = logSumExp_R, 763s + na.rm = TRUE) 763s + } 764s > 764s 764s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 764s Copyright (C) 2024 The R Foundation for Statistical Computing 764s Platform: powerpc64le-unknown-linux-gnu 764s 764s R is free software and comes with ABSOLUTELY NO WARRANTY. 764s You are welcome to redistribute it under certain conditions. 764s Type 'license()' or 'licence()' for distribution details. 764s 764s R is a collaborative project with many contributors. 764s Type 'contributors()' for more information and 764s 'citation()' on how to cite R or R packages in publications. 764s 764s Type 'demo()' for some demos, 'help()' for on-line help, or 764s 'help.start()' for an HTML browser interface to help. 764s Type 'q()' to quit R. 764s 764s > library("matrixStats") 764s > 764s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 764s > # Consistency checks 764s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > set.seed(1) 805s > 805s > mean2_R <- function(x, na.rm = FALSE, idxs = NULL) { 805s + if (is.null(idxs)) { 805s + mean(x, na.rm = na.rm) 805s + } else { 805s + mean(x[idxs], na.rm = na.rm) 805s + } 805s + } # mean2_R() 805s > 805s > 805s > cat("Consistency checks:\n") 805s Consistency checks: 805s > for (kk in 1:20) { 805s + cat("Random test #", kk, "\n", sep = "") 805s + 805s + # Simulate data in a matrix of any shape 805s + n <- sample(100L, size = 1L) 805s + x <- rnorm(n, sd = 100) 805s + 805s + # Add NAs? 805s + if ((kk %% 4) %in% c(3, 0)) { 805s + cat("Adding NAs\n") 805s + nna <- sample(n, size = 1L) 805s + na_values <- c(NA_real_, NaN) 805s + t <- sample(na_values, size = nna, replace = TRUE) 805s + x[sample(length(x), size = nna)] <- t 805s + } 805s + 805s + # Integer or double? 805s + if ((kk %% 4) %in% c(2, 0)) { 805s + cat("Coercing to integers\n") 805s + storage.mode(x) <- "integer" 805s + } 805s + 805s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 805s + 805s + # Sum over all 805s + y0 <- mean2_R(x, na.rm = na.rm) 805s + y1 <- mean2(x, na.rm = na.rm) 805s + stopifnot(all.equal(y1, y0)) 805s + 805s + # Sum over subset 805s + nidxs <- sample(n, size = 1L) 805s + idxs <- sample(n, size = nidxs) 805s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 805s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 805s + stopifnot(all.equal(y1, y0)) 805s + 805s + if (storage.mode(x) == "integer") { 805s + storage.mode(x) <- "logical" 805s + 805s + y0 <- mean2_R(x, na.rm = na.rm) 805s + y1 <- mean2(x, na.rm = na.rm) 805s + stopifnot(all.equal(y1, y0)) 805s + 805s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 805s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 805s + stopifnot(all.equal(y1, y0)) 805s + } 805s + } # for (kk ...) 805s Random test #1 805s Random test #2 805s Coercing to integers 805s Random test #3 805s Adding NAs 805s Random test #4 805s Adding NAs 805s Coercing to integers 805s Random test #5 805s Random test #6 805s Coercing to integers 805s Random test #7 805s Adding NAs 805s Random test #8 805s Adding NAs 805s Coercing to integers 805s Random test #9 805s Random test #10 805s Coercing to integers 805s Random test #11 805s Adding NAs 805s Random test #12 805s Adding NAs 805s Coercing to integers 805s Random test #13 805s Random test #14 805s Coercing to integers 805s Random test #15 805s Adding NAs 805s Random test #16 805s Adding NAs 805s Coercing to integers 805s Random test #17 805s Random test #18 805s Coercing to integers 805s Random test #19 805s Adding NAs 805s Random test #20 805s Adding NAs 805s Coercing to integers 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Special cases 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (na.rm in c(FALSE, TRUE)) { 805s + # Averaging over zero elements (integers) 805s + x <- integer(0) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + x <- 1:5 805s + idxs <- integer(0) 805s + s1 <- mean(x[idxs], na.rm = na.rm) 805s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over NA_integer_:s 805s + x <- rep(NA_integer_, times = 5L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + x <- rep(NA_integer_, times = 5L) 805s + idxs <- 1:3 805s + s1 <- mean(x[idxs], na.rm = na.rm) 805s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + 805s + # Averaging over zero elements (doubles) 805s + x <- double(0) 805s + s1 <- mean(x) 805s + s2 <- mean2(x) 805s + stopifnot(identical(s1, s2)) 805s + 805s + x <- as.double(1:10) 805s + idxs <- integer(0) 805s + s1 <- mean(x[idxs]) 805s + s2 <- mean2(x, idxs = idxs) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over NA_real_:s 805s + x <- rep(NA_real_, times = 5L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + x <- rep(NA_real_, times = 5L) 805s + idxs <- 1:3 805s + s1 <- mean(x[idxs], na.rm = na.rm) 805s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over -Inf:s 805s + x <- rep(-Inf, times = 3L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over +Inf:s 805s + x <- rep(+Inf, times = 3L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over mix of -Inf:s and +Inf:s 805s + x <- rep(c(-Inf, +Inf), times = 3L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over mix of -Inf:s and +Inf:s and numerics 805s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + stopifnot(identical(s1, s2)) 805s + 805s + # Averaging over mix of NaN, NA, +Inf, and numerics 805s + x <- c(NaN, NA, +Inf, 3.14) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + if (na.rm) { 805s + stopifnot(identical(s2, s1)) 805s + } else { 805s + stopifnot(is.na(s1), is.na(s2)) 805s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 805s + ## returned here (as one would expect). NaN might very well be returned, 805s + ## when both NA and NaN are involved. This is an accepted feature in R, 805s + ## which is documented in help("is.nan"). See also 805s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 805s + ## Thus, we cannot guarantee that s1 is identical to s0. 805s + } 805s + 805s + # Averaging over mix of NaN, NA_real_, +Inf, and numerics 805s + x <- c(NA_real_, NaN, +Inf, 3.14) 805s + s1 <- mean(x, na.rm = na.rm) 805s + s2 <- mean2(x, na.rm = na.rm) 805s + if (na.rm) { 805s + stopifnot(identical(s2, s1)) 805s + } else { 805s + stopifnot(is.na(s1), is.na(s2)) 805s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 805s + ## returned here (as one would expect). NaN might very well be returned, 805s + ## when both NA and NaN are involved. This is an accepted feature in R, 805s + ## which is documented in help("is.nan"). See also 805s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 805s + ## Thus, we cannot guarantee that s1 is identical to s0. 805s + } 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Argument 'idxs' 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- 1:5 805s > idxs_list <- list( 805s + integer = 1:3, 805s + double = as.double(1:3), 805s + logical = (x <= 3) 805s + ) 805s > 805s > for (idxs in idxs_list) { 805s + cat("idxs:\n") 805s + str(idxs) 805s + s1 <- mean(x[idxs], na.rm = TRUE) 805s + s2 <- mean2(x, idxs = idxs, na.rm = TRUE) 805s + stopifnot(identical(s1, s2)) 805s + } 805s idxs: 805s int [1:3] 1 2 3 805s idxs: 805s num [1:3] 1 2 3 805s idxs: 805s logi [1:5] TRUE TRUE TRUE FALSE FALSE 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- runif(6, min = -6, max = 6) 805s > storage.mode(x) <- "integer" 805s > for (idxs in index_cases) { 805s + validateIndicesTestVector(x, idxs, 805s + ftest = mean2, fsure = mean, 805s + na.rm = FALSE) 805s + validateIndicesTestVector(x, idxs, 805s + ftest = mean2, fsure = mean, 805s + na.rm = TRUE) 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > for (mode in c("integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + 805s + # Empty vector 805s + x <- 0 805s + storage.mode(x) <- mode 805s + y <- prod(x, na.rm = TRUE) 805s + print(y) 805s + z <- product(x, na.rm = TRUE) 805s + print(z) 805s + stopifnot(all.equal(z, y)) 805s + 805s + # Test negative values 805s + x <- c(1, -4, 2) 805s + storage.mode(x) <- mode 805s + y <- prod(x, na.rm = TRUE) 805s + print(y) 805s + z <- product(x, na.rm = TRUE) 805s + print(z) 805s + stopifnot(all.equal(z, y)) 805s + 805s + # Test missing values 805s + x <- c(1, NA, NaN, 2) 805s + storage.mode(x) <- mode 805s + y <- prod(x, na.rm = TRUE) 805s + print(y) 805s + z <- product(x, na.rm = TRUE) 805s + print(z) 805s + stopifnot(all.equal(z, y)) 805s + 805s + x <- c(1, NA, NaN, 2) 805s + storage.mode(x) <- mode 805s + y <- prod(x, na.rm = FALSE) 805s + print(y) 805s + z <- product(x, na.rm = FALSE) 805s + print(z) 805s + stopifnot(all(is.na(z), is.na(y))) 805s + 805s + x <- c(1, NaN, 2) 805s + storage.mode(x) <- mode 805s + y <- prod(x, na.rm = FALSE) 805s + print(y) 805s + stopifnot(is.na(y)) 805s + z <- product(x, na.rm = FALSE) 805s + print(z) 805s + stopifnot(is.na(z)) 805s + 805s + } # for (mode ...) 805s mode: integer 805s [1] 0 805s [1] 0 805s [1] -8 805s [1] -8 805s [1] 2 805s [1] 2 805s [1] NA 805s [1] NA 805s [1] NA 805s [1] NA 805s mode: double 805s [1] 0 805s [1] 0 805s [1] -8 805s [1] -8 805s [1] 2 805s [1] 2 805s [1] NA 805s [1] NA 805s [1] NaN 805s [1] NA 805s > 805s > 805s > # NAs following 0s 805s > x <- c(0L, NA_integer_) 805s > y <- prod(x, na.rm = FALSE) 805s > print(y) 805s [1] NA 805s > z <- product(x, na.rm = FALSE) 805s > print(z) 805s [1] NA 805s > stopifnot(identical(z, y)) 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- runif(6, min = -6, max = 6) 805s > storage.mode(x) <- "integer" 805s > for (idxs in index_cases) { 805s + validateIndicesTestVector(x, idxs, 805s + ftest = product, fsure = prod, 805s + na.rm = TRUE) 805s + validateIndicesTestVector(x, idxs, 805s + ftest = product, fsure = prod, 805s + na.rm = FALSE) 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > library("utils") ## utils::str 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Local functions 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > psortKM_R <- function(x, k, m) { 805s + x <- sort(x) 805s + x[(k - m + 1):k] 805s + } 805s > 805s > psortKM_R2 <- function(x, k, m) { 805s + partial <- (k - m + 1):k 805s + x <- sort.int(x, partial = partial) 805s + x[partial] 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Consistency checks 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > set.seed(1) 805s > 805s > cat("Consistency checks:\n") 805s Consistency checks: 805s > x <- 1:30 805s > x[18:20] <- 20 805s > y <- sample(x) 805s > cat("x:\n") 805s x: 805s > str(x) 805s num [1:30] 1 2 3 4 5 6 7 8 9 10 ... 805s > cat("sample(x):\n") 805s sample(x): 805s > str(y) 805s num [1:30] 25 4 7 1 2 23 11 14 20 20 ... 805s > 805s > for (k in c(1L, 2L, 20L, 21L, length(x))) { 805s + for (m in 1:min(5L, k)) { 805s + px0 <- psortKM_R(x, k = k, m = m) 805s + px0b <- psortKM_R2(x, k = k, m = m) 805s + stopifnot(identical(px0b, px0)) 805s + px1 <- matrixStats:::.psortKM(x, k = k, m = m) 805s + cat(sprintf(".psortKM(x, k = %d, m = %d):\n", k, m)) 805s + print(px1) 805s + stopifnot(identical(px1, px0)) 805s + 805s + py0 <- psortKM_R(y, k = k, m = m) 805s + py0b <- psortKM_R2(y, k = k, m = m) 805s + stopifnot(identical(py0b, py0)) 805s + py1 <- matrixStats:::.psortKM(y, k = k, m = m) 805s + cat(sprintf(".psortKM(y, k = %d, m = %d):\n", k, m)) 805s + print(py1) 805s + stopifnot(identical(py1, py0)) 805s + stopifnot(identical(py1, px1)) 805s + } # for (m ...) 805s + } # for (k ...) 805s .psortKM(x, k = 1, m = 1): 805s [1] 1 805s .psortKM(y, k = 1, m = 1): 805s [1] 1 805s .psortKM(x, k = 2, m = 1): 805s [1] 2 805s .psortKM(y, k = 2, m = 1): 805s [1] 2 805s .psortKM(x, k = 2, m = 2): 805s [1] 1 2 805s .psortKM(y, k = 2, m = 2): 805s [1] 1 2 805s .psortKM(x, k = 20, m = 1): 805s [1] 20 805s .psortKM(y, k = 20, m = 1): 805s [1] 20 805s .psortKM(x, k = 20, m = 2): 805s [1] 20 20 805s .psortKM(y, k = 20, m = 2): 805s [1] 20 20 805s .psortKM(x, k = 20, m = 3): 805s [1] 20 20 20 805s .psortKM(y, k = 20, m = 3): 805s [1] 20 20 20 805s .psortKM(x, k = 20, m = 4): 805s [1] 17 20 20 20 805s .psortKM(y, k = 20, m = 4): 805s [1] 17 20 20 20 805s .psortKM(x, k = 20, m = 5): 805s [1] 16 17 20 20 20 805s .psortKM(y, k = 20, m = 5): 805s [1] 16 17 20 20 20 805s .psortKM(x, k = 21, m = 1): 805s [1] 21 805s .psortKM(y, k = 21, m = 1): 805s [1] 21 805s .psortKM(x, k = 21, m = 2): 805s [1] 20 21 805s .psortKM(y, k = 21, m = 2): 805s [1] 20 21 805s .psortKM(x, k = 21, m = 3): 805s [1] 20 20 21 805s .psortKM(y, k = 21, m = 3): 805s [1] 20 20 21 805s .psortKM(x, k = 21, m = 4): 805s [1] 20 20 20 21 805s .psortKM(y, k = 21, m = 4): 805s [1] 20 20 20 21 805s .psortKM(x, k = 21, m = 5): 805s [1] 17 20 20 20 21 805s .psortKM(y, k = 21, m = 5): 805s [1] 17 20 20 20 21 805s .psortKM(x, k = 30, m = 1): 805s [1] 30 805s .psortKM(y, k = 30, m = 1): 805s [1] 30 805s .psortKM(x, k = 30, m = 2): 805s [1] 29 30 805s .psortKM(y, k = 30, m = 2): 805s [1] 29 30 805s .psortKM(x, k = 30, m = 3): 805s [1] 28 29 30 805s .psortKM(y, k = 30, m = 3): 805s [1] 28 29 30 805s .psortKM(x, k = 30, m = 4): 805s [1] 27 28 29 30 805s .psortKM(y, k = 30, m = 4): 805s [1] 27 28 29 30 805s .psortKM(x, k = 30, m = 5): 805s [1] 26 27 28 29 30 805s .psortKM(y, k = 30, m = 5): 805s [1] 26 27 28 29 30 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 805s + if (is.na(value)) { 805s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 805s + } else { 805s + y <- x == value 805s + 805s + # Preserve dimnames attribute 805s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 805s + if (!isTRUE(all.equal(dim(y), dim))) { 805s + dim(y) <- dim 805s + dimnames(y) <- dimnames(x) 805s + } 805s + 805s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 805s + } 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 805s + if (is.na(value)) { 805s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 805s + } else { 805s + y <- x == value 805s + 805s + # Preserve dimnames attribute 805s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 805s + if (!isTRUE(all.equal(dim(y), dim))) { 805s + dim(y) <- dim 805s + dimnames(y) <- dimnames(x) 805s + } 805s + 805s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 805s + } 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 805s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: logical 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 805s > x[7:8, 2:3] <- TRUE 805s > x[1:3, ] <- TRUE 805s > x[, 1] <- TRUE 805s > x[4, ] <- FALSE 805s > x[, 4] <- FALSE 805s > x[2, ] <- FALSE 805s > x[3, ] <- TRUE 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:10], LETTERS[1:4]) 805s > 805s > for (kk in 1:3) { 805s + if (kk == 2) { 805s + x[2, 2] <- NA 805s + } else if (kk == 3) { 805s + x[, 2] <- NA 805s + x[2, ] <- NA 805s + } 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + dimnames(x) <- if (setDimnames) dimnames else NULL 805s + 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + m0 <- rowAlls_R(x, na.rm = na.rm, useNames = useNames) 805s + m1 <- rowAlls(x, na.rm = na.rm, useNames = useNames) 805s + m2 <- colAlls(t(x), na.rm = na.rm, useNames = useNames) 805s + str(list("all()", m0 = m0, m1 = m1, m2 = m2)) 805s + stopifnot(identical(m1, m0)) 805s + stopifnot(identical(m2, m0)) 805s + 805s + m0 <- rowAnys_R(x, na.rm = na.rm, useNames = useNames) 805s + m1 <- rowAnys(x, na.rm = na.rm, useNames = useNames) 805s + m2 <- colAnys(t(x), na.rm = na.rm, useNames = useNames) 805s + str(list("any()", m0 = m0, m1 = m1, m2 = m2)) 805s + stopifnot(identical(m1, m0)) 805s + stopifnot(identical(m2, m0)) 805s + 805s + m0 <- rowAnyMissings_R(x, useNames = useNames) 805s + m1 <- rowAnyMissings(x, useNames = useNames) 805s + m2 <- colAnyMissings(t(x), useNames = useNames) 805s + str(list("anyMissing()", m0 = m0, m1 = m1, m2 = m2)) 805s + stopifnot(identical(m1, m0)) 805s + stopifnot(identical(m2, m0)) 805s + } 805s + } 805s + } 805s + } # for (kk ...) 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "any()" 805s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s List of 4 805s $ : chr "all()" 805s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 805s List of 4 805s $ : chr "any()" 805s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 805s List of 4 805s $ : chr "anyMissing()" 805s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: integer 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(rep(1:6, length.out = 4 * 5), nrow = 4L, ncol = 5L) 805s > x[2, ] <- 7L 805s > x[3, 1] <- 7L 805s > x[2:3, 3:4] <- NA_integer_ 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:4], LETTERS[1:5]) 805s > 805s > # Row/column counts 805s > value <- 7L 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + dimnames(x) <- if (setDimnames) dimnames else NULL 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r1)) 805s + if (!is.na(useNames) && !useNames && !setDimnames) { 805s + for (rr in seq_len(nrow(x))) { 805s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[rr])) 805s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[rr])) 805s + } 805s + } 805s + 805s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r1)) 805s + if (!is.na(useNames) && !useNames && !setDimnames) { 805s + for (rr in seq_len(nrow(x))) { 805s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[rr])) 805s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[rr])) 805s + } 805s + } 805s + } 805s + } 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # rowAlls(x) et al. on numeric 'x' with logical 'value' 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(0, nrow = 4L, ncol = 5L) 805s > x[2:4, 2] <- (1:3) / 4 805s > x[2, 2:4] <- (1:3) / 4 805s > x[3:4, 3] <- (3:4) / 4 805s > x[3, 3:4] <- (3:4) / 4 805s > x[1:4, 5] <- (1:4) / 5 805s > x[4, 4] <- NA_real_ 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:4], LETTERS[1:5]) 805s > 805s > for (value in c(TRUE, FALSE)) { 805s + for (na.rm in c(FALSE, TRUE)) { 805s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 805s + y <- rowAnys(x, na.rm = na.rm, value = value) 805s + stopifnot(identical(y, y0)) 805s + # Check names attribute 805s + dimnames(x) <- dimnames 805s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 805s + stopifnot(all.equal(y, y0)) 805s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 805s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 805s + stopifnot(all.equal(y, y0)) 805s + dimnames(x) <- NULL 805s + 805s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 805s + y <- colAnys(x, na.rm = na.rm, value = value) 805s + stopifnot(identical(y, y0)) 805s + # Check names attribute 805s + dimnames(x) <- dimnames 805s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 805s + stopifnot(all.equal(y, y0)) 805s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 805s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 805s + stopifnot(all.equal(y, y0)) 805s + dimnames(x) <- NULL 805s + 805s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 805s + y <- rowAlls(x, na.rm = na.rm, value = value) 805s + stopifnot(identical(y, y0)) 805s + # Check names attribute 805s + dimnames(x) <- dimnames 805s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 805s + stopifnot(all.equal(y, y0)) 805s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 805s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 805s + stopifnot(all.equal(y, y0)) 805s + dimnames(x) <- NULL 805s + 805s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 805s + y <- colAlls(x, na.rm = na.rm, value = value) 805s + stopifnot(identical(y, y0)) 805s + print(y0) 805s + # Check names attribute 805s + dimnames(x) <- dimnames 805s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 805s + stopifnot(all.equal(y, y0)) 805s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 805s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 805s + stopifnot(all.equal(y, y0)) 805s + dimnames(x) <- NULL 805s + } ## for (na.rm ...) 805s + } ## for(value ...) 805s [1] FALSE FALSE FALSE FALSE TRUE 805s [1] FALSE FALSE FALSE FALSE TRUE 805s [1] TRUE FALSE FALSE FALSE FALSE 805s [1] TRUE FALSE FALSE FALSE FALSE 805s > 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: character (not sure if this should be supported) 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > all_R <- function(x, value = TRUE, ...) { 805s + if (is.na(value)) { 805s + all(is.na(x), ...) 805s + } else { 805s + all(x == value, ...) 805s + } 805s + } 805s > 805s > any_R <- function(x, value = TRUE, ...) { 805s + if (is.na(value)) { 805s + any(is.na(x), ...) 805s + } else { 805s + any(x == value, ...) 805s + } 805s + } 805s > 805s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 805s > x[2, ] <- "g" 805s > x[2:4, 3:4] <- NA_character_ 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:10], LETTERS[1:5]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + dimnames(x) <- if (setDimnames) dimnames else NULL 805s + 805s + # Row/column counts 805s + for (value in c("g", NA_character_)) { 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r1)) 805s + if (!is.na(useNames) && !useNames && !setDimnames) { 805s + for (rr in seq_len(nrow(x))) { 805s + c0 <- all_R(x[rr, ], value, na.rm = na.rm) 805s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[rr])) 805s + stopifnot(identical(c, c0)) 805s + } 805s + } 805s + 805s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r1)) 805s + if (!is.na(useNames) && !useNames && !setDimnames) { 805s + for (rr in seq_len(nrow(x))) { 805s + c0 <- any_R(x[rr, ], value, na.rm = na.rm) 805s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, c0)) 805s + stopifnot(identical(c, r1[rr])) 805s + } 805s + } 805s + } 805s + } 805s + } 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # NA 0 test 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(0, nrow = 3L, ncol = 3L) 805s > x[1, ] <- c(NA_real_, NA_real_, 0) 805s > x[3, ] <- c(1, 0, 1) 805s > 805s > dimnames <- list(letters[1:3], LETTERS[1:3]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + dimnames(x) <- if (setDimnames) dimnames else NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowAnys_R(x, value = 0, useNames = useNames) 805s + r1 <- rowAnys(x, value = 0, useNames = useNames) 805s + stopifnot(identical(r0, r1)) 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 805s + if (is.na(value)) { 805s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 805s + } else { 805s + y <- x == value 805s + 805s + # Preserve dimnames attribute 805s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 805s + if (!isTRUE(all.equal(dim(y), dim))) { 805s + dim(y) <- dim 805s + dimnames(y) <- dimnames(x) 805s + } 805s + 805s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 805s + } 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 805s + if (is.na(value)) { 805s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 805s + } else { 805s + y <- x == value 805s + 805s + # Preserve dimnames attribute 805s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 805s + if (!isTRUE(all.equal(dim(y), dim))) { 805s + dim(y) <- dim 805s + dimnames(y) <- dimnames(x) 805s + } 805s + 805s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 805s + } 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 805s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > 805s > all_R <- function(x, value = TRUE, ...) { 805s + if (is.na(value)) { 805s + all(is.na(x), ...) 805s + } else { 805s + all(x == value, ...) 805s + } 805s + } 805s > 805s > any_R <- function(x, value = TRUE, ...) { 805s + if (is.na(value)) { 805s + any(is.na(x), ...) 805s + } else { 805s + any(x == value, ...) 805s + } 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > x[2:3, ] <- NA_integer_ 805s > x[2, 1] <- 0L 805s > x[4:5, ] <- 0L 805s > x[4, 6] <- NA_integer_ 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + 805s + count <- 0L 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + count <- count + 1L 805s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 805s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 805s + useNames <- useNames[count %% length(useNames) + 1] 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = 0, na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = NA_integer_, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = 0, na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = NA_integer_, useNames = useNames) 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = 0, na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = NA_integer_, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = 0, na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = NA_integer_, useNames = useNames) 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnyMissings, 805s + fsure = rowAnyMissings_R, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnyMissings, 805s + fsure = rowAnyMissings_R, useNames = useNames) 805s + } 805s + } 805s + } 805s > 805s > for (rr in seq_len(nrow(x))) { 805s + for (idxs in index_cases) { 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = 0, na.rm = TRUE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = 0, na.rm = FALSE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = NA_integer_) 805s + 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = 0, na.rm = TRUE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = 0, na.rm = FALSE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = NA_integer_) 805s + } 805s + } 805s > 805s > 805s > storage.mode(x) <- "character" 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = "0", na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = "0", na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAlls, fsure = rowAlls_R, 805s + value = NA_character_, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = "0", na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = "0", na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAlls, fsure = rowAlls_R, 805s + value = NA_character_, useNames = useNames) 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = "0", na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = "0", na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnys, fsure = rowAnys_R, 805s + value = NA_character_, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = "0", na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = "0", na.rm = FALSE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnys, fsure = rowAnys_R, 805s + value = NA_character_, useNames = useNames) 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowAnyMissings, 805s + fsure = rowAnyMissings_R, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colAnyMissings, 805s + fsure = rowAnyMissings_R, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s > 805s > for (rr in seq_len(nrow(x))) { 805s + for (idxs in index_cases) { 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = "0", na.rm = TRUE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = "0", na.rm = FALSE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = allValue, fsure = all_R, 805s + value = NA_integer_) 805s + 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = "0", na.rm = TRUE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = "0", na.rm = FALSE) 805s + validateIndicesTestVector(x[rr, ], idxs, 805s + ftest = anyValue, fsure = any_R, 805s + value = NA_integer_) 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > X <- matrix(rnorm(20 * 6), nrow = 20, ncol = 6) 805s > rownames(X) <- LETTERS[1:nrow(X)] 805s > colnames(X) <- letters[1:ncol(X)] 805s > print(X) 805s a b c d e f 805s A 0.14013478 0.33492055 -0.291960316 0.05717203 -0.3418511 0.237871307 805s B 1.01896911 0.14246766 -0.048067831 -0.03393365 -1.4662164 1.528678273 805s C 1.56371251 -1.18270874 0.061638280 -1.07881058 1.9324970 -0.265573809 805s D 0.72537646 0.20341204 -0.320840815 -0.39043873 0.2257342 -1.391669415 805s E 0.54063739 -0.23915762 -0.878365122 0.53326474 1.6683168 0.168840036 805s F -0.16181699 -0.15566508 -0.266742121 -1.74362999 -0.3063641 1.195278972 805s G -0.47347628 -0.31455097 -0.404960063 0.33950890 1.6492282 0.896416571 805s H 0.37521884 0.14037707 0.391115749 0.21018197 -1.3635334 0.063806993 805s I -0.80182781 -0.07845566 -1.000095079 -2.07019729 1.1473585 2.686397765 805s J 0.96355448 1.18164075 1.286699698 -0.76761079 -0.4782866 -0.636298991 805s K 0.27764083 0.67184455 0.390435143 -0.36197584 -1.4738608 0.337598575 805s L 0.55634462 -0.37188868 -0.691194084 1.07568989 0.6075146 0.008855336 805s M 1.68943220 0.51881317 0.358858457 -0.08630505 -1.4379988 -2.157305837 805s N 0.04414038 -1.13341207 0.832464462 -0.32394666 -1.1000598 1.166528730 805s O -1.02713262 0.05264954 -0.294591644 -0.42324579 -0.8816536 0.158268632 805s P 0.15123697 1.73840286 0.979448780 0.19202100 -0.0617299 0.809602089 805s Q -0.37531026 0.70511509 0.669652544 -0.31023219 -0.5553977 -0.220608163 805s R 0.77470983 0.80767541 0.738688268 0.34601959 1.4653818 0.647767831 805s S 0.37850861 -0.05049404 -0.459150914 0.33211208 0.6848781 -0.345974182 805s T 1.23148379 -0.43422568 0.003042522 0.31419653 0.1489967 0.641855293 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Apply rowMeans() for 3 sets of 2 columns 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > nbr_of_sets <- 3L 805s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 805s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 805s > print(S) 805s s1 s2 s3 805s [1,] 1 3 5 805s [2,] 2 4 6 805s > 805s > Z <- rowAvgsPerColSet(X, S = S) 805s > print(Z) 805s s1 s2 s3 805s A 0.23752766 -0.11739414 -0.05198990 805s B 0.58071839 -0.04100074 0.03123092 805s C 0.19050189 -0.50858615 0.83346158 805s D 0.46439425 -0.35563977 -0.58296761 805s E 0.15073989 -0.17255019 0.91857842 805s F -0.15874104 -1.00518605 0.44445744 805s G -0.39401363 -0.03272558 1.27282236 805s H 0.25779795 0.30064886 -0.64986319 805s I -0.44014174 -1.53514618 1.91687814 805s J 1.07259762 0.25954445 -0.55729281 805s K 0.47474269 0.01422965 -0.56813113 805s L 0.09222797 0.19224790 0.30818498 805s M 1.10412269 0.13627670 -1.79765230 805s N -0.54463584 0.25425890 0.03323444 805s O -0.48724154 -0.35891872 -0.36169250 805s P 0.94481991 0.58573489 0.37393609 805s Q 0.16490242 0.17971017 -0.38800291 805s R 0.79119262 0.54235393 1.05657483 805s S 0.16400729 -0.06351942 0.16945196 805s T 0.39862906 0.15861953 0.39542599 805s > 805s > # Validation 805s > Z0 <- cbind(s1 = rowMeans(X[, 1:2]), s2 = rowMeans(X[, 3:4]), 805s + s3 = rowMeans(X[, 5:6])) 805s > stopifnot(identical(drop(Z), Z0)) 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Apply colMeans() for 5 sets of 4 rows 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > nbr_of_sets <- 5L 805s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 805s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 805s > print(S) 805s s1 s2 s3 s4 s5 805s [1,] 1 5 9 13 17 805s [2,] 2 6 10 14 18 805s [3,] 3 7 11 15 19 805s [4,] 4 8 12 16 20 805s > 805s > Z <- colAvgsPerRowSet(X, S = S) 805s > print(Z) 805s a b c d e f 805s s1 0.86204822 -0.1254771 -0.14980767 -0.3615027 0.08754091 0.027326589 805s s2 0.07014074 -0.1422491 -0.28973789 -0.1651686 0.41191188 0.581085643 805s s3 0.24892803 0.3507852 -0.00353858 -0.5310235 -0.04931858 0.599138171 805s s4 0.21441923 0.2941134 0.46904501 -0.1603691 -0.87036053 -0.005726596 805s s5 0.50234800 0.2570177 0.23805810 0.1705240 0.43596474 0.180760195 805s > 805s > # Validation 805s > Z0 <- rbind(s1 = colMeans(X[1:4, ]), s2 = colMeans(X[5:8, ]), 805s + s3 = colMeans(X[9:12, ]), s4 = colMeans(X[13:16, ]), 805s + s5 = colMeans(X[17:20, ])) 805s > stopifnot(identical(drop(Z), Z0)) 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # When there is only one "complete" set 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > nbr_of_sets <- 1L 805s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 805s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 805s > print(S) 805s s1 805s [1,] 1 805s [2,] 2 805s [3,] 3 805s [4,] 4 805s [5,] 5 805s [6,] 6 805s > 805s > Z <- rowAvgsPerColSet(X, S = S, FUN = rowMeans) 805s > print(Z) 805s s1 805s A 0.02271454 805s B 0.19031619 805s C 0.17179244 805s D -0.15807104 805s E 0.29892271 805s F -0.23982322 805s G 0.28202772 805s H -0.03047213 805s I -0.01946993 805s J 0.25828309 805s K -0.02638626 805s L 0.19755361 805s M -0.18575097 805s N -0.08571417 805s O -0.40261758 805s P 0.63483030 805s Q -0.01446344 805s R 0.79670713 805s S 0.08997994 805s T 0.31755819 805s > 805s > Z0 <- rowMeans(X) 805s > stopifnot(identical(drop(Z), Z0)) 805s > 805s > 805s > nbr_of_sets <- 1L 805s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 805s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 805s > print(S) 805s s1 805s [1,] 1 805s [2,] 2 805s [3,] 3 805s [4,] 4 805s [5,] 5 805s [6,] 6 805s [7,] 7 805s [8,] 8 805s [9,] 9 805s [10,] 10 805s [11,] 11 805s [12,] 12 805s [13,] 13 805s [14,] 14 805s [15,] 15 805s [16,] 16 805s [17,] 17 805s [18,] 18 805s [19,] 19 805s [20,] 20 805s > 805s > Z <- colAvgsPerRowSet(X, S = S, FUN = colMeans) 805s > print(Z) 805s a b c d e f 805s s1 0.3795768 0.126838 0.0528038 -0.209508 0.003147682 0.2765168 805s > 805s > Z0 <- colMeans(X) 805s > stopifnot(identical(drop(Z), Z0)) 805s > 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Use weights 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > nbr_of_sets <- 3L 805s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 805s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 805s > print(S) 805s s1 s2 s3 805s [1,] 1 3 5 805s [2,] 2 4 6 805s > 805s > W <- matrix(runif(length(X)), nrow = nrow(X), ncol = ncol(X)) 805s > Z1 <- rowAvgsPerColSet(X, W = W, S = S, FUN = rowWeightedMeans) 805s > print(Z1) 805s s1 s2 s3 805s A 0.23752766 -0.11739414 -0.05198990 805s B 0.58071839 -0.04100074 0.03123092 805s C 0.19050189 -0.50858615 0.83346158 805s D 0.46439425 -0.35563977 -0.58296761 805s E 0.15073989 -0.17255019 0.91857842 805s F -0.15874104 -1.00518605 0.44445744 805s G -0.39401363 -0.03272558 1.27282236 805s H 0.25779795 0.30064886 -0.64986319 805s I -0.44014174 -1.53514618 1.91687814 805s J 1.07259762 0.25954445 -0.55729281 805s K 0.47474269 0.01422965 -0.56813113 805s L 0.09222797 0.19224790 0.30818498 805s M 1.10412269 0.13627670 -1.79765230 805s N -0.54463584 0.25425890 0.03323444 805s O -0.48724154 -0.35891872 -0.36169250 805s P 0.94481991 0.58573489 0.37393609 805s Q 0.16490242 0.17971017 -0.38800291 805s R 0.79119262 0.54235393 1.05657483 805s S 0.16400729 -0.06351942 0.16945196 805s T 0.39862906 0.15861953 0.39542599 805s > Z2 <- colAvgsPerRowSet(X, W = W, S = S, FUN = colWeightedMeans) 805s > print(Z2) 805s a b c d e f 805s s1 0.5795519 0.2386941 -0.1700141 0.01161919 -0.9040338 0.8832748 805s s2 1.1445445 -0.4896484 -0.1296013 -0.73462465 1.0791156 -0.8286216 805s s3 0.1894102 -0.1974113 -0.5725536 -0.60518263 0.6809764 0.6820595 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Result should always be a matrix, including when nrow(X) <= 1 805s > # (https://github.com/HenrikBengtsson/matrixStats/issues/108) 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > X <- matrix(1:3, nrow = 1L, ncol = 3L) 805s > S <- matrix(1, nrow = 1L, ncol = 1L) 805s > Z1 <- rowAvgsPerColSet(X, S = S) 805s > stopifnot(is.matrix(Z1)) 805s > Z2 <- rowAvgsPerColSet(X, S = S, rows = 0) 805s > stopifnot(is.matrix(Z2)) 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Works with many, one or zero columns / rows 805s > # (https://github.com/HenrikBengtsson/matrixStats/issues/172) 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > S <- cbind(1:2, 3:4, 5:6) 805s > X <- matrix(rnorm(2 * 6), nrow = 6, ncol = 2) 805s > Z2 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 805s > Z2_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 805s + colSums2(X[S[,2], ,drop=FALSE]), 805s + colSums2(X[S[,3], ,drop=FALSE])) 805s > stopifnot(identical(Z2, Z2_ref)) 805s > X <- matrix(rnorm(6), nrow = 6, ncol = 1) 805s > Z1 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 805s > Z1_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 805s + colSums2(X[S[,2], ,drop=FALSE]), 805s + colSums2(X[S[,3], ,drop=FALSE])) 805s > stopifnot(identical(Z1, Z1_ref)) 805s > X <- matrix(numeric(0), nrow = 6, ncol = 0) 805s > Z0 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 805s > Z0_ref <- matrix(numeric(0), nrow = ncol(S), ncol = 0) 805s > stopifnot(identical(Z0, unname(Z0_ref))) 805s > 805s > 805s > S <- rbind(1:4, 5:8) 805s > X <- matrix(rnorm(n = 2 * 8), nrow = 2, ncol = 8) 805s > Z2 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 805s > Z2_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 805s + rowMeans2(X[,S[,2],drop=FALSE]), 805s + rowMeans2(X[,S[,3],drop=FALSE]), 805s + rowMeans2(X[,S[,4],drop=FALSE])) 805s > stopifnot(identical(Z2, Z2_ref)) 805s > X <- matrix(rnorm(n = 8), nrow = 1, ncol = 8) 805s > Z1 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 805s > Z1_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 805s + rowMeans2(X[,S[,2],drop=FALSE]), 805s + rowMeans2(X[,S[,3],drop=FALSE]), 805s + rowMeans2(X[,S[,4],drop=FALSE])) 805s > stopifnot(identical(Z1, Z1_ref)) 805s > X <- matrix(numeric(0), nrow = 0, ncol = 8) 805s > Z0 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 805s > Z0_ref <- matrix(numeric(0), nrow = 0, ncol = ncol(S)) 805s > stopifnot(identical(Z0, Z0_ref)) 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 805s > #W <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 805s > for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + if (is.null(rows)) { 805s + rows <- seq_len(nrow(x)) 805s + rows_finite <- rows 805s + } else { 805s + rows_finite <- rows[is.finite(rows)] 805s + } 805s + 805s + if (is.null(cols)) { 805s + cols <- seq_len(ncol(x)) 805s + cols_finite <- cols 805s + } else { 805s + cols_finite <- cols[is.finite(cols)] 805s + } 805s + 805s + suppressWarnings({ 805s + actual <- tryCatch({ 805s + rowAvgsPerColSet(x, rows = rows, S = matrix(cols, ncol = 1), 805s + FUN = rowMeans) 805s + }, error = function(c) "error") 805s + expect <- tryCatch({ 805s + rowMeans(x[rows, cols_finite, drop = FALSE], na.rm = TRUE) 805s + }, error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(as.vector(actual), expect)) 805s + 805s + suppressWarnings({ 805s + actual <- tryCatch({ 805s + colAvgsPerRowSet(x, cols = cols, S = matrix(rows, ncol = 1), 805s + FUN = colMeans) 805s + }, error = function(c) "error") 805s + expect <- tryCatch({ 805s + colMeans(x[rows_finite, cols, drop = FALSE], na.rm = TRUE) 805s + }, error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(as.vector(actual), expect)) 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > x <- matrix(1:27, ncol = 3) 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:9], LETTERS[1:3]) 805s > 805s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 805s + res <- x[, idxs] 805s + # Preserve names attribute? 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > idxs <- 1L 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 805s + y <- rowCollapse(x, idxs, useNames = useNames) 805s + stopifnot(identical(y, y_truth)) 805s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 805s + stopifnot(identical(y2, y)) 805s + } 805s + } 805s > 805s > idxs <- 2L 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 805s + y <- rowCollapse(x, idxs, useNames = useNames) 805s + stopifnot(identical(y, y_truth)) 805s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 805s + stopifnot(identical(y2, y)) 805s + } 805s + } 805s > 805s > 805s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 805s + res <- c(x[1:5, 1], x[6:9, 3]) 805s + # Preserve names attribute? 805s + if (is.na(useNames) || !useNames) names(res) <- NULL 805s + res 805s + } 805s > 805s > idxs <- c(1, 1, 1, 1, 1, 3, 3, 3, 3) 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 805s + y <- rowCollapse(x, idxs, useNames = useNames) 805s + stopifnot(identical(y, y_truth)) 805s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 805s + stopifnot(identical(y2, y)) 805s + } 805s + } 805s > 805s > 805s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 805s + res <- c(x[1, 1], x[2, 2], x[3, 3], x[4, 1], x[5, 2], 805s + x[6, 3], x[7, 1], x[8, 2], x[9, 3]) 805s + # Preserve names attribute? 805s + if (isTRUE(useNames)) { 805s + names <- rownames(x) 805s + if (!is.null(names)) names(res) <- names 805s + } 805s + res 805s + } 805s > 805s > idxs <- 1:3 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 805s + y <- rowCollapse(x, idxs, useNames = useNames) 805s + stopifnot(identical(y, y_truth)) 805s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 805s + stopifnot(identical(y2, y)) 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 805s + ans <- c() 805s + storage.mode(ans) <- storage.mode(x) 805s + for (ii in seq_len(length(idxs))) { 805s + ans[ii] <- x[ii, idxs[ii]] 805s + } 805s + 805s + # Preserve names attribute 805s + if (isTRUE(useNames)) { 805s + names <- rownames(x) 805s + if (!is.null(names)) names(ans) <- names 805s + } 805s + 805s + ans 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > for (rows in index_cases) { 805s + if (is.null(rows)) rows <- seq_len(nrow(x)) 805s + 805s + for (idxs in list(2L, seq_len(6L))) { 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + suppressWarnings({ 805s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 805s + error = function(c) "error") 805s + expect <- tryCatch({ 805s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 805s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 805s + }, error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(actual, expect)) 805s + 805s + suppressWarnings({ 805s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 805s + error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(actual, expect)) 805s + 805s + # Check names attribute 805s + dimnames(x) <- dimnames 805s + suppressWarnings({ 805s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 805s + error = function(c) "error") 805s + expect <- tryCatch({ 805s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 805s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 805s + }, error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(actual, expect)) 805s + 805s + suppressWarnings({ 805s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 805s + error = function(c) "error") 805s + }) 805s + stopifnot(all.equal(actual, expect)) 805s + 805s + dimnames(x) <- NULL 805s + } 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 805s + if (is.na(value)) { 805s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 805s + sum(is.na(x)) 805s + ) 805s + } else { 805s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 805s + sum(x == value, na.rm = na.rm) 805s + ) 805s + } 805s + # Preserve names attribute 805s + names <- names(counts) 805s + counts <- as.integer(counts) 805s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 805s + counts 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: integer and numeric 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("integer", "double")) { 805s + x <- matrix(runif(10 * 5, min = -3, max = 3), nrow = 10L, ncol = 5L) 805s + x[sample.int(length(x), size = 7L)] <- 0 805s + storage.mode(x) <- mode 805s + 805s + dimnames = list(letters[1:10], LETTERS[1:5]) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Count zeros 805s + r0 <- rowCounts_R(x, value = 0, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, value = 0, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), value = 0, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + 805s + # Count NAs 805s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + 805s + if (mode == "integer") { 805s + ux <- unique(as.vector(x)) 805s + r0 <- r1 <- r2 <- integer(nrow(x)) 805s + for (value in ux) { 805s + r0 <- r0 + rowCounts_R(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r1 <- r1 + rowCounts(x, value = value, na.rm = na.rm, useNames = useNames) 805s + r2 <- r2 + colCounts(t(x), value = value, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + } 805s + stopifnot(all(r0 == ncol(x))) 805s + } # if (mode == "integer") 805s + } # for (useNames ...) 805s + } # for (na.rm ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s > 805s > 805s > # All NAs 805s > na_list <- list(NA_integer_, NA_real_, NaN) 805s > for (na_value in na_list) { 805s + x <- matrix(na_value, nrow = 10L, ncol = 5L) 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + 805s + # Count NAs 805s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 805s + stopifnot(all(r0 == ncol(x))) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + } 805s + } 805s + } 805s + } # for (na_value ...) 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: logical 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 805s > x[7:8, 2:3] <- TRUE 805s > x[1:3, ] <- TRUE 805s > x[, 1] <- TRUE 805s > x[4, ] <- FALSE 805s > x[, 4] <- FALSE 805s > x[2, ] <- FALSE 805s > x[3, ] <- TRUE 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:10], LETTERS[1:4]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Row/column counts 805s + for (na.rm in c(FALSE, TRUE)) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + 805s + r_true <- rowCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 805s + r_false <- rowCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 805s + stopifnot(r_true + r_false == ncol(x)) 805s + 805s + c_true <- colCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 805s + c_false <- colCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 805s + stopifnot(c_true + c_false == nrow(x)) 805s + 805s + # Count NAs 805s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 805s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + } 805s + } 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Data type: character (not sure if this should be supported) 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 805s > x[2:3, 3:4] <- NA_character_ 805s > 805s > # Row/column counts 805s > for (na.rm in c(FALSE, TRUE)) { 805s + for (value in c("g", NA_character_)) { 805s + r0 <- rowCounts_R(x, value = value, na.rm = na.rm) 805s + r1 <- rowCounts(x, value = value, na.rm = na.rm) 805s + r2 <- colCounts(t(x), value = value, na.rm = na.rm) 805s + stopifnot(identical(r1, r0)) 805s + stopifnot(identical(r2, r0)) 805s + 805s + c <- count(x[1, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[1])) 805s + 805s + c <- count(x[2, ], value = value, na.rm = na.rm) 805s + stopifnot(identical(c, r1[2])) 805s + } 805s + } 805s > 805s > # NA row 805s > x <- matrix(0, nrow = 2L, ncol = 2L) 805s > x[1, ] <- NA_integer_ 805s > 805s > dimnames <- list(letters[1:2], LETTERS[1:2]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCounts(x, value = 0, useNames = useNames) 805s + r1 <- rowCounts_R(x, value = 0, useNames = useNames) 805s + stopifnot(identical(r0, r1)) 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 805s + if (is.na(value)) { 805s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 805s + sum(is.na(x)) 805s + ) 805s + } else { 805s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 805s + sum(x == value, na.rm = na.rm) 805s + ) 805s + } 805s + # Preserve names attribute 805s + names <- names(counts) 805s + counts <- as.integer(counts) 805s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 805s + counts 805s + } # rowCounts_R() 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 805s > x[2:3, 3:4] <- NA_real_ 805s > storage.mode(x) <- "integer" 805s > 805s > # To check names attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCounts, fsure = rowCounts_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colCounts, fsure = rowCounts_R, 805s + value = 0, na.rm = TRUE, useNames = useNames) 805s + for (value in c(0, NA_integer_)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCounts, fsure = rowCounts_R, 805s + value = value, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colCounts, fsure = rowCounts_R, 805s + value = value, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s + } 805s > 805s > x <- matrix(rep(letters, length.out = 6 * 6), nrow = 6, ncol = 6) 805s > x[2:3, 3:4] <- NA_character_ 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + 805s + count <- 0L 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + count <- count + 1L 805s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 805s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 805s + useNames <- useNames[count %% length(useNames) + 1] 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCounts, fsure = rowCounts_R, 805s + value = "g", na.rm = TRUE, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colCounts, fsure = rowCounts_R, 805s + value = "g", na.rm = TRUE, useNames = useNames) 805s + for (value in c("g", NA_character_)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCounts, fsure = rowCounts_R, 805s + value = value, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + fcoltest = colCounts, fsure = rowCounts_R, 805s + value = value, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCummins_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + y 805s + } 805s > 805s > rowCummaxs_R <- function(x, ..., useNames = NA) { 805s + mode <- storage.mode(x) 805s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 805s + storage.mode(x) <- "numeric" 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # With and without some NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + for (add_na in c(FALSE, TRUE)) { 805s + cat("add_na = ", add_na, "\n", sep = "") 805s + 805s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 805s + diag(x) <- 0 805s + if (add_na) { 805s + x[3:7, c(2, 4)] <- NA_real_ 805s + } 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # To check dimnames attribute 805s + dimnames <- list(letters[1:10], LETTERS[1:5]) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCummins_R(x, useNames = useNames) 805s + r1 <- rowCummins(x, useNames = useNames) 805s + r2 <- t(colCummins(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + r0 <- rowCummaxs_R(x, useNames = useNames) 805s + r1 <- rowCummaxs(x, useNames = useNames) 805s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (add_na ...) 805s + } # for (mode ...) 805s add_na = FALSE 805s mode: logical 805s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = TRUE 805s mode: logical 805s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = FALSE 805s mode: integer 805s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: integer 805s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 805s add_na = FALSE 805s mode: double 805s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: double 805s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # All NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCummins_R(x, useNames = useNames) 805s + r1 <- rowCummins(x, useNames = useNames) 805s + r2 <- t(colCummins(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + r0 <- rowCummaxs_R(x, useNames = useNames) 805s + r1 <- rowCummaxs(x, useNames = useNames) 805s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi [1:10, 1:5] NA NA NA NA NA NA ... 805s mode: integer 805s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s mode: double 805s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # A 1x1 matrix 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(0, nrow = 1L, ncol = 1L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # To check dimnames attribute 805s + dimnames <- list("a", "A") 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCummins_R(x, useNames = useNames) 805s + r1 <- rowCummins(x, useNames = useNames) 805s + r2 <- t(colCummins(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + r0 <- rowCummaxs_R(x, useNames = useNames) 805s + r1 <- rowCummaxs(x, useNames = useNames) 805s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi [1, 1] FALSE 805s mode: integer 805s int [1, 1] 0 805s mode: double 805s num [1, 1] 0 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Corner cases 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + value <- 0 805s + storage.mode(value) <- mode 805s + value0 <- if (mode == "logical") 0L else value 805s + 805s + # A 0x0 matrix 805s + x <- matrix(value, nrow = 0L, ncol = 0L) 805s + str(x) 805s + r0 <- matrix(value0, nrow = nrow(x), ncol = ncol(x)) 805s + r1 <- rowCummins(x) 805s + r2 <- t(colCummins(t(x))) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + # A 0xK matrix 805s + x <- matrix(value, nrow = 0L, ncol = 5L) 805s + str(x) 805s + colnames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) colnames(x) <- colnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCummins_R(x, useNames = useNames) 805s + r1 <- rowCummins(x, useNames = useNames) 805s + r2 <- t(colCummins(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + r0 <- rowCummaxs_R(x, useNames = useNames) 805s + r1 <- rowCummaxs(x, useNames = useNames) 805s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + 805s + # A Nx0 matrix 805s + x <- matrix(value, nrow = 5L, ncol = 0L) 805s + str(x) 805s + rownames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) rownames(x) <- rownames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCummins_R(x, useNames = useNames) 805s + r1 <- rowCummins(x, useNames = useNames) 805s + r2 <- t(colCummins(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + r0 <- rowCummaxs_R(x, useNames = useNames) 805s + r1 <- rowCummaxs(x, useNames = useNames) 805s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi[0 , 0 ] 805s logi[0 , 1:5] 805s logi[1:5, 0 ] 805s mode: integer 805s int[0 , 0 ] 805s int[0 , 1:5] 805s int[1:5, 0 ] 805s mode: double 805s num[0 , 0 ] 805s num[0 , 1:5] 805s num[1:5, 0 ] 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCummins_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > rowCummaxs_R <- function(x, ..., useNames = NA) { 805s + mode <- storage.mode(x) 805s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 805s + storage.mode(x) <- "numeric" 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + storage.mode(y) <- mode 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > 805s > # To check dimnames attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCummins, fsure = rowCummins_R, useNames = useNames,verbose=TRUE) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = function(x, rows, cols, ..., useNames) { 805s + t(colCummins(t(x), rows = cols, cols = rows, useNames = useNames)) 805s + }, fsure = rowCummins_R, useNames = useNames) 805s + 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCummaxs, fsure = rowCummaxs_R, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = function(x, rows, cols, ..., useNames) { 805s + t(colCummaxs(t(x), rows = cols, cols = rows, useNames = useNames)) 805s + }, fsure = rowCummaxs_R, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCumprods_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # With and without some NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + for (add_na in c(FALSE, TRUE)) { 805s + cat("add_na = ", add_na, "\n", sep = "") 805s + 805s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 805s + if (add_na) { 805s + x[3:7, c(2, 4)] <- NA_real_ 805s + } 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # To check dimnames attribute 805s + dimnames <- list(letters[1:10], LETTERS[1:5]) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(colCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (add_na ...) 805s + } # for (mode ...) 805s add_na = FALSE 805s mode: logical 805s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = TRUE 805s mode: logical 805s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = FALSE 805s mode: integer 805s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: integer 805s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = FALSE 805s mode: double 805s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: double 805s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # All NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(colCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi [1:10, 1:5] NA NA NA NA NA NA ... 805s mode: integer 805s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s mode: double 805s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # A 1x1 matrix 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(0, nrow = 1L, ncol = 1L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + dimnames <- list("a", "A") 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(colCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } 805s mode: logical 805s logi [1, 1] FALSE 805s mode: integer 805s int [1, 1] 0 805s mode: double 805s num [1, 1] 0 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # BUG FIX TEST: Assert zeros don't trump NAs in integer matrices 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(NA_real_, nrow = 3L, ncol = 2L) 805s + x[1, 2] <- 0 805s + x[2, 2] <- 1 805s + x[3, 1] <- 0 805s + storage.mode(x) <- mode 805s + cat("mode: ", mode, "\n", sep = "") 805s + str(x) 805s + 805s + dimnames <- list(letters[1:3], LETTERS[1:2]) 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(colCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } 805s mode: logical 805s logi [1:3, 1:2] NA NA FALSE FALSE TRUE NA 805s mode: integer 805s int [1:3, 1:2] NA NA 0 0 1 NA 805s mode: double 805s num [1:3, 1:2] NA NA 0 0 1 NA 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Corner cases 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + value <- 0 805s + storage.mode(value) <- mode 805s + if (mode == "logical") value2 <- 0L 805s + 805s + # A 0x0 matrix 805s + x <- matrix(value, nrow = 0L, ncol = 0L) 805s + str(x) 805s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 805s + r1 <- rowCumprods(x) 805s + r2 <- t(colCumprods(t(x))) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + # A 0xK matrix 805s + x <- matrix(value, nrow = 0L, ncol = 5L) 805s + str(x) 805s + colnames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) colnames(x) <- colnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + 805s + # A Nx0 matrix 805s + x <- matrix(value, nrow = 5L, ncol = 0L) 805s + str(x) 805s + rownames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) rownames(x) <- rownames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCumprods_R(x, useNames = useNames) 805s + r1 <- rowCumprods(x, useNames = useNames) 805s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi[0 , 0 ] 805s logi[0 , 1:5] 805s logi[1:5, 0 ] 805s mode: integer 805s int[0 , 0 ] 805s int[0 , 1:5] 805s int[1:5, 0 ] 805s mode: double 805s num[0 , 0 ] 805s num[0 , 1:5] 805s num[1:5, 0 ] 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCumprods_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > 805s > # To check dimnames attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCumprods, fsure = rowCumprods_R, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = function(x, rows, cols, ..., useNames) { 805s + t(colCumprods(t(x), rows = cols, cols = rows, useNames = useNames)) 805s + }, fsure = rowCumprods_R, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCumsums_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # With and without some NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > dimnames <- list(letters[1:10], LETTERS[1:5]) # to check dimnames attribute 805s > for (mode in c("logical", "integer", "double")) { 805s + for (add_na in c(FALSE, TRUE)) { 805s + cat("add_na = ", add_na, "\n", sep = "") 805s + 805s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 805s + if (add_na) { 805s + x[3:7, c(2, 4)] <- NA_real_ 805s + } 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumsums_R(x, useNames = useNames) 805s + r1 <- rowCumsums(x, useNames = useNames) 805s + r2 <- t(colCumsums(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (add_na ...) 805s + } 805s add_na = FALSE 805s mode: logical 805s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = TRUE 805s mode: logical 805s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 805s add_na = FALSE 805s mode: integer 805s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: integer 805s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = FALSE 805s mode: double 805s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s add_na = TRUE 805s mode: double 805s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # All NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + # Row/column ranges 805s + r0 <- rowCumsums_R(x, useNames = useNames) 805s + r1 <- rowCumsums(x, useNames = useNames) 805s + r2 <- t(colCumsums(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi [1:10, 1:5] NA NA NA NA NA NA ... 805s mode: integer 805s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s mode: double 805s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # A 1x1 matrix 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > dimnames <- list("a", "A") # to check dimnames attribute 805s > for (mode in c("logical", "integer", "double")) { 805s + x <- matrix(0, nrow = 1L, ncol = 1L) 805s + cat("mode: ", mode, "\n", sep = "") 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + r0 <- rowCumsums_R(x) 805s + r1 <- rowCumsums(x) 805s + r2 <- t(colCumsums(t(x))) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + # Check dimnames attribute 805s + dimnames(x) <- dimnames 805s + # r0 <- rowCumsums_R(x) 805s + # > r0 805s + # a 805s + # [1,] 0 805s + r1 <- rowCumsums(x, useNames = TRUE) 805s + r2 <- t(colCumsums(t(x), useNames = TRUE)) 805s + stopifnot(identical(dimnames(r1), dimnames)) 805s + stopifnot(identical(dimnames(r2), dimnames)) 805s + dimnames(x) <- NULL 805s + } 805s mode: logical 805s logi [1, 1] FALSE 805s mode: integer 805s int [1, 1] 0 805s mode: double 805s num [1, 1] 0 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Corner cases 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > names <- LETTERS[1:5] # to check dimnames attribute 805s > for (mode in c("logical", "integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + value <- 0 805s + storage.mode(value) <- mode 805s + value2 <- value 805s + if (mode == "logical") value2 <- 0L 805s + 805s + # A 0x0 matrix 805s + x <- matrix(value, nrow = 0L, ncol = 0L) 805s + str(x) 805s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 805s + r1 <- rowCumsums(x) 805s + r2 <- t(colCumsums(t(x))) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + 805s + # A 0xK matrix 805s + x <- matrix(value, nrow = 0L, ncol = 5L) 805s + str(x) 805s + colnames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) colnames(x) <- colnames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCumsums_R(x, useNames = useNames) 805s + r1 <- rowCumsums(x, useNames = useNames) 805s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + 805s + # A Nx0 matrix 805s + x <- matrix(value, nrow = 5L, ncol = 0L) 805s + str(x) 805s + rownames <- LETTERS[1:5] 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) rownames(x) <- rownames 805s + else dimnames(x) <- NULL 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowCumsums_R(x, useNames = useNames) 805s + r1 <- rowCumsums(x, useNames = useNames) 805s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r2)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: logical 805s logi[0 , 0 ] 805s logi[0 , 1:5] 805s logi[1:5, 0 ] 805s mode: integer 805s int[0 , 0 ] 805s int[0 , 1:5] 805s int[1:5, 0 ] 805s mode: double 805s num[0 , 0 ] 805s num[0 , 1:5] 805s num[1:5, 0 ] 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowCumsums_R <- function(x, ..., useNames = NA) { 805s + suppressWarnings({ 805s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 805s + }) 805s + 805s + # Preserve dimnames attribute? 805s + dim(y) <- dim(x) 805s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > 805s > # To check dimnames attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + # Check names attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowCumsums, fsure = rowCumsums_R, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = function(x, rows, cols, ..., useNames) { 805s + t(colCumsums(t(x), rows = cols, cols = rows, useNames = useNames)) 805s + }, fsure = rowCumsums_R, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 805s + ncol2 <- ncol(x) - lag * differences 805s + if (ncol2 <= 0) { 805s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 805s + # Preserve names attribute 805s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 805s + return(y) 805s + } 805s + suppressWarnings({ 805s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 805s + }) 805s + y <- t(y) 805s + 805s + # Preserve dimnames attribute 805s + dim(y) <- c(nrow(x), ncol2) 805s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 805s + colnames <- colnames(x) 805s + if (!is.null(colnames)) { 805s + len <- length(colnames) 805s + colnames <- colnames[(len - ncol2 + 1):len] 805s + } 805s + dimnames(y) <- list(rownames(x), colnames) 805s + } 805s + else dimnames(y) <- NULL 805s + 805s + y 805s + } 805s > 805s > 805s > set.seed(0x42) 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # With and without some NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + 805s + for (add_na in c(FALSE, TRUE)) { 805s + cat("add_na = ", add_na, "\n", sep = "") 805s + 805s + x <- matrix(sample(10 * 8) + 0.1, nrow = 10L, ncol = 8L) 805s + if (add_na) { 805s + x[3:7, c(2, 4)] <- NA_real_ 805s + } 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + dimnames <- list(letters[1:10], LETTERS[1:8]) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check dimnames attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + for (lag in 1:4) { 805s + for (differences in 1:3) { 805s + cat(sprintf("mode: %s, lag = %d, differences = %d\n", 805s + mode, lag, differences)) 805s + # Row/column ranges 805s + r0 <- rowDiffs_R(x, lag = lag, differences = differences, useNames = useNames) 805s + r1 <- rowDiffs(x, lag = lag, differences = differences, useNames = useNames) 805s + r2 <- t(colDiffs(t(x), lag = lag, differences = differences, useNames = useNames)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + stopifnot(all.equal(r1, r2)) 805s + } 805s + } 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (add_na ...) 805s + } # for (mode ...) 805s mode: integer 805s add_na = FALSE 805s int [1:10, 1:8] 68 26 29 47 48 10 1 38 16 40 ... 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s add_na = TRUE 805s int [1:10, 1:8] 80 71 7 52 79 22 31 10 29 63 ... 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: integer, lag = 1, differences = 1 805s mode: integer, lag = 1, differences = 2 805s mode: integer, lag = 1, differences = 3 805s mode: integer, lag = 2, differences = 1 805s mode: integer, lag = 2, differences = 2 805s mode: integer, lag = 2, differences = 3 805s mode: integer, lag = 3, differences = 1 805s mode: integer, lag = 3, differences = 2 805s mode: integer, lag = 3, differences = 3 805s mode: integer, lag = 4, differences = 1 805s mode: integer, lag = 4, differences = 2 805s mode: integer, lag = 4, differences = 3 805s mode: double 805s add_na = FALSE 805s num [1:10, 1:8] 36.1 15.1 27.1 63.1 62.1 58.1 28.1 19.1 41.1 3.1 ... 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s add_na = TRUE 805s num [1:10, 1:8] 67.1 80.1 45.1 8.1 39.1 66.1 27.1 71.1 47.1 46.1 ... 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s mode: double, lag = 1, differences = 1 805s mode: double, lag = 1, differences = 2 805s mode: double, lag = 1, differences = 3 805s mode: double, lag = 2, differences = 1 805s mode: double, lag = 2, differences = 2 805s mode: double, lag = 2, differences = 3 805s mode: double, lag = 3, differences = 1 805s mode: double, lag = 3, differences = 2 805s mode: double, lag = 3, differences = 3 805s mode: double, lag = 4, differences = 1 805s mode: double, lag = 4, differences = 2 805s mode: double, lag = 4, differences = 3 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # All NAs 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > for (mode in c("integer", "double")) { 805s + cat("mode: ", mode, "\n", sep = "") 805s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 805s + storage.mode(x) <- mode 805s + str(x) 805s + 805s + dimnames <- list(letters[1:10], LETTERS[1:5]) 805s + 805s + # Test with and without dimnames on x 805s + for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check dimnames attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowDiffs_R(x, useNames = useNames) 805s + r1 <- rowDiffs(x, useNames = useNames) 805s + r2 <- t(colDiffs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + stopifnot(all.equal(r1, r2)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s + } # for (mode ...) 805s mode: integer 805s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s mode: double 805s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # A 1x1 matrix 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > x <- matrix(0, nrow = 1L, ncol = 1L) 805s > dimnames <- list("a", "A") 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + # Check dimnames attribute 805s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 805s + r0 <- rowDiffs_R(x, useNames = useNames) 805s + r1 <- rowDiffs(x, useNames = useNames) 805s + r2 <- t(colDiffs(t(x), useNames = useNames)) 805s + stopifnot(all.equal(r1, r0)) 805s + stopifnot(all.equal(r2, r0)) 805s + stopifnot(all.equal(r1, r2)) 805s + } # for (useNames ...) 805s + } # for (setDimnames ...) 805s > 805s 805s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 805s Copyright (C) 2024 The R Foundation for Statistical Computing 805s Platform: powerpc64le-unknown-linux-gnu 805s 805s R is free software and comes with ABSOLUTELY NO WARRANTY. 805s You are welcome to redistribute it under certain conditions. 805s Type 'license()' or 'licence()' for distribution details. 805s 805s R is a collaborative project with many contributors. 805s Type 'contributors()' for more information and 805s 'citation()' on how to cite R or R packages in publications. 805s 805s Type 'demo()' for some demos, 'help()' for on-line help, or 805s 'help.start()' for an HTML browser interface to help. 805s Type 'q()' to quit R. 805s 805s > library("matrixStats") 805s > 805s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 805s + ncol2 <- ncol(x) - lag * differences 805s + if (ncol2 <= 0) { 805s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 805s + # Preserve names attribute 805s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 805s + return(y) 805s + } 805s + suppressWarnings({ 805s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 805s + }) 805s + y <- t(y) 805s + 805s + # Preserve dimnames attribute 805s + dim(y) <- c(nrow(x), ncol2) 805s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 805s + colnames <- colnames(x) 805s + if (!is.null(colnames)) { 805s + len <- length(colnames) 805s + colnames <- colnames[(len - ncol2 + 1):len] 805s + } 805s + dimnames(y) <- list(rownames(x), colnames) 805s + } 805s + else dimnames(y) <- NULL 805s + 805s + y 805s + } 805s > 805s > 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > # Subsetted tests 805s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 805s > source("utils/validateIndicesFramework.R") 805s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 805s > storage.mode(x) <- "integer" 805s > 805s > # To check dimnames attribute 805s > dimnames <- list(letters[1:6], LETTERS[1:6]) 805s > 805s > # Test with and without dimnames on x 805s > for (setDimnames in c(TRUE, FALSE)) { 805s + if (setDimnames) dimnames(x) <- dimnames 805s + else dimnames(x) <- NULL 805s + 805s + count <- 0L 805s + for (rows in index_cases) { 805s + for (cols in index_cases) { 805s + count <- count + 1L 805s + for (lag in 1:2) { 805s + for (differences in 1:3) { 805s + # Check dimnames attribute 805s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 805s + useNames <- useNames[count %% length(useNames) + 1] 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = rowDiffs, fsure = rowDiffs_R, 805s + lag = lag, differences = differences, useNames = useNames) 805s + validateIndicesTestMatrix(x, rows, cols, 805s + ftest = function(x, rows, cols, ..., useNames) { 805s + t(colDiffs(t(x), rows = cols, cols = rows, ..., useNames = useNames)) 805s + }, fsure = rowDiffs_R, 805s + lag = lag, differences = differences, useNames = useNames) 805s + } 805s + } 805s + } 805s + } 805s + } 809s > 809s 809s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 809s Copyright (C) 2024 The R Foundation for Statistical Computing 809s Platform: powerpc64le-unknown-linux-gnu 809s 809s R is free software and comes with ABSOLUTELY NO WARRANTY. 809s You are welcome to redistribute it under certain conditions. 809s Type 'license()' or 'licence()' for distribution details. 809s 809s R is a collaborative project with many contributors. 809s Type 'contributors()' for more information and 809s 'citation()' on how to cite R or R packages in publications. 809s 809s Type 'demo()' for some demos, 'help()' for on-line help, or 809s 'help.start()' for an HTML browser interface to help. 809s Type 'q()' to quit R. 809s 809s > library("matrixStats") 809s > 809s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 809s + quantile_na <- function(x, ..., na.rm = FALSE) { 809s + if (!na.rm && anyMissing(x)) 809s + return(c(NA_real_, NA_real_)) 809s + quantile(x, ..., na.rm = na.rm) 809s + } 809s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 809s + probs = c(0.25, 0.75), na.rm = na.rm) 809s + rownames(q) <- NULL # Not needed anymore 809s + 809s + # Preserve names attribute 809s + dim(q) <- c(2L, nrow(x)) 809s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 809s + 809s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 809s + } 809s > 809s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 809s > # Test with multiple quantiles 809s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 809s > for (mode in c("integer", "double")) { 809s + cat("mode: ", mode, "\n", sep = "") 809s + x <- matrix(1:100 + 0.1, nrow = 10, ncol = 10) 824s + storage.mode(x) <- mode 824s + str(x) 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:10], LETTERS[1:10]) 824s + 824s + for (add_na in c(FALSE, TRUE)) { 824s + if (add_na) { 824s + x[3:5, 6:9] <- NA 824s + } 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + for (na.rm in c(FALSE, TRUE)) { 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + probs <- c(0, 0.5, 1) 824s + q0 <- rowIQRs_R(x, na.rm = na.rm, useNames = useNames) 824s + print(q0) 824s + q1 <- rowIQRs(x, na.rm = na.rm, useNames = useNames) 824s + print(q1) 824s + stopifnot(all.equal(q1, q0)) 824s + q2 <- colIQRs(t(x), na.rm = na.rm, useNames = useNames) 824s + stopifnot(all.equal(q2, q0)) 824s + 824s + q <- iqr(x[3, ], na.rm = na.rm) 824s + print(q) 824s + } # for (useNames ...) 824s + } # for (na.rm ...) 824s + } # for (setDimnames ...) 824s + } # for (add_na ...) 824s + } # for (mode ...) 824s mode: integer 824s int [1:10, 1:10] 1 2 3 4 5 6 7 8 9 10 ... 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s a b c d e f g h i j 824s 45 45 NA NA NA 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s a b c d e f g h i j 824s 45 45 25 25 25 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s mode: double 824s num [1:10, 1:10] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 45 45 45 45 45 45 45 45 45 824s [1] 45 824s a b c d e f g h i j 824s 45 45 NA NA NA 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s a b c d e f g h i j 824s 45 45 25 25 25 45 45 45 45 45 824s a b c d e f g h i j 824s 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] 45 45 NA NA NA 45 45 45 45 45 824s [1] NA 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 45 45 25 25 25 45 45 45 45 45 824s [1] 25 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Test corner cases 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (mode in c("integer", "double")) { 824s + cat("mode: ", mode, "\n", sep = "") 824s + # Empty vectors 824s + x <- integer(0L) 824s + storage.mode(x) <- mode 824s + str(x) 824s + q <- iqr(x) 824s + print(q) 824s + stopifnot(identical(q, NA_real_)) 824s + 824s + # Scalar 824s + x <- 1L 824s + storage.mode(x) <- mode 824s + str(x) 824s + q <- iqr(x) 824s + str(q) 824s + stopifnot(identical(q, 0)) 824s + } 824s mode: integer 824s int(0) 824s [1] NA 824s int 1 824s num 0 824s mode: double 824s num(0) 824s [1] NA 824s num 1 824s num 0 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Single row matrices 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > x <- matrix(1, nrow = 1L, ncol = 2L) 824s > dimnames <- list("a", LETTERS[1:2]) 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + q0 <- rowIQRs_R(x, useNames = useNames) 824s + q1 <- rowIQRs(x, useNames = useNames) 824s + q2 <- colIQRs(t(x), useNames = useNames) 824s + stopifnot(all.equal(q0, q1)) 824s + stopifnot(all.equal(q0, q2)) 824s + } 824s + } 824s > 824s > x <- matrix(1, nrow = 2L, ncol = 1L) 824s > q <- colIQRs(x) 824s > stopifnot(identical(q, 0)) 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + quantile_na <- function(x, ..., na.rm = FALSE) { 824s + if (!na.rm && anyMissing(x)) 824s + return(c(NA_real_, NA_real_)) 824s + quantile(x, ..., na.rm = na.rm) 824s + } 824s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 824s + probs = c(0.25, 0.75), na.rm = na.rm) 824s + rownames(q) <- NULL # Not needed anymore 824s + 824s + # Preserve names attribute 824s + dim(q) <- c(2L, nrow(x)) 824s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 824s + 824s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- runif(6, min = -6, max = 6) 824s > for (idxs in index_cases) { 824s + for (na.rm in c(TRUE, FALSE)) { 824s + validateIndicesTestVector(x, idxs, ftest = iqr, fsure = function(x, na.rm) { 824s + dim(x) <- c(1L, length(x)) 824s + rowIQRs_R(x, na.rm = na.rm) 824s + }, na.rm = na.rm) 824s + } 824s + } 824s > 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + 824s + count <- 0L 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + count <- count + 1L 824s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 824s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 824s + useNames <- useNames[count %% length(useNames) + 1] 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowIQRs, fsure = rowIQRs_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colIQRs, fsure = rowIQRs_R, 824s + na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > # Test inspired by the harmonic mean example in R-help 824s > # thread '[R] Beyond double-precision?' on May 9, 2009. 824s > 824s > library("matrixStats") 824s > library("stats") 824s > 824s > logSumExp0 <- function(lx) { 824s + idx_max <- which.max(lx) 824s + log1p(sum(exp(lx[-idx_max] - lx[idx_max]))) + lx[idx_max] 824s + } 824s > 824s > n <- 200L 824s > set.seed(1) 824s > 824s > for (mode in c("integer", "double")) { 824s + cat("mode: ", mode, "\n", sep = "") 824s + x <- matrix(runif(n, min = 1.0, max = 3.0), nrow = 20L) 824s + storage.mode(x) <- mode 824s + str(x) 824s + 824s + # The logarithm of the harmonic mean by rows 824s + y_h <- log(1 / rowMeans(1 / x)) 824s + str(y_h) 824s + 824s + lx_neg <- -log(x) 824s + 824s + y0 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp0) 824s + stopifnot(all.equal(y0, y_h)) 824s + 824s + y1 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y2 <- log(ncol(x)) - rowLogSumExps(lx_neg) 824s + stopifnot(all.equal(y2, y0)) 824s + 824s + y3 <- log(ncol(x)) - colLogSumExps(t(lx_neg)) 824s + stopifnot(all.equal(y3, y0)) 824s + 824s + 824s + # The logarithm of the harmonic mean by columns 824s + y_h <- log(1 / colMeans(1 / x)) 824s + str(y_h) 824s + 824s + y0 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp0) 824s + stopifnot(all.equal(y0, y_h)) 824s + 824s + y1 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y2 <- log(nrow(x)) - colLogSumExps(lx_neg) 824s + stopifnot(all.equal(y2, y0)) 824s + 824s + y3 <- log(nrow(x)) - rowLogSumExps(t(lx_neg)) 824s + stopifnot(all.equal(y3, y0)) 824s + 824s + # Testing names 824s + rownames(lx_neg) <- seq_len(nrow(x)) 824s + colnames(lx_neg) <- seq_len(ncol(x)) 824s + y2 <- rowLogSumExps(lx_neg, useNames = TRUE) 824s + stopifnot(identical(names(y2), rownames(lx_neg))) 824s + y3 <- colLogSumExps(t(lx_neg), useNames = TRUE) 824s + stopifnot(identical(names(y3), rownames(lx_neg))) 824s + } # for (mode ...) 824s mode: integer 824s int [1:20, 1:10] 1 1 2 2 1 2 2 2 2 1 ... 824s num [1:20] 0.357 0.223 0.223 0.288 0.511 ... 824s num [1:10] 0.322 0.223 0.322 0.255 0.255 ... 824s mode: double 824s num [1:20, 1:10] 1.54 1.44 2.03 1.54 1.36 ... 824s num [1:20] 0.526 0.466 0.734 0.638 0.604 ... 824s num [1:10] 0.627 0.582 0.617 0.474 0.418 ... 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Corner cases 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > ## Zero-size matrices 824s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 0L) 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s numeric(0) 824s > stopifnot(length(y) == nrow(lx)) 824s > 824s > y <- colLogSumExps(lx) 824s > print(y) 824s numeric(0) 824s > stopifnot(length(y) == ncol(lx)) 824s > 824s > ## Zero-height matrices 824s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 5L) 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s numeric(0) 824s > stopifnot(length(y) == nrow(lx)) 824s > 824s > y <- colLogSumExps(lx) 824s > print(y) 824s [1] -Inf -Inf -Inf -Inf -Inf 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(all(y == -Inf)) 824s > 824s > ## Zero-width matrices 824s > lx <- matrix(numeric(0L), nrow = 5L, ncol = 0L) 824s > y <- colLogSumExps(lx) 824s > print(y) 824s numeric(0) 824s > stopifnot(length(y) == ncol(lx)) 824s > 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s [1] -Inf -Inf -Inf -Inf -Inf 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(y == -Inf)) 824s > 824s > 824s > ## Matrices with one element 824s > lx <- matrix(1.0, nrow = 1L, ncol = 1L) 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s [1] 1 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(y == lx)) 824s > 824s > y <- colLogSumExps(lx) 824s > print(y) 824s [1] 1 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(all(y == lx)) 824s > 824s > ## All missing values 824s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 824s > y <- rowLogSumExps(lx, na.rm = TRUE) 824s > print(y) 824s [1] -Inf 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(identical(y, -Inf)) 824s > 824s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 824s > y <- colLogSumExps(lx, na.rm = TRUE) 824s > print(y) 824s [1] -Inf 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(identical(y, -Inf)) 824s > 824s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 824s > y <- rowLogSumExps(lx, na.rm = TRUE) 824s > print(y) 824s [1] -Inf -Inf 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(y == -Inf)) 824s > 824s > y <- rowLogSumExps(lx, na.rm = FALSE) 824s > print(y) 824s [1] NA NA 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(is.na(y) & !is.nan(y))) 824s > 824s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 824s > y <- colLogSumExps(lx, na.rm = TRUE) 824s > print(y) 824s [1] -Inf -Inf 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(all(y == -Inf)) 824s > 824s > y <- colLogSumExps(lx, na.rm = FALSE) 824s > print(y) 824s [1] NA NA 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(all(is.na(y) & !is.nan(y))) 824s > 824s > ## +Inf values 824s > lx <- matrix(c(1, 2, +Inf), nrow = 3L, ncol = 2L) 824s > y <- colLogSumExps(lx, na.rm = TRUE) 824s > print(y) 824s [1] Inf Inf 824s > stopifnot(length(y) == ncol(lx)) 824s > stopifnot(all(y == +Inf)) 824s > 824s > ## multiple -Inf values 824s > lx <- matrix(c(-Inf, -Inf), nrow = 2L, ncol = 3L) 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s [1] -Inf -Inf 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(y == -Inf)) 824s > 824s > lx <- matrix(c(-Inf, 5, -Inf), nrow = 2L, ncol = 3L, byrow = TRUE) 824s > y <- rowLogSumExps(lx) 824s > print(y) 824s [1] 5 5 824s > stopifnot(length(y) == nrow(lx)) 824s > stopifnot(all(y == 5)) 824s > 824s > ## Bug report #104 (https://github.com/HenrikBengtsson/matrixStats/issues/104) 824s > ## (This would core dump on Windows) 824s > x <- matrix(0.0, nrow = 2L, ncol = 32762L) 824s > y <- colLogSumExps(x) 824s > str(y) 824s num [1:32762] 0.693 0.693 0.693 0.693 0.693 ... 824s > 824s > ## Bug report #120 (https://github.com/HenrikBengtsson/matrixStats/issues/120) 824s > ## (This would error if x had rownames/colnames and non-NULL rows/cols were 824s > ## used) 824s > x <- matrix(runif(6), nrow = 2L, ncol = 3L, 824s + dimnames = list(c("A", "B"), c("a", "b", "c"))) 824s > y <- colLogSumExps(x, cols = 3:1, useNames = TRUE) 824s > stopifnot(names(y) == c("c", "b", "a")) 824s > y <- rowLogSumExps(x, rows = 2, useNames = TRUE) 824s > stopifnot(names(y) == "B") 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Check names attributes 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > 824s > ## Create isFALSE() if running on an old version of R 824s > if (!exists("isFALSE", mode="function")) { 824s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 824s + } 824s > 824s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 824s + log(sum(exp(rx), ...)) 824s + }, ...) 824s + if (isFALSE(useNames)) names(res) <- NULL 824s + res 824s + } 824s > 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowLogSumExps_R(x, useNames = useNames) 824s + y1 <- rowLogSumExps(x, useNames = useNames) 824s + y2 <- colLogSumExps(t(x), useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + stopifnot(all.equal(y2, y0)) 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > ## Create isFALSE() if running on an old version of R 824s > if (!exists("isFALSE", mode="function")) { 824s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 824s + } 824s > 824s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 824s + log(sum(exp(rx), ...)) 824s + }, ...) 824s + if (isFALSE(useNames)) names(res) <- NULL 824s + res 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + for (na.rm in c(TRUE, FALSE)) { 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowLogSumExps, 824s + fsure = rowLogSumExps_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colLogSumExps, 824s + fsure = rowLogSumExps_R, 824s + na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 824s > options(matrixStats.center.onUse = "ignore") 824s > 824s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + suppressWarnings({ 824s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 824s + }) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + suppressWarnings({ 824s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 824s + }) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 824s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 824s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 824s + } 824s > 824s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 824s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 824s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # A 3x3 matrix (no ties) 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 824s + cat("mode: ", mode, "\n", sep = "") 824s + storage.mode(x) <- mode 824s + str(x) 824s + 824s + # To check name attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("rowMads():\n") 824s + center <- rowMedians(x, na.rm = TRUE, useNames = useNames) 824s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 824s + r1b <- rowMads_center(x, na.rm = TRUE, useNames = useNames) 824s + r1c <- rowMads(x, center = center, na.rm = TRUE, useNames = useNames) 824s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 824s + r2b <- colMads_center(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r1b, r1)) 824s + stopifnot(all.equal(r1c, r1)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r2b, r2)) 824s + 824s + cat("colMads():\n") 824s + center <- colMedians(x, na.rm = TRUE, useNames = useNames) 824s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 824s + r1b <- colMads_center(x, na.rm = TRUE, useNames = useNames) 824s + r1c <- colMads(x, center = center, na.rm = TRUE, useNames = useNames) 824s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 824s + r2b <- rowMads_center(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r1b, r1)) 824s + stopifnot(all.equal(r1c, r1)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r2b, r2)) 824s + } 824s + } 824s + } 824s mode: integer 824s int [1:3, 1:3] 1 2 3 2 3 4 3 4 5 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s mode: double 824s num [1:3, 1:3] 1.1 2.1 3.1 2.1 3.1 4.1 3.1 4.1 5.1 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Ties: a 4x4 matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(c(1:4, 2:5, 3:6, 4:7) + 0.1, nrow = 4, ncol = 4) 824s + cat("mode: ", mode, "\n", sep = "") 824s + storage.mode(x) <- mode 824s + str(x) 824s + tx <- t(x) 824s + 824s + # To check name attribute 824s + dimnames <- list(letters[1:4], LETTERS[1:4]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("rowMads():\n") 824s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 824s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + 824s + cat("colMads():\n") 824s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 824s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + } 824s + } 824s + } 824s mode: integer 824s int [1:4, 1:4] 1 2 3 4 2 3 4 5 3 4 ... 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s mode: double 824s num [1:4, 1:4] 1.1 2.1 3.1 4.1 2.1 3.1 4.1 5.1 3.1 4.1 ... 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s > tx <- NULL 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # No ties: a 3x3 matrix with an NA value 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 824s + x[2, 2] <- NA_real_ 824s + 824s + cat("mode: ", mode, "\n", sep = "") 824s + storage.mode(x) <- mode 824s + str(x) 824s + tx <- t(x) 824s + 824s + # To check name attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("rowMads():\n") 824s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 824s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + 824s + cat("colMads():\n") 824s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 824s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 824s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + } 824s + } 824s + } 824s mode: integer 824s int [1:3, 1:3] 1 2 3 2 NA 4 3 4 5 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s mode: double 824s num [1:3, 1:3] 1.1 2.1 3.1 2.1 NA 4.1 3.1 4.1 5.1 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s rowMads(): 824s colMads(): 824s > tx <- NULL 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # With and without some NAs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (add_na in c(FALSE, TRUE)) { 824s + cat("add_na = ", add_na, "\n", sep = "") 824s + 824s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 824s + if (add_na) { 824s + x[3:7, c(2, 4)] <- NA_real_ 824s + } 824s + 824s + # To check name attribute 824s + dimnames <- list(letters[1:10], LETTERS[1:5]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Row/column ranges 824s + for (na.rm in c(FALSE, TRUE)) { 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("na.rm = ", na.rm, "\n", sep = "") 824s + cat("rowMads():\n") 824s + center <- rowMedians(x, na.rm = na.rm, useNames = useNames) 824s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 824s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 824s + r2 <- rowMads(x, center = center, na.rm = na.rm, useNames = useNames) 824s + r3 <- colMads(tx, na.rm = na.rm, useNames = useNames) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r2, r1)) 824s + stopifnot(all.equal(r3, r0)) 824s + stopifnot(all.equal(r3, r1)) 824s + stopifnot(all.equal(r3, r2)) 824s + 824s + cat("colMads():\n") 824s + center <- colMedians(x, na.rm = na.rm, useNames = useNames) 824s + r0 <- colMads_R(x, na.rm = na.rm, useNames = useNames) 824s + r1 <- colMads(x, na.rm = na.rm, useNames = useNames) 824s + r2 <- colMads(x, center = center, na.rm = na.rm, useNames = useNames) 824s + r3 <- rowMads(tx, na.rm = na.rm, useNames = useNames) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r2, r1)) 824s + stopifnot(all.equal(r3, r0)) 824s + stopifnot(all.equal(r3, r1)) 824s + stopifnot(all.equal(r3, r2)) 824s + } 824s + } 824s + } 824s + tx <- NULL 824s + } # for (add_na ...) 824s add_na = FALSE 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s add_na = TRUE 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = FALSE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s na.rm = TRUE 824s rowMads(): 824s colMads(): 824s > 824s > 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # All NAs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Row/column ranges 824s + for (na.rm in c(FALSE, TRUE)) { 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("na.rm = ", na.rm, "\n", sep = "") 824s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 824s + if (na.rm) r0[is.na(r0)] <- NaN 824s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 824s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r1, r2)) 824s + } 824s + } 824s + } 824s na.rm = FALSE 824s na.rm = FALSE 824s na.rm = TRUE 824s na.rm = TRUE 824s na.rm = FALSE 824s na.rm = FALSE 824s na.rm = TRUE 824s na.rm = TRUE 824s > tx <- NULL 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # A 1x1 matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > x <- matrix(0, nrow = 1L, ncol = 1L) 824s > dimnames <- list("a", "A") 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + tx <- t(x) 824s + # Row/column ranges 824s + for (na.rm in c(FALSE, TRUE)) { 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + cat("na.rm = ", na.rm, "\n", sep = "") 824s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 824s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 824s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + stopifnot(all.equal(r1, r2)) 824s + } 824s + } 824s + } 824s na.rm = FALSE 824s na.rm = FALSE 824s na.rm = TRUE 824s na.rm = TRUE 824s na.rm = FALSE 824s na.rm = FALSE 824s na.rm = TRUE 824s na.rm = TRUE 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # A 0x0 matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > x <- matrix(double(0), nrow = 0, ncol = 0) 824s > tx <- t(x) 824s > for (na.rm in c(FALSE, TRUE)) { 824s + cat("na.rm = ", na.rm, "\n", sep = "") 824s + r0 <- rowMads_R(x, na.rm = na.rm) 824s + r1 <- rowMads(x, na.rm = na.rm) 824s + r2 <- colMads(tx, na.rm = na.rm) 824s + stopifnot(all.equal(r1, r2)) 824s + stopifnot(all.equal(r1, r0)) 824s + stopifnot(all.equal(r2, r0)) 824s + } 824s na.rm = FALSE 824s na.rm = TRUE 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 824s > options(matrixStats.center.onUse = "ignore") 824s > 824s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + suppressWarnings({ 824s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 824s + }) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + suppressWarnings({ 824s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 824s + }) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 824s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 824s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 824s + } 824s > 824s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 824s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 824s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 824s > storage.mode(x) <- "integer" 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + 824s + count <- 0L 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + count <- count + 1L 824s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 824s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 824s + useNames <- useNames[count %% length(useNames) + 1] 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowMads, fsure = rowMads_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowMads_center, fsure = rowMads_R, 824s + na.rm = na.rm, useNames = useNames) 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colMads, fsure = rowMads_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colMads_center, fsure = rowMads_R, 824s + na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- rowMeans(x, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > colMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- colMeans(x, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > for (mode in c("integer", "logical", "double")) { 824s + x <- matrix(-4:4, nrow = 3, ncol = 3) 824s + storage.mode(x) <- mode 824s + if (mode == "double") x <- x + 0.1 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Single-element matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Single-element matrix:\n") 824s Special case: Single-element matrix: 824s > for (mode in c("integer", "logical", "double")) { 824s + x <- matrix(1, nrow = 1, ncol = 1) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list("a", "A") 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Empty matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Empty matrix:\n") 824s Special case: Empty matrix: 824s > for (mode in c("integer", "logical", "double")) { 824s + x <- matrix(integer(0), nrow = 0, ncol = 0) 824s + storage.mode(x) <- mode 824s + 824s + y0 <- rowMeans(x, na.rm = FALSE) 824s + y1 <- rowMeans2(x, na.rm = FALSE) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans(x, na.rm = FALSE) 824s + y1 <- colMeans2(x, na.rm = FALSE) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All NAs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All NAs:\n") 824s Special case: All NAs: 824s > for (mode in c("integer", "logical", "double")) { 824s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All NaNs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All NaNs:\n") 824s Special case: All NaNs: 824s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All Infs:\n") 824s Special case: All Infs: 824s > x <- matrix(Inf, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All -Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All -Infs:\n") 824s Special case: All -Infs: 824s > x <- matrix(-Inf, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Infs and -Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Infs and -Infs:\n") 824s Special case: Infs and -Infs: 824s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:4], LETTERS[1:4]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: NaNs and NAs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: NaNs and NAs:\n") 824s Special case: NaNs and NAs: 824s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + str(y0) 824s + stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + str(y1) 824s + stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s Named num [1:4] NaN NA NaN NA 824s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 824s Named num [1:4] NaN NA NaN NA 824s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 824s num [1:4] NaN NA NaN NA 824s num [1:4] NaN NA NaN NA 824s num [1:4] NaN NA NaN NA 824s num [1:4] NaN NA NaN NA 824s num [1:4] NaN NA NaN NA 824s num [1:4] NaN NA NaN NA 824s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 824s > ## returned here (as one would expect). NaN might very well be returned, 824s > ## when both NA and NaN are involved. This is an accepted feature in R, 824s > ## which is documented in help("is.nan"). See also 824s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 824s > ## Thus, we cannot guarantee that y1 is identical to y0. 824s > 824s > 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Integer overflow with ties 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Integer overflow with ties:\n") 824s Special case: Integer overflow with ties: 824s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Consistency checks 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > set.seed(1) 824s > 824s > cat("Consistency checks:\n") 824s Consistency checks: 824s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 824s > for (kk in seq_len(n_sims)) { 824s + cat("Random test #", kk, "\n", sep = "") 824s + 824s + # Simulate data in a matrix of any shape 824s + dim <- sample(50:200, size = 2) 824s + n <- prod(dim) 824s + x <- rnorm(n, sd = 100) 824s + dim(x) <- dim 824s + 824s + # Add NAs? 824s + if ((kk %% 4) %in% c(3, 0)) { 824s + cat("Adding NAs\n") 824s + nna <- sample(n, size = 1) 824s + na_values <- c(NA_real_, NaN) 824s + t <- sample(na_values, size = nna, replace = TRUE) 824s + x[sample(length(x), size = nna)] <- t 824s + } 824s + 824s + # Mode? 824s + modes <- "double" 824s + if ((kk %% 4) %in% c(2, 0)) { 824s + modes <- c("integer", "logical") 824s + } 824s + 824s + for (mode in modes) { 824s + if (mode != "double") { 824s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 824s + storage.mode(x) <- mode 824s + } 824s + 824s + na.rm <- sample(c(TRUE, FALSE), size = 1) 824s + 824s + # rowMeans2(): 824s + y0 <- rowMeans(x, na.rm = na.rm) 824s + y1 <- rowMeans2(x, na.rm = na.rm) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- colMeans2(t(x), na.rm = na.rm) 824s + stopifnot(all.equal(y2, y0)) 824s + 824s + # colMeans2(): 824s + y0 <- colMeans(x, na.rm = na.rm) 824s + y1 <- colMeans2(x, na.rm = na.rm) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- rowMeans2(t(x), na.rm = na.rm) 824s + stopifnot(all.equal(y2, y0)) 824s + } 824s + } # for (kk ...) 824s Random test #1 824s Random test #2 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #3 824s Adding NAs 824s Random test #4 824s Adding NAs 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #5 824s Random test #6 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #7 824s Adding NAs 824s Random test #8 824s Adding NAs 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #9 824s Random test #10 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #11 824s Adding NAs 824s Random test #12 824s Adding NAs 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #13 824s Random test #14 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #15 824s Adding NAs 824s Random test #16 824s Adding NAs 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #17 824s Random test #18 824s Coercing from double to integer 824s Coercing from integer to logical 824s Random test #19 824s Adding NAs 824s Random test #20 824s Adding NAs 824s Coercing from double to integer 824s Coercing from integer to logical 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- rowMeans(x, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 824s > storage.mode(x) <- "integer" 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + 824s + count <- 0L 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + count <- count + 1L 824s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 824s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 824s + useNames <- useNames[count %% length(useNames) + 1] 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowMeans2, fsure = rowMeans_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colMeans2, fsure = rowMeans_R, 824s + na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Non-ties 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Non-ties:\n") 824s Special case: Non-ties: 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(1:9 + 0.1, nrow = 3, ncol = 3) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Ties 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Ties:\n") 824s Special case: Ties: 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(1:16 + 0.1, nrow = 4, ncol = 4) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:4], LETTERS[1:4]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Single-element matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Single-element matrix:\n") 824s Special case: Single-element matrix: 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(1, nrow = 1, ncol = 1) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list("a", "A") 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Empty matrix 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Empty matrix:\n") 824s Special case: Empty matrix: 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(integer(0), nrow = 0, ncol = 0) 824s + storage.mode(x) <- mode 824s + 824s + y0 <- rowMedians_R(x, na.rm = FALSE) 824s + y1 <- rowMedians(x, na.rm = FALSE) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE) 824s + y1 <- colMedians(x, na.rm = FALSE) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All NAs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All NAs:\n") 824s Special case: All NAs: 824s > for (mode in c("integer", "double")) { 824s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 824s + storage.mode(x) <- mode 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:3], LETTERS[1:3]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All NaNs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All NaNs:\n") 824s Special case: All NaNs: 824s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All Infs:\n") 824s Special case: All Infs: 824s > x <- matrix(Inf, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: All -Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: All -Infs:\n") 824s Special case: All -Infs: 824s > x <- matrix(-Inf, nrow = 3, ncol = 3) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Infs and -Infs 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Infs and -Infs:\n") 824s Special case: Infs and -Infs: 824s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:4], LETTERS[1:4]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Special case: Integer overflow with ties 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > cat("Special case: Integer overflow with ties:\n") 824s Special case: Integer overflow with ties: 824s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + 824s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 824s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + } 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Consistency checks 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > set.seed(1) 824s > 824s > cat("Consistency checks:\n") 824s Consistency checks: 824s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 824s > for (kk in seq_len(n_sims)) { 824s + cat("Random test #", kk, "\n", sep = "") 824s + 824s + # Simulate data in a matrix of any shape 824s + dim <- sample(50:200, size = 2) 824s + n <- prod(dim) 824s + x <- rnorm(n, sd = 100) 824s + dim(x) <- dim 824s + 824s + # Add NAs? 824s + if ((kk %% 4) %in% c(3, 0)) { 824s + cat("Adding NAs\n") 824s + nna <- sample(n, size = 1) 824s + na_values <- c(NA_real_, NaN) 824s + t <- sample(na_values, size = nna, replace = TRUE) 824s + x[sample(length(x), size = nna)] <- t 824s + } 824s + 824s + # Integer or double? 824s + if ((kk %% 4) %in% c(2, 0)) { 824s + cat("Coercing to integers\n") 824s + storage.mode(x) <- "integer" 824s + } 824s + 824s + na.rm <- sample(c(TRUE, FALSE), size = 1) 824s + 824s + # rowMedians(): 824s + y0 <- rowMedians_R(x, na.rm = na.rm) 824s + y1 <- rowMedians(x, na.rm = na.rm) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- colMedians(t(x), na.rm = na.rm) 824s + stopifnot(all.equal(y2, y0)) 824s + 824s + # colMedians(): 824s + y0 <- colMedians_R(x, na.rm = na.rm) 824s + y1 <- colMedians(x, na.rm = na.rm) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- rowMedians(t(x), na.rm = na.rm) 824s + stopifnot(all.equal(y2, y0)) 824s + } # for (kk ...) 824s Random test #1 824s Random test #2 824s Coercing to integers 824s Random test #3 824s Adding NAs 824s Random test #4 824s Adding NAs 824s Coercing to integers 824s Random test #5 824s Random test #6 824s Coercing to integers 824s Random test #7 824s Adding NAs 824s Random test #8 824s Adding NAs 824s Coercing to integers 824s Random test #9 824s Random test #10 824s Coercing to integers 824s Random test #11 824s Adding NAs 824s Random test #12 824s Adding NAs 824s Coercing to integers 824s Random test #13 824s Random test #14 824s Coercing to integers 824s Random test #15 824s Adding NAs 824s Random test #16 824s Adding NAs 824s Coercing to integers 824s Random test #17 824s Random test #18 824s Coercing to integers 824s Random test #19 824s Adding NAs 824s Random test #20 824s Adding NAs 824s Coercing to integers 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 824s > storage.mode(x) <- "integer" 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + 824s + count <- 0L 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + count <- count + 1L 824s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 824s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 824s + useNames <- useNames[count %% length(useNames) + 1] 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowMedians, fsure = rowMedians_R, 824s + na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colMedians, fsure = rowMedians_R, 824s + na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > library("stats") 824s > 824s > asWhich <- function(probs, max) { 824s + idx <- as.integer(round(probs * max)) 824s + if (idx < 1L) { 824s + idx <- 1L 824s + } else if (idx > max) { 824s + idx <- max 824s + } 824s + idx 824s + } # asWhich() 824s > 824s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 824s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 824s + 824s + # Remove Attributes 824s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 824s + ans 824s + } # rowOrderStats_R() 824s > 824s > 824s > set.seed(1) 824s > 824s > 824s > # Simulate data in a matrix of any shape 824s > nrow <- 60L 824s > ncol <- 30L 824s > x <- rnorm(nrow * ncol) 824s > dim(x) <- c(nrow, ncol) 824s > probs <- 0.3 824s > which <- asWhich(probs, max = ncol) 824s > 824s > y0 <- rowOrderStats_R(x, probs = probs) 824s > y1 <- rowOrderStats(x, which = which) 824s > stopifnot(all.equal(y1, y0)) 824s > y2 <- colOrderStats(t(x), which = which) 824s > stopifnot(all.equal(y2, y0)) 824s > 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Consistency checks 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > for (mode in c("integer", "double")) { 824s + cat("Consistency checks without NAs:\n") 824s + for (kk in 1:3) { 824s + cat("Random test #", kk, "\n", sep = "") 824s + 824s + # Simulate data in a matrix of any shape 824s + nrow <- sample(20L, size = 1L) 824s + ncol <- sample(20L, size = 1L) 824s + x <- rnorm(nrow * ncol) 824s + dim(x) <- c(nrow, ncol) 824s + 824s + cat("mode: ", mode, "\n", sep = "") 824s + storage.mode(x) <- mode 824s + str(x) 824s + 824s + probs <- runif(1) 824s + which <- asWhich(probs, max = ncol) 824s + 824s + y0 <- rowOrderStats_R(x, probs = probs) 824s + y1 <- rowOrderStats(x, which = which) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- colOrderStats(t(x), which = which) 824s + stopifnot(all.equal(y2, y0)) 824s + } # for (kk in ...) 824s + } # for (mode ...) 824s Consistency checks without NAs: 824s Random test #1 824s mode: integer 824s int [1:14, 1:6] 0 0 1 0 2 -1 1 0 0 0 ... 824s Random test #2 824s mode: integer 824s int [1:8, 1:13] 0 0 1 -2 0 0 0 0 1 0 ... 824s Random test #3 824s mode: integer 824s int [1:20, 1:17] 0 0 0 0 1 0 1 0 0 -1 ... 824s Consistency checks without NAs: 824s Random test #1 824s mode: double 824s num [1:9, 1:5] -1.4286 -0.00386 -0.70456 -0.29242 -0.49607 ... 824s Random test #2 824s mode: double 824s num [1:11, 1:20] -0.796 0.482 -0.952 0.5 1.242 ... 824s Random test #3 824s mode: double 824s num [1:7, 1:18] 1.553 -2.405 0.167 -0.403 -1.746 ... 824s > 824s > 824s > # Check names attribute 824s > x <- matrix(1:9 + 0.1, nrow = 3L, ncol = 3L) 824s > 824s > probs <- runif(1) 824s > which <- asWhich(probs, max = ncol(x)) 824s > 824s > dimnames <- list(letters[1:3], LETTERS[1:3]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowOrderStats_R(x, probs = probs, useNames = useNames) 824s + y1 <- rowOrderStats(x, which = which, useNames = useNames) 824s + stopifnot(all.equal(y1, y0)) 824s + y2 <- colOrderStats(t(x), which = which, useNames = useNames) 824s + stopifnot(all.equal(y2, y0)) 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 824s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 824s + 824s + # Remove Attributes 824s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 824s + ans 824s + } # rowOrderStats_R() 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 824s > storage.mode(x) <- "integer" 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > probs <- 0.3 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + if (is.null(cols)) which <- round(probs * ncol(x)) 824s + else { 824s + xxrows <- rows 824s + suppressWarnings({ 824s + xx <- tryCatch(x[, cols, drop = FALSE], error = function(c) "error") 824s + if (identical(xx, "error")) which <- 0L 824s + else which <- round(probs * ncol(xx)) 824s + }) 824s + } 824s + if (which == 0L) next 824s + 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowOrderStats, fsure = rowOrderStats_R, 824s + which = which, probs = probs, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colOrderStats, fsure = rowOrderStats_R, 824s + which = which, probs = probs, useNames = useNames) 824s + } 824s + } 824s + } 824s + } 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > all.equal.na <- function(target, current, ...) { 824s + # Computations involving NaN may return NaN or NA, cf. ?is.nan 824s + current[is.nan(current)] <- NA_real_ 824s + target[is.nan(target)] <- NA_real_ 824s + all.equal(target, current, ...) 824s + } 824s > 824s > for (mode in c("integer", "double")) { 824s + # Missing values 824s + x <- matrix(c(1, NA, NaN, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 824s + cat("mode: ", mode, "\n", sep = "") 824s + storage.mode(x) <- mode 824s + str(x) 824s + 824s + # To check names attribute 824s + dimnames <- list(letters[1:4], LETTERS[1:2]) 824s + 824s + # Test with and without dimnames on x 824s + for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + # Check names attribute 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + y0 <- rowProds_R(x, na.rm = TRUE, useNames = useNames) 824s + print(y0) 824s + y1 <- rowProds(x, na.rm = TRUE, useNames = useNames) 824s + print(y1) 824s + y2 <- colProds(t(x), na.rm = TRUE, useNames = useNames) 824s + print(y2) 824s + stopifnot(all.equal(y1, y0)) 824s + stopifnot(all.equal(y2, y1)) 824s + 824s + # Missing values 824s + y0 <- rowProds_R(x, na.rm = FALSE, useNames = useNames) 824s + print(y0) 824s + y1 <- rowProds(x, na.rm = FALSE, useNames = useNames) 824s + print(y1) 824s + y2 <- colProds(t(x), na.rm = FALSE, useNames = useNames) 824s + print(y2) 824s + stopifnot(all.equal(y1, y0)) 824s + stopifnot(all.equal(y2, y1)) 824s + 824s + # "Empty" rows 824s + y0 <- rowProds_R(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 824s + print(y0) 824s + y1 <- rowProds(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 824s + print(y1) 824s + y2 <- colProds(t(x[integer(0), , drop = FALSE]), na.rm = FALSE, useNames = useNames) 824s + print(y2) 824s + stopifnot(all.equal.na(y1, y0)) 824s + stopifnot(all.equal(y2, y1)) 824s + stopifnot(length(y1) == 0L) 824s + 824s + # Using product() 824s + y1 <- rowProds(x, method = "expSumLog", na.rm = FALSE, useNames = useNames) 824s + print(y1) 824s + y2 <- colProds(t(x), method = "expSumLog", na.rm = FALSE, useNames = useNames) 824s + print(y2) 824s + stopifnot(all.equal(y2, y1)) 824s + } 824s + } 824s + } # for (mode ...) 824s mode: integer 824s int [1:4, 1:2] 1 NA NA 1 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 NA NA 0 824s a b c d 824s 1 NA NA 0 824s a b c d 824s 1 NA NA 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s a b c d 824s 1 NA NA 0 824s a b c d 824s 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s mode: double 824s num [1:4, 1:2] 1 NA NaN 1 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 0 1 0 824s a b c d 824s 1 NA NaN 0 824s a b c d 824s 1 NA NaN 0 824s a b c d 824s 1 NA NaN 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s a b c d 824s 1 NA NA 0 824s a b c d 824s 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 0 1 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s [1] 1 NA NaN 0 824s numeric(0) 824s numeric(0) 824s numeric(0) 824s [1] 1 NA NA 0 824s [1] 1 NA NA 0 824s > 824s > 824s > # Bug report 2012-06-25 824s > x <- matrix(c(1, 1, 1, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 824s > y0 <- rowProds_R(x) 824s > print(y0) 824s [1] 1 0 1 0 824s > y1 <- rowProds(x) 824s > print(y1) 824s [1] 1 0 1 0 824s > y2 <- colProds(t(x)) 824s > print(y2) 824s [1] 1 0 1 0 824s > stopifnot(all.equal.na(y1, y0)) 824s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 824s > stopifnot(all.equal.na(y2, y1)) 824s > # Check names attribute 824s > dimnames(x) <- dimnames 824s > y0 <- rowProds_R(x, useNames = TRUE) 824s > print(y0) 824s a b c d 824s 1 0 1 0 824s > y1 <- rowProds(x, useNames = TRUE) 824s > print(y1) 824s a b c d 824s 1 0 1 0 824s > y2 <- colProds(t(x), useNames = TRUE) 824s > print(y2) 824s a b c d 824s 1 0 1 0 824s > stopifnot(all.equal.na(y1, y0)) 824s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 824s > stopifnot(all.equal.na(y2, y1)) 824s > 824s > # Bug report 2014-03-25 ("all rows contains a zero") 824s > x <- matrix(c(0, 1, 1, 0), nrow = 2, ncol = 2) 824s > # To check names attribute 824s > dimnames <- list(letters[1:2], LETTERS[1:2]) 824s > y0 <- rowProds_R(x) 824s > print(y0) 824s [1] 0 0 824s > y1 <- rowProds(x) 824s > print(y1) 824s [1] 0 0 824s > y2 <- colProds(t(x)) 824s > print(y2) 824s [1] 0 0 824s > stopifnot(all.equal.na(y1, y0)) 824s > stopifnot(all.equal.na(y1, c(0, 0))) 824s > stopifnot(all.equal.na(y2, y1)) 824s > # Check names attribute 824s > dimnames(x) <- dimnames 824s > y0 <- rowProds_R(x, useNames = TRUE) 824s > print(y0) 824s a b 824s 0 0 824s > y1 <- rowProds(x, useNames = TRUE) 824s > print(y1) 824s a b 824s 0 0 824s > y2 <- colProds(t(x), useNames = TRUE) 824s > print(y2) 824s a b 824s 0 0 824s > stopifnot(all.equal.na(y1, y0)) 824s > stopifnot(all.equal.na(y2, y1)) 824s > 824s 824s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 824s Copyright (C) 2024 The R Foundation for Statistical Computing 824s Platform: powerpc64le-unknown-linux-gnu 824s 824s R is free software and comes with ABSOLUTELY NO WARRANTY. 824s You are welcome to redistribute it under certain conditions. 824s Type 'license()' or 'licence()' for distribution details. 824s 824s R is a collaborative project with many contributors. 824s Type 'contributors()' for more information and 824s 'citation()' on how to cite R or R packages in publications. 824s 824s Type 'demo()' for some demos, 'help()' for on-line help, or 824s 'help.start()' for an HTML browser interface to help. 824s Type 'q()' to quit R. 824s 824s > library("matrixStats") 824s > 824s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 824s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 824s + if (is.na(useNames) || !useNames) names(res) <- NULL 824s + res 824s + } 824s > 824s > 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > # Subsetted tests 824s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 824s > source("utils/validateIndicesFramework.R") 824s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 824s > storage.mode(x) <- "integer" 824s > 824s > # To check names attribute 824s > dimnames <- list(letters[1:6], LETTERS[1:6]) 824s > 824s > # Test with and without dimnames on x 824s > for (setDimnames in c(TRUE, FALSE)) { 824s + if (setDimnames) dimnames(x) <- dimnames 824s + else dimnames(x) <- NULL 824s + for (rows in index_cases) { 824s + for (cols in index_cases) { 824s + for (na.rm in c(TRUE, FALSE)) { 824s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 824s + validateIndicesTestMatrix(x, rows, cols, 824s + ftest = rowProds, fsure = rowProds_R, 824s + method = "expSumLog", 824s + FUN = product, na.rm = na.rm, useNames = useNames) 824s + validateIndicesTestMatrix(x, rows, cols, 824s + fcoltest = colProds, fsure = rowProds_R, 824s + method = "expSumLog", 824s + FUN = product, na.rm = na.rm, useNames = useNames) 824s + } 824s + } 824s + } 824s + } 824s + } 826s > 826s 826s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 826s Copyright (C) 2024 The R Foundation for Statistical Computing 826s Platform: powerpc64le-unknown-linux-gnu 826s 826s R is free software and comes with ABSOLUTELY NO WARRANTY. 826s You are welcome to redistribute it under certain conditions. 826s Type 'license()' or 'licence()' for distribution details. 826s 826s R is a collaborative project with many contributors. 826s Type 'contributors()' for more information and 826s 'citation()' on how to cite R or R packages in publications. 826s 826s Type 'demo()' for some demos, 'help()' for on-line help, or 826s 'help.start()' for an HTML browser interface to help. 826s Type 'q()' to quit R. 826s 826s > library("matrixStats") 826s > 826s > ## Create isFALSE() if running on an old version of R 826s > if (!exists("isFALSE", mode="function")) { 826s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 826s + } 826s > 826s > rowQuantiles_R <- function(x, probs = c(0, 0.25, 0.50, 0.75, 1), na.rm = FALSE, drop = TRUE, type = 7L, ..., useNames = NA) { 826s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 826s + if (!na.rm && any(is.na(x))) { 826s + na_value <- NA_real_ 826s + if (type != 7L) storage.mode(na_value) <- storage.mode(x) 826s + rep(na_value, times = length(probs)) 826s + } else { 826s + as.vector(quantile(x, probs = probs, na.rm = na.rm, type = type, names = FALSE, ...)) 826s + } 826s + }, probs = probs, na.rm = na.rm) 826s + 826s + if (!is.null(dim(q))) q <- t(q) 826s + else dim(q) <- c(nrow(x), length(probs)) 826s + 826s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 826s + rownames(q) <- rownames(x) 826s + if (isFALSE(useNames)) dimnames(q) <- NULL 826s + 826s + if (drop) q <- drop(q) 826s + q 826s + } 826s > 826s > 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > # Test with multiple quantiles 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > for (mode in c("logical", "integer", "double")) { 826s + cat("mode: ", mode, "\n", sep = "") 826s + x <- matrix(1:40 + 0.1, nrow = 8, ncol = 5) 826s + storage.mode(x) <- mode 826s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 826s + str(x) 826s + 826s + probs <- c(0, 0.5, 1) 826s + # Test with and without dimnames on x 826s + for (setDimnames in c(TRUE, FALSE)) { 826s + if (setDimnames) dimnames(x) <- dimnames 826s + else dimnames(x) <- NULL 826s + # Check names attribute 826s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 826s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 826s + print(q0) 826s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 826s + print(q1) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 826s + stopifnot(all.equal(q1, q0)) 826s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 826s + stopifnot(all.equal(q2, q0)) 826s + } 826s + } 826s + } # for (mode ...) 826s mode: logical 826s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 826s 0% 50% 100% 826s a 1 1 1 826s b 1 1 1 826s c 1 1 1 826s d 1 1 1 826s e 1 1 1 826s f 1 1 1 826s g 1 1 1 826s h 1 1 1 826s 0% 50% 100% 826s a 1 1 1 826s b 1 1 1 826s c 1 1 1 826s d 1 1 1 826s e 1 1 1 826s f 1 1 1 826s g 1 1 1 826s h 1 1 1 826s [,1] [,2] [,3] 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s [,1] [,2] [,3] 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s 0% 50% 100% 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s 0% 50% 100% 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s [,1] [,2] [,3] 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s [,1] [,2] [,3] 826s [1,] 1 1 1 826s [2,] 1 1 1 826s [3,] 1 1 1 826s [4,] 1 1 1 826s [5,] 1 1 1 826s [6,] 1 1 1 826s [7,] 1 1 1 826s [8,] 1 1 1 826s mode: integer 826s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 826s 0% 50% 100% 826s a 1 17 33 826s b 2 18 34 826s c 3 19 35 826s d 4 20 36 826s e 5 21 37 826s f 6 22 38 826s g 7 23 39 826s h 8 24 40 826s 0% 50% 100% 826s a 1 17 33 826s b 2 18 34 826s c 3 19 35 826s d 4 20 36 826s e 5 21 37 826s f 6 22 38 826s g 7 23 39 826s h 8 24 40 826s [,1] [,2] [,3] 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s [,1] [,2] [,3] 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s 0% 50% 100% 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s 0% 50% 100% 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s [,1] [,2] [,3] 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s [,1] [,2] [,3] 826s [1,] 1 17 33 826s [2,] 2 18 34 826s [3,] 3 19 35 826s [4,] 4 20 36 826s [5,] 5 21 37 826s [6,] 6 22 38 826s [7,] 7 23 39 826s [8,] 8 24 40 826s mode: double 826s num [1:8, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 826s 0% 50% 100% 826s a 1.1 17.1 33.1 826s b 2.1 18.1 34.1 826s c 3.1 19.1 35.1 826s d 4.1 20.1 36.1 826s e 5.1 21.1 37.1 826s f 6.1 22.1 38.1 826s g 7.1 23.1 39.1 826s h 8.1 24.1 40.1 826s 0% 50% 100% 826s a 1.1 17.1 33.1 826s b 2.1 18.1 34.1 826s c 3.1 19.1 35.1 826s d 4.1 20.1 36.1 826s e 5.1 21.1 37.1 826s f 6.1 22.1 38.1 826s g 7.1 23.1 39.1 826s h 8.1 24.1 40.1 826s [,1] [,2] [,3] 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s [,1] [,2] [,3] 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s 0% 50% 100% 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s 0% 50% 100% 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s [,1] [,2] [,3] 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s [,1] [,2] [,3] 826s [1,] 1.1 17.1 33.1 826s [2,] 2.1 18.1 34.1 826s [3,] 3.1 19.1 35.1 826s [4,] 4.1 20.1 36.1 826s [5,] 5.1 21.1 37.1 826s [6,] 6.1 22.1 38.1 826s [7,] 7.1 23.1 39.1 826s [8,] 8.1 24.1 40.1 826s > 826s > 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > # Test with a single quantile 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > for (mode in c("logical", "integer", "double")) { 826s + cat("mode: ", mode, "\n", sep = "") 826s + x <- matrix(1:40, nrow = 8, ncol = 5) 826s + storage.mode(x) <- mode 826s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 826s + str(x) 826s + 826s + probs <- c(0.5) 826s + # Test with and without dimnames on x 826s + for (setDimnames in c(TRUE, FALSE)) { 826s + if (setDimnames) dimnames(x) <- dimnames 826s + else dimnames(x) <- NULL 826s + # Check names attribute 826s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 826s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 826s + print(q0) 826s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 826s + print(q1) 826s + stopifnot(all.equal(q1, q0)) 826s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 826s + stopifnot(all.equal(q2, q0)) 826s + } 826s + } 826s + } # for (mode ...) 826s mode: logical 826s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 826s a b c d e f g h 826s 1 1 1 1 1 1 1 1 826s a b c d e f g h 826s 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s [1] 1 1 1 1 1 1 1 1 826s mode: integer 826s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 826s a b c d e f g h 826s 17 18 19 20 21 22 23 24 826s a b c d e f g h 826s 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s mode: double 826s num [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 826s a b c d e f g h 826s 17 18 19 20 21 22 23 24 826s a b c d e f g h 826s 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s [1] 17 18 19 20 21 22 23 24 826s > 826s > 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > # Consistency checks 826s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 826s > set.seed(1) 826s > 826s > probs <- seq(from = 0, to = 1, by = 0.25) 826s > 826s > cat("Consistency checks:\n") 826s Consistency checks: 826s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 6L else 24L 826s > for (kk in seq_len(n_sims)) { 826s + cat("Random test #", kk, "\n", sep = "") 826s + 826s + # Simulate data in a matrix of any shape 826s + dim <- sample(20:60, size = 2L) 826s + n <- prod(dim) 826s + x <- rnorm(n, sd = 100) 826s + dim(x) <- dim 826s + dimnames <- lapply(dim(x), FUN = function(n) rep(letters, length.out = n)) 826s + 826s + # Add NAs? 826s + has_na <- ((kk %% 2) == 0L) 826s + if (has_na) { 826s + cat("Adding NAs\n") 826s + nna <- sample(n, size = 1) 826s + na_values <- c(NA_real_, NaN) 826s + t <- sample(na_values, size = nna, replace = TRUE) 826s + x[sample(length(x), size = nna)] <- t 826s + } 826s + 826s + # Logical, integer, or double? 826s + mode <- "numeric" 826s + if ((kk %% 6) %in% 1:2) { 826s + cat("Coercing to logical\n") 826s + mode <- "logical" 826s + } else if ((kk %% 6) %in% 3:4) { 826s + cat("Coercing to integers\n") 826s + mode <- "integer" 826s + } 826s + storage.mode(x) <- mode 826s + 826s + str(x) 826s + 826s + # rowQuantiles(): 826s + for (type in 1:9) { 826s + cat(sprintf("type=%d, has_na=%s:\n", type, has_na)) 826s + # Test with and without dimnames on x 826s + for (setDimnames in c(TRUE, FALSE)) { 826s + if (setDimnames) dimnames(x) <- dimnames 826s + else dimnames(x) <- NULL 826s + # Check names attribute 826s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 826s + q0 <- rowQuantiles_R(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 826s + q1 <- rowQuantiles(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q1) <- storage.mode(q0) 826s + stopifnot(all.equal(q1, q0)) 826s + q2 <- colQuantiles(t(x), probs = probs, na.rm = has_na, type = type, useNames = useNames) 826s + ## FIXME: Workaround for R (< 3.0.0) 826s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q2) <- storage.mode(q0) 826s + stopifnot(all.equal(q2, q0)) 826s + } 826s + } 826s + } 826s + } # for (kk ...) 826s Random test #1 826s Coercing to logical 826s logi [1:23, 1:58] TRUE TRUE TRUE TRUE TRUE TRUE ... 826s type=1, has_na=FALSE: 826s type=2, has_na=FALSE: 826s type=3, has_na=FALSE: 826s type=4, has_na=FALSE: 826s type=5, has_na=FALSE: 827s type=6, has_na=FALSE: 827s type=7, has_na=FALSE: 827s type=8, has_na=FALSE: 827s type=9, has_na=FALSE: 827s Random test #2 827s Adding NAs 827s Coercing to logical 827s logi [1:58, 1:33] TRUE TRUE TRUE TRUE TRUE NA ... 827s type=1, has_na=TRUE: 827s type=2, has_na=TRUE: 827s type=3, has_na=TRUE: 827s type=4, has_na=TRUE: 827s type=5, has_na=TRUE: 827s type=6, has_na=TRUE: 827s type=7, has_na=TRUE: 827s type=8, has_na=TRUE: 828s type=9, has_na=TRUE: 828s Random test #3 828s Coercing to integers 828s int [1:28, 1:60] 119 -164 115 -129 209 -175 2 -32 120 -28 ... 828s type=1, has_na=FALSE: 828s type=2, has_na=FALSE: 828s type=3, has_na=FALSE: 828s type=4, has_na=FALSE: 828s type=5, has_na=FALSE: 828s type=6, has_na=FALSE: 828s type=7, has_na=FALSE: 828s type=8, has_na=FALSE: 828s type=9, has_na=FALSE: 828s Random test #4 828s Adding NAs 828s Coercing to integers 828s int [1:54, 1:35] 147 11 116 -50 NA -69 132 NA 114 NA ... 828s type=1, has_na=TRUE: 828s type=2, has_na=TRUE: 829s type=3, has_na=TRUE: 829s type=4, has_na=TRUE: 829s type=5, has_na=TRUE: 829s type=6, has_na=TRUE: 829s type=7, has_na=TRUE: 829s type=8, has_na=TRUE: 829s type=9, has_na=TRUE: 829s Random test #5 829s num [1:39, 1:53] 5.94 -27.16 -30.78 173 126.05 ... 829s type=1, has_na=FALSE: 829s type=2, has_na=FALSE: 829s type=3, has_na=FALSE: 829s type=4, has_na=FALSE: 830s type=5, has_na=FALSE: 830s type=6, has_na=FALSE: 830s type=7, has_na=FALSE: 830s type=8, has_na=FALSE: 830s type=9, has_na=FALSE: 830s Random test #6 830s Adding NAs 830s num [1:46, 1:22] 197 -107 15 148 -110 ... 830s type=1, has_na=TRUE: 830s type=2, has_na=TRUE: 830s type=3, has_na=TRUE: 830s type=4, has_na=TRUE: 830s type=5, has_na=TRUE: 831s type=6, has_na=TRUE: 831s type=7, has_na=TRUE: 831s type=8, has_na=TRUE: 831s type=9, has_na=TRUE: 831s Random test #7 831s Coercing to logical 831s logi [1:21, 1:51] TRUE TRUE TRUE TRUE TRUE TRUE ... 831s type=1, has_na=FALSE: 831s type=2, has_na=FALSE: 831s type=3, has_na=FALSE: 831s type=4, has_na=FALSE: 831s type=5, has_na=FALSE: 831s type=6, has_na=FALSE: 831s type=7, has_na=FALSE: 831s type=8, has_na=FALSE: 831s type=9, has_na=FALSE: 831s Random test #8 831s Adding NAs 831s Coercing to logical 831s logi [1:33, 1:53] NA NA TRUE TRUE TRUE TRUE ... 831s type=1, has_na=TRUE: 831s type=2, has_na=TRUE: 832s type=3, has_na=TRUE: 832s type=4, has_na=TRUE: 832s type=5, has_na=TRUE: 832s type=6, has_na=TRUE: 832s type=7, has_na=TRUE: 832s type=8, has_na=TRUE: 832s type=9, has_na=TRUE: 832s Random test #9 832s Coercing to integers 832s int [1:53, 1:24] -73 10 -73 -5 44 -107 -100 95 58 -50 ... 832s type=1, has_na=FALSE: 832s type=2, has_na=FALSE: 832s type=3, has_na=FALSE: 832s type=4, has_na=FALSE: 833s type=5, has_na=FALSE: 833s type=6, has_na=FALSE: 833s type=7, has_na=FALSE: 833s type=8, has_na=FALSE: 833s type=9, has_na=FALSE: 833s Random test #10 833s Adding NAs 833s Coercing to integers 833s int [1:44, 1:20] NA -140 NA -57 -252 NA NA 20 NA NA ... 833s type=1, has_na=TRUE: 833s type=2, has_na=TRUE: 833s type=3, has_na=TRUE: 833s type=4, has_na=TRUE: 834s type=5, has_na=TRUE: 834s type=6, has_na=TRUE: 834s type=7, has_na=TRUE: 834s type=8, has_na=TRUE: 834s type=9, has_na=TRUE: 834s Random test #11 834s num [1:54, 1:23] -160.87 74.13 196.08 7.27 4.92 ... 834s type=1, has_na=FALSE: 834s type=2, has_na=FALSE: 835s type=3, has_na=FALSE: 835s type=4, has_na=FALSE: 835s type=5, has_na=FALSE: 835s type=6, has_na=FALSE: 835s type=7, has_na=FALSE: 835s type=8, has_na=FALSE: 835s type=9, has_na=FALSE: 835s Random test #12 835s Adding NAs 835s num [1:59, 1:27] -139.2 -86.3 NA -40.7 NA ... 835s type=1, has_na=TRUE: 835s type=2, has_na=TRUE: 836s type=3, has_na=TRUE: 836s type=4, has_na=TRUE: 836s type=5, has_na=TRUE: 836s type=6, has_na=TRUE: 836s type=7, has_na=TRUE: 836s type=8, has_na=TRUE: 836s type=9, has_na=TRUE: 836s Random test #13 836s Coercing to logical 836s logi [1:53, 1:60] TRUE TRUE TRUE TRUE TRUE TRUE ... 836s type=1, has_na=FALSE: 836s type=2, has_na=FALSE: 836s type=3, has_na=FALSE: 837s type=4, has_na=FALSE: 837s type=5, has_na=FALSE: 837s type=6, has_na=FALSE: 837s type=7, has_na=FALSE: 837s type=8, has_na=FALSE: 837s type=9, has_na=FALSE: 837s Random test #14 837s Adding NAs 837s Coercing to logical 837s logi [1:22, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 837s type=1, has_na=TRUE: 837s type=2, has_na=TRUE: 837s type=3, has_na=TRUE: 837s type=4, has_na=TRUE: 837s type=5, has_na=TRUE: 837s type=6, has_na=TRUE: 837s type=7, has_na=TRUE: 837s type=8, has_na=TRUE: 837s type=9, has_na=TRUE: 837s Random test #15 837s Coercing to integers 837s int [1:20, 1:34] 78 -41 183 190 -71 37 0 -4 -86 27 ... 837s type=1, has_na=FALSE: 837s type=2, has_na=FALSE: 837s type=3, has_na=FALSE: 837s type=4, has_na=FALSE: 837s type=5, has_na=FALSE: 837s type=6, has_na=FALSE: 837s type=7, has_na=FALSE: 837s type=8, has_na=FALSE: 838s type=9, has_na=FALSE: 838s Random test #16 838s Adding NAs 838s Coercing to integers 838s int [1:42, 1:37] NA 12 -15 41 -28 17 NA -74 NA NA ... 838s type=1, has_na=TRUE: 838s type=2, has_na=TRUE: 838s type=3, has_na=TRUE: 838s type=4, has_na=TRUE: 838s type=5, has_na=TRUE: 838s type=6, has_na=TRUE: 838s type=7, has_na=TRUE: 838s type=8, has_na=TRUE: 838s type=9, has_na=TRUE: 838s Random test #17 838s num [1:42, 1:29] -50.51 -6.51 -117.59 135.58 226.87 ... 838s type=1, has_na=FALSE: 838s type=2, has_na=FALSE: 838s type=3, has_na=FALSE: 839s type=4, has_na=FALSE: 839s type=5, has_na=FALSE: 839s type=6, has_na=FALSE: 839s type=7, has_na=FALSE: 839s type=8, has_na=FALSE: 839s type=9, has_na=FALSE: 839s Random test #18 839s Adding NAs 839s num [1:57, 1:39] 223 156.8 -44.6 -127.5 -147.7 ... 839s type=1, has_na=TRUE: 839s type=2, has_na=TRUE: 839s type=3, has_na=TRUE: 839s type=4, has_na=TRUE: 839s type=5, has_na=TRUE: 840s type=6, has_na=TRUE: 840s type=7, has_na=TRUE: 840s type=8, has_na=TRUE: 840s type=9, has_na=TRUE: 840s Random test #19 840s Coercing to logical 840s logi [1:52, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 840s type=1, has_na=FALSE: 840s type=2, has_na=FALSE: 840s type=3, has_na=FALSE: 840s type=4, has_na=FALSE: 840s type=5, has_na=FALSE: 840s type=6, has_na=FALSE: 841s type=7, has_na=FALSE: 841s type=8, has_na=FALSE: 841s type=9, has_na=FALSE: 841s Random test #20 841s Adding NAs 841s Coercing to logical 841s logi [1:25, 1:48] NA TRUE NA NA NA NA ... 841s type=1, has_na=TRUE: 841s type=2, has_na=TRUE: 841s type=3, has_na=TRUE: 841s type=4, has_na=TRUE: 841s type=5, has_na=TRUE: 841s type=6, has_na=TRUE: 841s type=7, has_na=TRUE: 841s type=8, has_na=TRUE: 841s type=9, has_na=TRUE: 841s Random test #21 841s Coercing to integers 841s int [1:53, 1:27] 3 -30 203 -49 19 -45 -138 28 46 -44 ... 841s type=1, has_na=FALSE: 841s type=2, has_na=FALSE: 842s type=3, has_na=FALSE: 842s type=4, has_na=FALSE: 842s type=5, has_na=FALSE: 842s type=6, has_na=FALSE: 842s type=7, has_na=FALSE: 842s type=8, has_na=FALSE: 842s type=9, has_na=FALSE: 842s Random test #22 842s Adding NAs 842s Coercing to integers 842s int [1:48, 1:36] -131 NA NA -201 45 -17 NA 57 NA NA ... 842s type=1, has_na=TRUE: 842s type=2, has_na=TRUE: 843s type=3, has_na=TRUE: 843s type=4, has_na=TRUE: 843s type=5, has_na=TRUE: 843s type=6, has_na=TRUE: 843s type=7, has_na=TRUE: 843s type=8, has_na=TRUE: 843s type=9, has_na=TRUE: 843s Random test #23 843s num [1:23, 1:43] -99.2 -68.8 -86.7 -104.2 48 ... 843s type=1, has_na=FALSE: 843s type=2, has_na=FALSE: 843s type=3, has_na=FALSE: 843s type=4, has_na=FALSE: 843s type=5, has_na=FALSE: 843s type=6, has_na=FALSE: 843s type=7, has_na=FALSE: 843s type=8, has_na=FALSE: 843s type=9, has_na=FALSE: 844s Random test #24 844s Adding NAs 844s num [1:53, 1:29] NaN -67.6 10.8 -88.4 130.1 ... 844s type=1, has_na=TRUE: 844s type=2, has_na=TRUE: 844s type=3, has_na=TRUE: 844s type=4, has_na=TRUE: 844s type=5, has_na=TRUE: 844s type=6, has_na=TRUE: 844s type=7, has_na=TRUE: 844s type=8, has_na=TRUE: 844s type=9, has_na=TRUE: 844s > 844s > 844s > 844s > for (mode in c("logical", "integer", "double")) { 844s + naValue <- NA_real_ 844s + storage.mode(naValue) <- mode 844s + 844s + someValue <- 1 844s + storage.mode(someValue) <- mode 844s + 844s + for (type in 1:9) { 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + # All NA 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + x <- matrix(naValue, nrow = 3L, ncol = 4L) 844s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + # Test with and without dimnames on x 844s + for (setDimnames in c(TRUE, FALSE)) { 844s + if (setDimnames) dimnames(x) <- dimnames 844s + else dimnames(x) <- NULL 844s + # Check names attribute 844s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 844s + qr0 <- rowQuantiles_R(x, type = type, useNames = useNames) 844s + 844s + qr <- rowQuantiles(x, type = type, useNames = useNames) 844s + stopifnot(identical(qr, qr0)) 844s + 844s + # x <- matrix(naValue, nrow = 4L, ncol = 3L) 844s + qc <- colQuantiles(t(x), type = type, useNames = useNames) 844s + 844s + stopifnot(identical(qc, qr)) 844s + } 844s + } 844s + 844s + 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + # Empty matrices 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + probs <- c(0, 0.25, 0.75, 1) 844s + x <- matrix(naValue, nrow = 0L, ncol = 0L) 844s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 844s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 844s + 844s + x <- matrix(naValue, nrow = 2L, ncol = 0L) 844s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 844s + 844s + x <- matrix(naValue, nrow = 0L, ncol = 2L) 844s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 844s + 844s + 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + # Single column matrices 844s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 844s + probs <- c(0, 0.25, 0.75, 1) 844s + x <- matrix(someValue, nrow = 2L, ncol = 1L) 844s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + qr <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + print(qr) 844s + 844s + x <- matrix(someValue, nrow = 1L, ncol = 2L) 844s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 844s + qc <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 844s + print(qc) 844s + 844s + stopifnot(identical(qc, qr)) 844s + } 844s + } 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 844s 0% 25% 75% 100% 844s a 1 1 1 1 844s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s 0% 25% 75% 100% 845s a 1 1 1 1 845s b 1 1 1 1 845s > 845s 845s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 845s Copyright (C) 2024 The R Foundation for Statistical Computing 845s Platform: powerpc64le-unknown-linux-gnu 845s 845s R is free software and comes with ABSOLUTELY NO WARRANTY. 845s You are welcome to redistribute it under certain conditions. 845s Type 'license()' or 'licence()' for distribution details. 845s 845s R is a collaborative project with many contributors. 845s Type 'contributors()' for more information and 845s 'citation()' on how to cite R or R packages in publications. 845s 845s Type 'demo()' for some demos, 'help()' for on-line help, or 845s 'help.start()' for an HTML browser interface to help. 845s Type 'q()' to quit R. 845s 845s > library("matrixStats") 845s > 845s > ## Create isFALSE() if running on an old version of R 845s > if (!exists("isFALSE", mode="function")) { 845s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 845s + } 845s > 845s > rowQuantiles_R <- function(x, probs, na.rm = FALSE, drop = TRUE, ..., useNames = NA) { 845s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 845s + if (!na.rm && any(is.na(x))) { 845s + na_value <- NA_real_ 845s + storage.mode(na_value) <- storage.mode(x) 845s + rep(na_value, times = length(probs)) 845s + 845s + } else { 845s + as.vector(quantile(x, probs = probs, na.rm = na.rm, names = FALSE, ...)) 845s + } 845s + }, probs = probs, na.rm = na.rm) 845s + 845s + if (!is.null(dim(q))) q <- t(q) 845s + else dim(q) <- c(nrow(x), length(probs)) 845s + 845s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 845s + rownames(q) <- rownames(x) 845s + if (isFALSE(useNames)) dimnames(q) <- NULL 845s + 845s + if (drop) q <- drop(q) 845s + q 845s + } 845s > 845s > 845s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 845s > # Subsetted tests 845s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 845s > source("utils/validateIndicesFramework.R") 845s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 845s > dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 845s > probs <- c(0, 0.25, 0.75, 1) 845s > # Test with and without dimnames on x 845s > for (setDimnames in c(TRUE, FALSE)) { 845s + if (setDimnames) dimnames(x) <- dimnames 845s + else dimnames(x) <- NULL 845s + 845s + count <- 0L 845s + for (rows in index_cases) { 845s + for (cols in index_cases) { 845s + count <- count + 1L 845s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 845s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 845s + useNames <- useNames[count %% length(useNames) + 1] 845s + 845s + validateIndicesTestMatrix(x, rows, cols, 845s + ftest = rowQuantiles, fsure = rowQuantiles_R, 845s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 845s + validateIndicesTestMatrix(x, rows, cols, 845s + fcoltest = colQuantiles, fsure = rowQuantiles_R, 845s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 845s + } 845s + } 845s + } 847s > 847s > 847s 847s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 847s Copyright (C) 2024 The R Foundation for Statistical Computing 847s Platform: powerpc64le-unknown-linux-gnu 847s 847s R is free software and comes with ABSOLUTELY NO WARRANTY. 847s You are welcome to redistribute it under certain conditions. 847s Type 'license()' or 'licence()' for distribution details. 847s 847s R is a collaborative project with many contributors. 847s Type 'contributors()' for more information and 847s 'citation()' on how to cite R or R packages in publications. 847s 847s Type 'demo()' for some demos, 'help()' for on-line help, or 847s 'help.start()' for an HTML browser interface to help. 847s Type 'q()' to quit R. 847s 847s > library("matrixStats") 847s > 847s > rowMins_R <- function(x, ..., useNames = NA) { 847s + suppressWarnings({ 847s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 847s + }) 847s + if (is.na(useNames) || !useNames) names(res) <- NULL 847s + res 847s + } # rowMins_R() 847s > 847s > rowMaxs_R <- function(x, ..., useNames = NA) { 847s + suppressWarnings({ 847s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 847s + }) 847s + if (is.na(useNames) || !useNames) names(res) <- NULL 847s + res 847s + } # rowMaxs_R() 847s > 847s > rowRanges_R <- function(x, ..., useNames = NA) { 847s + suppressWarnings({ 847s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 847s + }) 847s + 847s + # Preserve rownames attribute 847s + dim <- c(dim(x)[1], 2L) 847s + if (!isTRUE(all.equal(dim(ans), dim))) { 847s + dim(ans) <- dim 847s + rownames <- rownames(x) 847s + if (!is.null(dimnames)) rownames(ans) <- rownames 847s + } 847s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 847s + ans 847s + } # rowRanges_R() 847s > 847s > 847s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 847s > # With and without some NAs 847s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 847s > for (mode in c("integer", "double")) { 847s + cat("mode: ", mode, "\n", sep = "") 847s + 847s + for (add_na in c(FALSE, TRUE)) { 847s + cat("add_na = ", add_na, "\n", sep = "") 847s + 847s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 847s + if (add_na) { 847s + x[3:7, c(2, 4)] <- NA_real_ 847s + } 847s + storage.mode(x) <- mode 847s + str(x) 847s + 847s + # To check names attribute 847s + dimnames <- list(letters[1:10], LETTERS[1:5]) 847s + 847s + # Test with and without dimnames on x 847s + for (setDimnames in c(TRUE, FALSE)) { 847s + if (setDimnames) dimnames(x) <- dimnames 847s + else dimnames(x) <- NULL 847s + # Row/column extremes 847s + for (na.rm in c(FALSE, TRUE)) { 847s + # Check names attribute 847s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 847s + cat("na.rm = ", na.rm, "\n", sep = "") 847s + 847s + # Ranges 847s + cat("range:\n") 847s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 847s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 847s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 847s + stopifnot(all.equal(r1, r2)) 847s + stopifnot(all.equal(r1, r0)) 847s + 847s + # Min 847s + cat("min:\n") 847s + m0 <- rowMins_R(x, na.rm = na.rm, useNames = useNames) 847s + m1 <- rowMins(x, na.rm = na.rm, useNames = useNames) 847s + m2 <- colMins(t(x), na.rm = na.rm, useNames = useNames) 847s + stopifnot(all.equal(m1, m2)) 847s + stopifnot(all.equal(m1, m0)) 847s + 847s + # Max 847s + cat("max:\n") 847s + m0 <- rowMaxs_R(x, na.rm = na.rm, useNames = useNames) 847s + m1 <- rowMaxs(x, na.rm = na.rm, useNames = useNames) 847s + m2 <- colMaxs(t(x), na.rm = na.rm, useNames = useNames) 847s + stopifnot(all.equal(m1, m2)) 847s + stopifnot(all.equal(m1, m0)) 847s + } 847s + } 847s + } 847s + } # for (add_na ...) 847s + } # for (mode ...) 847s mode: integer 847s add_na = FALSE 847s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s add_na = TRUE 847s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s mode: double 847s add_na = FALSE 847s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s add_na = TRUE 847s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = FALSE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s na.rm = TRUE 847s range: 847s min: 847s max: 847s > 847s > 847s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 847s > # All NAs 847s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 847s > for (mode in c("integer", "double")) { 847s + cat("mode: ", mode, "\n", sep = "") 847s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 847s + storage.mode(x) <- mode 847s + str(x) 847s + 847s + # Test with and without dimnames on x 847s + for (setDimnames in c(TRUE, FALSE)) { 847s + if (setDimnames) dimnames(x) <- dimnames 847s + else dimnames(x) <- NULL 847s + for (na.rm in c(FALSE, TRUE)) { 847s + # Check names attribute 847s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 847s + cat("na.rm = ", na.rm, "\n", sep = "") 848s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 848s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 848s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 848s + stopifnot(all.equal(r1, r2)) 848s + stopifnot(all.equal(r1, r0)) 848s + } 848s + } 848s + } 848s + } # for (mode ...) 848s mode: integer 848s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 848s na.rm = FALSE 848s na.rm = FALSE 848s na.rm = TRUE 848s na.rm = TRUE 848s na.rm = FALSE 848s na.rm = FALSE 848s na.rm = TRUE 848s na.rm = TRUE 848s mode: double 848s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 848s na.rm = FALSE 848s na.rm = FALSE 848s na.rm = TRUE 848s na.rm = TRUE 848s na.rm = FALSE 848s na.rm = FALSE 848s na.rm = TRUE 848s na.rm = TRUE 848s > 848s > 848s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 848s > # Special cases 848s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 848s > # Nx0 matrix 848s > x <- matrix(double(0L), nrow = 5L, ncol = 0L) 848s > r0 <- rowRanges_R(x) 848s > #r1 <- rowRanges(x) 848s > #r_truth <- matrix(c(Inf, -Inf), nrow = nrow(x), ncol = 2L, byrow = TRUE) 848s > #stopifnot(all.equal(r1, r_truth)) 848s > 848s > # 0xN matrix 848s > x <- t(x) 848s > #r1 <- colRanges(x) 848s > #stopifnot(all.equal(r1, r_truth)) 848s > 848s > # Nx1 matrix 848s > x <- matrix(1:5, nrow = 5L, ncol = 1L) 848s > # To check names attribute 848s > dimnames <- list(letters[1:5], "A") 848s > r1 <- rowRanges(x) 848s > r_truth <- matrix(1:5, nrow = nrow(x), ncol = 2L, byrow = FALSE) 848s > stopifnot(all.equal(r1, r_truth)) 848s > # Check names attribute 848s > dimnames(x) <- dimnames 848s > r0 <- rowRanges_R(x, useNames = TRUE) 848s > r1 <- rowRanges(x, useNames = TRUE) 848s > stopifnot(all.equal(r1, r0)) 848s > dimnames(x) <- NULL 848s > 848s > # 1xN matrix 848s > x <- t(x) 848s > r1 <- colRanges(x) 848s > stopifnot(all.equal(r1, r_truth)) 848s > # Check names attribute 848s > dimnames(x) <- list("a", LETTERS[1:5]) 848s > r1 <- colRanges(x, useNames = TRUE) 848s > stopifnot(identical(rownames(r1), colnames(x))) 848s > 848s > 848s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 848s > # Additional tests with NA_integer_, NA_real, NaN, -Inf, +Inf 848s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 848s > x <- matrix(1:12, nrow = 4L, ncol = 3L) 848s > 848s > na_list <- list( 848s + "integer" = matrix(1:12, nrow = 4L, ncol = 3L), 848s + "integer w/ NA" = matrix(NA_integer_, nrow = 4L, ncol = 3L), 848s + "real" = matrix(as.double(1:12), nrow = 4L, ncol = 3L), 848s + "real w/ NA" = matrix(NA_real_, nrow = 4L, ncol = 3L) 848s + ) 848s > 848s > na <- na_list[["real"]] 848s > na[2, 2] <- NA 848s > na_list[["real + NA cell"]] <- na 848s > 848s > na <- na_list[["real"]] 848s > na[2, ] <- NA 848s > na_list[["real + NA row"]] <- na 848s > 848s > na <- na_list[["real"]] 848s > na[2, ] <- NaN 848s > na_list[["real + NaN row"]] <- na 848s > 848s > na <- na_list[["real"]] 848s > na[2, 2] <- Inf 848s > na_list[["real + Inf cell"]] <- na 848s > 848s > na <- na_list[["real"]] 848s > na[2, ] <- Inf 848s > na_list[["real + Inf row"]] <- na 848s > 848s > na <- na_list[["real"]] 848s > na[2, 2] <- NaN 848s > na_list[["real + NaN cell"]] <- na 848s > 848s > na <- na_list[["real w/ NA"]] 848s > na[2, 2] <- NaN 848s > na_list[["real w/ NA + NaN cell"]] <- na 848s > 848s > na <- na_list[["real w/ NA"]] 848s > na[2, ] <- NaN 848s > na_list[["real w/ NA + NaN row"]] <- na 848s > 848s > # To check names attribute 848s > dimnames <- list(letters[1:4], LETTERS[1:3]) 848s > 848s > # Test with and without dimnames on x 848s > for (setDimnames in c(TRUE, FALSE)) { 848s + if (setDimnames) dimnames(x) <- dimnames 848s + else dimnames(x) <- NULL 848s + for (na.rm in c(FALSE, TRUE)) { 848s + for (name in names(na_list)) { 848s + # Check names attribute 848s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 848s + na <- na_list[[name]] 848s + cat(sprintf("%s (%s) w/ na.rm = %s:\n", name, typeof(na), na.rm)) 848s + print(na) 848s + 848s + cat(" min:\n") 848s + y0 <- rowMins_R(na, na.rm = na.rm, useNames = useNames) 848s + str(y0) 848s + y1 <- rowMins(na, na.rm = na.rm, useNames = useNames) 848s + str(y1) 848s + stopifnot(all.equal(y1, y0)) 848s + y1c <- colMins(t(na), na.rm = na.rm, useNames = useNames) 848s + str(y1c) 848s + stopifnot(all.equal(y1c, y1)) 848s + 848s + cat(" max:\n") 848s + y0 <- rowMaxs_R(na, na.rm = na.rm, useNames = useNames) 848s + str(y0) 848s + y1 <- rowMaxs(na, na.rm = na.rm, useNames = useNames) 848s + str(y1) 848s + stopifnot(all.equal(y1, y0)) 848s + y1c <- colMaxs(t(na), na.rm = na.rm, useNames = useNames) 848s + str(y1c) 848s + stopifnot(all.equal(y1c, y1)) 848s + 848s + cat(" range:\n") 848s + y0 <- rowRanges_R(na, na.rm = na.rm, useNames = useNames) 848s + str(y0) 848s + y1 <- rowRanges(na, na.rm = na.rm, useNames = useNames) 848s + str(y1) 848s + stopifnot(all.equal(y1, y0)) 848s + y1c <- colRanges(t(na), na.rm = na.rm, useNames = useNames) 848s + str(y1c) 848s + stopifnot(all.equal(y1c, y1)) 848s + } 848s + } # for (name ...) 848s + } # for (na.rm ...) 848s + } 848s integer (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer w/ NA (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s max: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s range: 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s integer w/ NA (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s max: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s range: 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real w/ NA (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real + NA cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + Inf cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + Inf row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s max: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s range: 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s real w/ NA + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s max: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s range: 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s integer (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer w/ NA (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s integer w/ NA (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real w/ NA (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real w/ NA (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real + NA cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real + NA cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real + NA row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NA row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NaN row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NaN row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + Inf cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + Inf row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NaN cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real + NaN cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real w/ NA + NaN row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real w/ NA + NaN row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s integer (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer w/ NA (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s max: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s range: 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s integer w/ NA (integer) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s max: 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s int [1:4] NA NA NA NA 848s range: 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s int [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real w/ NA (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real + NA cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NA row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s num [1:4] 1 NA 3 4 848s max: 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s num [1:4] 9 NA 11 12 848s range: 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 848s real + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NaN NaN NaN 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + Inf cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 Inf 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s num [1:4, 1:2] 1 2 3 4 9 ... 848s real + Inf row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + Inf row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] Inf Inf Inf 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s num [1:4] 9 Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NaN 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s num [1:4] 1 NaN 3 4 848s max: 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s num [1:4] 9 NaN 11 12 848s range: 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 848s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NaN NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s max: 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s num [1:4] NA NA NA NA 848s range: 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s num [1:4, 1:2] NA NA NA NA NA NA NA NA 848s real w/ NA + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s max: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s range: 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s real w/ NA + NaN row (double) w/ na.rm = FALSE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NaN NaN NaN 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s max: 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s num [1:4] NA NaN NA NA 848s range: 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 848s integer (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s int [1:4] 1 2 3 4 848s max: 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s int [1:4] 9 10 11 12 848s range: 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s int [1:4, 1:2] 1 2 3 4 9 10 11 12 848s integer w/ NA (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s integer w/ NA (integer) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 6 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real w/ NA (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real w/ NA (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] NA NA NA 848s [2,] NA NA NA 848s [3,] NA NA NA 848s [4,] NA NA NA 848s min: 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s num [1:4] Inf Inf Inf Inf 848s max: 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s num [1:4] -Inf -Inf -Inf -Inf 848s range: 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 848s real + NA cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real + NA cell (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] 2 NA 10 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s num [1:4] 1 2 3 4 848s max: 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s num [1:4] 9 10 11 12 848s range: 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s num [1:4, 1:2] 1 2 3 4 9 10 11 12 848s real + NA row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s num [1:4] 1 Inf 3 4 848s max: 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s num [1:4] 9 -Inf 11 12 848s range: 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s num [1:4, 1:2] 1 Inf 3 4 9 ... 848s real + NA row (double) w/ na.rm = TRUE: 848s [,1] [,2] [,3] 848s [1,] 1 5 9 848s [2,] NA NA NA 848s [3,] 3 7 11 848s [4,] 4 8 12 848s min: 848s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s max: 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s range: 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s real + NaN row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] NaN NaN NaN 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s max: 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s range: 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s real + NaN row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] NaN NaN NaN 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s max: 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s num [1:4] 9 -Inf 11 12 849s range: 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s real + Inf cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] 2 Inf 10 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s max: 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s range: 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s real + Inf cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] 2 Inf 10 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s max: 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s range: 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s num [1:4, 1:2] 1 2 3 4 9 ... 849s real + Inf row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] Inf Inf Inf 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s max: 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s range: 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s real + Inf row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] Inf Inf Inf 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s num [1:4] 1 Inf 3 4 849s max: 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s num [1:4] 9 Inf 11 12 849s range: 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s num [1:4, 1:2] 1 Inf 3 4 9 ... 849s real + NaN cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] 2 NaN 10 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s max: 849s num [1:4] 9 10 11 12 849s num [1:4] 9 10 11 12 849s num [1:4] 9 10 11 12 849s range: 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s real + NaN cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] 1 5 9 849s [2,] 2 NaN 10 849s [3,] 3 7 11 849s [4,] 4 8 12 849s min: 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s num [1:4] 1 2 3 4 849s max: 849s num [1:4] 9 10 11 12 849s num [1:4] 9 10 11 12 849s num [1:4] 9 10 11 12 849s range: 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s num [1:4, 1:2] 1 2 3 4 9 10 11 12 849s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] NA NA NA 849s [2,] NA NaN NA 849s [3,] NA NA NA 849s [4,] NA NA NA 849s min: 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s max: 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s range: 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] NA NA NA 849s [2,] NA NaN NA 849s [3,] NA NA NA 849s [4,] NA NA NA 849s min: 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s max: 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s range: 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s real w/ NA + NaN row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] NA NA NA 849s [2,] NaN NaN NaN 849s [3,] NA NA NA 849s [4,] NA NA NA 849s min: 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s max: 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s range: 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s real w/ NA + NaN row (double) w/ na.rm = TRUE: 849s [,1] [,2] [,3] 849s [1,] NA NA NA 849s [2,] NaN NaN NaN 849s [3,] NA NA NA 849s [4,] NA NA NA 849s min: 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s num [1:4] Inf Inf Inf Inf 849s max: 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s num [1:4] -Inf -Inf -Inf -Inf 849s range: 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 849s > 849s 849s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 849s Copyright (C) 2024 The R Foundation for Statistical Computing 849s Platform: powerpc64le-unknown-linux-gnu 849s 849s R is free software and comes with ABSOLUTELY NO WARRANTY. 849s You are welcome to redistribute it under certain conditions. 849s Type 'license()' or 'licence()' for distribution details. 849s 849s R is a collaborative project with many contributors. 849s Type 'contributors()' for more information and 849s 'citation()' on how to cite R or R packages in publications. 849s 849s Type 'demo()' for some demos, 'help()' for on-line help, or 849s 'help.start()' for an HTML browser interface to help. 849s Type 'q()' to quit R. 849s 849s > library("matrixStats") 849s > 849s > rowMins_R <- function(x, ..., useNames = NA) { 849s + suppressWarnings({ 849s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 849s + }) 849s + if (is.na(useNames) || !useNames) names(res) <- NULL 849s + res 849s + } # rowMins_R() 849s > 849s > rowMaxs_R <- function(x, ..., useNames = NA) { 849s + suppressWarnings({ 849s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 849s + }) 849s + if (is.na(useNames) || !useNames) names(res) <- NULL 849s + res 849s + } # rowMaxs_R() 849s > 849s > rowRanges_R <- function(x, ..., useNames = NA) { 849s + suppressWarnings({ 849s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 849s + }) 849s + 849s + # Preserve rownames attribute 849s + dim <- c(dim(x)[1], 2L) 849s + if (!isTRUE(all.equal(dim(ans), dim))) { 849s + dim(ans) <- dim 849s + rownames <- rownames(x) 849s + if (!is.null(dimnames)) rownames(ans) <- rownames 849s + } 849s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 849s + ans 849s + } # rowRanges_R() 849s > 849s > 849s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 849s > # Subsetted tests 849s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 849s > source("utils/validateIndicesFramework.R") 849s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 849s > storage.mode(x) <- "integer" 849s > 849s > # To check rownames/names attributes 849s > dimnames <- list(letters[1:6], LETTERS[1:6]) 849s > 849s > # Test with and without dimnames on x 849s > for (setDimnames in c(TRUE, FALSE)) { 849s + if (setDimnames) dimnames(x) <- dimnames 849s + else dimnames(x) <- NULL 849s + 849s + count <- 0L 849s + for (rows in index_cases) { 849s + for (cols in index_cases) { 849s + count <- count + 1L 849s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 849s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 849s + useNames <- useNames[count %% length(useNames) + 1] 849s + 849s + validateIndicesTestMatrix(x, rows, cols, 849s + ftest = rowRanges, fsure = rowRanges_R, 849s + na.rm = na.rm, useNames = useNames) 849s + validateIndicesTestMatrix(x, rows, cols, 849s + ftest = rowMins, fsure = rowMins_R, 849s + na.rm = na.rm, useNames = useNames) 849s + validateIndicesTestMatrix(x, rows, cols, 849s + ftest = rowMaxs, fsure = rowMaxs_R, 849s + na.rm = na.rm, useNames = useNames) 849s + 849s + validateIndicesTestMatrix(x, rows, cols, 849s + fcoltest = colRanges, fsure = rowRanges_R, 849s + na.rm = na.rm, useNames = useNames) 849s + validateIndicesTestMatrix(x, rows, cols, 849s + fcoltest = colMins, fsure = rowMins_R, 849s + na.rm = na.rm, useNames = useNames) 849s + validateIndicesTestMatrix(x, rows, cols, 849s + fcoltest = colMaxs, fsure = rowMaxs_R, 849s + na.rm = na.rm, useNames = useNames) 849s + } 849s + } 849s + } 852s > 852s 852s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 852s Copyright (C) 2024 The R Foundation for Statistical Computing 852s Platform: powerpc64le-unknown-linux-gnu 852s 852s R is free software and comes with ABSOLUTELY NO WARRANTY. 852s You are welcome to redistribute it under certain conditions. 852s Type 'license()' or 'licence()' for distribution details. 852s 852s R is a collaborative project with many contributors. 852s Type 'contributors()' for more information and 852s 'citation()' on how to cite R or R packages in publications. 852s 852s Type 'demo()' for some demos, 'help()' for on-line help, or 852s 'help.start()' for an HTML browser interface to help. 852s Type 'q()' to quit R. 852s 852s > library("matrixStats") 852s > 852s > dense_rank <- function(x) match(x, table = sort(unique(x))) 852s > 852s > rowRanks_R <- function(x, ties.method, ..., useNames = NA) { 852s + if (ties.method == "dense") { 852s + res <- t(apply(x, MARGIN = 1L, FUN = dense_rank)) 852s + } else { 852s + res <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", ties.method = ties.method)) 852s + } 852s + 852s + # Preserve dimnames attribute? 852s + dim(res) <- dim(x) 852s + dimnames(res) <- if (isTRUE(useNames)) dimnames(x) else NULL 852s + 852s + res 852s + } 852s > 852s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 852s + if (ties.method == "dense") { 852s + res <- t(apply(x, MARGIN = 2L, FUN = dense_rank)) 852s + } else { 852s + res <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 852s + } 852s + 852s + # Preserve dimnames attribute? 852s + tx <- t(x) 852s + dim(res) <- dim(tx) 852s + dimnames(res) <- if (isTRUE(useNames)) dimnames(tx) else NULL 852s + 852s + if (preserveShape) res <- t(res) 852s + res 852s + } 852s > 852s > set.seed(1) 852s > 852s > cat("Consistency checks:\n") 852s Consistency checks: 852s > xs <- vector("list", length = 4L) 852s > for (kk in 1:4) { 852s + 852s + # Simulate data in a matrix of any shape 852s + dim <- sample(40:80, size = 2L) 852s + n <- prod(dim) 852s + x <- rnorm(n, sd = 10) 852s + dim(x) <- dim 852s + 852s + # Add NAs? 852s + if ((kk %% 4) %in% c(3, 0)) { 852s + cat("Adding NAs\n") 852s + nna <- sample(n, size = 1L) 852s + x[sample(length(x), size = nna)] <- NA_real_ 852s + } 852s + 852s + # Integer or double? 852s + if ((kk %% 4) %in% c(2, 0)) { 852s + cat("Coercing to integers\n") 852s + storage.mode(x) <- "integer" 852s + } 852s + 852s + xs[[kk]] <- x 852s + } # for (kk ...) 852s Coercing to integers 852s Adding NAs 852s Adding NAs 852s Coercing to integers 852s > str(xs) 852s List of 4 852s $ : num [1:43, 1:78] 13.3 12.72 4.15 -15.4 -9.29 ... 852s $ : int [1:46, 1:61] 2 11 -16 -5 19 5 26 -13 1 -9 ... 852s $ : num [1:42, 1:47] NA -22.3 NA NA NA ... 852s $ : int [1:42, 1:78] NA NA NA NA NA NA NA NA NA NA ... 852s > 852s > for (kk in 1:4) { 852s + cat("Random test #", kk, "\n", sep = "") 852s + x <- xs[[kk]] 852s + tx <- t(x) 852s + 852s + for (ties in c("max", "min", "average", "first", "last", "dense")) { 852s + cat(sprintf("ties.method = %s\n", ties)) 852s + # rowRanks(): 852s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 852s + if (ties != "last" || getRversion() >= "3.3.0") { 852s + y2 <- rowRanks_R(x, ties.method = ties) 852s + stopifnot(identical(y1, y2)) 852s + } 852s + 852s + y3 <- matrixStats::colRanks(tx, ties.method = ties) 852s + stopifnot(identical(y1, y3)) 852s + 852s + # colRanks(): 852s + y1 <- matrixStats::colRanks(x, ties.method = ties) 852s + if (ties != "last" || getRversion() >= "3.3.0") { 852s + y2 <- colRanks_R(x, ties.method = ties) 852s + stopifnot(identical(y1, y2)) 852s + } 852s + 852s + y3 <- matrixStats::rowRanks(tx, ties.method = ties) 852s + stopifnot(identical(y1, y3)) 852s + } 852s + } # for (kk ...) 852s Random test #1 852s ties.method = max 852s ties.method = min 852s ties.method = average 852s ties.method = first 852s ties.method = last 852s ties.method = dense 852s Random test #2 852s ties.method = max 852s ties.method = min 852s ties.method = average 853s ties.method = first 853s ties.method = last 853s ties.method = dense 853s Random test #3 853s ties.method = max 853s ties.method = min 853s ties.method = average 853s ties.method = first 853s ties.method = last 853s ties.method = dense 853s Random test #4 853s ties.method = max 853s ties.method = min 853s ties.method = average 853s ties.method = first 853s ties.method = last 853s ties.method = dense 853s > 853s > # Note, below we know ties.method %in% c("min", "max", "average") is correct 853s > 853s > cat("Consistency checks for random:\n") 853s Consistency checks for random: 853s > tolerance <- 0.1 853s > nsamples <- 10000 853s > for (kk in 1:4) { 853s + cat("Random test #", kk, "\n", sep = "") 853s + x <- xs[[kk]] 853s + tx <- t(x) 853s + 853s + for (ties in c("random")) { 853s + cat(sprintf("ties.method = %s\n", ties)) 853s + 853s + ## rowRanks(): 853s + y0 <- rowRanks_R(x, ties.method = ties) 853s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 853s + 853s + ## Assert symmetric rank differences 853s + d <- y1 - y0 853s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 853s + 853s + ## Assert within [min, max] 853s + y2min <- matrixStats::rowRanks(x, ties.method = "min") 853s + y2max <- matrixStats::rowRanks(x, ties.method = "max") 853s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 853s + ## Assert near average 853s + y1list <- replicate(nsamples, matrixStats::rowRanks(x, ties.method = ties), simplify = FALSE) 853s + y1mean <- Reduce(`+`, y1list) / nsamples 853s + y2avg <- matrixStats::rowRanks(x, ties.method = "average") 853s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 853s + 853s + ## colRanks(): 853s + y0 <- colRanks_R(x, ties.method = ties) 853s + y1 <- matrixStats::colRanks(x, ties.method = ties) 853s + 853s + ## Assert symmetric rank differences 853s + d <- y1 - y0 853s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 853s + 853s + ## Assert within [min, max] 853s + y2min <- matrixStats::colRanks(x, ties.method = "min") 853s + y2max <- matrixStats::colRanks(x, ties.method = "max") 853s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 853s + y1list <- replicate(nsamples, matrixStats::colRanks(x, ties.method = ties), simplify = FALSE) 853s + y1mean <- Reduce(`+`, y1list) / nsamples 853s + ## Assert near average 853s + y2avg <- matrixStats::colRanks(x, ties.method = "average") 853s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 853s + } 853s + } # for (kk ...) 853s Random test #1 853s ties.method = random 857s Random test #2 857s ties.method = random 862s Random test #3 862s ties.method = random 875s Random test #4 875s ties.method = random 875s > 875s > 875s > ## Exception handling 875s > x <- matrix(1:12, nrow = 3L, ncol = 4L) 875s > y <- try(rowRanks(x, ties.method = "unknown"), silent = TRUE) 875s > stopifnot(inherits(y, "try-error")) 875s > 875s > y <- try(colRanks(x, ties.method = "unknown"), silent = TRUE) 875s > stopifnot(inherits(y, "try-error")) 875s > 875s > dimnames <- list(letters[1:3], LETTERS[1:4]) 875s > for (mode in c("integer", "double")){ 875s + storage.mode(x) <- mode 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + for (ties in c("max", "min", "average", "first", "last", "dense", "random")) { 875s + cat(sprintf("ties.method = %s\n", ties)) 875s + # rowRanks(): 875s + y1 <- matrixStats::rowRanks(x, ties.method = ties, useNames = useNames) 875s + if (ties != "last" || getRversion() >= "3.3.0") { 875s + y2 <- rowRanks_R(x, ties.method = ties, useNames = useNames) 875s + stopifnot(identical(y1, y2)) 875s + } 875s + 875s + y3 <- matrixStats::colRanks(t(x), ties.method = ties, useNames = useNames) 875s + stopifnot(identical(y1, y3)) 875s + 875s + # colRanks(): 875s + y1 <- matrixStats::colRanks(x, ties.method = ties, useNames = useNames) 875s + if (ties != "last" || getRversion() >= "3.3.0") { 875s + y2 <- colRanks_R(x, ties.method = ties, useNames = useNames) 875s + stopifnot(identical(y1, y2)) 875s + } 875s + 875s + y3 <- matrixStats::rowRanks(t(x), ties.method = ties, useNames = useNames) 875s + stopifnot(identical(y1, y3)) 875s + 875s + # Check preserveShape 875s + y1 <- matrixStats::colRanks(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 875s + if (ties != "last" || getRversion() >= "3.3.0") { 875s + y2 <- colRanks_R(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 875s + stopifnot(identical(y1, y2)) 875s + } 875s + } 875s + } 875s + } 875s + } 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s ties.method = max 875s ties.method = min 875s ties.method = average 875s ties.method = first 875s ties.method = last 875s ties.method = dense 875s ties.method = random 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > rowRanks_R <- function(x, ties.method = "average", ..., useNames = NA) { 875s + ans <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", 875s + ties.method = ties.method)) 875s + 875s + # Preserve dimnames attribute? 875s + dim(ans) <- dim(x) 875s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(x) else NULL 875s + 875s + ans 875s + } 875s > 875s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 875s + ans <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 875s + 875s + # Preserve dimnames attribute? 875s + tx <- t(x) 875s + dim(ans) <- dim(tx) 875s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(tx) else NULL 875s + 875s + if (preserveShape) ans <- t(ans) 875s + ans 875s + } 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Subsetted tests 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > source("utils/validateIndicesFramework.R") 875s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 875s > storage.mode(x) <- "integer" 875s > 875s > # To check dimnames attribute 875s > dimnames <- list(letters[1:6], LETTERS[1:6]) 875s > 875s > colRanks_R_t <- function(x, rows, cols, ..., useNames = NA) { 875s + t(colRanks(t(x), rows = cols, cols = rows, preserveShape = TRUE, ..., useNames = useNames)) 875s + } 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + 875s + count <- 0L 875s + for (rows in index_cases) { 875s + for (cols in index_cases) { 875s + count <- count + 1L 875s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 875s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 875s + useNames <- useNames[count %% length(useNames) + 1] 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowRanks, fsure = rowRanks_R, 875s + ties.method = "average", useNames = useNames) 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = colRanks_R_t, fsure = rowRanks_R, 875s + ties.method = "average", useNames = useNames) 875s + 875s + for (perserveShape in c(TRUE, FALSE)) { 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = colRanks, fsure = colRanks_R, 875s + ties.method = "average", perserveShape = perserveShape, 875s + useNames = useNames) 875s + } 875s + } 875s + } 875s + } 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 875s > options(matrixStats.center.onUse = "ignore") 875s > 875s > ## Create isFALSE() if running on an old version of R 875s > if (!exists("isFALSE", mode="function")) { 875s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 875s + } 875s > 875s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 875s + suppressWarnings({ 875s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 875s + }) 875s + stopifnot(!any(is.infinite(sigma))) 875s + 875s + # Keep naming support consistency same as rowSds() 875s + if (is.null(center) || ncol(x) <= 1L) { 875s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 875s + } 875s + else if (isFALSE(useNames)) names(sigma) <- NULL 875s + sigma 875s + } 875s > 875s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 875s + suppressWarnings({ 875s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 875s + }) 875s + stopifnot(!any(is.infinite(sigma))) 875s + 875s + # Keep naming support consistency same as colSds() 875s + if (is.null(center) || nrow(x) <= 1L) { 875s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 875s + } 875s + if (isFALSE(useNames)) names(sigma) <- NULL 875s + sigma 875s + } 875s > 875s > 875s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 875s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 875s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 875s + stopifnot(!any(is.infinite(sigma))) 875s + sigma 875s + } 875s > 875s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 875s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 875s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 875s + stopifnot(!any(is.infinite(sigma))) 875s + sigma 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # With and without some NAs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > for (mode in c("integer", "double")) { 875s + for (add_na in c(FALSE, TRUE)) { 875s + cat("add_na = ", add_na, "\n", sep = "") 875s + 875s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 875s + if (add_na) { 875s + x[3:7, c(2, 4)] <- NA_real_ 875s + } 875s + cat("mode: ", mode, "\n", sep = "") 875s + storage.mode(x) <- mode 875s + str(x) 875s + 875s + # To check names attribute 875s + dimnames <- list(letters[1:10], LETTERS[1:5]) 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Row/column ranges 875s + for (na.rm in c(FALSE, TRUE)) { 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 875s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 875s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 875s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 875s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 875s + stopifnot(all.equal(r1, r2)) 875s + stopifnot(all.equal(r1, r0)) 875s + stopifnot(all.equal(r2, r0)) 875s + stopifnot(all.equal(r1b, r2b)) 875s + stopifnot( 875s + !any(is.infinite(r1)), 875s + !any(is.infinite(r2)), 875s + !any(is.infinite(r1b)), 875s + !any(is.infinite(r2b)) 875s + ) 875s + } 875s + } 875s + } 875s + } # for (add_na ...) 875s + } 875s add_na = FALSE 875s mode: integer 875s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 875s add_na = TRUE 875s mode: integer 875s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 875s add_na = FALSE 875s mode: double 875s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 875s add_na = TRUE 875s mode: double 875s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # All NAs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > for (mode in c("integer", "double")) { 875s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 875s + cat("mode: ", mode, "\n", sep = "") 875s + storage.mode(x) <- mode 875s + str(x) 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Row/column ranges 875s + for (na.rm in c(FALSE, TRUE)) { 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 875s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 875s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 875s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 875s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 875s + stopifnot(all.equal(r1, r2)) 875s + stopifnot(all.equal(r1, r0)) 875s + stopifnot(all.equal(r2, r0)) 875s + stopifnot(all.equal(r1b, r2b)) 875s + stopifnot( 875s + !any(is.infinite(r1)), 875s + !any(is.infinite(r2)), 875s + !any(is.infinite(r1b)), 875s + !any(is.infinite(r2b)) 875s + ) 875s + } 875s + } 875s + } 875s + } 875s mode: integer 875s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 875s mode: double 875s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # A 1x1 matrix 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > x <- matrix(0, nrow = 1L, ncol = 1L) 875s > dimnames <- list("a", "A") 875s > for (na.rm in c(FALSE, TRUE)) { 875s + cat("na.rm = ", na.rm, "\n", sep = "") 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Row/column ranges 875s + for (na.rm in c(FALSE, TRUE)) { 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 875s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 875s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 875s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 875s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 875s + stopifnot(all.equal(r1, r2)) 875s + stopifnot(all.equal(r1, r0)) 875s + stopifnot(all.equal(r2, r0)) 875s + stopifnot(all.equal(r1b, r2b)) 875s + stopifnot( 875s + !any(is.infinite(r1)), 875s + !any(is.infinite(r2)), 875s + !any(is.infinite(r1b)), 875s + !any(is.infinite(r2b)) 875s + ) 875s + } 875s + } 875s + } 875s + } 875s na.rm = FALSE 875s na.rm = TRUE 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 875s > options(matrixStats.center.onUse = "ignore") 875s > 875s > ## Create isFALSE() if running on an old version of R 875s > if (!exists("isFALSE", mode="function")) { 875s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 875s + } 875s > 875s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 875s + suppressWarnings({ 875s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 875s + }) 875s + stopifnot(!any(is.infinite(sigma))) 875s + 875s + # Keep naming support consistency same as rowSds() 875s + if (is.null(center) || ncol(x) <= 1L) { 875s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 875s + } 875s + else if (isFALSE(useNames)) names(sigma) <- NULL 875s + sigma 875s + } 875s > 875s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 875s + suppressWarnings({ 875s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 875s + }) 875s + stopifnot(!any(is.infinite(sigma))) 875s + 875s + # Keep naming support consistency same as colSds() 875s + if (is.null(center) || nrow(x) <= 1L) { 875s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 875s + } 875s + else if (isFALSE(useNames)) names(sigma) <- NULL 875s + sigma 875s + } 875s > 875s > 875s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 875s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 875s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 875s + stopifnot(!any(is.infinite(sigma))) 875s + sigma 875s + } 875s > 875s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 875s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 875s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 875s + stopifnot(!any(is.infinite(sigma))) 875s + sigma 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Subsetted tests 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > source("utils/validateIndicesFramework.R") 875s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 875s > storage.mode(x) <- "integer" 875s > 875s > # To check names attribute 875s > dimnames <- list(letters[1:6], LETTERS[1:6]) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + 875s + count <- 0L 875s + for (rows in index_cases) { 875s + for (cols in index_cases) { 875s + count <- count + 1L 875s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 875s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 875s + useNames <- useNames[count %% length(useNames) + 1] 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowSds, fsure = rowSds_R, 875s + na.rm = na.rm, useNames = useNames) 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowSds_center, fsure = rowSds_R, 875s + na.rm = na.rm, center = TRUE, useNames = useNames) 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + fcoltest = colSds, fsure = rowSds_R, 875s + na.rm = na.rm, useNames = useNames) 875s + validateIndicesTestMatrix(x, rows, cols, 875s + fcoltest = colSds_center, fsure = rowSds_R, 875s + na.rm = na.rm, center = TRUE, useNames = useNames) 875s + } 875s + } 875s + } 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 875s + ## FIXME: sum() may overflow for integers, whereas 875s + ## base::rowSums() doesn't. What should rowSums2() do? 875s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 875s + res <- rowSums(x, na.rm = na.rm) 875s + if (is.na(useNames) || !useNames) names(res) <- NULL 875s + res 875s + } 875s > 875s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 875s + ## FIXME: sum() may overflow for integers, whereas 875s + ## base::colSums() doesn't. What should colSums2() do? 875s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 875s + res <- colSums(x, na.rm = na.rm) 875s + if (is.na(useNames) || !useNames) names(res) <- NULL 875s + res 875s + } 875s > 875s > for (mode in c("integer", "logical", "double")) { 875s + x <- matrix(-4:4, nrow = 3, ncol = 3) 875s + storage.mode(x) <- mode 875s + if (mode == "double") x <- x + 0.1 875s + 875s + # To check names attribute 875s + dimnames <- list(letters[1:3], LETTERS[1:3]) 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s + } 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: Single-element matrix 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: Single-element matrix:\n") 875s Special case: Single-element matrix: 875s > for (mode in c("integer", "logical", "double")) { 875s + x <- matrix(1, nrow = 1, ncol = 1) 875s + storage.mode(x) <- mode 875s + 875s + # To check names attribute 875s + dimnames <- list("a", "A") 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: Empty matrix 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: Empty matrix:\n") 875s Special case: Empty matrix: 875s > for (mode in c("integer", "logical", "double")) { 875s + x <- matrix(integer(0), nrow = 0, ncol = 0) 875s + storage.mode(x) <- mode 875s + 875s + y0 <- rowSums2_R(x, na.rm = FALSE) 875s + y1 <- rowSums2(x, na.rm = FALSE) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE) 875s + y1 <- colSums2(x, na.rm = FALSE) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: All NAs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: All NAs:\n") 875s Special case: All NAs: 875s > for (mode in c("integer", "logical", "double")) { 875s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 875s + storage.mode(x) <- mode 875s + 875s + # To check names attribute 875s + dimnames <- list(letters[1:3], LETTERS[1:3]) 875s + 875s + # Test with and without dimnames on x 875s + for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: All NaNs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: All NaNs:\n") 875s Special case: All NaNs: 875s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: All Infs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: All Infs:\n") 875s Special case: All Infs: 875s > x <- matrix(Inf, nrow = 3, ncol = 3) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: All -Infs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: All -Infs:\n") 875s Special case: All -Infs: 875s > x <- matrix(-Inf, nrow = 3, ncol = 3) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: Infs and -Infs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: Infs and -Infs:\n") 875s Special case: Infs and -Infs: 875s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 875s > 875s > # To check names attribute 875s > dimnames <- list(letters[1:4], LETTERS[1:4]) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: NaNs and NAs 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: Infs and -Infs:\n") 875s Special case: Infs and -Infs: 875s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 875s > 875s > y0 <- rowSums(x, na.rm = FALSE) 875s > str(y0) 875s num [1:4] NaN NA NaN NA 875s > stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 875s > y1 <- rowSums2(x, na.rm = FALSE) 875s > str(y0) 875s num [1:4] NaN NA NaN NA 875s > stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 875s > stopifnot(all.equal(y1, y0)) 875s > 875s > y0 <- colSums(x, na.rm = FALSE) 875s > stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 875s > y1 <- colSums2(x, na.rm = FALSE) 875s > stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 875s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 875s > ## returned here (as one would expect). NaN might very well be returned, 875s > ## when both NA and NaN are involved. This is an accepted feature in R, 875s > ## which is documented in help("is.nan"). See also 875s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 875s > ## Thus, we cannot guarantee that y1 is identical to y0. 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Special case: Integer overflow with ties 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > cat("Special case: Integer overflow with ties:\n") 875s Special case: Integer overflow with ties: 875s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + # Check names attribute 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + 875s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 875s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 875s + stopifnot(all.equal(y1, y0)) 875s + } 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Consistency checks 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > set.seed(1) 875s > 875s > cat("Consistency checks:\n") 875s Consistency checks: 875s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 875s > for (kk in seq_len(n_sims)) { 875s + cat("Random test #", kk, "\n", sep = "") 875s + 875s + # Simulate data in a matrix of any shape 875s + dim <- sample(50:200, size = 2) 875s + n <- prod(dim) 875s + x <- rnorm(n, sd = 100) 875s + dim(x) <- dim 875s + 875s + # Add NAs? 875s + if ((kk %% 4) %in% c(3, 0)) { 875s + cat("Adding NAs\n") 875s + nna <- sample(n, size = 1) 875s + na_values <- c(NA_real_, NaN) 875s + t <- sample(na_values, size = nna, replace = TRUE) 875s + x[sample(length(x), size = nna)] <- t 875s + } 875s + 875s + # Mode? 875s + modes <- "double" 875s + if ((kk %% 4) %in% c(2, 0)) { 875s + modes <- c("integer", "logical") 875s + } 875s + 875s + for (mode in modes) { 875s + if (mode != "double") { 875s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 875s + storage.mode(x) <- mode 875s + } 875s + 875s + na.rm <- sample(c(TRUE, FALSE), size = 1) 875s + 875s + # rowSums2(): 875s + y0 <- rowSums2_R(x, na.rm = na.rm) 875s + y1 <- rowSums2(x, na.rm = na.rm) 875s + stopifnot(all.equal(y1, y0)) 875s + y2 <- colSums2(t(x), na.rm = na.rm) 875s + stopifnot(all.equal(y2, y0)) 875s + 875s + # colSums2(): 875s + y0 <- colSums2_R(x, na.rm = na.rm) 875s + y1 <- colSums2(x, na.rm = na.rm) 875s + stopifnot(all.equal(y1, y0)) 875s + y2 <- rowSums2(t(x), na.rm = na.rm) 875s + stopifnot(all.equal(y2, y0)) 875s + } 875s + } # for (kk ...) 875s Random test #1 875s Random test #2 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #3 875s Adding NAs 875s Random test #4 875s Adding NAs 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #5 875s Random test #6 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #7 875s Adding NAs 875s Random test #8 875s Adding NAs 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #9 875s Random test #10 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #11 875s Adding NAs 875s Random test #12 875s Adding NAs 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #13 875s Random test #14 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #15 875s Adding NAs 875s Random test #16 875s Adding NAs 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #17 875s Random test #18 875s Coercing from double to integer 875s Coercing from integer to logical 875s Random test #19 875s Adding NAs 875s Random test #20 875s Adding NAs 875s Coercing from double to integer 875s Coercing from integer to logical 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 875s + ## FIXME: sum() may overflow for integers, whereas 875s + ## base::rowSums() doesn't. What should rowSums2() do? 875s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 875s + res <- rowSums(x, na.rm = na.rm) 875s + if (is.na(useNames) || !useNames) names(res) <- NULL 875s + res 875s + } 875s > 875s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 875s + ## FIXME: sum() may overflow for integers, whereas 875s + ## base::colSums() doesn't. What should colSums2() do? 875s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 875s + res <- colSums(x, na.rm = na.rm) 875s + if (is.na(useNames) || !useNames) names(res) <- NULL 875s + res 875s + } 875s > 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Subsetted tests 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > source("utils/validateIndicesFramework.R") 875s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 875s > storage.mode(x) <- "integer" 875s > 875s > # To check names attribute 875s > dimnames <- list(letters[1:6], LETTERS[1:6]) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + for (rows in index_cases) { 875s + for (cols in index_cases) { 875s + for (na.rm in c(TRUE, FALSE)) { 875s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowSums2, fsure = rowSums2_R, 875s + na.rm = na.rm, useNames = useNames) 875s + validateIndicesTestMatrix(x, rows, cols, 875s + fcoltest = colSums2, fsure = rowSums2_R, 875s + na.rm = na.rm, useNames = useNames) 875s + } 875s + } 875s + } 875s + } 875s + } 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > nrow <- 6L 875s > ncol <- 5L 875s > data <- matrix(0:4, nrow = nrow, ncol = ncol) 875s > 875s > # To check names attribute 875s > dimnames <- list(letters[1:6], LETTERS[1:5]) 875s > 875s > modes <- c("integer", "logical", "raw") 875s > for (mode in modes) { 875s + cat(sprintf("Mode: %s...\n", mode)) 875s + 875s + x <- data 875s + if (mode == "logical") x <- x - 2L 875s + if (mode != "raw") x[c(2,5,7)] <- NA_integer_ 875s + storage.mode(x) <- mode 875s + print(x) 875s + 875s + unique_values <- unique(as.vector(x)) 875s + nbr_of_unique_values <- length(unique_values) 875s + 875s + y <- rowTabulates(x) 875s + print(y) 875s + stopifnot( 875s + identical(dim(y), c(nrow, nbr_of_unique_values)), 875s + all(y >= 0) 875s + ) 875s + if (mode != "raw") { 875s + y0 <- t(table(x, row(x), useNA = "always")[, seq_len(nrow(x))]) 875s + stopifnot(all(y == y0)) 875s + } 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- rowTabulates(x, useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- rowTabulates(x, useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y <- rowTabulates(x, useNames = TRUE) 875s + stopifnot(identical(rownames(y), rownames(x))) 875s + dimnames(x) <- NULL 875s + 875s + y <- colTabulates(x) 875s + print(y) 875s + stopifnot( 875s + identical(dim(y), c(ncol, nbr_of_unique_values)), 875s + all(y >= 0) 875s + ) 875s + if (mode != "raw") { 875s + y0 <- t(table(x, col(x), useNA = "always")[, seq_len(ncol(x))]) 875s + stopifnot(all(y == y0)) 875s + } 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- colTabulates(x, useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- colTabulates(x, useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y <- colTabulates(x, useNames = TRUE) 875s + stopifnot(identical(rownames(y), colnames(x))) 875s + dimnames(x) <- NULL 875s + 875s + # Count only certain values 875s + if (mode == "integer") { 875s + subset <- c(0:2, NA_integer_) 875s + } else if (mode == "logical") { 875s + subset <- c(TRUE, FALSE, NA) 875s + } else { 875s + subset <- c(0:2) 875s + } 875s + y <- rowTabulates(x, values = subset) 875s + print(y) 875s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- rowTabulates(x, values = subset, useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- rowTabulates(x, values = subset, useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y <- rowTabulates(x, values = subset, useNames = TRUE) 875s + stopifnot(identical(rownames(y), rownames(x))) 875s + dimnames(x) <- NULL 875s + 875s + y <- colTabulates(x, values = subset) 875s + print(y) 875s + stopifnot(identical(dim(y), c(ncol, length(subset)))) 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- colTabulates(x, values = subset, useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- colTabulates(x, values = subset, useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y <- colTabulates(x, values = subset, useNames = TRUE) 875s + stopifnot(identical(rownames(y), colnames(x))) 875s + dimnames(x) <- NULL 875s + 875s + # Raw 875s + if (mode %in% c("integer", "raw")) { 875s + subset <- c(0:2) 875s + 875s + y <- rowTabulates(x, values = as.raw(subset)) 875s + print(y) 875s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- rowTabulates(x, values = as.raw(subset), useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- rowTabulates(x, values = as.raw(subset), useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y3 <- rowTabulates(x, values = as.raw(subset), useNames = TRUE) 875s + stopifnot(identical(rownames(y3), rownames(x))) 875s + dimnames(x) <- NULL 875s + 875s + y2 <- colTabulates(t(x), values = as.raw(subset)) 875s + print(y2) 875s + stopifnot( 875s + identical(dim(y2), c(nrow, length(subset))), 875s + identical(y2, y) 875s + ) 875s + # Check names attribute 875s + dimnames(x) <- dimnames 875s + y1 <- colTabulates(t(x), values = as.raw(subset), useNames = FALSE) 875s + stopifnot(all.equal(y1, y)) 875s + if (!matrixStats:::isUseNamesNADefunct()) { 875s + y2 <- colTabulates(t(x), values = as.raw(subset), useNames = NA) 875s + stopifnot(all.equal(y2, y)) 875s + } 875s + y <- colTabulates(t(x), values = as.raw(subset), useNames = TRUE) 875s + stopifnot(identical(rownames(y), colnames(t(x)))) 875s + dimnames(x) <- NULL 875s + } 875s + 875s + cat(sprintf("Mode: %s...done\n", mode)) 875s + } # for (mode ...) 875s Mode: integer... 875s [,1] [,2] [,3] [,4] [,5] 875s [1,] 0 NA 2 3 4 875s [2,] NA 2 3 4 0 875s [3,] 2 3 4 0 1 875s [4,] 3 4 0 1 2 875s [5,] NA 0 1 2 3 875s [6,] 0 1 2 3 4 875s 0 1 2 3 4 875s [1,] 1 0 1 1 1 1 875s [2,] 1 0 1 1 1 1 875s [3,] 1 1 1 1 1 0 875s [4,] 1 1 1 1 1 0 875s [5,] 1 1 1 1 0 1 875s [6,] 1 1 1 1 1 0 875s 0 1 2 3 4 875s [1,] 2 0 1 1 0 2 875s [2,] 1 1 1 1 1 1 875s [3,] 1 1 2 1 1 0 875s [4,] 1 1 1 2 1 0 875s [5,] 1 1 1 1 2 0 875s 0 1 2 875s [1,] 1 0 1 1 875s [2,] 1 0 1 1 875s [3,] 1 1 1 0 875s [4,] 1 1 1 0 875s [5,] 1 1 1 1 875s [6,] 1 1 1 0 875s 0 1 2 875s [1,] 2 0 1 2 875s [2,] 1 1 1 1 875s [3,] 1 1 2 0 875s [4,] 1 1 1 0 875s [5,] 1 1 1 0 875s 0x0 0x1 0x2 875s [1,] 1 0 1 875s [2,] 1 0 1 875s [3,] 1 1 1 875s [4,] 1 1 1 875s [5,] 1 1 1 875s [6,] 1 1 1 875s 0x0 0x1 0x2 875s [1,] 1 0 1 875s [2,] 1 0 1 875s [3,] 1 1 1 875s [4,] 1 1 1 875s [5,] 1 1 1 875s [6,] 1 1 1 875s Mode: integer...done 875s Mode: logical... 875s [,1] [,2] [,3] [,4] [,5] 875s [1,] TRUE NA FALSE TRUE TRUE 875s [2,] NA FALSE TRUE TRUE TRUE 875s [3,] FALSE TRUE TRUE TRUE TRUE 875s [4,] TRUE TRUE TRUE TRUE FALSE 875s [5,] NA TRUE TRUE FALSE TRUE 875s [6,] TRUE TRUE FALSE TRUE TRUE 875s FALSE TRUE 875s [1,] 1 3 1 875s [2,] 1 3 1 875s [3,] 1 4 0 875s [4,] 1 4 0 875s [5,] 1 3 1 875s [6,] 1 4 0 875s FALSE TRUE 875s [1,] 1 3 2 875s [2,] 1 4 1 875s [3,] 2 4 0 875s [4,] 1 5 0 875s [5,] 1 5 0 875s TRUE FALSE 875s [1,] 3 1 1 875s [2,] 3 1 1 875s [3,] 4 1 0 875s [4,] 4 1 0 875s [5,] 3 1 1 875s [6,] 4 1 0 875s TRUE FALSE 875s [1,] 3 1 2 875s [2,] 4 1 1 875s [3,] 4 2 0 875s [4,] 5 1 0 875s [5,] 5 1 0 875s Mode: logical...done 875s Mode: raw... 875s [,1] [,2] [,3] [,4] [,5] 875s [1,] 00 01 02 03 04 875s [2,] 01 02 03 04 00 875s [3,] 02 03 04 00 01 875s [4,] 03 04 00 01 02 875s [5,] 04 00 01 02 03 875s [6,] 00 01 02 03 04 875s 0x0 0x1 0x2 0x3 0x4 875s [1,] 1 1 1 1 1 875s [2,] 1 1 1 1 1 875s [3,] 1 1 1 1 1 875s [4,] 1 1 1 1 1 875s [5,] 1 1 1 1 1 875s [6,] 1 1 1 1 1 875s 0x0 0x1 0x2 0x3 0x4 875s [1,] 2 1 1 1 1 875s [2,] 1 2 1 1 1 875s [3,] 1 1 2 1 1 875s [4,] 1 1 1 2 1 875s [5,] 1 1 1 1 2 875s 0 1 2 875s [1,] 1 1 1 875s [2,] 1 1 1 875s [3,] 1 1 1 875s [4,] 1 1 1 875s [5,] 1 1 1 875s [6,] 1 1 1 875s 0 1 2 875s [1,] 2 1 1 875s [2,] 1 2 1 875s [3,] 1 1 2 875s [4,] 1 1 1 875s [5,] 1 1 1 875s 0x0 0x1 0x2 875s [1,] 1 1 1 875s [2,] 1 1 1 875s [3,] 1 1 1 875s [4,] 1 1 1 875s [5,] 1 1 1 875s [6,] 1 1 1 875s 0x0 0x1 0x2 875s [1,] 1 1 1 875s [2,] 1 1 1 875s [3,] 1 1 1 875s [4,] 1 1 1 875s [5,] 1 1 1 875s [6,] 1 1 1 875s Mode: raw...done 875s > 875s 875s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 875s Copyright (C) 2024 The R Foundation for Statistical Computing 875s Platform: powerpc64le-unknown-linux-gnu 875s 875s R is free software and comes with ABSOLUTELY NO WARRANTY. 875s You are welcome to redistribute it under certain conditions. 875s Type 'license()' or 'licence()' for distribution details. 875s 875s R is a collaborative project with many contributors. 875s Type 'contributors()' for more information and 875s 'citation()' on how to cite R or R packages in publications. 875s 875s Type 'demo()' for some demos, 'help()' for on-line help, or 875s 'help.start()' for an HTML browser interface to help. 875s Type 'q()' to quit R. 875s 875s > library("matrixStats") 875s > 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > # Subsetted tests 875s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 875s > source("utils/validateIndicesFramework.R") 875s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 875s > storage.mode(x) <- "integer" 875s > 875s > # To check names attribute 875s > dimnames <- list(letters[1:6], LETTERS[1:6]) 875s > 875s > # Test with and without dimnames on x 875s > for (setDimnames in c(TRUE, FALSE)) { 875s + if (setDimnames) dimnames(x) <- dimnames 875s + else dimnames(x) <- NULL 875s + 875s + count <- 0L 875s + for (rows in index_cases) { 875s + for (cols in index_cases) { 875s + count <- count + 1L 875s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 875s + useNames <- useNames[count %% length(useNames) + 1] 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowTabulates, fsure = rowTabulates, useNames = useNames) 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = rowTabulates, fsure = rowTabulates, 875s + values = 1:3, useNames = useNames) 875s + 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = colTabulates, fsure = colTabulates, useNames = useNames) 875s + validateIndicesTestMatrix(x, rows, cols, 875s + ftest = colTabulates, fsure = colTabulates, 875s + values = 1:3, useNames = useNames) 875s + } 875s + } 875s + } 877s > 877s 877s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 877s Copyright (C) 2024 The R Foundation for Statistical Computing 877s Platform: powerpc64le-unknown-linux-gnu 877s 877s R is free software and comes with ABSOLUTELY NO WARRANTY. 877s You are welcome to redistribute it under certain conditions. 877s Type 'license()' or 'licence()' for distribution details. 877s 877s R is a collaborative project with many contributors. 877s Type 'contributors()' for more information and 877s 'citation()' on how to cite R or R packages in publications. 877s 877s Type 'demo()' for some demos, 'help()' for on-line help, or 877s 'help.start()' for an HTML browser interface to help. 877s Type 'q()' to quit R. 877s 878s > library("matrixStats") 878s > 878s > fcns <- list( 878s + rowVarDiffs = list(rowVarDiffs, colVarDiffs), 878s + rowSdDiffs = list(rowSdDiffs, colSdDiffs), 878s + rowMadDiffs = list(rowMadDiffs, colMadDiffs), 878s + rowIQRDiffs = list(rowIQRDiffs, colIQRDiffs) 878s + ) 878s > 878s > for (fcn in names(fcns)) { 878s + cat(sprintf("%s()...\n", fcn)) 878s + row_fcn <- fcns[[fcn]][[1L]] 878s + col_fcn <- fcns[[fcn]][[2L]] 878s + 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + # With and without some NAs 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + for (mode in c("integer", "double")) { 878s + for (add_na in c(FALSE, TRUE)) { 878s + cat("add_na = ", add_na, "\n", sep = "") 878s + 878s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 878s + if (add_na) { 878s + x[3:7, c(2, 4)] <- NA_real_ 878s + } 878s + cat("mode: ", mode, "\n", sep = "") 878s + storage.mode(x) <- mode 878s + str(x) 878s + 878s + # To check names attribute 878s + dimnames <- list(letters[1:10], LETTERS[1:5]) 878s + 878s + # Test with and without dimnames on x 878s + for (setDimnames in c(TRUE, FALSE)) { 878s + if (setDimnames) dimnames(x) <- dimnames 878s + else dimnames(x) <- NULL 878s + # Row/column ranges 878s + for (na.rm in c(FALSE, TRUE)) { 878s + # Check names attribute 878s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 878s + cat("na.rm = ", na.rm, "\n", sep = "") 878s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 878s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 878s + stopifnot(all.equal(r1, r2)) 878s + } 878s + } 878s + } 878s + } # for (add_na ...) 878s + } 878s + 878s + 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + # All NAs 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + for (mode in c("integer", "double")) { 878s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 878s + cat("mode: ", mode, "\n", sep = "") 878s + storage.mode(x) <- mode 878s + str(x) 878s + 878s + # Test with and without dimnames on x 878s + for (setDimnames in c(TRUE, FALSE)) { 878s + if (setDimnames) dimnames(x) <- dimnames 878s + else dimnames(x) <- NULL 878s + # Row/column ranges 878s + for (na.rm in c(FALSE, TRUE)) { 878s + # Check names attribute 878s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 878s + cat("na.rm = ", na.rm, "\n", sep = "") 878s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 878s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 878s + stopifnot(all.equal(r1, r2)) 878s + } 878s + } 878s + } 878s + } 878s + 878s + 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + # A 1x1 matrix 878s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s + x <- matrix(0, nrow = 1L, ncol = 1L) 878s + dimnames <- list("a", "A") 878s + # Test with and without dimnames on x 878s + for (setDimnames in c(TRUE, FALSE)) { 878s + if (setDimnames) dimnames(x) <- dimnames 878s + else dimnames(x) <- NULL 878s + # Row/column ranges 878s + for (na.rm in c(FALSE, TRUE)) { 878s + # Check names attribute 878s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 878s + cat("na.rm = ", na.rm, "\n", sep = "") 878s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 878s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 878s + stopifnot(all.equal(r1, r2)) 878s + } 878s + } 878s + } 878s + 878s + cat(sprintf("%s()...DONE\n", fcn)) 878s + } # for (fcn ...) 878s rowVarDiffs()... 878s add_na = FALSE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = FALSE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: integer 878s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: double 878s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s rowVarDiffs()...DONE 878s rowSdDiffs()... 878s add_na = FALSE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = FALSE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: integer 878s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: double 878s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s rowSdDiffs()...DONE 878s rowMadDiffs()... 878s add_na = FALSE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = FALSE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: integer 878s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: double 878s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s rowMadDiffs()...DONE 878s rowIQRDiffs()... 878s add_na = FALSE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: integer 878s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = FALSE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s add_na = TRUE 878s mode: double 878s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: integer 878s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s mode: double 878s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s na.rm = FALSE 878s na.rm = FALSE 878s na.rm = TRUE 878s na.rm = TRUE 878s rowIQRDiffs()...DONE 878s > 878s 878s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 878s Copyright (C) 2024 The R Foundation for Statistical Computing 878s Platform: powerpc64le-unknown-linux-gnu 878s 878s R is free software and comes with ABSOLUTELY NO WARRANTY. 878s You are welcome to redistribute it under certain conditions. 878s Type 'license()' or 'licence()' for distribution details. 878s 878s R is a collaborative project with many contributors. 878s Type 'contributors()' for more information and 878s 'citation()' on how to cite R or R packages in publications. 878s 878s Type 'demo()' for some demos, 'help()' for on-line help, or 878s 'help.start()' for an HTML browser interface to help. 878s Type 'q()' to quit R. 878s 878s > library("matrixStats") 878s > 878s > fcns <- list( 878s + madDiff = c(rowMadDiffs, colMadDiffs), 878s + iqrDiff = c(rowIQRDiffs, colIQRDiffs) 878s + ) 878s > 878s > 878s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s > # Subsetted tests 878s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 878s > source("utils/validateIndicesFramework.R") 878s > # To check names attribute 878s > dimnames <- list(letters[1:6], LETTERS[1:6]) 878s > trim <- runif(1, min = 0, max = 0.5) 878s > for (fcn in names(fcns)) { 878s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 878s + row_fcn <- fcns[[fcn]][[1L]] 878s + col_fcn <- fcns[[fcn]][[2L]] 878s + 878s + for (mode in c("numeric", "integer")) { 878s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 878s + storage.mode(x) <- mode 878s + if (mode == "numeric") x[1:2, 3:4] <- Inf 878s + 878s + # Test with and without dimnames on x 878s + for (setDimnames in c(TRUE, FALSE)) { 878s + if (setDimnames) dimnames(x) <- dimnames 878s + else dimnames(x) <- NULL 878s + 878s + count <- 0L 878s + for (diff in 1:2) { 878s + for (rows in index_cases) { 878s + for (cols in index_cases) { 878s + count <- count + 1L 878s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 878s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 878s + useNames <- useNames[count %% length(useNames) + 1] 878s + validateIndicesTestMatrix(x, rows, cols, 878s + ftest = row_fcn, fsure = row_fcn, 878s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 878s + validateIndicesTestMatrix(x, rows, cols, 878s + fcoltest = col_fcn, fsure = row_fcn, 878s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 878s + } 878s + } 878s + } 878s + } 878s + } 878s + cat(sprintf("%s()...DONE\n", fcn)) 878s + } 879s subsetted tests on madDiff()... 884s madDiff()...DONE 884s subsetted tests on iqrDiff()... 889s iqrDiff()...DONE 889s > 889s 889s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 889s Copyright (C) 2024 The R Foundation for Statistical Computing 889s Platform: powerpc64le-unknown-linux-gnu 889s 889s R is free software and comes with ABSOLUTELY NO WARRANTY. 889s You are welcome to redistribute it under certain conditions. 889s Type 'license()' or 'licence()' for distribution details. 889s 889s R is a collaborative project with many contributors. 889s Type 'contributors()' for more information and 889s 'citation()' on how to cite R or R packages in publications. 889s 889s Type 'demo()' for some demos, 'help()' for on-line help, or 889s 'help.start()' for an HTML browser interface to help. 889s Type 'q()' to quit R. 889s 889s > library("matrixStats") 889s > 889s > fcns <- list( 889s + varDiff = c(rowVarDiffs, colVarDiffs), 889s + sdDiff = c(rowSdDiffs, colSdDiffs) 889s + ) 889s > 889s > 889s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 889s > # Subsetted tests 889s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 889s > source("utils/validateIndicesFramework.R") 889s > # To check names attribute 889s > dimnames <- list(letters[1:6], LETTERS[1:6]) 889s > trim <- runif(1, min = 0, max = 0.5) 889s > for (fcn in names(fcns)) { 889s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 889s + row_fcn <- fcns[[fcn]][[1L]] 889s + col_fcn <- fcns[[fcn]][[2L]] 889s + 889s + for (mode in c("numeric", "integer")) { 889s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 889s + storage.mode(x) <- mode 889s + if (mode == "numeric") x[1:2, 3:4] <- Inf 889s + 889s + # Test with and without dimnames on x 889s + for (setDimnames in c(TRUE, FALSE)) { 889s + if (setDimnames) dimnames(x) <- dimnames 889s + else dimnames(x) <- NULL 889s + 889s + count <- 0L 889s + for (diff in 1:2) { 889s + for (rows in index_cases) { 889s + for (cols in index_cases) { 889s + count <- count + 1L 889s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 889s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 889s + useNames <- useNames[count %% length(useNames) + 1] 889s + 889s + validateIndicesTestMatrix(x, rows, cols, 889s + ftest = row_fcn, fsure = row_fcn, 889s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 889s + validateIndicesTestMatrix(x, rows, cols, 889s + fcoltest = col_fcn, fsure = row_fcn, 889s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 889s + } 889s + } 889s + } 889s + } 889s + } 889s + cat(sprintf("%s()...DONE\n", fcn)) 889s + } 889s subsetted tests on varDiff()... 894s varDiff()...DONE 894s subsetted tests on sdDiff()... 898s sdDiff()...DONE 898s > 898s 898s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 898s Copyright (C) 2024 The R Foundation for Statistical Computing 898s Platform: powerpc64le-unknown-linux-gnu 898s 898s R is free software and comes with ABSOLUTELY NO WARRANTY. 898s You are welcome to redistribute it under certain conditions. 898s Type 'license()' or 'licence()' for distribution details. 898s 898s R is a collaborative project with many contributors. 898s Type 'contributors()' for more information and 898s 'citation()' on how to cite R or R packages in publications. 898s 898s Type 'demo()' for some demos, 'help()' for on-line help, or 898s 'help.start()' for an HTML browser interface to help. 898s Type 'q()' to quit R. 898s 898s > library("matrixStats") 898s > 898s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 898s > options(matrixStats.center.onUse = "ignore") 898s > options(matrixStats.vars.formula.freq = Inf) 898s > 898s > ## Create isFALSE() if running on an old version of R 898s > if (!exists("isFALSE", mode="function")) { 898s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 898s + } 898s > 898s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 898s + suppressWarnings({ 898s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 898s + }) 898s + stopifnot(!any(is.infinite(res))) 898s + 898s + # Keep naming support consistency same as rowVars() 898s + if (is.null(center) || ncol(x) <= 1L) { 898s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 898s + } 898s + else if (isFALSE(useNames)) names(res) <- NULL 898s + res 898s + } 898s > 898s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 898s + suppressWarnings({ 898s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 898s + }) 898s + stopifnot(!any(is.infinite(res))) 898s + 898s + # Keep naming support consistency same as colVars() 898s + if (is.null(center) || ncol(x) <= 1L) { 898s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 898s + } 898s + else if (isFALSE(useNames)) names(res) <- NULL 898s + res 898s + } 898s > 898s > 898s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 898s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 898s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 898s + stopifnot(!any(is.infinite(res))) 898s + res 898s + } 898s > 898s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 898s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 898s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 898s + stopifnot(!any(is.infinite(res))) 898s + res 898s + } 898s > 898s > rowVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 898s + x <- sweep(x, MARGIN = 1, STATS = as.array(center), FUN = "-") 898s + x[is.infinite(center), ] <- NaN 898s + res <- rowVars(x, rows = rows, cols = cols, center = rep(0, times = nrow(x)), na.rm = na.rm, useNames = useNames) 898s + stopifnot(!any(is.infinite(res))) 898s + res 898s + } 898s > 898s > colVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 898s + x <- sweep(x, MARGIN = 2, STATS = as.array(center), FUN = "-") 898s + x[, is.infinite(center)] <- NaN 898s + res <- colVars(x, rows = rows, cols = cols, center = rep(0, times = ncol(x)), na.rm = na.rm, useNames = useNames) 898s + stopifnot(!any(is.infinite(res))) 898s + res 898s + } 898s > 898s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 898s > # With and without some NAs or Infs 898s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 898s > for (mode in c("integer", "double")) { 898s + if (mode == "integer") { 898s + specials <- c(0L, NA_integer_) 898s + delta <- 0L 898s + } else { 898s + specials <- c(0, NA_real_, Inf) 898s + delta <- 0.1 898s + } 898s + 898s + for (special in specials) { 898s + cat("special = ", special, "\n", sep = "") 898s + x <- matrix(1:50 + delta, nrow = 10L, ncol = 5L) 898s + x[3:7, c(2, 4)] <- special 898s + cat("mode: ", mode, "\n", sep = "") 898s + str(x) 898s + stopifnot(storage.mode(x) == mode) 898s + 898s + # To check names attribute 898s + dimnames <- list(letters[1:10], LETTERS[1:5]) 898s + 898s + # Test with and without dimnames on x 898s + for (setDimnames in c(TRUE, FALSE)) { 898s + if (setDimnames) dimnames(x) <- dimnames 898s + else dimnames(x) <- NULL 898s + # Row/column variance 898s + for (na.rm in c(FALSE, TRUE)) { 898s + # Check names attribute 898s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 898s + cat("na.rm = ", na.rm, "\n", sep = "") 898s + center <- rowMeans(x, na.rm = na.rm) 898s + 898s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 898s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 898s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 898s + r1c <- rowVars(x, center = center, na.rm = na.rm, useNames = useNames) 898s + 898s + tx <- t(x) 898s + r2 <- colVars(tx, na.rm = na.rm, useNames = useNames) 898s + r2b <- colVars_center(tx, na.rm = na.rm, useNames = useNames) 898s + r2c <- colVars(tx, center = center, na.rm = na.rm, useNames = useNames) 898s + tx <- NULL 898s + 898s + stopifnot(all.equal(r1, r2)) 898s + stopifnot(all.equal(r1, r0)) 898s + stopifnot(all.equal(r1b, r1c)) 898s + stopifnot(all.equal(r2, r0)) 898s + stopifnot(all.equal(r2b, r2c)) 898s + 898s + center <- colMeans(x, na.rm = na.rm) 898s + 898s + r3 <- colVars(x, center = center, na.rm = na.rm, useNames = useNames) 898s + r3b <- colVars_center_naive(x, center = center, na.rm = na.rm, useNames = useNames) 898s + r3c <- rowVars(t(x), center = center, na.rm = na.rm, useNames = useNames) 898s + r3d <- rowVars_center_naive(t(x), center = center, na.rm = na.rm, useNames = useNames) 898s + stopifnot(all.equal(r3b, r3)) 898s + stopifnot(all.equal(r3c, r3)) 898s + stopifnot(all.equal(r3d, r3)) 898s + 898s + stopifnot( 898s + !any(is.infinite(r0)), 898s + !any(is.infinite(r1)), 898s + !any(is.infinite(r2)), 898s + !any(is.infinite(r3)), 898s + !any(is.infinite(r1b)), 898s + !any(is.infinite(r1c)), 898s + !any(is.infinite(r2b)), 898s + !any(is.infinite(r2c)), 898s + !any(is.infinite(r3b)), 898s + !any(is.infinite(r3c)), 898s + !any(is.infinite(r3d)) 898s + ) 898s + } 898s + } 898s + } 898s + } # for (special ...) 898s + } 898s special = 0 898s mode: integer 898s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s special = NA 898s mode: integer 898s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s special = 0 898s mode: double 898s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s special = NA 898s mode: double 898s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s special = Inf 898s mode: double 898s num [1:10, 1:5] 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s > 898s > 898s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 898s > # All NAs 898s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 898s > for (mode in c("integer", "double")) { 898s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 898s + cat("mode: ", mode, "\n", sep = "") 898s + storage.mode(x) <- mode 898s + str(x) 898s + 898s + # Test with and without dimnames on x 898s + for (setDimnames in c(TRUE, FALSE)) { 898s + if (setDimnames) dimnames(x) <- dimnames 898s + else dimnames(x) <- NULL 898s + # Row/column variance 898s + for (na.rm in c(FALSE, TRUE)) { 898s + # Check names attribute 898s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 898s + cat("na.rm = ", na.rm, "\n", sep = "") 898s + 898s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 898s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 898s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 898s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 898s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 898s + stopifnot(all.equal(r1, r2)) 898s + stopifnot(all.equal(r1, r0)) 898s + stopifnot(all.equal(r2, r0)) 898s + stopifnot(all.equal(r1b, r2b)) 898s + stopifnot( 898s + !any(is.infinite(r0)), 898s + !any(is.infinite(r1)), 898s + !any(is.infinite(r2)), 898s + !any(is.infinite(r1b)), 898s + !any(is.infinite(r2b)) 898s + ) 898s + } 898s + } 898s + } 898s + } 898s mode: integer 898s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s mode: double 898s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s na.rm = FALSE 898s na.rm = FALSE 898s na.rm = TRUE 898s na.rm = TRUE 898s > 898s > 898s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > # A 1x1 matrix 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > x <- matrix(0, nrow = 1L, ncol = 1L) 899s > dimnames <- list("a", "A") 899s > # Test with and without dimnames on x 899s > for (setDimnames in c(TRUE, FALSE)) { 899s + if (setDimnames) dimnames(x) <- dimnames 899s + else dimnames(x) <- NULL 899s + # Row/column variance 899s + for (na.rm in c(FALSE, TRUE)) { 899s + # Check names attribute 899s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 899s + cat("na.rm = ", na.rm, "\n", sep = "") 899s + 899s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 899s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 899s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 899s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 899s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 899s + stopifnot(all.equal(r1, r2)) 899s + stopifnot(all.equal(r1, r0)) 899s + stopifnot(all.equal(r2, r0)) 899s + stopifnot(all.equal(r1b, r2b)) 899s + stopifnot( 899s + !any(is.infinite(r0)), 899s + !any(is.infinite(r1)), 899s + !any(is.infinite(r2)), 899s + !any(is.infinite(r1b)), 899s + !any(is.infinite(r2b)) 899s + ) 899s + } 899s + } 899s + } 899s na.rm = FALSE 899s na.rm = FALSE 899s na.rm = TRUE 899s na.rm = TRUE 899s na.rm = FALSE 899s na.rm = FALSE 899s na.rm = TRUE 899s na.rm = TRUE 899s > 899s > 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > # center and .dim 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > m <- matrix(1:12, nrow = 3L, ncol = 4L) 899s > a <- array(m, dim = c(3, 2, 2)) 899s > stopifnot(prod(dim(a)) == prod(dim(m))) 899s > 899s > y0 <- rowVars(m, dim. = dim(m)) 899s > print(y0) 899s [1] 15 15 15 899s > y1 <- rowVars(a, dim. = dim(m)) 899s > print(y1) 899s [1] 15 15 15 899s > stopifnot(identical(y1, y0)) 899s > stopifnot( 899s + !any(is.infinite(y0)), 899s + !any(is.infinite(y1)) 899s + ) 899s > 899s > mu <- rowMeans(m) 899s > y0 <- rowVars(m, center = mu, dim. = dim(m)) 899s > print(y0) 899s [1] 15 15 15 899s > y1 <- rowVars(a, center = mu, dim. = dim(m)) 899s > print(y1) 899s [1] 15 15 15 899s > stopifnot(identical(y1, y0)) 899s > stopifnot( 899s + !any(is.infinite(y0)), 899s + !any(is.infinite(y1)) 899s + ) 899s > 899s > 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > # Corner cases 899s > # https://github.com/HenrikBengtsson/matrixStats/issues/195 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > x <- matrix(c(1,2,3,4), nrow = 2L, ncol = 2L) 899s > x[1,1] <- NA_real_ 899s > x[1,2] <- Inf 899s > 899s > center <- colMeans2(x, na.rm = TRUE) 899s > y <- colVars(x, center = center, na.rm = TRUE) 899s > stopifnot(!any(is.infinite(y))) 899s > 899s > x <- t(x) 899s > center <- rowMeans2(x, na.rm = TRUE) 899s > y <- rowVars(x, center = center, na.rm = TRUE) 899s > stopifnot(!any(is.infinite(y))) 899s > 899s 899s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 899s Copyright (C) 2024 The R Foundation for Statistical Computing 899s Platform: powerpc64le-unknown-linux-gnu 899s 899s R is free software and comes with ABSOLUTELY NO WARRANTY. 899s You are welcome to redistribute it under certain conditions. 899s Type 'license()' or 'licence()' for distribution details. 899s 899s R is a collaborative project with many contributors. 899s Type 'contributors()' for more information and 899s 'citation()' on how to cite R or R packages in publications. 899s 899s Type 'demo()' for some demos, 'help()' for on-line help, or 899s 'help.start()' for an HTML browser interface to help. 899s Type 'q()' to quit R. 899s 899s > library("matrixStats") 899s > 899s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 899s > options(matrixStats.center.onUse = "ignore") 899s > 899s > ## Create isFALSE() if running on an old version of R 899s > if (!exists("isFALSE", mode="function")) { 899s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 899s + } 899s > 899s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 899s + suppressWarnings({ 899s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 899s + }) 899s + stopifnot(!any(is.infinite(res))) 899s + 899s + # Keep naming support consistency same as rowVars() 899s + if (is.null(center) || ncol(x) <= 1L) { 899s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 899s + } 899s + else if (isFALSE(useNames)) names(res) <- NULL 899s + res 899s + } 899s > 899s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 899s + suppressWarnings({ 899s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 899s + }) 899s + stopifnot(!any(is.infinite(res))) 899s + 899s + # Keep naming support consistency same as colVars() 899s + if (is.null(center) || nrow(x) <= 1L) { 899s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 899s + } 899s + else if (isFALSE(useNames)) names(res) <- NULL 899s + res 899s + } 899s > 899s > 899s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 899s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 899s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 899s + stopifnot(!any(is.infinite(res))) 899s + res 899s + } 899s > 899s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 899s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 899s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 899s + stopifnot(!any(is.infinite(res))) 899s + res 899s + } 899s > 899s > 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > # Subsetted tests 899s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 899s > source("utils/validateIndicesFramework.R") 899s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 899s > storage.mode(x) <- "integer" 899s > 899s > # To check names attribute 899s > dimnames <- list(letters[1:6], LETTERS[1:6]) 899s > 899s > # Test with and without dimnames on x 899s > for (setDimnames in c(TRUE, FALSE)) { 899s + if (setDimnames) dimnames(x) <- dimnames 899s + else dimnames(x) <- NULL 899s + 899s + count <- 0L 899s + for (rows in index_cases) { 899s + for (cols in index_cases) { 899s + count <- count + 1L 899s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 899s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 899s + useNames <- useNames[count %% length(useNames) + 1] 899s + 899s + validateIndicesTestMatrix(x, rows, cols, 899s + ftest = rowVars, fsure = rowVars_R, 899s + na.rm = na.rm, useNames = useNames) 899s + validateIndicesTestMatrix(x, rows, cols, 899s + ftest = rowVars_center, fsure = rowVars_R, 899s + na.rm = na.rm, center = TRUE, useNames = useNames) 899s + 899s + validateIndicesTestMatrix(x, rows, cols, 899s + fcoltest = colVars, fsure = rowVars_R, 899s + na.rm = na.rm, useNames = useNames) 899s + validateIndicesTestMatrix(x, rows, cols, 899s + fcoltest = colVars_center, fsure = rowVars_R, 899s + na.rm = na.rm, center = TRUE, useNames = useNames) 899s + } 899s + } 899s + } 901s > 901s 901s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 901s Copyright (C) 2024 The R Foundation for Statistical Computing 901s Platform: powerpc64le-unknown-linux-gnu 901s 901s R is free software and comes with ABSOLUTELY NO WARRANTY. 901s You are welcome to redistribute it under certain conditions. 901s Type 'license()' or 'licence()' for distribution details. 901s 901s R is a collaborative project with many contributors. 901s Type 'contributors()' for more information and 901s 'citation()' on how to cite R or R packages in publications. 901s 901s Type 'demo()' for some demos, 'help()' for on-line help, or 901s 'help.start()' for an HTML browser interface to help. 901s Type 'q()' to quit R. 901s 901s > library("matrixStats") 901s > 901s > ## Create isFALSE() if running on an old version of R 901s > if (!exists("isFALSE", mode="function")) { 901s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 901s + } 901s > 901s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 901s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 901s + 901s + # Keep naming support consistency same as rowWeightedMeans() 901s + idxs <- which(is.na(w) | w != 0) 901s + nw <- length(idxs) 901s + if (na.rm) na.rm <- anyMissing(x) 901s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 901s + if (is.na(useNames) || !useNames) names(res) <- NULL 901s + } 901s + else if (isFALSE(useNames)) names(res) <- NULL 901s + 901s + res 901s + } 901s > 901s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 901s + res <- apply(x, MARGIN = 2L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 901s + 901s + # Keep naming support consistency same as colWeightedMeans() 901s + idxs <- which(is.na(w) | w != 0) 901s + nw <- length(idxs) 901s + if (!is.null(w) && nw == 0L) { 901s + if (is.na(useNames) || !useNames) names(res) <- NULL 901s + } 901s + else if (isFALSE(useNames)) names(res) <- NULL 901s + 901s + res 901s + } 901s > 901s > set.seed(1) 901s > 901s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 901s > print(x) 901s [,1] [,2] [,3] [,4] 901s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 901s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 901s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 901s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 901s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 901s > 901s > # To check names attribute 901s > dimnames <- list(letters[1:5], LETTERS[1:4]) 901s > 901s > # Non-weighted row averages 901s > x_est0 <- rowMeans(x) 901s > x_est1 <- rowWeightedMeans(x) 901s > print(x_est1) 901s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x)) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Check names attribute 901s > dimnames(x) <- dimnames 901s > x_est1 <- rowWeightedMeans(x, useNames = FALSE) 901s > x_est2 <- colWeightedMeans(t(x), useNames = FALSE) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > x_est0 <- rowMeans(x) 901s > x_est1 <- rowWeightedMeans(x, useNames = TRUE) 901s > x_est2 <- colWeightedMeans(t(x), useNames = TRUE) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > dimnames(x) <- NULL 901s > 901s > 901s > # Weighted row averages (uniform weights) 901s > w <- rep(2.5, times = ncol(x)) 901s > x_est0 <- rowMeans(x) 901s > x_est1 <- rowWeightedMeans(x, w = w) 901s > print(x_est1) 901s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), w = w) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # Weighted row averages (excluding some columns) 901s > w <- c(1, 1, 0, 1) 901s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 901s > x_est1 <- rowWeightedMeans(x, w = w) 901s > print(x_est1) 901s [1] -0.4972853 0.2182940 0.2821774 0.9974278 0.2060069 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), w = w) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # Weighted row averages (excluding some columns) 901s > w <- c(0, 1, 0, 0) 901s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 901s > x_est1 <- rowWeightedMeans(x, w = w) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), w = w) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # Weighted row averages (all zero weights) 901s > w <- c(0, 0, 0, 0) 901s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 901s > x_est1 <- rowWeightedMeans(x, w = w) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), w = w) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # Weighted averages by rows and columns 901s > w <- 1:4 901s > x_est1 <- rowWeightedMeans(x, w = w) 901s > print(x_est1) 901s [1] 0.20882185 0.22632701 0.25526439 -0.06123714 0.54691290 901s > x_est2 <- colWeightedMeans(t(x), w = w) 901s > stopifnot(all.equal(x_est2, x_est1)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > x[sample(length(x), size = 0.3 * length(x))] <- NA 901s > print(x) 901s [,1] [,2] [,3] [,4] 901s [1,] -0.6264538 NA 1.5117812 -0.04493361 901s [2,] 0.1836433 NA NA -0.01619026 901s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 901s [4,] 1.5952808 NA -2.2146999 0.82122120 901s [5,] 0.3295078 NA NA 0.59390132 901s > 901s > # Non-weighted row averages with missing values 901s > x_est0 <- rowMeans(x, na.rm = TRUE) 901s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE) 901s > print(x_est1) 901s [1] 0.28013125 0.08372653 0.05632293 0.06726737 0.46170455 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Check names attribute 901s > dimnames(x) <- dimnames 901s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = FALSE) 901s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = FALSE) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > x_est0 <- rowMeans(x, na.rm = TRUE) 901s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = TRUE) 901s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = TRUE) 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > dimnames(x) <- NULL 901s > 901s > 901s > # Weighted row averages with missing values 901s > x_est0 <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = TRUE) 901s > print(x_est0) 901s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 901s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 901s > print(x_est1) 901s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 901s > stopifnot(all.equal(x_est1, x_est0)) 901s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 901s > stopifnot(all.equal(x_est2, x_est0)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # Weighted averages by rows and columns 901s > w <- 1:4 901s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 901s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 901s > stopifnot(all.equal(x_est2, x_est1)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > 901s > # w contains missing value 901s > w[1] <- NA_integer_ 901s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 901s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 901s > stopifnot(all.equal(x_est2, x_est1)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE) 901s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = FALSE) 901s > stopifnot(all.equal(x_est2, x_est1)) 901s > # Test with and without dimnames on x 901s > for (setDimnames in c(TRUE, FALSE)) { 901s + if (setDimnames) dimnames(x) <- dimnames 901s + else dimnames(x) <- NULL 901s + # Check names attribute 901s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 901s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = FALSE, useNames = useNames) 901s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = FALSE, useNames = useNames) 901s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = FALSE, useNames = useNames) 901s + stopifnot(all.equal(x_est1, x_est0)) 901s + } 901s + } 901s > 901s 901s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 901s Copyright (C) 2024 The R Foundation for Statistical Computing 901s Platform: powerpc64le-unknown-linux-gnu 901s 901s R is free software and comes with ABSOLUTELY NO WARRANTY. 901s You are welcome to redistribute it under certain conditions. 901s Type 'license()' or 'licence()' for distribution details. 901s 901s R is a collaborative project with many contributors. 901s Type 'contributors()' for more information and 901s 'citation()' on how to cite R or R packages in publications. 901s 901s Type 'demo()' for some demos, 'help()' for on-line help, or 901s 'help.start()' for an HTML browser interface to help. 901s Type 'q()' to quit R. 901s 902s > library("matrixStats") 902s > 902s > ## Create isFALSE() if running on an old version of R 902s > if (!exists("isFALSE", mode="function")) { 902s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 902s + } 902s > 902s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 902s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 902s + 902s + # Keep naming support consistency same as rowWeightedMeans() 902s + idxs <- which(is.na(w) | w != 0) 902s + nw <- length(idxs) 902s + if (na.rm) na.rm <- anyMissing(x) 902s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 902s + if (is.na(useNames) || !useNames) names(res) <- NULL 902s + } 902s + else if (isFALSE(useNames)) names(res) <- NULL 902s + 902s + res 902s + } 902s > 902s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 902s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 902s + 902s + # Keep naming support consistency same as colWeightedMeans() 902s + idxs <- which(is.na(w) | w != 0) 902s + nw <- length(idxs) 902s + if (!is.null(w) && nw == 0L) { 902s + if (is.na(useNames) || !useNames) names(res) <- NULL 902s + } 902s + else if (isFALSE(useNames)) names(res) <- NULL 902s + 902s + res 902s + } 902s > 902s > 902s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 902s > # Subsetted tests 902s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 902s > source("utils/validateIndicesFramework.R") 902s > # To check names attribute 902s > dimnames <- list(letters[1:6], LETTERS[1:6]) 902s > for (mode in c("numeric", "integer", "logical")) { 902s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 902s + w <- runif(6, min = 0, max = 6) 902s + storage.mode(x) <- mode 902s + storage.mode(w) <- if (mode == "logical") "integer" else mode 902s + if (mode == "numeric") w[1] <- Inf 902s + 902s + # Test with and without dimnames on x 902s + for (setDimnames in c(TRUE, FALSE)) { 902s + if (setDimnames) dimnames(x) <- dimnames 902s + else dimnames(x) <- NULL 902s + 902s + count <- 0L 902s + for (rows in index_cases) { 902s + for (cols in index_cases) { 902s + count <- count + 1L 902s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 902s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 902s + useNames <- useNames[count %% length(useNames) + 1] 902s + 902s + validateIndicesTestMatrix_w(x, w, rows, cols, 902s + ftest = rowWeightedMeans, fsure = rowWeightedMeans_R, 902s + na.rm = na.rm, useNames = useNames) 902s + validateIndicesTestMatrix_w(x, w, rows, cols, 902s + fcoltest = colWeightedMeans, fsure = colWeightedMeans_R, 902s + na.rm = na.rm, useNames = useNames) 902s + } 902s + } 902s + } 902s + } 904s > 904s 904s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 904s Copyright (C) 2024 The R Foundation for Statistical Computing 904s Platform: powerpc64le-unknown-linux-gnu 904s 904s R is free software and comes with ABSOLUTELY NO WARRANTY. 904s You are welcome to redistribute it under certain conditions. 904s Type 'license()' or 'licence()' for distribution details. 904s 904s R is a collaborative project with many contributors. 904s Type 'contributors()' for more information and 904s 'citation()' on how to cite R or R packages in publications. 904s 904s Type 'demo()' for some demos, 'help()' for on-line help, or 904s 'help.start()' for an HTML browser interface to help. 904s Type 'q()' to quit R. 904s 904s > library("matrixStats") 904s > 904s > ## Create isFALSE() if running on an old version of R 904s > if (!exists("isFALSE", mode="function")) { 904s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 904s + } 904s > 904s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 904s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 904s + 904s + # Keep naming support consistency same as rowWeightedMedians() 904s + if (!is.null(w)) { 904s + if (isFALSE(useNames)) names(res) <- NULL 904s + } 904s + else if (is.na(useNames) || !useNames) names(res) <- NULL 904s + 904s + res 904s + } 904s > 904s > colWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 904s + res <- apply(x, MARGIN = 2L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 904s + 904s + # Keep naming support consistency same as colWeightedMedians() 904s + if (!is.null(w)) { 904s + if (isFALSE(useNames)) names(res) <- NULL 904s + } 904s + else if (is.na(useNames) || !useNames) names(res) <- NULL 904s + 904s + res 904s + } 904s > 904s > set.seed(1) 904s > 904s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 904s > print(x) 904s [,1] [,2] [,3] [,4] 904s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 904s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 904s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 904s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 904s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 904s > 904s > # To check names attribute 904s > dimnames <- list(letters[1:5], LETTERS[1:4]) 904s > 904s > # Non-weighted row medians 904s > x_est0 <- rowMedians(x) 904s > x_est1 <- rowWeightedMedians(x) 904s > stopifnot(all.equal(x_est1, x_est0)) 904s > x_est2 <- colWeightedMedians(t(x)) 904s > stopifnot(all.equal(x_est2, x_est0)) 904s > # Test with and without dimnames on x 904s > for (setDimnames in c(TRUE, FALSE)) { 904s + if (setDimnames) dimnames(x) <- dimnames 904s + else dimnames(x) <- NULL 904s + # Check names attribute 904s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 904s + x_est0 <- rowMedians(x, useNames = useNames) 904s + x_est1 <- rowWeightedMedians(x, useNames = useNames) 904s + x_est2 <- colWeightedMedians(t(x), useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + stopifnot(all.equal(x_est2, x_est0)) 904s + } 904s + } 904s > 904s > 904s > # Weighted row medians (uniform weights) 904s > w <- rep(2.5, times = ncol(x)) 904s > x_est0 <- rowMedians(x) 904s > x_est1 <- rowWeightedMedians(x, w = w) 904s > stopifnot(all.equal(x_est1, x_est0)) 904s > x_est2 <- colWeightedMedians(t(x), w = w) 904s > stopifnot(all.equal(x_est2, x_est0)) 904s > # Test with and without dimnames on x 904s > for (setDimnames in c(TRUE, FALSE)) { 904s + if (setDimnames) dimnames(x) <- dimnames 904s + else dimnames(x) <- NULL 904s + # Check names attribute 904s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 904s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 904s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 904s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + } 904s + } 904s > 904s > 904s > # Weighted row medians (excluding some columns) 904s > w <- c(1, 1, 0, 1) 904s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 904s > x_est1 <- rowWeightedMedians(x, w = w) 904s > stopifnot(all.equal(x_est1, x_est0)) 904s > x_est2 <- colWeightedMedians(t(x), w = w) 904s > stopifnot(all.equal(x_est2, x_est0)) 904s > # Test with and without dimnames on x 904s > for (setDimnames in c(TRUE, FALSE)) { 904s + if (setDimnames) dimnames(x) <- dimnames 904s + else dimnames(x) <- NULL 904s + # Check names attribute 904s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 904s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 904s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 904s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + } 904s + } 904s > 904s > # Weighted row medians (excluding some columns) 904s > w <- c(0, 1, 0, 0) 904s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 904s > x_est1 <- rowWeightedMedians(x, w = w) 904s > stopifnot(all.equal(x_est1, x_est0)) 904s > x_est2 <- colWeightedMedians(t(x), w = w) 904s > stopifnot(all.equal(x_est2, x_est0)) 904s > # Test with and without dimnames on x 904s > for (setDimnames in c(TRUE, FALSE)) { 904s + if (setDimnames) dimnames(x) <- dimnames 904s + else dimnames(x) <- NULL 904s + # Check names attribute 904s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 904s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 904s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 904s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 904s + stopifnot(all.equal(x_est1, x_est0)) 904s + } 904s + } 904s > 904s > # Weighted row medians (all zero weights) 904s > w <- c(0, 0, 0, 0) 905s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 905s > x_est1 <- rowWeightedMedians(x, w = w) 905s > stopifnot(all.equal(x_est1, x_est0)) 905s > x_est2 <- colWeightedMedians(t(x), w = w) 905s > stopifnot(all.equal(x_est2, x_est0)) 905s > # Test with and without dimnames on x 905s > for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + # Check names attribute 905s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 905s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 905s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 905s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + } 905s + } 905s > 905s > # Weighted medians by rows and columns 905s > w <- 1:4 905s > x_est1 <- rowWeightedMedians(x, w = w) 905s > x_est2 <- colWeightedMedians(t(x), w = w) 905s > stopifnot(all.equal(x_est2, x_est1)) 905s > # Test with and without dimnames on x 905s > for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + # Check names attribute 905s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 905s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 905s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 905s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + } 905s + } 905s > 905s > 905s > # Weighted row medians with missing values 905s > x_est0 <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = TRUE) 905s > print(x_est0) 905s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 905s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 905s > print(x_est1) 905s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 905s > stopifnot(all.equal(x_est1, x_est0)) 905s > x_est2 <- colWeightedMedians(t(x), w = w) 905s > stopifnot(all.equal(x_est2, x_est0)) 905s > # Test with and without dimnames on x 905s > for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + # Check names attribute 905s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 905s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 905s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 905s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + } 905s + } 905s > 905s > # Weighted medians by rows and columns 905s > w <- 1:4 905s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 905s > x_est2 <- colWeightedMedians(t(x), w = w, na.rm = TRUE) 905s > stopifnot(all.equal(x_est2, x_est1)) 905s > # Test with and without dimnames on x 905s > for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + # Check names attribute 905s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 905s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 905s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 905s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + } 905s + } 905s > 905s > 905s > # Inf weight 905s > x <- matrix(1:2, nrow = 1, ncol = 2) 905s > w <- c(7, Inf) 905s > x_est1 <- rowWeightedMedians(x, w = w) 905s > x_est2 <- colWeightedMedians(t(x), w = w) 905s > stopifnot(identical(2, x_est1)) 905s > stopifnot(identical(2, x_est2)) 905s > # Test with and without dimnames on x 905s > dimnames <- list("a", LETTERS[1:2]) 905s > for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + # Check names attribute 905s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 905s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 905s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 905s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 905s + stopifnot(all.equal(x_est1, x_est0)) 905s + } 905s + } 905s > 905s 905s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 905s Copyright (C) 2024 The R Foundation for Statistical Computing 905s Platform: powerpc64le-unknown-linux-gnu 905s 905s R is free software and comes with ABSOLUTELY NO WARRANTY. 905s You are welcome to redistribute it under certain conditions. 905s Type 'license()' or 'licence()' for distribution details. 905s 905s R is a collaborative project with many contributors. 905s Type 'contributors()' for more information and 905s 'citation()' on how to cite R or R packages in publications. 905s 905s Type 'demo()' for some demos, 'help()' for on-line help, or 905s 'help.start()' for an HTML browser interface to help. 905s Type 'q()' to quit R. 905s 905s > library("matrixStats") 905s > 905s > ## Create isFALSE() if running on an old version of R 905s > if (!exists("isFALSE", mode="function")) { 905s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 905s + } 905s > 905s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 905s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 905s + 905s + # Keep naming support consistency same as rowWeightedMedians() 905s + if (!is.null(w)) { 905s + if (isFALSE(useNames)) names(res) <- NULL 905s + } 905s + else if (is.na(useNames) || !useNames) names(res) <- NULL 905s + 905s + res 905s + } 905s > 905s > 905s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 905s > # Subsetted tests 905s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 905s > source("utils/validateIndicesFramework.R") 905s > # To check names attribute 905s > dimnames <- list(letters[1:6], LETTERS[1:6]) 905s > for (mode in c("numeric", "integer", "logical")) { 905s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 905s + w <- runif(6, min = 0, max = 6) 905s + storage.mode(x) <- mode 905s + storage.mode(w) <- if (mode == "logical") "integer" else mode 905s + if (mode == "numeric") w[1] <- Inf 905s + 905s + # Test with and without dimnames on x 905s + for (setDimnames in c(TRUE, FALSE)) { 905s + if (setDimnames) dimnames(x) <- dimnames 905s + else dimnames(x) <- NULL 905s + 905s + count <- 0L 905s + for (rows in index_cases) { 905s + for (cols in index_cases) { 905s + count <- count + 1L 905s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 905s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 905s + useNames <- useNames[count %% length(useNames) + 1] 905s + 905s + validateIndicesTestMatrix_w(x, w, rows, cols, 905s + ftest = rowWeightedMedians, 905s + fsure = rowWeightedMedians_R, 905s + na.rm = na.rm, useNames = useNames) 905s + validateIndicesTestMatrix_w(x, w, rows, cols, 905s + fcoltest = colWeightedMedians, 905s + fsure = rowWeightedMedians_R, 905s + na.rm = na.rm, useNames = useNames) 905s + } 905s + } 905s + } 905s + } 907s > 907s 907s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 907s Copyright (C) 2024 The R Foundation for Statistical Computing 907s Platform: powerpc64le-unknown-linux-gnu 907s 907s R is free software and comes with ABSOLUTELY NO WARRANTY. 907s You are welcome to redistribute it under certain conditions. 907s Type 'license()' or 'licence()' for distribution details. 907s 907s R is a collaborative project with many contributors. 907s Type 'contributors()' for more information and 907s 'citation()' on how to cite R or R packages in publications. 907s 907s Type 'demo()' for some demos, 'help()' for on-line help, or 907s 'help.start()' for an HTML browser interface to help. 907s Type 'q()' to quit R. 907s 907s > library("matrixStats") 907s > 907s > set.seed(1) 907s > 907s > x <- matrix(rnorm(20), nrow = 5L, ncol = 4L) 907s > print(x) 907s [,1] [,2] [,3] [,4] 907s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 907s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 907s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 907s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 907s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 907s > 907s > # To check names attribute 907s > dimnames <- list(letters[1:5], LETTERS[1:4]) 907s > 907s > # Weighted row variances (uniform weights - all w = 1) 907s > # Non-weighted row variances 907s > x_est0 <- rowVars(x) 907s > w <- rep(1, times = ncol(x)) 907s > x_est1 <- rowWeightedVars(x, w = w) 907s > print(x_est1) 907s [1] 1.11767161 0.05022969 0.83582537 2.76819528 0.35351857 907s > stopifnot(all.equal(x_est1, x_est0)) 907s > x_est2 <- colWeightedVars(t(x), w = w) 907s > stopifnot(all.equal(x_est2, x_est0)) 907s > # Check names attribute 907s > dimnames(x) <- dimnames 907s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 907s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 907s > stopifnot(all.equal(x_est1, x_est0)) 907s > stopifnot(all.equal(x_est2, x_est0)) 907s > x_est0 <- rowVars(x, useNames = TRUE) 907s > if (!matrixStats:::isUseNamesNADefunct()) { 907s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 907s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 907s + stopifnot(all.equal(x_est1, x_est0)) 907s + stopifnot(all.equal(x_est2, x_est0)) 907s + } 907s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 907s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 907s > stopifnot(all.equal(x_est1, x_est0)) 907s > stopifnot(all.equal(x_est2, x_est0)) 907s > dimnames(x) <- NULL 907s > 907s > 907s > # Weighted row variances (uniform weights - all w = 3) 907s > x3 <- cbind(x, x, x) 907s > x_est0 <- rowVars(x3) 907s > w <- rep(3, times = ncol(x)) 907s > x_est1 <- rowWeightedVars(x, w = w) 907s > print(x_est1) 907s [1] 0.91445859 0.04109702 0.68385712 2.26488705 0.28924246 907s > stopifnot(all.equal(x_est1, x_est0)) 907s > x_est2 <- colWeightedVars(t(x), w = w) 907s > stopifnot(all.equal(x_est2, x_est0)) 907s > # Check names attribute 907s > dimnames(x) <- dimnames 907s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 907s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 907s > stopifnot(all.equal(x_est1, x_est0)) 907s > stopifnot(all.equal(x_est2, x_est0)) 907s > x3 <- cbind(x, x, x) 907s > x_est0 <- rowVars(x3, useNames = TRUE) 907s > if (!matrixStats:::isUseNamesNADefunct()) { 907s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 907s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 907s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > 910s > # Weighted row variances (excluding some columns) 910s > w <- c(1, 1, 0, 1) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 910s > x_est1 <- rowWeightedVars(x, w = w) 910s > print(x_est1) 910s [1] 0.16287693 0.06430861 0.94767651 0.28313135 0.21361984 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedVars(t(x), w = w) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 910s > if (!matrixStats:::isUseNamesNADefunct()) { 910s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 910s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 910s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > 910s > # Weighted row variances (excluding some columns) 910s > w <- c(0, 1, 0, 0) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 910s > x_est1 <- rowWeightedVars(x, w = w) 910s > #stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedVars(t(x), w = w) 910s > stopifnot(all.equal(x_est2, x_est1)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 910s > if (!matrixStats:::isUseNamesNADefunct()) { 910s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 910s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 910s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > 910s > # Weighted row variances (all zero weights) 910s > w <- c(0, 0, 0, 0) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 910s > x_est1 <- rowWeightedVars(x, w = w) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedVars(t(x), w = w) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 910s > if (!matrixStats:::isUseNamesNADefunct()) { 910s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 910s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 910s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 910s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > # Weighted variances by rows and columns 910s > w <- 1:4 910s > # Test with and without dimnames on x 910s > for (setDimnames in c(TRUE, FALSE)) { 910s + if (setDimnames) dimnames(x) <- dimnames 910s + else dimnames(x) <- NULL 910s + # Check names attribute 910s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 910s + x_est1 <- rowWeightedVars(x, w = w, useNames = useNames) 910s + print(x_est1) 910s + x_est2 <- colWeightedVars(t(x), w = w, useNames = useNames) 910s + stopifnot(all.equal(x_est2, x_est1)) 910s + } 910s + } 910s a b c d e 910s 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 910s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 910s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 910s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 910s > 910s > 910s > x[sample(length(x), size = 0.3 * length(x))] <- NA 910s > print(x) 910s [,1] [,2] [,3] [,4] 910s [1,] -0.6264538 NA 1.5117812 -0.04493361 910s [2,] 0.1836433 NA NA -0.01619026 910s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 910s [4,] 1.5952808 NA -2.2146999 0.82122120 910s [5,] 0.3295078 NA NA 0.59390132 910s > 910s > # Non-weighted row variances with missing values 910s > x_est0 <- rowVars(x, na.rm = TRUE) 910s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE) 910s > print(x_est1) 910s [1] 1.22226258 0.01996673 0.83582537 4.05532299 0.03495197 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 910s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowVars(x, na.rm = TRUE, useNames = TRUE) 910s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 910s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > 910s > # Weighted row variances with missing values 910s > # Test with and without dimnames on x 910s > for (setDimnames in c(TRUE, FALSE)) { 910s + if (setDimnames) dimnames(x) <- dimnames 910s + else dimnames(x) <- NULL 910s + # Check names attribute 910s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 910s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 910s + print(x_est1) 910s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 910s + stopifnot(all.equal(x_est2, x_est1)) 910s + } 910s + } 910s a b c d e 910s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s > 910s > 910s > # Weighted variances by rows and columns 910s > w <- 1:4 910s > # Test with and without dimnames on x 910s > for (setDimnames in c(TRUE, FALSE)) { 910s + if (setDimnames) dimnames(x) <- dimnames 910s + else dimnames(x) <- NULL 910s + # Check names attribute 910s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 910s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 910s + print(x_est1) 910s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 910s + stopifnot(all.equal(x_est2, x_est1)) 910s + } 910s + } 910s a b c d e 910s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 910s > 910s > 910s > # Weighted row standard deviation (excluding some columns) 910s > w <- c(1, 1, 0, 1) 910s > ## FIXME: rowVars()/rowSds() needs na.rm = FALSE (wrong default) 910s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE) 910s > x_est1 <- rowWeightedSds(x, w = w) 910s > print(x_est1) 910s [1] NA NA 0.9734868 NA NA 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = FALSE) 910s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE, useNames = TRUE) 910s > if (!matrixStats:::isUseNamesNADefunct()) { 910s + x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = NA) 910s + x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = NA) 910s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = TRUE) 910s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s > 910s > # Weighted row MADs (excluding some columns) 910s > w <- c(1, 1, 0, 1) 910s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE]) 910s > x_est1 <- rowWeightedMads(x, w = w) 910s > print(x_est1) 910s [1] NA NA 0.3046914 NA NA 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > x_est2 <- colWeightedMads(t(x), w = w) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > # Check names attribute 910s > dimnames(x) <- dimnames 910s > x_est1 <- rowWeightedMads(x, w = w, useNames = FALSE) 910s > x_est2 <- colWeightedMads(t(x), w = w, useNames = FALSE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE], useNames = TRUE) 910s > if (!matrixStats:::isUseNamesNADefunct()) { 910s + x_est1 <- rowWeightedMads(x, w = w, useNames = NA) 910s + x_est2 <- colWeightedMads(t(x), w = w, useNames = NA) 910s + stopifnot(all.equal(x_est1, x_est0)) 910s + stopifnot(all.equal(x_est2, x_est0)) 910s + } 910s > x_est1 <- rowWeightedMads(x, w = w, useNames = TRUE) 910s > x_est2 <- colWeightedMads(t(x), w = w, useNames = TRUE) 910s > stopifnot(all.equal(x_est1, x_est0)) 910s > stopifnot(all.equal(x_est2, x_est0)) 910s > dimnames(x) <- NULL 910s > 910s 910s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 910s Copyright (C) 2024 The R Foundation for Statistical Computing 910s Platform: powerpc64le-unknown-linux-gnu 910s 910s R is free software and comes with ABSOLUTELY NO WARRANTY. 910s You are welcome to redistribute it under certain conditions. 910s Type 'license()' or 'licence()' for distribution details. 910s 910s R is a collaborative project with many contributors. 910s Type 'contributors()' for more information and 910s 'citation()' on how to cite R or R packages in publications. 910s 910s Type 'demo()' for some demos, 'help()' for on-line help, or 910s 'help.start()' for an HTML browser interface to help. 910s Type 'q()' to quit R. 910s 910s > library("matrixStats") 910s > 910s > fcns <- list( 910s + weightedVar = c(rowWeightedVars, colWeightedVars), 910s + weightedSd = c(rowWeightedSds, colWeightedSds), 910s + weightedMad = c(rowWeightedMads, colWeightedMads) 910s + ) 910s > 910s > 910s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 910s > # Subsetted tests 910s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 910s > source("utils/validateIndicesFramework.R") 910s > # To check names attribute 910s > dimnames <- list(letters[1:6], LETTERS[1:6]) 910s > for (fcn in names(fcns)) { 910s + cat(sprintf("subsetted tests on matrix %s()...\n", fcn)) 910s + row_fcn <- fcns[[fcn]][[1]] 910s + col_fcn <- fcns[[fcn]][[2]] 910s + 910s + for (mode in c("numeric", "integer")) { 910s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 910s + w <- runif(6, min = 0, max = 6) 910s + storage.mode(x) <- mode 910s + storage.mode(w) <- mode 910s + if (mode == "numeric") w[1] <- Inf 910s + 910s + # Test with and without dimnames on x 910s + for (setDimnames in c(TRUE, FALSE)) { 910s + if (setDimnames) dimnames(x) <- dimnames 910s + else dimnames(x) <- NULL 910s + 910s + count <- 0L 910s + for (rows in index_cases) { 910s + for (cols in index_cases) { 910s + count <- count + 1L 910s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 910s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 910s + useNames <- useNames[count %% length(useNames) + 1] 910s + 910s + validateIndicesTestMatrix_w(x, w, rows, cols, 910s + ftest = row_fcn, fsure = row_fcn, 910s + na.rm = na.rm, useNames = useNames) 910s + validateIndicesTestMatrix_w(x, w, rows, cols, 910s + fcoltest = col_fcn, fsure = row_fcn, 910s + na.rm = na.rm, useNames = useNames) 910s + } 910s + } 910s + } 910s + } 910s + cat(sprintf("%s()...DONE\n", fcn)) 910s + } 910s subsetted tests on matrix weightedVar()... 910s weightedVar()...DONE 910s subsetted tests on matrix weightedSd()... 911s weightedSd()...DONE 911s subsetted tests on matrix weightedMad()... 912s weightedMad()...DONE 912s > 913s 913s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 913s Copyright (C) 2024 The R Foundation for Statistical Computing 913s Platform: powerpc64le-unknown-linux-gnu 913s 913s R is free software and comes with ABSOLUTELY NO WARRANTY. 913s You are welcome to redistribute it under certain conditions. 913s Type 'license()' or 'licence()' for distribution details. 913s 913s R is a collaborative project with many contributors. 913s Type 'contributors()' for more information and 913s 'citation()' on how to cite R or R packages in publications. 913s 913s Type 'demo()' for some demos, 'help()' for on-line help, or 913s 'help.start()' for an HTML browser interface to help. 913s Type 'q()' to quit R. 913s 913s > library("matrixStats") 913s > 913s > signTabulate0 <- function(x, ...) { 913s + nneg <- sum(x < 0, na.rm = TRUE) 913s + nzero <- sum(x == 0, na.rm = TRUE) 913s + npos <- sum(x > 0, na.rm = TRUE) 913s + nna <- sum(is.na(x)) 913s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 913s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 913s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 913s + res <- as.double(res) 913s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 913s + if (is.integer(x)) res <- res[1:4] 913s + res 913s + } # signTabulate0() 913s > 913s > 913s > # Simulate data 913s > set.seed(0xBEEF) 913s > n <- 100L 913s > x <- runif(n) 913s > x[sample(n, size = 0.1 * n)] <- 0 913s > x[sample(n, size = 0.1 * n)] <- NA_real_ 913s > x[sample(n, size = 0.1 * n)] <- -Inf 913s > x[sample(n, size = 0.1 * n)] <- +Inf 913s > 913s > # Doubles 913s > message("Doubles:") 913s > counts0 <- signTabulate0(x) 913s > print(counts0) 913s -1 0 +1 NA -Inf +Inf 913s 9 7 77 7 9 10 913s > counts1 <- signTabulate(x) 913s > print(counts1) 913s -1 0 +1 NA -Inf +Inf 913s 9 7 77 7 9 10 913s > stopifnot(identical(counts1, counts0)) 913s > 913s > # Integers 913s > message("Integers:") 913s > x <- suppressWarnings(as.integer(x)) 913s > counts0 <- signTabulate0(x) 913s > print(counts0) 913s -1 0 +1 NA 913s 0 74 0 26 913s > counts1 <- signTabulate(x) 913s > print(counts1) 913s -1 0 +1 NA 913s 0 74 0 26 913s > stopifnot(identical(counts1, counts0)) 913s > 913s Doubles: 913s Integers: 913s 913s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 913s Copyright (C) 2024 The R Foundation for Statistical Computing 913s Platform: powerpc64le-unknown-linux-gnu 913s 913s R is free software and comes with ABSOLUTELY NO WARRANTY. 913s You are welcome to redistribute it under certain conditions. 913s Type 'license()' or 'licence()' for distribution details. 913s 913s R is a collaborative project with many contributors. 913s Type 'contributors()' for more information and 913s 'citation()' on how to cite R or R packages in publications. 913s 913s Type 'demo()' for some demos, 'help()' for on-line help, or 913s 'help.start()' for an HTML browser interface to help. 913s Type 'q()' to quit R. 913s 913s > library("matrixStats") 913s > 913s > signTabulate0 <- function(x, ...) { 913s + nneg <- sum(x < 0, na.rm = TRUE) 913s + nzero <- sum(x == 0, na.rm = TRUE) 913s + npos <- sum(x > 0, na.rm = TRUE) 913s + nna <- sum(is.na(x)) 913s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 913s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 913s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 913s + res <- as.double(res) 913s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 913s + if (is.integer(x)) res <- res[1:4] 913s + res 913s + } # signTabulate0() 913s > 913s > 913s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 913s > # Subsetted tests 913s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 913s > source("utils/validateIndicesFramework.R") 913s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 913s > x[2:3, 4:5] <- +Inf 913s > x[4:5, 1:2] <- -Inf 913s > for (idxs in index_cases) { 913s + validateIndicesTestVector(x, idxs, 913s + ftest = signTabulate, fsure = signTabulate0) 913s + } 913s > 913s 913s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 913s Copyright (C) 2024 The R Foundation for Statistical Computing 913s Platform: powerpc64le-unknown-linux-gnu 913s 913s R is free software and comes with ABSOLUTELY NO WARRANTY. 913s You are welcome to redistribute it under certain conditions. 913s Type 'license()' or 'licence()' for distribution details. 913s 913s R is a collaborative project with many contributors. 913s Type 'contributors()' for more information and 913s 'citation()' on how to cite R or R packages in publications. 913s 913s Type 'demo()' for some demos, 'help()' for on-line help, or 913s 'help.start()' for an HTML browser interface to help. 913s Type 'q()' to quit R. 913s 914s > library("matrixStats") 914s > options(warn = 1) 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Consistency checks 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > set.seed(1) 914s > 914s > sum2_R <- function(x, na.rm = FALSE, idxs = NULL) { 914s + if (is.null(idxs)) { 914s + sum(x, na.rm = na.rm) 914s + } else { 914s + sum(x[idxs], na.rm = na.rm) 914s + } 914s + } # sum2_R() 914s > 914s > 914s > cat("Consistency checks:\n") 914s Consistency checks: 914s > for (kk in 1:20) { 914s + cat("Random test #", kk, "\n", sep = "") 914s + 914s + # Simulate data in a matrix of any shape 914s + n <- sample(1e3, size = 1L) 914s + x <- rnorm(n, sd = 100) 914s + 914s + # Add NAs? 914s + if ((kk %% 4) %in% c(3, 0)) { 914s + cat("Adding NAs\n") 914s + nna <- sample(n, size = 1L) 914s + na_values <- c(NA_real_, NaN) 914s + t <- sample(na_values, size = nna, replace = TRUE) 914s + x[sample(length(x), size = nna)] <- t 914s + } 914s + 914s + # Integer or double? 914s + if ((kk %% 4) %in% c(2, 0)) { 914s + cat("Coercing to integers\n") 914s + storage.mode(x) <- "integer" 914s + } 914s + 914s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 914s + 914s + # Sum over all 914s + y0 <- sum2_R(x, na.rm = na.rm) 914s + y1 <- sum2(x, na.rm = na.rm) 914s + stopifnot(all.equal(y1, y0)) 914s + 914s + # Sum over subset 914s + nidxs <- sample(n, size = 1L) 914s + idxs <- sample(n, size = nidxs) 914s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 914s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 914s + stopifnot(all.equal(y1, y0)) 914s + 914s + if (storage.mode(x) == "integer") { 914s + storage.mode(x) <- "logical" 914s + 914s + y0 <- sum2_R(x, na.rm = na.rm) 914s + y1 <- sum2(x, na.rm = na.rm) 914s + stopifnot(all.equal(y1, y0)) 914s + 914s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 914s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 914s + stopifnot(all.equal(y1, y0)) 914s + } 914s + } # for (kk ...) 914s Random test #1 914s Random test #2 914s Coercing to integers 914s Random test #3 914s Adding NAs 914s Random test #4 914s Adding NAs 914s Coercing to integers 914s Random test #5 914s Random test #6 914s Coercing to integers 914s Random test #7 914s Adding NAs 914s Random test #8 914s Adding NAs 914s Coercing to integers 914s Random test #9 914s Random test #10 914s Coercing to integers 914s Random test #11 914s Adding NAs 914s Random test #12 914s Adding NAs 914s Coercing to integers 914s Random test #13 914s Random test #14 914s Coercing to integers 914s Random test #15 914s Adding NAs 914s Random test #16 914s Adding NAs 914s Coercing to integers 914s Random test #17 914s Random test #18 914s Coercing to integers 914s Random test #19 914s Adding NAs 914s Random test #20 914s Adding NAs 914s Coercing to integers 914s > 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # All missing values 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > for (n in 0:2) { 914s + for (na.rm in c(FALSE, TRUE)) { 914s + x <- rep(NA_real_, times = n) 914s + y0 <- sum(x, na.rm = na.rm) 914s + y <- sum2(x, na.rm = na.rm) 914s + stopifnot(all.equal(y, y0)) 914s + 914s + x <- rep(NA_integer_, times = n) 914s + y0 <- sum(x, na.rm = na.rm) 914s + y <- sum2(x, na.rm = na.rm) 914s + stopifnot(all.equal(y, y0)) 914s + 914s + x <- rep(NA, times = n) 914s + y0 <- sum(x, na.rm = na.rm) 914s + y <- sum2(x, na.rm = na.rm) 914s + stopifnot(all.equal(y, y0)) 914s + } 914s + } 914s > 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Special cases 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > for (na.rm in c(FALSE, TRUE)) { 914s + # Summing over zero elements (integers) 914s + x <- integer(0) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot(identical(s1, s2)) 914s + 914s + x <- 1:10 914s + idxs <- integer(0) 914s + s1 <- sum(x[idxs], na.rm = na.rm) 914s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 914s + stopifnot(identical(s1, s2)) 914s + 914s + # Summing over NA_integer_:s 914s + x <- rep(NA_integer_, times = 10L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot(identical(s1, s2)) 914s + 914s + x <- rep(NA_integer_, times = 10L) 914s + idxs <- 1:5 914s + s1 <- sum(x[idxs], na.rm = na.rm) 914s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 914s + stopifnot(identical(s1, s2)) 914s + 914s + 914s + # Summing over zero elements (doubles) 914s + x <- double(0) 914s + s1 <- sum(x) 914s + s2 <- sum2(x) 914s + stopifnot( 914s + identical(s1, 0), 914s + identical(s1, s2) 914s + ) 914s + 914s + x <- as.double(1:10) 914s + idxs <- integer(0) 914s + s1 <- sum(x[idxs]) 914s + s2 <- sum2(x, idxs = idxs) 914s + stopifnot( 914s + identical(s1, 0), 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over NA_real_:s 914s + x <- rep(NA_real_, times = 10L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot( 914s + !na.rm || s1 == 0, 914s + identical(s1, s2) 914s + ) 914s + 914s + x <- rep(NA_real_, times = 10L) 914s + idxs <- 1:5 914s + s1 <- sum(x[idxs], na.rm = na.rm) 914s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 914s + stopifnot( 914s + !na.rm || s1 == 0, 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over -Inf:s 914s + x <- rep(-Inf, times = 3L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot( 914s + is.infinite(s1) && s1 < 0, 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over +Inf:s 914s + x <- rep(+Inf, times = 3L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot(identical(s1, s2)) 914s + stopifnot( 914s + is.infinite(s1) && s1 > 0, 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over mix of -Inf:s and +Inf:s 914s + x <- rep(c(-Inf, +Inf), times = 3L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot( 914s + is.nan(s1), 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over mix of -Inf:s and +Inf:s and numerics 914s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + stopifnot( 914s + is.nan(s1), 914s + identical(s1, s2) 914s + ) 914s + 914s + # Summing over mix of NaN, NA, +Inf, and numerics 914s + x <- c(NaN, NA, +Inf, 3.14) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + if (na.rm) { 914s + stopifnot( 914s + is.infinite(s1) && s1 > 0, 914s + identical(s2, s1) 914s + ) 914s + } else { 914s + stopifnot(is.na(s1), is.na(s2)) 914s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 914s + ## returned here (as one would expect). NaN might very well be returned, 914s + ## when both NA and NaN are involved. This is an accepted feature in R, 914s + ## which is documented in help("is.nan"). See also 914s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 914s + ## Thus, we cannot guarantee that s1 is identical to s0. 914s + } 914s + 914s + # Summing over mix of NaN, NA, +Inf, and numerics 914s + x <- c(NA, NaN, +Inf, 3.14) 914s + s1 <- sum(x, na.rm = na.rm) 914s + s2 <- sum2(x, na.rm = na.rm) 914s + if (na.rm) { 914s + stopifnot( 914s + is.infinite(s1) && s1 > 0, 914s + identical(s2, s1) 914s + ) 914s + } else { 914s + stopifnot(is.na(s1), is.na(s2)) 914s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 914s + ## returned here (as one would expect). NaN might very well be returned, 914s + ## when both NA and NaN are involved. This is an accepted feature in R, 914s + ## which is documented in help("is.nan"). See also 914s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 914s + ## Thus, we cannot guarantee that s1 is identical to s0. 914s + } 914s + } 914s > 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Summing of large integers 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > x <- c(.Machine$integer.max, 1L, -.Machine$integer.max) 914s > 914s > # Total gives integer overflow 914s > s1 <- sum(x[1:2]) # NA_integer_ w/ warning 914s > s2 <- sum2(x[1:2]) # NA_integer_ w/ warning 914s > stopifnot( 914s + getRversion() >= "3.5.0" || identical(s1, NA_integer_), 914s + identical(s2, NA_integer_) 914s + ) 914s > 914s > ## Assert above warning 914s > res <- tryCatch({ 914s + s2 <- sum2(x[1:2]) 914s + Warning in sum2(x[1:2]) : 914s Integer overflow. Use sum2(..., mode = "double") to avoid this. 914s }, warning = identity) 914s > stopifnot(inherits(res, "warning")) 914s > 914s > 914s > # Total gives integer overflow (coerce to numeric) 914s > s1 <- sum(as.numeric(x[1:2])) # 2147483648 914s > s2 <- sum2(as.numeric(x[1:2])) # 2147483648 914s > s3 <- sum2(x[1:2], mode = "double") # 2147483648 914s > stopifnot( 914s + identical(s1, 2147483648), 914s + identical(s1, s2), 914s + identical(s1, s3) 914s + ) 914s > 914s > # Cumulative sum would give integer overflow but not the total 914s > s1 <- sum(x) # 1L 914s > s2 <- sum2(x) # 1L 914s > stopifnot( 914s + identical(s1, 1L), 914s + identical(s1, s2) 914s + ) 914s > 914s > # Input is double but coersing result to integer 914s > x <- c(1, 2, 3.1) 914s > s1 <- sum2(x) 914s > s2 <- sum2(x, mode = "integer") 914s > stopifnot( 914s + identical(as.integer(s1), s2) 914s + ) 914s > 914s > ## Assert above warning 914s > res <- tryCatch({ 914s + s2 <- sum2(x, mode = "integer") 914s + }, warning = identity) 914s > stopifnot(inherits(res, "warning")) 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Summing of large doubles 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > ## Double overflow 914s > x <- rep(.Machine$double.xmax, times = 2L) 914s > y0 <- sum(x) 914s > print(y0) 914s [1] Inf 914s > y <- sum2(x) 914s > print(y) 914s [1] Inf 914s > stopifnot( 914s + is.infinite(y) && y > 0, 914s + identical(y, y0) 914s + ) 914s > 914s > x <- rep(-.Machine$double.xmax, times = 2L) 914s > y0 <- sum(x) 914s > print(y0) 914s [1] -Inf 914s > y <- sum2(x) 914s > print(y) 914s [1] -Inf 914s > stopifnot( 914s + is.infinite(y) && y < 0, 914s + identical(y, y0) 914s + ) 914s > 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Argument 'idxs' 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > x <- 1:10 914s > idxs_list <- list( 914s + integer = 1:5, 914s + double = as.double(1:5), 914s + logical = (x <= 5) 914s + ) 914s > 914s > for (idxs in idxs_list) { 914s + cat("idxs:\n") 914s + str(idxs) 914s + s1 <- sum(x[idxs], na.rm = TRUE) 914s + s2 <- sum2(x, idxs = idxs, na.rm = TRUE) 914s + stopifnot(identical(s1, s2)) 914s + } 914s idxs: 914s int [1:5] 1 2 3 4 5 914s idxs: 914s Warning in sum2(x, mode = "integer") : 914s sum2(x, mode = "integer") called with typeof(x) == "double"; did you mean to use as.integer(sum2(x))? 914s num [1:5] 1 2 3 4 5 914s idxs: 914s logi [1:10] TRUE TRUE TRUE TRUE TRUE FALSE ... 914s > 914s 914s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 914s Copyright (C) 2024 The R Foundation for Statistical Computing 914s Platform: powerpc64le-unknown-linux-gnu 914s 914s R is free software and comes with ABSOLUTELY NO WARRANTY. 914s You are welcome to redistribute it under certain conditions. 914s Type 'license()' or 'licence()' for distribution details. 914s 914s R is a collaborative project with many contributors. 914s Type 'contributors()' for more information and 914s 'citation()' on how to cite R or R packages in publications. 914s 914s Type 'demo()' for some demos, 'help()' for on-line help, or 914s 'help.start()' for an HTML browser interface to help. 914s Type 'q()' to quit R. 914s 914s > library("matrixStats") 914s > 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > # Subsetted tests 914s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 914s > source("utils/validateIndicesFramework.R") 914s > x <- runif(6, min = -6, max = 6) 914s > storage.mode(x) <- "integer" 914s > for (idxs in index_cases) { 914s + validateIndicesTestVector(x, idxs, 914s + ftest = sum2, fsure = sum, 914s + na.rm = FALSE) 914s + validateIndicesTestVector(x, idxs, 914s + ftest = sum2, fsure = sum, 914s + na.rm = TRUE) 914s + } 915s > 915s 915s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 915s Copyright (C) 2024 The R Foundation for Statistical Computing 915s Platform: powerpc64le-unknown-linux-gnu 915s 915s R is free software and comes with ABSOLUTELY NO WARRANTY. 915s You are welcome to redistribute it under certain conditions. 915s Type 'license()' or 'licence()' for distribution details. 915s 915s R is a collaborative project with many contributors. 915s Type 'contributors()' for more information and 915s 'citation()' on how to cite R or R packages in publications. 973s 973s Type 'demo()' for some demos, 'help()' for on-line help, or 973s 'help.start()' for an HTML browser interface to help. 973s Type 'q()' to quit R. 973s 973s > library(matrixStats) 973s > source("utils/validateIndicesFramework.R") 973s > 973s > oopts <- options(matrixStats.validateIndices = "ignore") 973s > 973s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 973s > 973s > x <- 1:6 973s > for (idxs in index_cases) { 973s + for (mode in c("integer", "numeric", "logical")) { 973s + if (!is.null(idxs)) { 973s + suppressWarnings({storage.mode(idxs) <- mode}) 973s + } 973s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 973s + } 973s + } 973s > 973s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 973s > 973s > for (idxs in index_error_cases) { 973s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 973s + } 973s > 973s > 973s > ftest <- function(x, rows, cols) { 973s + vr <- validateIndices(rows, dim(x)[1], FALSE) 973s + vc <- validateIndices(cols, dim(x)[2], FALSE) 973s + 973s + stopifnot(all((vr > 0 & vr <= dim(x)[1]) | is.na(vr))) 973s + stopifnot(all((vc > 0 & vc <= dim(x)[2]) | is.na(vc))) 973s + suppressWarnings(x <- x[vr, vc, drop = FALSE]) 973s + x 973s + } 973s > 973s > x <- matrix(1:36, nrow = 6, ncol = 6) 973s > for (rows in index_cases) { 973s + for (cols in index_cases) { 973s + validateIndicesTestMatrix(x, rows, cols, ftest = ftest, fsure = identity) 973s + } 973s + } 973s > 973s > # Testing for 64-bit builds (64 bits = 8 bytes) 973s > if (.Machine$sizeof.pointer == 8L) { 973s + validateIndices(c(1.25*2^40, 3, 1*2^38, 1, 1.4*2^39), maxIdx = 1*2^41) 973s + } 973s [1] 1.374390e+12 3.000000e+00 2.748779e+11 1.000000e+00 7.696581e+11 973s > 973s > options(oopts) 973s > 973s 973s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 973s Copyright (C) 2024 The R Foundation for Statistical Computing 973s Platform: powerpc64le-unknown-linux-gnu 973s 973s R is free software and comes with ABSOLUTELY NO WARRANTY. 973s You are welcome to redistribute it under certain conditions. 973s Type 'license()' or 'licence()' for distribution details. 973s 973s R is a collaborative project with many contributors. 973s Type 'contributors()' for more information and 973s 'citation()' on how to cite R or R packages in publications. 973s 973s Type 'demo()' for some demos, 'help()' for on-line help, or 973s 'help.start()' for an HTML browser interface to help. 973s Type 'q()' to quit R. 973s 973s > library("matrixStats") 973s > 973s > set.seed(1) 973s > x <- rnorm(1e4) 973s > 973s > 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > # Variance estimators 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > sigma2_a <- var(x) 973s > cat(sprintf("var(x) = %g\n", sigma2_a)) 973s var(x) = 1.02487 973s > 973s > sigma2_b <- varDiff(x) 973s > cat(sprintf("varDiff(x) = %g\n", sigma2_b)) 973s varDiff(x) = 1.01224 973s > 973s > d <- abs(sigma2_b - sigma2_a) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 0.0126268 973s > stopifnot(d < 0.02) 973s > 973s > 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > # Standard deviation estimators 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > sigma_a <- sd(x) 973s > cat(sprintf("sd(x) = %g\n", sigma_a)) 973s sd(x) = 1.01236 973s > 973s > sigma_b <- sdDiff(x) 973s > cat(sprintf("sdDiff(x) = %g\n", sigma_b)) 973s sdDiff(x) = 1.0061 973s > 973s > d <- abs(sigma_b - sigma_a) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 0.00625567 973s > stopifnot(d < 0.01) 973s > 973s > # Sanity checks 973s > stopifnot(abs(sigma2_a - sigma_a ^ 2) < 1e-9) 973s > stopifnot(abs(sigma2_b - sigma_b ^ 2) < 1e-9) 973s > 973s > 973s > sigma_a2 <- mad(x) 973s > cat(sprintf("mad(x) = %g\n", sigma_a2)) 973s mad(x) = 0.998376 973s > 973s > sigma_b2 <- madDiff(x) 973s > cat(sprintf("madDiff(x) = %g\n", sigma_b2)) 973s madDiff(x) = 1.02513 973s > 973s > d <- abs(sigma_b2 - sigma_a2) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 0.0267497 973s > stopifnot(d < 0.05) 973s > 973s > 973s > sigma_a3 <- IQR(x) 973s > cat(sprintf("IQR(x) = %g\n", sigma_a3)) 973s IQR(x) = 1.35105 973s > 973s > sigma_b3 <- iqrDiff(x) 973s > cat(sprintf("iqrDiff(x) = %g\n", sigma_b3)) 973s iqrDiff(x) = 1.37797 973s > 973s > d <- abs(sigma_b3 - sigma_a3) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 0.0269152 973s > stopifnot(d < 0.05) 973s > 973s > 973s > 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > # Trimmed estimators 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > y <- x 973s > outliers <- sample(length(x), size = 0.1 * length(x)) 973s > y[outliers] <- 100 * y[outliers] 973s > 973s > sigma_ao <- sd(y[-outliers]) 973s > cat(sprintf("sd(y) = %g\n", sigma_ao)) 973s sd(y) = 1.01166 973s > 973s > sigma_bo <- sdDiff(y[-outliers]) 973s > cat(sprintf("sdDiff(y) = %g\n", sigma_bo)) 973s sdDiff(y) = 1.00743 973s > 973s > d <- abs(sigma_b - sigma_a) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 0.00625567 973s > stopifnot(d < 0.01) 973s > 973s > sigma_bot <- sdDiff(y, trim = 0.05) 973s > cat(sprintf("sdDiff(y, trim = 0.05) = %g\n", sigma_bot)) 973s sdDiff(y, trim = 0.05) = 7.74327 973s > 973s > d <- abs(sigma_bot - sigma_a) 973s > cat(sprintf("Absolute difference = %g\n", d)) 973s Absolute difference = 6.73091 973s > #stopifnot(d < 1e-3) 973s > 973s > sigma_cot <- madDiff(y, trim = 0.05) 973s > cat(sprintf("madDiff(y, trim = 0.05) = %g\n", sigma_cot)) 973s madDiff(y, trim = 0.05) = 1.15278 973s > 973s > sigma_dot <- iqrDiff(y, trim = 0.05) 973s > cat(sprintf("iqrDiff(y, trim = 0.05) = %g\n", sigma_dot)) 973s iqrDiff(y, trim = 0.05) = 1.55762 973s > 973s > 973s > fcns <- list( 973s + varDiff = varDiff, 973s + sdDiff = sdDiff, 973s + madDiff = madDiff, 973s + iqrDiff = iqrDiff 973s + ) 973s > 973s > for (name in names(fcns)) { 973s + cat(sprintf("%s()...\n", name)) 973s + fcn <- fcns[[name]] 973s + 973s + for (mode in c("integer", "double")) { 973s + cat("mode: ", mode, "", sep = "") 973s + for (n in 0:3) { 973s + x <- runif(n, min = -5, max = 5) 973s + storage.mode(x) <- mode 973s + str(x) 973s + 973s + y <- fcn(x) 973s + yt <- fcn(x, trim = 0.1) 973s + str(list("non-trimmed" = y, trimmed = yt)) 973s + } # for (mode ...) 973s + } 973s + 973s + cat(sprintf("%s()...DONE\n", name)) 973s + } # for (name ...) 973s varDiff()... 973s mode: integer int(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int -4 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:2] 3 2 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:3] 1 4 -1 973s List of 2 973s $ non-trimmed: num 16 973s $ trimmed : num 16 973s mode: double num(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num -0.794 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:2] 0.897 -3.728 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:3] 2.07 -1.13 1.94 973s List of 2 973s $ non-trimmed: num 9.83 973s $ trimmed : num 9.83 973s varDiff()...DONE 973s sdDiff()... 973s mode: integer int(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int 2 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:2] -4 1 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:3] -2 1 -1 973s List of 2 973s $ non-trimmed: num 2.5 973s $ trimmed : num 2.5 973s mode: double num(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num -3.78 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:2] -2.04 2.38 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:3] 1.42 -2.14 1.14 973s List of 2 973s $ non-trimmed: num 3.42 973s $ trimmed : num 3.42 973s sdDiff()...DONE 973s madDiff()... 973s mode: integer int(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int -1 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:2] -1 4 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int [1:3] -1 0 -3 973s List of 2 973s $ non-trimmed: num 2.1 973s $ trimmed : num 2.1 973s mode: double num(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num -1.13 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:2] -1.7 -1.21 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num [1:3] -2.39 -0.464 3.086 973s List of 2 973s $ non-trimmed: num 0.851 973s $ trimmed : num 0.851 973s madDiff()...DONE 973s iqrDiff()... 973s mode: integer int(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s int 3 973s List of 2 973s $ non-trimmed: num 0 973s $ trimmed : num 0 973s int [1:2] -3 4 973s List of 2 973s $ non-trimmed: num 0 973s $ trimmed : num 0 973s int [1:3] 0 -2 -2 973s List of 2 973s $ non-trimmed: num 0.707 973s $ trimmed : num 0.707 973s mode: double num(0) 973s List of 2 973s $ non-trimmed: num NA 973s $ trimmed : num NA 973s num -4.46 973s List of 2 973s $ non-trimmed: num 0 973s $ trimmed : num 0 973s num [1:2] 3.67 1.02 973s List of 2 973s $ non-trimmed: num 0 973s $ trimmed : num 0 973s num [1:3] -0.537 -2.733 2.857 973s List of 2 973s $ non-trimmed: num 2.75 973s $ trimmed : num 2.75 973s iqrDiff()...DONE 973s > 973s 973s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 973s Copyright (C) 2024 The R Foundation for Statistical Computing 973s Platform: powerpc64le-unknown-linux-gnu 973s 973s R is free software and comes with ABSOLUTELY NO WARRANTY. 973s You are welcome to redistribute it under certain conditions. 973s Type 'license()' or 'licence()' for distribution details. 973s 973s R is a collaborative project with many contributors. 973s Type 'contributors()' for more information and 973s 'citation()' on how to cite R or R packages in publications. 973s 973s Type 'demo()' for some demos, 'help()' for on-line help, or 973s 'help.start()' for an HTML browser interface to help. 973s Type 'q()' to quit R. 973s 973s > library("matrixStats") 973s > 973s > fcns <- list( 973s + varDiff = varDiff, 973s + sdDiff = sdDiff, 973s + madDiff = madDiff, 973s + iqrDiff = iqrDiff 973s + ) 973s > 973s > 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > # Subsetted tests 973s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 973s > source("utils/validateIndicesFramework.R") 973s > for (name in names(fcns)) { 973s + cat(sprintf("subsetted tests on %s()...\n", name)) 973s + fcn <- fcns[[name]] 973s + 973s + for (mode in c("numeric", "integer")) { 973s + x <- runif(6, min = -6, max = 6) 973s + storage.mode(x) <- mode 973s + trim <- runif(1, min = 0, max = 0.5) 973s + if (mode == "numeric") x[1] <- Inf 973s + 973s + for (diff in 1:2) { 973s + for (idxs in index_cases) { 973s + validateIndicesTestVector(x, idxs, 973s + ftest = fcn, fsure = fcn, 973s + na.rm = TRUE, diff = diff, trim = trim) 973s + validateIndicesTestVector(x, idxs, 973s + ftest = fcn, fsure = fcn, 973s + na.rm = FALSE, diff = diff, trim = trim) 973s + } 973s + } 973s + } 973s + cat(sprintf("%s()...DONE\n", name)) 973s + } 973s subsetted tests on varDiff()... 973s varDiff()...DONE 973s subsetted tests on sdDiff()... 973s sdDiff()...DONE 973s subsetted tests on madDiff()... 973s madDiff()...DONE 973s subsetted tests on iqrDiff()... 973s iqrDiff()...DONE 973s > 973s 973s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 973s Copyright (C) 2024 The R Foundation for Statistical Computing 973s Platform: powerpc64le-unknown-linux-gnu 973s 973s R is free software and comes with ABSOLUTELY NO WARRANTY. 973s You are welcome to redistribute it under certain conditions. 973s Type 'license()' or 'licence()' for distribution details. 973s 973s R is a collaborative project with many contributors. 973s Type 'contributors()' for more information and 973s 'citation()' on how to cite R or R packages in publications. 973s 973s Type 'demo()' for some demos, 'help()' for on-line help, or 973s 'help.start()' for an HTML browser interface to help. 973s Type 'q()' to quit R. 973s 973s > library("matrixStats") 973s > 973s > for (mode in c("logical", "integer", "double")) { 973s + cat("mode: ", mode, "", sep = "") 973s + n <- 2L 973s + x <- runif(n, min = -5, max = 5) 973s + if (mode == "logical") { 973s + x <- x > 0 973s + } 973s + storage.mode(x) <- mode 973s + str(x) 973s + 973s + cat("All weights are 1\n") 973s + w <- rep(1, times = n) 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + 973s + cat("First weight is 5\n") 973s + # Pull the mean towards zero 973s + w[1] <- 5 973s + str(w) 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + 973s + cat("All weights are 0\n") 973s + # All weights set to zero 973s + w <- rep(0, times = n) 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + 973s + cat("First weight is 8.5\n") 973s + # Put even more weight on the zero 973s + w[1] <- 8.5 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + 973s + cat("First weight is Inf\n") 973s + # All weight on the first value 973s + w[1] <- Inf 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + 973s + cat("Last weight is Inf\n") 973s + # All weight on the last value 973s + w[1] <- 1 973s + w[n] <- Inf 973s + m0 <- weighted.mean(x, w) 973s + m1 <- weightedMean(x, w) 973s + str(list(m0 = m0, m1 = m1)) 973s + stopifnot(identical(m1, m0)) 973s + } # for (mode ...) 973s *** Testing for missing values 1011s mode: logical logi [1:2] FALSE FALSE 1011s All weights are 1 1011s List of 2 1011s $ m0: num 0 1011s $ m1: num 0 1011s First weight is 5 1011s num [1:2] 5 1 1011s List of 2 1011s $ m0: num 0 1011s $ m1: num 0 1011s All weights are 0 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s First weight is 8.5 1011s List of 2 1011s $ m0: num 0 1011s $ m1: num 0 1011s First weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s Last weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s mode: integer int [1:2] -2 1 1011s All weights are 1 1011s List of 2 1011s $ m0: num -0.5 1011s $ m1: num -0.5 1011s First weight is 5 1011s num [1:2] 5 1 1011s List of 2 1011s $ m0: num -1.5 1011s $ m1: num -1.5 1011s All weights are 0 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s First weight is 8.5 1011s List of 2 1011s $ m0: num -2 1011s $ m1: num -2 1011s First weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s Last weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s mode: double num [1:2] -4.13 4.53 1011s All weights are 1 1011s List of 2 1011s $ m0: num 0.201 1011s $ m1: num 0.201 1011s First weight is 5 1011s num [1:2] 5 1 1011s List of 2 1011s $ m0: num -2.68 1011s $ m1: num -2.68 1011s All weights are 0 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s First weight is 8.5 1011s List of 2 1011s $ m0: num -4.13 1011s $ m1: num -4.13 1011s First weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s Last weight is Inf 1011s List of 2 1011s $ m0: num NaN 1011s $ m1: num NaN 1011s > 1011s > 1011s > message("*** Testing for missing values") 1011s > # NA tests 1011s > xs <- list(A = c(1, 2, 3), B = c(NA, 2, 3), C = c(NA, 2, 3)) 1011s > ws <- list(A = c(1, 1, 1), B = c(NA, 1, 1), C = c(1, NA, 1)) 1011s > ## NOTE: The (B, B) case with na.rm = TRUE is interesting because 1011s > ## even if NAs in 'w' are not dropped by na.rm = TRUE, this one 1011s > ## is because 'x' is dropped and therefore that first element 1011s > ## is skipped in the computation. It basically does 1011s > ## keep <- !is.na(x); x <- x[keep]; w <- w[keep] 1011s > ## without looking at 'w'. 1011s > for (x in xs) { 1011s + for (mode in c("logical", "integer", "double")) { 1011s + storage.mode(x) <- mode 1011s + for (w in ws) { 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat(sprintf("mode: %s, na.rm = %s\n", mode, na.rm)) 1011s + str(list(x = x, w = w)) 1011s + m0 <- weighted.mean(x, w, na.rm = na.rm) 1011s + m1 <- weightedMean(x, w, na.rm = na.rm) 1011s + str(list(m0 = m0, m1 = m1)) 1011s + stopifnot(all.equal(m1, m0)) 1011s + } 1011s + } 1011s + } 1011s + } 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] TRUE TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] 1 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] 1 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: logical, na.rm = FALSE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: logical, na.rm = TRUE 1011s List of 2 1011s $ x: logi [1:3] NA TRUE TRUE 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: integer, na.rm = FALSE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: integer, na.rm = TRUE 1011s List of 2 1011s $ x: int [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] NA 1 1 1011s List of 2 1011s $ m0: num 1 1011s $ m1: num 1 1011s mode: double, na.rm = FALSE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s mode: double, na.rm = TRUE 1011s List of 2 1011s $ x: num [1:3] NA 1 1 1011s $ w: num [1:3] 1 NA 1 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Subsetted tests 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > source("utils/validateIndicesFramework.R") 1011s > for (mode in c("numeric", "integer")) { 1011s + x <- runif(6, min = -6, max = 6) 1011s + w <- runif(6, min = 0, max = 6) 1011s + storage.mode(x) <- mode 1011s + storage.mode(w) <- mode 1011s + if (mode == "numeric") w[1] <- Inf 1011s + 1011s + for (idxs in index_cases) { 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMean, fsure = weighted.mean, 1011s + na.rm = TRUE, refine = TRUE) 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMean, fsure = weighted.mean, 1011s + na.rm = FALSE, refine = TRUE) 1011s + } 1011s + } 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > x <- 1:5 1011s > y <- weightedMedian(x) 1011s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = TRUE) 1011s > print(y) 1011s [1] 3 1011s > 1011s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = FALSE) 1011s > print(y) 1011s [1] NA 1011s > stopifnot(is.na(y)) 1011s > 1011s > x <- 1:10 1011s > n <- length(x) 1011s > 1011s > y1 <- median(x) # 5.5 1011s > y2 <- weightedMedian(x) # 5.5 1011s > stopifnot(all.equal(y1, y2)) 1011s > 1011s > 1011s > w <- rep(1, times = n) 1011s > y1 <- weightedMedian(x, w) # 5.5 (default) 1011s > y2a <- weightedMedian(x, ties = "weighted") # 5.5 (default) 1011s > y2b <- weightedMedian(x, ties = "min") # 5 1011s > y2c <- weightedMedian(x, ties = "max") # 6 1011s > stopifnot(all.equal(y2a, y1)) 1011s > 1011s > y3 <- weightedMedian(x, w) # 5.5 (default) 1011s > 1011s > 1011s > # Pull the median towards zero 1011s > w[1] <- 5 1011s > y1 <- weightedMedian(x, w) # 3.5 1011s > y <- c(rep(0, times = w[1]), x[-1]) # Only possible for integer weights 1011s > y2 <- median(y) # 3.5 1011s > stopifnot(all.equal(y1, y2)) 1011s > 1011s > # Put even more weight on the zero 1011s > w[1] <- 8.5 1011s > y <- weightedMedian(x, w) # 2 1011s > 1011s > # All weight on the first value 1011s > w[1] <- Inf 1011s > y <- weightedMedian(x, w) # 1 1011s > 1011s > # All weight on the last value 1011s > w[1] <- 1 1011s > w[n] <- Inf 1011s > y <- weightedMedian(x, w) # 10 1011s > 1011s > # All weights set to zero 1011s > w <- rep(0, times = n) 1011s > y <- weightedMedian(x, w) # NA 1011s > 1011s > x <- 1:4 1011s > w <- rep(1, times = 4) 1011s > for (mode in c("integer", "double")) { 1011s + storage.mode(x) <- mode 1011s + for (ties in c("weighted", "mean", "min", "max")) { 1011s + cat(sprintf("ties = %s\n", ties)) 1011s + y <- weightedMedian(x, w, ties = ties) 1011s + } 1011s + } 1011s ties = weighted 1011s ties = mean 1011s ties = min 1011s ties = max 1011s ties = weighted 1011s ties = mean 1011s ties = min 1011s ties = max 1011s > 1011s > set.seed(0x42) 1011s > 1011s > y <- weightedMedian(x = double(0L)) 1011s > print(y) 1011s [1] NA 1011s > stopifnot(length(y) == 1L) 1011s > stopifnot(is.na(y)) 1011s > 1011s > y <- weightedMedian(x = x[1]) 1011s > print(y) 1011s [1] 1 1011s > stopifnot(length(y) == 1L) 1011s > stopifnot(all.equal(y, x[1])) 1011s > 1011s > 1011s > n <- 1e3 1011s > x <- runif(n) 1011s > w <- runif(n, min = 0, max = 1) 1011s > for (mode in c("integer", "double")) { 1011s + storage.mode(x) <- mode 1011s + for (ties in c("weighted", "mean", "min", "max")) { 1011s + y <- weightedMedian(x, w, ties = ties) 1011s + cat(sprintf("mode = %s, ties = %s, result = %g\n", mode, ties, y)) 1011s + } 1011s + } 1011s mode = integer, ties = weighted, result = 0 1011s mode = integer, ties = mean, result = 0 1011s mode = integer, ties = min, result = 0 1011s mode = integer, ties = max, result = 0 1011s mode = double, ties = weighted, result = 0 1011s mode = double, ties = mean, result = 0 1011s mode = double, ties = min, result = 0 1011s mode = double, ties = max, result = 0 1011s > 1011s > 1011s > # A large vector 1011s > n <- 1e5 1011s > x <- runif(n) 1011s > w <- runif(n, min = 0, max = 1) 1011s > y <- weightedMedian(x, w) 1011s > 1011s > y <- weightedMedian(x, w, ties = "min") 1011s > 1011s > 1011s > # Single Number 1011s > xs <- c(1, NA_integer_) 1011s > ws <- c(1, NA_integer_) 1011s > for (x in xs) { 1011s + for (w in ws) { 1011s + y <- weightedMedian(x = x, w = w) 1011s + if (is.na(w)) z <- NA_real_ 1011s + else z <- x[1] 1011s + stopifnot(all.equal(y, z)) 1011s + } 1011s + } 1011s > 1011s > ## Logical 1011s > x1 <- c(TRUE, FALSE, TRUE) 1011s > w0 <- c(0, 0, 0) 1011s > stopifnot(!is.finite(weightedMedian(x1, w0)), 1011s + !is.infinite(weightedMedian(x1, w0))) 1011s > 1011s > w1 <- c(1, 1, 1) 1011s > stopifnot(weightedMedian(x1, w1) == 1) 1011s > 1011s > w2 <- c(1, 2, 3) 1011s > stopifnot(weightedMedian(x1, w2) == 1) 1011s > 1011s > ### NA 1011s > stopifnot(is.na(weightedMedian(c(TRUE, FALSE, NA), 1011s + c(1, 2, 3))), 1011s + all.equal(weightedMedian(c(TRUE, FALSE, NA), 1011s + c(1, 2, 3), 1011s + na.rm = TRUE), 1011s + weightedMedian(c(TRUE, FALSE), 1011s + c(1, 2)))) 1011s > ### Identical to as.integer() 1011s > x <- rcauchy(100) 1011s > w <- abs(rcauchy(100)) 1011s > stopifnot(all.equal(weightedMedian(x > 0, w), 1011s + weightedMedian(as.integer(x > 0), w))) 1011s > 1011s > 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Subsetted tests 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > source("utils/validateIndicesFramework.R") 1011s > for (mode in c("numeric", "integer")) { 1011s + x <- runif(6, min = -6, max = 6) 1011s + w <- runif(6, min = 0, max = 6) 1011s + storage.mode(x) <- mode 1011s + storage.mode(w) <- mode 1011s + if (mode == "numeric") w[1] <- Inf 1011s + 1011s + for (idxs in index_cases) { 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMedian, 1011s + fsure = weightedMedian, 1011s + na.rm = TRUE) 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMedian, 1011s + fsure = weightedMedian, 1011s + na.rm = FALSE) 1011s + 1011s + for (ties in c("weighted", "mean", "min", "max")) { 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMedian, 1011s + fsure = weightedMedian, 1011s + na.rm = TRUE, ties = ties) 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = weightedMedian, 1011s + fsure = weightedMedian, 1011s + na.rm = FALSE, ties = ties) 1011s + } 1011s + } 1011s + } 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > weightedVar_R <- function(x, w) { 1011s + mu <- weighted.mean(x, w = w) 1011s + sum(w * (x - mu) ^ 2) / (sum(w) - 1) 1011s + } 1011s > 1011s > 1011s > n <- 10 1011s > x <- as.double(1:n) 1011s > 1011s > message("*** weightedVar() ...") 1011s > 1011s > message("- Zero elements") 1011s > m0 <- var(integer(0)) 1011s > m1 <- weightedVar(integer(0), w = integer(0)) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num NA 1011s $ m1: int NA 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- One elements") 1011s > m0 <- var(1) 1011s > m1 <- weightedVar(1) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- Uniform weights (all w = 1)") 1011s > m0 <- var(x) 1011s > w <- rep(1, times = n) 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num 9.17 1011s $ m1: num 9.17 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- Uniform weights (all w = 3)") 1011s > m0 <- var(rep(x, each = 3)) 1011s > w <- rep(3, times = n) 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num 8.53 1011s $ m1: num 8.53 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- Uniform weights on the first five elements") 1011s > idxs <- 1:5 1011s > m0 <- var(x[1:5]) 1011s > w <- rep(0, times = n) 1011s > w[idxs] <- 1 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num 2.5 1011s $ m1: num 2.5 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- Uniform weights on every second elements") 1011s > idxs <- seq(from = 1, to = n, by = 2) 1011s > m0 <- var(x[idxs]) 1011s > w <- rep(0, times = n) 1011s > w[idxs] <- 1 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num 10 1011s $ m1: num 10 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > 1011s > message("- All weights are zero") 1011s > idxs <- integer(0L) 1011s > m0 <- var(x[idxs]) 1011s > w <- rep(0, times = n) 1011s > w[idxs] <- 1 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > message("- Infinite weight on first element") 1011s > idxs <- 1L 1011s > m0 <- var(x[idxs]) 1011s > w <- rep(0, times = n) 1011s > w[idxs] <- Inf 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num NA 1011s $ m1: num NA 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > message("- Missing-value weight on first element") 1011s > idxs <- 1L 1011s > w <- rep(1, times = n) 1011s > w[idxs] <- NA_real_ 1011s > m1 <- weightedVar(x, w = w) 1011s > str(list(m1 = m1)) 1011s List of 1 1011s $ m1: num NA 1011s > stopifnot(identical(m1, NA_real_)) 1011s > 1011s > 1011s > message("- Frequency weights") 1011s > 1011s > ## From https://en.wikipedia.org/wiki/Weighted_arithmetic_mean 1011s > y <- c(2, 2, 4, 5, 5, 5) 1011s > x <- unique(y) 1011s > w <- table(y) 1011s > stopifnot(names(w) == x) 1011s > 1011s > m0 <- weightedVar(x, w = w) 1011s > m1 <- var(y) 1011s > stopifnot(all.equal(m1, m0)) 1011s > m2 <- weightedVar(x, w = w) 1011s > str(list(m0 = m0, m1 = m1, m2 = m2)) 1011s List of 3 1011s $ m0: num 2.17 1011s $ m1: num 2.17 1011s $ m2: num 2.17 1011s > stopifnot(all.equal(m2, m0)) 1011s > 1011s > ## From https://github.com/HenrikBengtsson/matrixStats/issues/72 1011s > large <- c(21, 8, 26, 1, 15, 33, 12, 25, 0, 84) 1011s > years <- c(41706, 9301, 33678, 3082, 27040, 44188, 10049, 30591, 2275, 109831) 1011s > 1011s > m0 <- weightedVar(large, w = years) 1011s > m1 <- weightedVar(large, w = years) 1011s > str(list(m0 = m0, m1 = m1)) 1011s List of 2 1011s $ m0: num 899 1011s $ m1: num 899 1011s > stopifnot(all.equal(m1, m0)) 1011s > 1011s > message("*** weightedVar() ... DONE") 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > fcns <- list( 1011s + weightedVar = weightedVar, 1011s + weightedSd = weightedSd, 1011s + weightedMad = weightedMad 1011s + ) 1011s > 1011s > for (name in names(fcns)) { 1011s + cat(sprintf("%s()...\n", name)) 1011s + fcn <- fcns[[name]] 1011s + 1011s + for (mode in c("integer", "double")) { 1011s + cat("mode: ", mode, "\n", sep = "") 1011s + n <- 15L 1011s + x <- runif(n, min = -5, max = 5) 1011s + storage.mode(x) <- mode 1011s + str(x) 1011s + 1011s + for (add_na in c(FALSE, TRUE)) { 1011s + cat("add_na: ", add_na, "\n", sep = "") 1011s + if (add_na) { 1011s + x[c(5, 7)] <- NA 1011s + } 1011s + str(x) 1011s + 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat("na.rm: ", na.rm, "\n", sep = "") 1011s + 1011s + cat("Weights are not specified (all are 1)\n") 1011s + m1 <- fcn(x, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("All weights are 1\n") 1011s + w <- rep(1, times = n) 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("First weight is 5\n") 1011s + # Pull the mean towards zero 1011s + w[1] <- 5 1011s + str(w) 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("All weights are 0\n") 1011s + # All weights set to zero 1011s + w <- rep(0, times = n) 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("First weight is 8.5\n") 1011s + # Put even more weight on the zero 1011s + w[1] <- 8.5 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("First weight is Inf\n") 1011s + # All weight on the first value 1011s + w[1] <- Inf 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("Last weight is Inf\n") 1011s + # All weight on the last value 1011s + w[1] <- 1 1011s + w[n] <- Inf 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + 1011s + cat("Last weight is NA\n") 1011s + # All weight on the last value 1011s + w[1] <- 1 1011s + w[n] <- NA_real_ 1011s + m1 <- fcn(x, w, na.rm = na.rm) 1011s + str(list(m1 = m1)) 1011s + } # for (na.rm ...) 1011s + } # for (add_na ...) 1011s + } # for (mode ...) 1011s + 1011s + cat(sprintf("%s()...DONE\n", name)) 1011s + } # for (name ...) 1011s weightedVar()... 1011s mode: integer 1011s int [1:15] 0 3 -2 2 2 0 -3 -3 -2 -3 ... 1011s add_na: FALSE 1011s int [1:15] 0 3 -2 2 2 0 -3 -3 -2 -3 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 3.97 1011s All weights are 1 1011s List of 1 1011s $ m1: num 3.97 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.12 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 3.97 1011s All weights are 1 1011s List of 1 1011s $ m1: num 3.97 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.12 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s add_na: TRUE 1011s int [1:15] 0 3 -2 2 NA 0 NA -3 -2 -3 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: int NA 1011s All weights are 1 1011s List of 1 1011s $ m1: int NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: int NA 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 3.59 1011s All weights are 1 1011s List of 1 1011s $ m1: num 3.59 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.72 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s mode: double 1011s num [1:15] -1.848 -4.169 1.757 2.205 -0.579 ... 1011s add_na: FALSE 1011s num [1:15] -1.848 -4.169 1.757 2.205 -0.579 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 7.43 1011s All weights are 1 1011s List of 1 1011s $ m1: num 7.43 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 6.01 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 7.43 1011s All weights are 1 1011s List of 1 1011s $ m1: num 7.43 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 6.01 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s add_na: TRUE 1011s num [1:15] -1.85 -4.17 1.76 2.2 NA ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num NA 1011s All weights are 1 1011s List of 1 1011s $ m1: num NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num NA 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 8.66 1011s All weights are 1 1011s List of 1 1011s $ m1: num 8.66 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 6.75 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s weightedVar()...DONE 1011s weightedSd()... 1011s mode: integer 1011s int [1:15] 0 3 3 -2 4 3 -3 -3 -2 1 ... 1011s add_na: FALSE 1011s int [1:15] 0 3 3 -2 4 3 -3 -3 -2 1 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.69 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.69 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.38 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.69 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.69 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.38 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s add_na: TRUE 1011s int [1:15] 0 3 3 -2 NA 3 NA -3 -2 1 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num NA 1011s All weights are 1 1011s List of 1 1011s $ m1: num NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num NA 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.53 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.53 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.2 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s mode: double 1011s num [1:15] -3.54 -1 -2.99 2.36 3.05 ... 1011s add_na: FALSE 1011s num [1:15] -3.54 -1 -2.99 2.36 3.05 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.74 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.74 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.98 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.74 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.74 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 2.98 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s add_na: TRUE 1011s num [1:15] -3.54 -1 -2.99 2.36 NA ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num NA 1011s All weights are 1 1011s List of 1 1011s $ m1: num NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num NA 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.87 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.87 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.02 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num NA 1011s First weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num NA 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s weightedSd()...DONE 1011s weightedMad()... 1011s mode: integer 1011s int [1:15] 3 -3 -3 3 4 0 0 2 0 -3 ... 1011s add_na: FALSE 1011s int [1:15] 3 -3 -3 3 4 0 0 2 0 -3 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 1 1011s List of 1 1011s $ m1: num 4.45 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 1 1011s List of 1 1011s $ m1: num 4.45 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s add_na: TRUE 1011s int [1:15] 3 -3 -3 3 NA 0 NA 2 0 -3 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num NA 1011s All weights are 1 1011s List of 1 1011s $ m1: int NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: int NA 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 1 1011s List of 1 1011s $ m1: num 4.45 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 4.45 1011s All weights are 0 1011s List of 1 1011s $ m1: int NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: int 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: int 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: int NA 1011s mode: double 1011s num [1:15] -2.689 2.673 2.572 0.694 -4.862 ... 1011s add_na: FALSE 1011s num [1:15] -2.689 2.673 2.572 0.694 -4.862 ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.96 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.96 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.61 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.96 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.96 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.61 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s add_na: TRUE 1011s num [1:15] -2.689 2.673 2.572 0.694 NA ... 1011s na.rm: FALSE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num NA 1011s All weights are 1 1011s List of 1 1011s $ m1: num NA 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num NA 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s na.rm: TRUE 1011s Weights are not specified (all are 1) 1011s List of 1 1011s $ m1: num 2.93 1011s All weights are 1 1011s List of 1 1011s $ m1: num 2.93 1011s First weight is 5 1011s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 1011s List of 1 1011s $ m1: num 3.53 1011s All weights are 0 1011s List of 1 1011s $ m1: num NA 1011s First weight is 8.5 1011s List of 1 1011s $ m1: num 0 1011s First weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is Inf 1011s List of 1 1011s $ m1: num 0 1011s Last weight is NA 1011s List of 1 1011s $ m1: num NA 1011s weightedMad()...DONE 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > fcns <- list( 1011s + weightedVar = weightedVar, 1011s + weightedSd = weightedSd, 1011s + weightedMad = weightedMad 1011s + ) 1011s > 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Subsetted tests 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > source("utils/validateIndicesFramework.R") 1011s > for (name in names(fcns)) { 1011s + cat(sprintf("subsetted tests on %s()...\n", name)) 1011s + fcn <- fcns[[name]] 1011s + 1011s + for (mode in c("numeric", "integer")) { 1011s + x <- runif(6, min = -6, max = 6) 1011s + w <- runif(6, min = 0, max = 6) 1011s + storage.mode(x) <- mode 1011s + storage.mode(w) <- mode 1011s + if (mode == "numeric") w[1] <- Inf 1011s + 1011s + for (idxs in index_cases) { 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = fcn, fsure = fcn, 1011s + na.rm = TRUE) 1011s + validateIndicesTestVector_w(x, w, idxs, 1011s + ftest = fcn, fsure = fcn, 1011s + na.rm = FALSE) 1011s + } 1011s + } 1011s + cat(sprintf("%s()...DONE\n", name)) 1011s + } 1011s subsetted tests on weightedVar()... 1011s weightedVar()...DONE 1011s subsetted tests on weightedSd()... 1011s weightedSd()...DONE 1011s subsetted tests on weightedMad()... 1011s weightedMad()...DONE 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 1011s + if (na.rm) { 1011s + xnok <- is.na(x) 1011s + ynok <- is.na(y) 1011s + anok <- xnok & ynok 1011s + unit <- switch(OP, 1011s + "+" = 0, 1011s + "-" = NA_real_, 1011s + "*" = 1, 1011s + "/" = NA_real_, 1011s + stop("Unknown 'OP' operator: ", OP) 1011s + ) 1011s + x[xnok] <- unit 1011s + y[ynok] <- unit 1011s + } 1011s + 1011s + ans <- switch(OP, 1011s + "+" = x + y, 1011s + "-" = x - y, 1011s + "*" = x * y, 1011s + "/" = x / y, 1011s + stop("Unknown 'OP' operator: ", OP) 1011s + ) 1011s + 1011s + if (na.rm) { 1011s + ans[anok] <- NA_real_ 1011s + } 1011s + 1011s + ans 1011s + } # x_OP_y_R() 1011s > 1011s > 1011s > 1011s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 1011s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 1011s + } 1011s > 1011s > 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # No missing values 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > x <- matrix(1:16, nrow = 4, ncol = 4) 1011s > y <- 1:nrow(x) 1011s > storage.mode(y) <- storage.mode(x) 1011s > 1011s > for (OP in c("+", "-", "*", "/")) { 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 1011s + 1011s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(a1) 1011s + stopifnot(all.equal(a1, a0)) 1011s + 1011s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(b1) 1011s + stopifnot(all.equal(b1, b0)) 1011s + } 1011s + } 1011s OP = '+', na.rm = FALSE 1011s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 1011s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 1011s OP = '+', na.rm = TRUE 1011s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 1011s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 1011s OP = '-', na.rm = FALSE 1011s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 1011s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 1011s OP = '-', na.rm = TRUE 1011s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 1011s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 1011s OP = '*', na.rm = FALSE 1011s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 1011s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 1011s OP = '*', na.rm = TRUE 1011s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 1011s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 1011s OP = '/', na.rm = FALSE 1011s num [1:4, 1:4] 1 1 1 1 5 ... 1011s num [1:4, 1:4] 1 2 3 4 2.5 ... 1011s OP = '/', na.rm = TRUE 1011s num [1:4, 1:4] 1 1 1 1 5 ... 1011s num [1:4, 1:4] 1 2 3 4 2.5 ... 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Missing values in x, y, or both. 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > for (which in c("x", "y", "both")) { 1011s + x <- matrix(1:16, nrow = 4, ncol = 4) 1011s + y <- 1:nrow(x) 1011s + storage.mode(y) <- storage.mode(x) 1011s + 1011s + if (which == "x") { 1011s + x[3:6] <- NA_real_ 1011s + } else if (which == "y") { 1011s + y[c(1, 3)] <- NA_real_ 1011s + } else if (which == "both") { 1011s + x[3:6] <- NA_real_ 1011s + y[c(1, 3)] <- NA_real_ 1011s + } 1011s + 1011s + for (OP in c("+", "-", "*", "/")) { 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 1011s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(a1) 1011s + stopifnot(all.equal(a1, a0)) 1011s + 1011s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(b1) 1011s + stopifnot(all.equal(b1, b0)) 1011s + } 1011s + } 1011s + } 1011s OP = '+', na.rm = FALSE 1011s num [1:4, 1:4] 2 4 NA NA NA NA 10 12 10 12 ... 1011s num [1:4, 1:4] 2 3 NA NA NA NA 9 10 12 13 ... 1011s OP = '+', na.rm = TRUE 1011s num [1:4, 1:4] 2 4 3 4 1 2 10 12 10 12 ... 1011s num [1:4, 1:4] 2 3 1 1 2 2 9 10 12 13 ... 1011s OP = '-', na.rm = FALSE 1011s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 1011s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 1011s OP = '-', na.rm = TRUE 1011s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 1011s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 1011s OP = '*', na.rm = FALSE 1011s num [1:4, 1:4] 1 4 NA NA NA NA 21 32 9 20 ... 1011s num [1:4, 1:4] 1 2 NA NA NA NA 14 16 27 30 ... 1011s OP = '*', na.rm = TRUE 1011s num [1:4, 1:4] 1 4 3 4 1 2 21 32 9 20 ... 1011s num [1:4, 1:4] 1 2 1 1 2 2 14 16 27 30 ... 1011s OP = '/', na.rm = FALSE 1011s num [1:4, 1:4] 1 1 NA NA NA ... 1011s num [1:4, 1:4] 1 2 NA NA NA ... 1011s OP = '/', na.rm = TRUE 1011s num [1:4, 1:4] 1 1 NA NA NA ... 1011s num [1:4, 1:4] 1 2 NA NA NA ... 1011s OP = '+', na.rm = FALSE 1011s num [1:4, 1:4] NA 4 NA 8 NA 8 NA 12 NA 12 ... 1011s num [1:4, 1:4] NA NA NA NA 7 8 9 10 NA NA ... 1011s OP = '+', na.rm = TRUE 1011s num [1:4, 1:4] 1 4 3 8 5 8 7 12 9 12 ... 1011s num [1:4, 1:4] 1 2 3 4 7 8 9 10 9 10 ... 1011s OP = '-', na.rm = FALSE 1011s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 1011s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 1011s OP = '-', na.rm = TRUE 1011s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 1011s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 1011s OP = '*', na.rm = FALSE 1011s num [1:4, 1:4] NA 4 NA 16 NA 12 NA 32 NA 20 ... 1011s num [1:4, 1:4] NA NA NA NA 10 12 14 16 NA NA ... 1011s OP = '*', na.rm = TRUE 1011s num [1:4, 1:4] 1 4 3 16 5 12 7 32 9 20 ... 1011s num [1:4, 1:4] 1 2 3 4 10 12 14 16 9 10 ... 1011s OP = '/', na.rm = FALSE 1011s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 1011s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 1011s OP = '/', na.rm = TRUE 1011s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 1011s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 1011s OP = '+', na.rm = FALSE 1011s num [1:4, 1:4] NA 4 NA NA NA NA NA 12 NA 12 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 9 10 NA NA ... 1011s OP = '+', na.rm = TRUE 1011s num [1:4, 1:4] 1 4 NA 4 NA 2 7 12 9 12 ... 1011s num [1:4, 1:4] 1 2 NA NA 2 2 9 10 9 10 ... 1011s OP = '-', na.rm = FALSE 1011s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 1011s OP = '-', na.rm = TRUE 1011s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 1011s OP = '*', na.rm = FALSE 1011s num [1:4, 1:4] NA 4 NA NA NA NA NA 32 NA 20 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 14 16 NA NA ... 1011s OP = '*', na.rm = TRUE 1011s num [1:4, 1:4] 1 4 NA 4 NA 2 7 32 9 20 ... 1011s num [1:4, 1:4] 1 2 NA NA 2 2 14 16 9 10 ... 1011s OP = '/', na.rm = FALSE 1011s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 1011s OP = '/', na.rm = TRUE 1011s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 1011s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 1011s > 1011s > 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Length differences 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > x <- matrix(1:8, nrow = 2, ncol = 4) 1011s > y <- 1:ncol(x) 1011s > storage.mode(y) <- storage.mode(x) 1011s > 1011s > for (OP in c("+", "-", "*", "/")) { 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 1011s + 1011s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(a1) 1011s + stopifnot(all.equal(a1, a0)) 1011s + 1011s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 1011s + str(b1) 1011s + stopifnot(all.equal(b1, b0)) 1011s + } 1011s + } 1011s OP = '+', na.rm = FALSE 1011s int [1:2, 1:4] 2 4 6 8 6 8 10 12 1011s int [1:2, 1:4] 2 3 5 6 8 9 11 12 1011s OP = '+', na.rm = TRUE 1011s int [1:2, 1:4] 2 4 6 8 6 8 10 12 1011s int [1:2, 1:4] 2 3 5 6 8 9 11 12 1011s OP = '-', na.rm = FALSE 1011s int [1:2, 1:4] 0 0 0 0 4 4 4 4 1011s int [1:2, 1:4] 0 1 1 2 2 3 3 4 1011s OP = '-', na.rm = TRUE 1011s int [1:2, 1:4] 0 0 0 0 4 4 4 4 1011s int [1:2, 1:4] 0 1 1 2 2 3 3 4 1011s OP = '*', na.rm = FALSE 1011s int [1:2, 1:4] 1 4 9 16 5 12 21 32 1011s int [1:2, 1:4] 1 2 6 8 15 18 28 32 1011s OP = '*', na.rm = TRUE 1011s int [1:2, 1:4] 1 4 9 16 5 12 21 32 1011s int [1:2, 1:4] 1 2 6 8 15 18 28 32 1011s OP = '/', na.rm = FALSE 1011s num [1:2, 1:4] 1 1 1 1 5 ... 1011s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 1011s OP = '/', na.rm = TRUE 1011s num [1:2, 1:4] 1 1 1 1 5 ... 1011s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 1011s > 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # All missing values 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > xs <- list( 1011s + A = matrix(1:2, nrow = 2, ncol = 2), 1011s + B = matrix(NA_integer_, nrow = 2, ncol = 2) 1011s + ) 1011s > ys <- list( 1011s + A = 1L, 1011s + B = NA_integer_ 1011s + ) 1011s > 1011s > for (x in xs) { 1011s + for (y in ys) { 1011s + for (mode in c("logical", "integer", "double")) { 1011s + storage.mode(x) <- mode 1011s + storage.mode(y) <- mode 1011s + str(list(x = x, y = y)) 1011s + 1011s + for (OP in c("+", "-", "*", "/")) { 1011s + for (na.rm in c(FALSE, TRUE)) { 1011s + cat(sprintf("mode = '%s', OP = '%s', na.rm = %s\n", mode, OP, na.rm)) 1011s + suppressWarnings({ 1011s + z0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 1011s + z <- x_OP_y(x, y, OP, na.rm = na.rm) 1011s + }) 1011s + str(z) 1011s + stopifnot(all.equal(z, z0)) 1011s + } 1011s + } 1011s + } # for (mode ...) 1011s + } # for (y ...) 1011s + } # for (x ...) 1011s List of 2 1011s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 1011s $ y: logi TRUE 1011s mode = 'logical', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] 2 2 2 2 1011s mode = 'logical', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 2 2 2 2 1011s mode = 'logical', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] 0 0 0 0 1011s mode = 'logical', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] 0 0 0 0 1011s mode = 'logical', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s List of 2 1011s $ x: int [1:2, 1:2] 1 1 1 1 1011s $ y: int 1 1011s mode = 'integer', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] 2 2 2 2 1011s mode = 'integer', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 2 2 2 2 1011s mode = 'integer', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] 0 0 0 0 1011s mode = 'integer', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] 0 0 0 0 1011s mode = 'integer', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s List of 2 1011s $ x: num [1:2, 1:2] 1 1 1 1 1011s $ y: num 1 1011s mode = 'double', OP = '+', na.rm = FALSE 1011s num [1:2, 1:2] 2 2 2 2 1011s mode = 'double', OP = '+', na.rm = TRUE 1011s num [1:2, 1:2] 2 2 2 2 1011s mode = 'double', OP = '-', na.rm = FALSE 1011s num [1:2, 1:2] 0 0 0 0 1011s mode = 'double', OP = '-', na.rm = TRUE 1011s num [1:2, 1:2] 0 0 0 0 1011s mode = 'double', OP = '*', na.rm = FALSE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '*', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s List of 2 1011s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 1011s $ y: logi NA 1011s mode = 'logical', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: int [1:2, 1:2] 1 1 1 1 1011s $ y: int NA 1011s mode = 'integer', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: num [1:2, 1:2] 1 1 1 1 1011s $ y: num NA 1011s mode = 'double', OP = '+', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '+', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '-', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '-', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: logi [1:2, 1:2] NA NA NA NA 1011s $ y: logi TRUE 1011s mode = 'logical', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'logical', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: int [1:2, 1:2] NA NA NA NA 1011s $ y: int 1 1011s mode = 'integer', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] 1 1 1 1 1011s mode = 'integer', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: num [1:2, 1:2] NA NA NA NA 1011s $ y: num 1 1011s mode = 'double', OP = '+', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '+', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '-', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '-', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = TRUE 1011s num [1:2, 1:2] 1 1 1 1 1011s mode = 'double', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: logi [1:2, 1:2] NA NA NA NA 1011s $ y: logi NA 1011s mode = 'logical', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'logical', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: int [1:2, 1:2] NA NA NA NA 1011s $ y: int NA 1011s mode = 'integer', OP = '+', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '+', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '-', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '-', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = FALSE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '*', na.rm = TRUE 1011s int [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'integer', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s List of 2 1011s $ x: num [1:2, 1:2] NA NA NA NA 1011s $ y: num NA 1011s mode = 'double', OP = '+', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '+', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '-', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '-', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '*', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '/', na.rm = FALSE 1011s num [1:2, 1:2] NA NA NA NA 1011s mode = 'double', OP = '/', na.rm = TRUE 1011s num [1:2, 1:2] NA NA NA NA 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > library("matrixStats") 1011s > 1011s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 1011s + if (na.rm) { 1011s + xnok <- is.na(x) 1011s + ynok <- is.na(y) 1011s + anok <- xnok & ynok 1011s + unit <- switch(OP, 1011s + "+" = 0, 1011s + "-" = NA_real_, 1011s + "*" = 1, 1011s + "/" = NA_real_, 1011s + stop("Unknown 'OP' operator: ", OP) 1011s + ) 1011s + x[xnok] <- unit 1011s + y[ynok] <- unit 1011s + } 1011s + 1011s + ans <- switch(OP, 1011s + "+" = x + y, 1011s + "-" = x - y, 1011s + "*" = x * y, 1011s + "/" = x / y, 1011s + stop("Unknown 'OP' operator: ", OP) 1011s + ) 1011s + 1011s + if (na.rm) { 1011s + ans[anok] <- NA_real_ 1011s + } 1011s + 1011s + ans 1011s + } # x_OP_y_R() 1011s > 1011s > 1011s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 1011s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 1011s + } 1011s > 1011s > 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > # Subsetted tests 1011s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1011s > source("utils/validateIndicesFramework.R") 1011s > for (OP in c("+", "-", "*", "/")) { 1011s + for (mode in c("numeric", "integer", "logical")) { 1011s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 1011s + y <- runif(6, min = 0, max = 6) 1011s + storage.mode(x) <- mode 1011s + storage.mode(y) <- mode 1011s + if (mode == "numeric") y[1] <- Inf 1011s + 1011s + for (xrows in index_cases) { 1011s + for (xcols in index_cases) { 1011s + if (is.null(xrows)) xrows <- seq_len(nrow(x)) 1011s + if (is.null(xcols)) xcols <- seq_len(ncol(x)) 1011s + 1011s + for (yidxs in list(xrows, xcols)) { 1011s + for (na.rm in c(TRUE, FALSE)) { 1011s + 1011s + suppressWarnings({ 1011s + actual <- tryCatch( 1011s + x_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 1011s + na.rm = na.rm), 1011s + error = function(c) "error" 1011s + ) 1011s + 1011s + expect <- tryCatch( 1011s + x_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 1011s + na.rm = na.rm), 1011s + error = function(c) "error" 1011s + ) 1011s + }) 1011s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 1011s + 1011s + suppressWarnings({ 1011s + actual <- tryCatch( 1011s + t_tx_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 1011s + na.rm = na.rm), 1011s + error = function(c) "error" 1011s + ) 1011s + 1011s + expect <- tryCatch( 1011s + t_tx_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 1011s + na.rm = na.rm), 1011s + error = function(c) "error" 1011s + ) 1011s + }) 1011s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 1011s + } 1011s + } 1011s + } 1011s + } 1011s + } 1011s + } 1011s > 1011s 1011s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1011s Copyright (C) 2024 The R Foundation for Statistical Computing 1011s Platform: powerpc64le-unknown-linux-gnu 1011s 1011s R is free software and comes with ABSOLUTELY NO WARRANTY. 1011s You are welcome to redistribute it under certain conditions. 1011s Type 'license()' or 'licence()' for distribution details. 1011s 1011s R is a collaborative project with many contributors. 1011s Type 'contributors()' for more information and 1011s 'citation()' on how to cite R or R packages in publications. 1011s 1011s Type 'demo()' for some demos, 'help()' for on-line help, or 1011s 'help.start()' for an HTML browser interface to help. 1011s Type 'q()' to quit R. 1011s 1011s > ## These tests need to be last of all tests, otherwise 1011s > ## covr::package_coverage() gives an error. 1011s > cat("1. Loading package\n") 1011s 1. Loading package 1011s > loadNamespace("matrixStats") 1011s 1011s > stopifnot("matrixStats" %in% loadedNamespaces()) 1011s > 1011s > cat("2. Unloading package\n") 1011s 2. Unloading package 1011s > unloadNamespace("matrixStats") 1011s > stopifnot(!"matrixStats" %in% loadedNamespaces()) 1011s > 1011s > if (FALSE) { 1011s + ## 'covr' gives "Error in library("matrixStats") : 1011s + ## there is no package called 'matrixStats'" here, cf. 1011s + ## https://travis-ci.org/HenrikBengtsson/matrixStats/builds/48015577 1011s + 1011s + cat("3. Attaching package\n") 1011s + library("matrixStats") 1011s + stopifnot("package:matrixStats" %in% search()) 1011s + 1011s + cat("4. Detaching package\n") 1011s + detach("package:matrixStats") 1011s + stopifnot(!"package:matrixStats" %in% search()) 1011s + stopifnot("matrixStats" %in% loadedNamespaces()) 1011s + 1011s + cat("5. Unloading package\n") 1011s + unloadNamespace("matrixStats") 1011s + stopifnot(!"matrixStats" %in% loadedNamespaces()) 1011s + 1011s + cat("6. Attaching package (again)\n") 1011s + library("matrixStats") 1011s + stopifnot("package:matrixStats" %in% search()) 1011s + 1011s + cat("7. Detaching package (again)\n") 1011s + detach("package:matrixStats") 1011s + stopifnot(!"package:matrixStats" %in% search()) 1011s + stopifnot("matrixStats" %in% loadedNamespaces()) 1011s + } 1011s > 1011s > cat("7. DONE\n") 1011s 7. DONE 1011s > 1011s *** weightedVar() ... 1011s - Zero elements 1011s - One elements 1011s - Uniform weights (all w = 1) 1011s - Uniform weights (all w = 3) 1011s - Uniform weights on the first five elements 1011s - Uniform weights on every second elements 1011s - All weights are zero 1011s - Infinite weight on first element 1011s - Missing-value weight on first element 1011s - Frequency weights 1011s *** weightedVar() ... DONE 1012s autopkgtest [08:54:29]: test run-unit-test: -----------------------] 1012s autopkgtest [08:54:29]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 1012s run-unit-test PASS 1013s autopkgtest [08:54:30]: test pkg-r-autopkgtest: preparing testbed 1234s autopkgtest [08:58:11]: testbed dpkg architecture: ppc64el 1234s autopkgtest [08:58:11]: testbed apt version: 2.7.14build2 1234s autopkgtest [08:58:11]: @@@@@@@@@@@@@@@@@@@@ test bed setup 1235s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 1236s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 1236s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 1236s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [497 kB] 1236s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [54.1 kB] 1236s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main ppc64el Packages [160 kB] 1236s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el Packages [489 kB] 1236s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse ppc64el Packages [1968 B] 1236s Fetched 1282 kB in 1s (1393 kB/s) 1236s Reading package lists... 1238s Reading package lists... 1238s Building dependency tree... 1238s Reading state information... 1239s Calculating upgrade... 1239s The following package was automatically installed and is no longer required: 1239s libatm1t64 1239s Use 'sudo apt autoremove' to remove it. 1239s The following packages will be upgraded: 1239s apparmor apport apport-core-dump-handler apt apt-utils bash-completion bc 1239s curl dhcpcd-base dpkg dpkg-dev dracut-install eatmydata fwupd gcc-14-base 1239s gir1.2-girepository-2.0 gir1.2-glib-2.0 groff-base initramfs-tools 1239s initramfs-tools-bin initramfs-tools-core iproute2 klibc-utils less libacl1 1239s libapparmor1 libapt-pkg6.0t64 libbpf1 libbsd0 libc-bin libc-dev-bin 1239s libc-devtools libc6 libc6-dev libcap-ng0 libclang-cpp18 libclang1-18 1239s libcurl3t64-gnutls libcurl4t64 libdpkg-perl libdw1t64 libeatmydata1 1239s libelf1t64 libevent-core-2.1-7t64 libexpat1 libfwupd2 libgcc-s1 libgcrypt20 1239s libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-data libgnutls30t64 1239s libgpg-error-l10n libgpg-error0 libklibc libllvm18 liblocale-gettext-perl 1239s liblz4-1 libnss3 libnvme1t64 libpam-modules libpam-modules-bin 1239s libpam-runtime libpam0g libperl5.38t64 libsharpyuv0 libslang2 libsqlite3-0 1239s libstdc++6 libtirpc-common libtirpc3t64 libuv1t64 libwebp7 libxcb1 locales 1239s man-db pastebinit perl perl-base perl-modules-5.38 python-apt-common 1239s python-babel-localedata python3-apport python3-apt python3-babel 1239s python3-blinker python3-httplib2 python3-jinja2 python3-netaddr 1239s python3-problem-report python3-pyparsing python3-six 1239s python3-typing-extensions rsync tzdata ubuntu-pro-client 1239s ubuntu-pro-client-l10n vim-common vim-tiny xxd 1239s 100 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1239s Need to get 110 MB of archives. 1239s After this operation, 3828 kB disk space will be freed. 1239s Get:1 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-devtools ppc64el 2.39-0ubuntu8.1 [29.6 kB] 1239s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6-dev ppc64el 2.39-0ubuntu8.1 [2104 kB] 1239s Get:3 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-dev-bin ppc64el 2.39-0ubuntu8.1 [21.3 kB] 1239s Get:4 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-14-base ppc64el 14.1.0-1ubuntu1 [48.4 kB] 1239s Get:5 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgcc-s1 ppc64el 14.1.0-1ubuntu1 [39.2 kB] 1239s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el libstdc++6 ppc64el 14.1.0-1ubuntu1 [893 kB] 1240s Get:7 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6 ppc64el 2.39-0ubuntu8.1 [3275 kB] 1240s Get:8 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgpg-error-l10n all 1.49-2 [8228 B] 1240s Get:9 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgpg-error0 ppc64el 1.49-2 [89.2 kB] 1240s Get:10 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgcrypt20 ppc64el 1.10.3-3 [742 kB] 1240s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblz4-1 ppc64el 1.9.4-2 [105 kB] 1240s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el libapt-pkg6.0t64 ppc64el 2.9.3 [1091 kB] 1240s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el dpkg ppc64el 1.22.6ubuntu10 [1339 kB] 1240s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el libperl5.38t64 ppc64el 5.38.2-4 [4938 kB] 1240s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl ppc64el 5.38.2-4 [231 kB] 1240s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl-base ppc64el 5.38.2-4 [1906 kB] 1240s Get:17 http://ftpmaster.internal/ubuntu oracular/main ppc64el perl-modules-5.38 all 5.38.2-4 [3110 kB] 1240s Get:18 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-bin ppc64el 2.39-0ubuntu8.1 [751 kB] 1240s Get:19 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt ppc64el 2.9.3 [1429 kB] 1240s Get:20 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt-utils ppc64el 2.9.3 [231 kB] 1240s Get:21 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgnutls30t64 ppc64el 3.8.5-2ubuntu1 [1060 kB] 1240s Get:22 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam0g ppc64el 1.5.3-7ubuntu1 [75.7 kB] 1240s Get:23 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-modules-bin ppc64el 1.5.3-7ubuntu1 [57.8 kB] 1240s Get:24 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-modules ppc64el 1.5.3-7ubuntu1 [325 kB] 1240s Get:25 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblocale-gettext-perl ppc64el 1.07-7 [15.8 kB] 1240s Get:26 http://ftpmaster.internal/ubuntu oracular/main ppc64el libacl1 ppc64el 2.3.2-2 [21.1 kB] 1240s Get:27 http://ftpmaster.internal/ubuntu oracular/main ppc64el rsync ppc64el 3.3.0-1 [485 kB] 1240s Get:28 http://ftpmaster.internal/ubuntu oracular/main ppc64el python-apt-common all 2.9.0 [20.1 kB] 1240s Get:29 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-apt ppc64el 2.9.0 [180 kB] 1240s Get:30 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-pyparsing all 3.1.2-1 [86.4 kB] 1240s Get:31 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-httplib2 all 0.22.0-1 [30.4 kB] 1240s Get:32 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-problem-report all 2.28.1-0ubuntu4 [23.9 kB] 1240s Get:33 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-apport all 2.28.1-0ubuntu4 [92.1 kB] 1240s Get:34 http://ftpmaster.internal/ubuntu oracular/main ppc64el gir1.2-girepository-2.0 ppc64el 1.80.1-3 [24.6 kB] 1240s Get:35 http://ftpmaster.internal/ubuntu oracular/main ppc64el gir1.2-glib-2.0 ppc64el 2.80.2-1ubuntu1 [182 kB] 1240s Get:36 http://ftpmaster.internal/ubuntu oracular/main ppc64el libglib2.0-0t64 ppc64el 2.80.2-1ubuntu1 [1765 kB] 1240s Get:37 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgirepository-1.0-1 ppc64el 1.80.1-3 [94.2 kB] 1240s Get:38 http://ftpmaster.internal/ubuntu oracular/main ppc64el apport-core-dump-handler all 2.28.1-0ubuntu4 [16.9 kB] 1240s Get:39 http://ftpmaster.internal/ubuntu oracular/main ppc64el apport all 2.28.1-0ubuntu4 [83.4 kB] 1240s Get:40 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcap-ng0 ppc64el 0.8.5-1 [16.0 kB] 1240s Get:41 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpam-runtime all 1.5.3-7ubuntu1 [40.8 kB] 1240s Get:42 http://ftpmaster.internal/ubuntu oracular/main ppc64el dhcpcd-base ppc64el 1:10.0.6-5 [273 kB] 1240s Get:43 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdw1t64 ppc64el 0.191-1 [303 kB] 1240s Get:44 http://ftpmaster.internal/ubuntu oracular/main ppc64el libelf1t64 ppc64el 0.191-1 [68.0 kB] 1240s Get:45 http://ftpmaster.internal/ubuntu oracular/main ppc64el libbpf1 ppc64el 1:1.4.1-1 [220 kB] 1240s Get:46 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtirpc-common all 1.3.4+ds-1.3 [8106 B] 1240s Get:47 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtirpc3t64 ppc64el 1.3.4+ds-1.3 [101 kB] 1241s Get:48 http://ftpmaster.internal/ubuntu oracular/main ppc64el iproute2 ppc64el 6.9.0-1 [1399 kB] 1241s Get:49 http://ftpmaster.internal/ubuntu oracular/main ppc64el less ppc64el 590-2ubuntu2.1 [170 kB] 1241s Get:50 http://ftpmaster.internal/ubuntu oracular/main ppc64el libapparmor1 ppc64el 4.0.1-0ubuntu1 [55.1 kB] 1241s Get:51 http://ftpmaster.internal/ubuntu oracular/main ppc64el libbsd0 ppc64el 0.12.2-1 [56.3 kB] 1241s Get:52 http://ftpmaster.internal/ubuntu oracular/main ppc64el libexpat1 ppc64el 2.6.2-1 [98.5 kB] 1241s Get:53 http://ftpmaster.internal/ubuntu oracular/main ppc64el libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 1241s Get:54 http://ftpmaster.internal/ubuntu oracular/main ppc64el libslang2 ppc64el 2.3.3-5 [503 kB] 1241s Get:55 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsqlite3-0 ppc64el 3.45.3-1 [803 kB] 1241s Get:56 http://ftpmaster.internal/ubuntu oracular/main ppc64el locales all 2.39-0ubuntu8.1 [4234 kB] 1241s Get:57 http://ftpmaster.internal/ubuntu oracular/main ppc64el tzdata all 2024a-4ubuntu1 [274 kB] 1241s Get:58 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client-l10n ppc64el 32.1 [19.4 kB] 1241s Get:59 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client ppc64el 32.1 [229 kB] 1241s Get:60 http://ftpmaster.internal/ubuntu oracular/main ppc64el vim-tiny ppc64el 2:9.1.0377-1ubuntu1 [1043 kB] 1241s Get:61 http://ftpmaster.internal/ubuntu oracular/main ppc64el vim-common all 2:9.1.0377-1ubuntu1 [385 kB] 1241s Get:62 http://ftpmaster.internal/ubuntu oracular/main ppc64el xxd ppc64el 2:9.1.0377-1ubuntu1 [64.0 kB] 1241s Get:63 http://ftpmaster.internal/ubuntu oracular/main ppc64el apparmor ppc64el 4.0.1-0ubuntu1 [748 kB] 1241s Get:64 http://ftpmaster.internal/ubuntu oracular/main ppc64el bash-completion all 1:2.14.0-1 [206 kB] 1241s Get:65 http://ftpmaster.internal/ubuntu oracular/main ppc64el groff-base ppc64el 1.23.0-4 [1106 kB] 1241s Get:66 http://ftpmaster.internal/ubuntu oracular/main ppc64el libuv1t64 ppc64el 1.48.0-4 [115 kB] 1241s Get:67 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb1 ppc64el 1.17.0-2 [57.0 kB] 1241s Get:68 http://ftpmaster.internal/ubuntu oracular/main ppc64el man-db ppc64el 2.12.1-1 [1278 kB] 1241s Get:69 http://ftpmaster.internal/ubuntu oracular/main ppc64el bc ppc64el 1.07.1-4 [93.3 kB] 1241s Get:70 http://ftpmaster.internal/ubuntu oracular/main ppc64el curl ppc64el 8.5.0-2ubuntu10.1 [234 kB] 1241s Get:71 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcurl4t64 ppc64el 8.5.0-2ubuntu10.1 [428 kB] 1241s Get:72 http://ftpmaster.internal/ubuntu oracular/main ppc64el dpkg-dev all 1.22.6ubuntu10 [1074 kB] 1241s Get:73 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdpkg-perl all 1.22.6ubuntu10 [269 kB] 1241s Get:74 http://ftpmaster.internal/ubuntu oracular/main ppc64el dracut-install ppc64el 060+5-8ubuntu1 [35.2 kB] 1241s Get:75 http://ftpmaster.internal/ubuntu oracular/main ppc64el libeatmydata1 ppc64el 131-2 [7522 B] 1241s Get:76 http://ftpmaster.internal/ubuntu oracular/main ppc64el eatmydata all 131-2 [5576 B] 1241s Get:77 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcurl3t64-gnutls ppc64el 8.5.0-2ubuntu10.1 [420 kB] 1241s Get:78 http://ftpmaster.internal/ubuntu oracular/main ppc64el libfwupd2 ppc64el 1.9.20-1 [137 kB] 1241s Get:79 http://ftpmaster.internal/ubuntu oracular/main ppc64el fwupd ppc64el 1.9.20-1 [4641 kB] 1241s Get:80 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools all 0.142ubuntu27 [7898 B] 1241s Get:81 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools-core all 0.142ubuntu27 [49.5 kB] 1241s Get:82 http://ftpmaster.internal/ubuntu oracular/main ppc64el initramfs-tools-bin ppc64el 0.142ubuntu27 [21.6 kB] 1241s Get:83 http://ftpmaster.internal/ubuntu oracular/main ppc64el klibc-utils ppc64el 2.0.13-4ubuntu1 [120 kB] 1241s Get:84 http://ftpmaster.internal/ubuntu oracular/main ppc64el libklibc ppc64el 2.0.13-4ubuntu1 [54.2 kB] 1241s Get:85 http://ftpmaster.internal/ubuntu oracular/main ppc64el libclang-cpp18 ppc64el 1:18.1.6-1 [14.4 MB] 1241s Get:86 http://ftpmaster.internal/ubuntu oracular/main ppc64el libllvm18 ppc64el 1:18.1.6-1 [28.7 MB] 1242s Get:87 http://ftpmaster.internal/ubuntu oracular/main ppc64el libclang1-18 ppc64el 1:18.1.6-1 [8673 kB] 1242s Get:88 http://ftpmaster.internal/ubuntu oracular/main ppc64el libevent-core-2.1-7t64 ppc64el 2.1.12-stable-10 [108 kB] 1242s Get:89 http://ftpmaster.internal/ubuntu oracular/main ppc64el libnss3 ppc64el 2:3.100-1 [1848 kB] 1242s Get:90 http://ftpmaster.internal/ubuntu oracular/main ppc64el libnvme1t64 ppc64el 1.9-1 [100 kB] 1242s Get:91 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsharpyuv0 ppc64el 1.4.0-0.1 [22.0 kB] 1242s Get:92 http://ftpmaster.internal/ubuntu oracular/main ppc64el libwebp7 ppc64el 1.4.0-0.1 [309 kB] 1242s Get:93 http://ftpmaster.internal/ubuntu oracular/main ppc64el pastebinit all 1.7.0-1 [14.9 kB] 1242s Get:94 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-babel all 2.14.0-1 [96.4 kB] 1242s Get:95 http://ftpmaster.internal/ubuntu oracular/main ppc64el python-babel-localedata all 2.14.0-1 [6385 kB] 1243s Get:96 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-blinker all 1.8.2-1 [11.4 kB] 1243s Get:97 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-jinja2 all 3.1.3-1 [107 kB] 1243s Get:98 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-netaddr all 0.10.1-1 [322 kB] 1243s Get:99 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-six all 1.16.0-6 [13.0 kB] 1243s Get:100 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-typing-extensions all 4.11.0-1 [61.5 kB] 1243s Preconfiguring packages ... 1243s Fetched 110 MB in 4s (29.0 MB/s) 1243s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1243s Preparing to unpack .../libc-devtools_2.39-0ubuntu8.1_ppc64el.deb ... 1243s Unpacking libc-devtools (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1243s Preparing to unpack .../libc6-dev_2.39-0ubuntu8.1_ppc64el.deb ... 1243s Unpacking libc6-dev:ppc64el (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1243s Preparing to unpack .../libc-dev-bin_2.39-0ubuntu8.1_ppc64el.deb ... 1243s Unpacking libc-dev-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1243s Preparing to unpack .../gcc-14-base_14.1.0-1ubuntu1_ppc64el.deb ... 1243s Unpacking gcc-14-base:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 1243s Setting up gcc-14-base:ppc64el (14.1.0-1ubuntu1) ... 1244s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1244s Preparing to unpack .../libgcc-s1_14.1.0-1ubuntu1_ppc64el.deb ... 1244s Unpacking libgcc-s1:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 1244s Setting up libgcc-s1:ppc64el (14.1.0-1ubuntu1) ... 1244s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1244s Preparing to unpack .../libstdc++6_14.1.0-1ubuntu1_ppc64el.deb ... 1244s Unpacking libstdc++6:ppc64el (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 1244s Setting up libstdc++6:ppc64el (14.1.0-1ubuntu1) ... 1244s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1244s Preparing to unpack .../libc6_2.39-0ubuntu8.1_ppc64el.deb ... 1244s Unpacking libc6:ppc64el (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1244s Setting up libc6:ppc64el (2.39-0ubuntu8.1) ... 1245s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1245s Preparing to unpack .../libgpg-error-l10n_1.49-2_all.deb ... 1245s Unpacking libgpg-error-l10n (1.49-2) over (1.47-3build2) ... 1245s Preparing to unpack .../libgpg-error0_1.49-2_ppc64el.deb ... 1245s Unpacking libgpg-error0:ppc64el (1.49-2) over (1.47-3build2) ... 1245s Setting up libgpg-error0:ppc64el (1.49-2) ... 1245s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1245s Preparing to unpack .../libgcrypt20_1.10.3-3_ppc64el.deb ... 1245s Unpacking libgcrypt20:ppc64el (1.10.3-3) over (1.10.3-2build1) ... 1245s Setting up libgcrypt20:ppc64el (1.10.3-3) ... 1245s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1245s Preparing to unpack .../liblz4-1_1.9.4-2_ppc64el.deb ... 1245s Unpacking liblz4-1:ppc64el (1.9.4-2) over (1.9.4-1build1) ... 1245s Setting up liblz4-1:ppc64el (1.9.4-2) ... 1245s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1245s Preparing to unpack .../libapt-pkg6.0t64_2.9.3_ppc64el.deb ... 1245s Unpacking libapt-pkg6.0t64:ppc64el (2.9.3) over (2.7.14build2) ... 1245s Setting up libapt-pkg6.0t64:ppc64el (2.9.3) ... 1245s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1245s Preparing to unpack .../dpkg_1.22.6ubuntu10_ppc64el.deb ... 1245s Unpacking dpkg (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 1245s Setting up dpkg (1.22.6ubuntu10) ... 1246s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1246s Preparing to unpack .../libperl5.38t64_5.38.2-4_ppc64el.deb ... 1246s Unpacking libperl5.38t64:ppc64el (5.38.2-4) over (5.38.2-3.2build2) ... 1246s Preparing to unpack .../perl_5.38.2-4_ppc64el.deb ... 1246s Unpacking perl (5.38.2-4) over (5.38.2-3.2build2) ... 1246s Preparing to unpack .../perl-base_5.38.2-4_ppc64el.deb ... 1246s Unpacking perl-base (5.38.2-4) over (5.38.2-3.2build2) ... 1246s Setting up perl-base (5.38.2-4) ... 1246s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1246s Preparing to unpack .../perl-modules-5.38_5.38.2-4_all.deb ... 1246s Unpacking perl-modules-5.38 (5.38.2-4) over (5.38.2-3.2build2) ... 1247s Preparing to unpack .../libc-bin_2.39-0ubuntu8.1_ppc64el.deb ... 1247s Unpacking libc-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1247s Setting up libc-bin (2.39-0ubuntu8.1) ... 1247s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1247s Preparing to unpack .../archives/apt_2.9.3_ppc64el.deb ... 1247s Unpacking apt (2.9.3) over (2.7.14build2) ... 1247s Setting up apt (2.9.3) ... 1247s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72144 files and directories currently installed.) 1247s Preparing to unpack .../apt-utils_2.9.3_ppc64el.deb ... 1247s Unpacking apt-utils (2.9.3) over (2.7.14build2) ... 1247s Preparing to unpack .../libgnutls30t64_3.8.5-2ubuntu1_ppc64el.deb ... 1247s Unpacking libgnutls30t64:ppc64el (3.8.5-2ubuntu1) over (3.8.3-1.1ubuntu3) ... 1248s Setting up libgnutls30t64:ppc64el (3.8.5-2ubuntu1) ... 1248s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 1248s Preparing to unpack .../libpam0g_1.5.3-7ubuntu1_ppc64el.deb ... 1248s Unpacking libpam0g:ppc64el (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 1248s Setting up libpam0g:ppc64el (1.5.3-7ubuntu1) ... 1248s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 1248s Preparing to unpack .../libpam-modules-bin_1.5.3-7ubuntu1_ppc64el.deb ... 1248s Unpacking libpam-modules-bin (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 1248s Setting up libpam-modules-bin (1.5.3-7ubuntu1) ... 1248s pam_namespace.service is a disabled or a static unit not running, not starting it. 1248s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72145 files and directories currently installed.) 1248s Preparing to unpack .../libpam-modules_1.5.3-7ubuntu1_ppc64el.deb ... 1248s Unpacking libpam-modules:ppc64el (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 1248s Setting up libpam-modules:ppc64el (1.5.3-7ubuntu1) ... 1248s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72148 files and directories currently installed.) 1248s Preparing to unpack .../liblocale-gettext-perl_1.07-7_ppc64el.deb ... 1248s Unpacking liblocale-gettext-perl (1.07-7) over (1.07-6ubuntu5) ... 1248s Preparing to unpack .../libacl1_2.3.2-2_ppc64el.deb ... 1248s Unpacking libacl1:ppc64el (2.3.2-2) over (2.3.2-1build1) ... 1248s Setting up libacl1:ppc64el (2.3.2-2) ... 1248s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72148 files and directories currently installed.) 1248s Preparing to unpack .../00-rsync_3.3.0-1_ppc64el.deb ... 1248s Unpacking rsync (3.3.0-1) over (3.2.7-1ubuntu1) ... 1248s Preparing to unpack .../01-python-apt-common_2.9.0_all.deb ... 1248s Unpacking python-apt-common (2.9.0) over (2.7.7ubuntu1) ... 1248s Preparing to unpack .../02-python3-apt_2.9.0_ppc64el.deb ... 1249s Unpacking python3-apt (2.9.0) over (2.7.7ubuntu1) ... 1249s Preparing to unpack .../03-python3-pyparsing_3.1.2-1_all.deb ... 1249s Unpacking python3-pyparsing (3.1.2-1) over (3.1.1-1) ... 1249s Preparing to unpack .../04-python3-httplib2_0.22.0-1_all.deb ... 1249s Unpacking python3-httplib2 (0.22.0-1) over (0.20.4-3) ... 1249s Preparing to unpack .../05-python3-problem-report_2.28.1-0ubuntu4_all.deb ... 1249s Unpacking python3-problem-report (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 1249s Preparing to unpack .../06-python3-apport_2.28.1-0ubuntu4_all.deb ... 1249s Unpacking python3-apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 1249s Preparing to unpack .../07-gir1.2-girepository-2.0_1.80.1-3_ppc64el.deb ... 1249s Unpacking gir1.2-girepository-2.0:ppc64el (1.80.1-3) over (1.80.1-1) ... 1249s Preparing to unpack .../08-gir1.2-glib-2.0_2.80.2-1ubuntu1_ppc64el.deb ... 1249s Unpacking gir1.2-glib-2.0:ppc64el (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 1249s Preparing to unpack .../09-libglib2.0-0t64_2.80.2-1ubuntu1_ppc64el.deb ... 1249s Unpacking libglib2.0-0t64:ppc64el (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 1249s Preparing to unpack .../10-libgirepository-1.0-1_1.80.1-3_ppc64el.deb ... 1249s Unpacking libgirepository-1.0-1:ppc64el (1.80.1-3) over (1.80.1-1) ... 1249s Preparing to unpack .../11-apport-core-dump-handler_2.28.1-0ubuntu4_all.deb ... 1249s Unpacking apport-core-dump-handler (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 1249s Preparing to unpack .../12-apport_2.28.1-0ubuntu4_all.deb ... 1249s Unpacking apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 1249s Preparing to unpack .../13-libcap-ng0_0.8.5-1_ppc64el.deb ... 1249s Unpacking libcap-ng0:ppc64el (0.8.5-1) over (0.8.4-2build2) ... 1249s Setting up libcap-ng0:ppc64el (0.8.5-1) ... 1249s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72150 files and directories currently installed.) 1249s Preparing to unpack .../libpam-runtime_1.5.3-7ubuntu1_all.deb ... 1249s Unpacking libpam-runtime (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 1249s Setting up libpam-runtime (1.5.3-7ubuntu1) ... 1249s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72150 files and directories currently installed.) 1249s Preparing to unpack .../00-dhcpcd-base_1%3a10.0.6-5_ppc64el.deb ... 1249s Unpacking dhcpcd-base (1:10.0.6-5) over (1:10.0.6-1ubuntu3) ... 1249s Preparing to unpack .../01-libdw1t64_0.191-1_ppc64el.deb ... 1249s Unpacking libdw1t64:ppc64el (0.191-1) over (0.190-1.1build4) ... 1249s Preparing to unpack .../02-libelf1t64_0.191-1_ppc64el.deb ... 1249s Unpacking libelf1t64:ppc64el (0.191-1) over (0.190-1.1build4) ... 1249s Preparing to unpack .../03-libbpf1_1%3a1.4.1-1_ppc64el.deb ... 1249s Unpacking libbpf1:ppc64el (1:1.4.1-1) over (1:1.3.0-2build2) ... 1249s Preparing to unpack .../04-libtirpc-common_1.3.4+ds-1.3_all.deb ... 1249s Unpacking libtirpc-common (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 1249s Preparing to unpack .../05-libtirpc3t64_1.3.4+ds-1.3_ppc64el.deb ... 1249s Unpacking libtirpc3t64:ppc64el (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 1249s Preparing to unpack .../06-iproute2_6.9.0-1_ppc64el.deb ... 1250s Unpacking iproute2 (6.9.0-1) over (6.1.0-1ubuntu6) ... 1250s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_tables.d': Directory not empty 1250s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_protos.d': Directory not empty 1250s dpkg: warning: unable to delete old directory '/etc/iproute2': Directory not empty 1250s Preparing to unpack .../07-less_590-2ubuntu2.1_ppc64el.deb ... 1250s Unpacking less (590-2ubuntu2.1) over (590-2ubuntu2) ... 1250s Preparing to unpack .../08-libapparmor1_4.0.1-0ubuntu1_ppc64el.deb ... 1250s Unpacking libapparmor1:ppc64el (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 1250s Preparing to unpack .../09-libbsd0_0.12.2-1_ppc64el.deb ... 1250s Unpacking libbsd0:ppc64el (0.12.2-1) over (0.12.1-1build1) ... 1250s Preparing to unpack .../10-libexpat1_2.6.2-1_ppc64el.deb ... 1250s Unpacking libexpat1:ppc64el (2.6.2-1) over (2.6.1-2build1) ... 1250s Preparing to unpack .../11-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 1250s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 1250s Preparing to unpack .../12-libslang2_2.3.3-5_ppc64el.deb ... 1250s Unpacking libslang2:ppc64el (2.3.3-5) over (2.3.3-3build2) ... 1250s Preparing to unpack .../13-libsqlite3-0_3.45.3-1_ppc64el.deb ... 1250s Unpacking libsqlite3-0:ppc64el (3.45.3-1) over (3.45.1-1ubuntu2) ... 1250s Preparing to unpack .../14-locales_2.39-0ubuntu8.1_all.deb ... 1250s Unpacking locales (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 1250s Preparing to unpack .../15-tzdata_2024a-4ubuntu1_all.deb ... 1250s Unpacking tzdata (2024a-4ubuntu1) over (2024a-2ubuntu1) ... 1250s Preparing to unpack .../16-ubuntu-pro-client-l10n_32.1_ppc64el.deb ... 1250s Unpacking ubuntu-pro-client-l10n (32.1) over (31.2.3) ... 1250s Preparing to unpack .../17-ubuntu-pro-client_32.1_ppc64el.deb ... 1250s Unpacking ubuntu-pro-client (32.1) over (31.2.3) ... 1250s Preparing to unpack .../18-vim-tiny_2%3a9.1.0377-1ubuntu1_ppc64el.deb ... 1250s Unpacking vim-tiny (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 1250s Preparing to unpack .../19-vim-common_2%3a9.1.0377-1ubuntu1_all.deb ... 1250s Unpacking vim-common (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 1251s Preparing to unpack .../20-xxd_2%3a9.1.0377-1ubuntu1_ppc64el.deb ... 1251s Unpacking xxd (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 1251s Preparing to unpack .../21-apparmor_4.0.1-0ubuntu1_ppc64el.deb ... 1251s Unpacking apparmor (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 1251s Preparing to unpack .../22-bash-completion_1%3a2.14.0-1_all.deb ... 1251s Unpacking bash-completion (1:2.14.0-1) over (1:2.11-8) ... 1251s Preparing to unpack .../23-groff-base_1.23.0-4_ppc64el.deb ... 1251s Unpacking groff-base (1.23.0-4) over (1.23.0-3build2) ... 1251s Preparing to unpack .../24-libuv1t64_1.48.0-4_ppc64el.deb ... 1251s Unpacking libuv1t64:ppc64el (1.48.0-4) over (1.48.0-1.1build1) ... 1251s Preparing to unpack .../25-libxcb1_1.17.0-2_ppc64el.deb ... 1251s Unpacking libxcb1:ppc64el (1.17.0-2) over (1.15-1ubuntu2) ... 1251s Preparing to unpack .../26-man-db_2.12.1-1_ppc64el.deb ... 1251s Unpacking man-db (2.12.1-1) over (2.12.0-4build2) ... 1252s Preparing to unpack .../27-bc_1.07.1-4_ppc64el.deb ... 1252s Unpacking bc (1.07.1-4) over (1.07.1-3ubuntu4) ... 1252s Preparing to unpack .../28-curl_8.5.0-2ubuntu10.1_ppc64el.deb ... 1252s Unpacking curl (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 1252s Preparing to unpack .../29-libcurl4t64_8.5.0-2ubuntu10.1_ppc64el.deb ... 1252s Unpacking libcurl4t64:ppc64el (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 1252s Preparing to unpack .../30-dpkg-dev_1.22.6ubuntu10_all.deb ... 1252s Unpacking dpkg-dev (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 1252s Preparing to unpack .../31-libdpkg-perl_1.22.6ubuntu10_all.deb ... 1252s Unpacking libdpkg-perl (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 1252s Preparing to unpack .../32-dracut-install_060+5-8ubuntu1_ppc64el.deb ... 1252s Unpacking dracut-install (060+5-8ubuntu1) over (060+5-1ubuntu3) ... 1252s Preparing to unpack .../33-libeatmydata1_131-2_ppc64el.deb ... 1252s Unpacking libeatmydata1:ppc64el (131-2) over (131-1ubuntu1) ... 1252s Preparing to unpack .../34-eatmydata_131-2_all.deb ... 1252s Unpacking eatmydata (131-2) over (131-1ubuntu1) ... 1252s Preparing to unpack .../35-libcurl3t64-gnutls_8.5.0-2ubuntu10.1_ppc64el.deb ... 1252s Unpacking libcurl3t64-gnutls:ppc64el (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 1252s Preparing to unpack .../36-libfwupd2_1.9.20-1_ppc64el.deb ... 1252s Unpacking libfwupd2:ppc64el (1.9.20-1) over (1.9.16-1) ... 1252s Preparing to unpack .../37-fwupd_1.9.20-1_ppc64el.deb ... 1252s Unpacking fwupd (1.9.20-1) over (1.9.16-1) ... 1252s Preparing to unpack .../38-initramfs-tools_0.142ubuntu27_all.deb ... 1252s Unpacking initramfs-tools (0.142ubuntu27) over (0.142ubuntu25) ... 1252s Preparing to unpack .../39-initramfs-tools-core_0.142ubuntu27_all.deb ... 1252s Unpacking initramfs-tools-core (0.142ubuntu27) over (0.142ubuntu25) ... 1252s Preparing to unpack .../40-initramfs-tools-bin_0.142ubuntu27_ppc64el.deb ... 1252s Unpacking initramfs-tools-bin (0.142ubuntu27) over (0.142ubuntu25) ... 1252s Preparing to unpack .../41-klibc-utils_2.0.13-4ubuntu1_ppc64el.deb ... 1252s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 1252s Preparing to unpack .../42-libklibc_2.0.13-4ubuntu1_ppc64el.deb ... 1252s Unpacking libklibc:ppc64el (2.0.13-4ubuntu1) over (2.0.13-4) ... 1252s Preparing to unpack .../43-libclang-cpp18_1%3a18.1.6-1_ppc64el.deb ... 1252s Unpacking libclang-cpp18 (1:18.1.6-1) over (1:18.1.3-1) ... 1253s Preparing to unpack .../44-libllvm18_1%3a18.1.6-1_ppc64el.deb ... 1253s Unpacking libllvm18:ppc64el (1:18.1.6-1) over (1:18.1.3-1) ... 1253s Preparing to unpack .../45-libclang1-18_1%3a18.1.6-1_ppc64el.deb ... 1253s Unpacking libclang1-18 (1:18.1.6-1) over (1:18.1.3-1) ... 1254s Preparing to unpack .../46-libevent-core-2.1-7t64_2.1.12-stable-10_ppc64el.deb ... 1254s Unpacking libevent-core-2.1-7t64:ppc64el (2.1.12-stable-10) over (2.1.12-stable-9ubuntu2) ... 1254s Preparing to unpack .../47-libnss3_2%3a3.100-1_ppc64el.deb ... 1254s Unpacking libnss3:ppc64el (2:3.100-1) over (2:3.98-1build1) ... 1254s Preparing to unpack .../48-libnvme1t64_1.9-1_ppc64el.deb ... 1254s Unpacking libnvme1t64 (1.9-1) over (1.8-3build1) ... 1254s Preparing to unpack .../49-libsharpyuv0_1.4.0-0.1_ppc64el.deb ... 1254s Unpacking libsharpyuv0:ppc64el (1.4.0-0.1) over (1.3.2-0.4build3) ... 1254s Preparing to unpack .../50-libwebp7_1.4.0-0.1_ppc64el.deb ... 1254s Unpacking libwebp7:ppc64el (1.4.0-0.1) over (1.3.2-0.4build3) ... 1254s Preparing to unpack .../51-pastebinit_1.7.0-1_all.deb ... 1254s Unpacking pastebinit (1.7.0-1) over (1.6.2-1) ... 1254s Preparing to unpack .../52-python3-babel_2.14.0-1_all.deb ... 1254s Unpacking python3-babel (2.14.0-1) over (2.10.3-3build1) ... 1254s Preparing to unpack .../53-python-babel-localedata_2.14.0-1_all.deb ... 1254s Unpacking python-babel-localedata (2.14.0-1) over (2.10.3-3build1) ... 1254s Preparing to unpack .../54-python3-blinker_1.8.2-1_all.deb ... 1254s Unpacking python3-blinker (1.8.2-1) over (1.8.1-1) ... 1254s Preparing to unpack .../55-python3-jinja2_3.1.3-1_all.deb ... 1254s Unpacking python3-jinja2 (3.1.3-1) over (3.1.2-1ubuntu1) ... 1255s Preparing to unpack .../56-python3-netaddr_0.10.1-1_all.deb ... 1255s Unpacking python3-netaddr (0.10.1-1) over (0.8.0-2ubuntu1) ... 1255s Preparing to unpack .../57-python3-six_1.16.0-6_all.deb ... 1255s Unpacking python3-six (1.16.0-6) over (1.16.0-4) ... 1255s Preparing to unpack .../58-python3-typing-extensions_4.11.0-1_all.deb ... 1255s Unpacking python3-typing-extensions (4.11.0-1) over (4.10.0-1) ... 1255s Setting up libexpat1:ppc64el (2.6.2-1) ... 1255s Setting up libsharpyuv0:ppc64el (1.4.0-0.1) ... 1255s Setting up libapparmor1:ppc64el (4.0.1-0ubuntu1) ... 1255s Setting up libxcb1:ppc64el (1.17.0-2) ... 1255s Setting up apt-utils (2.9.3) ... 1255s Setting up libcurl4t64:ppc64el (8.5.0-2ubuntu10.1) ... 1255s Setting up python3-problem-report (2.28.1-0ubuntu4) ... 1255s Setting up libtirpc-common (1.3.4+ds-1.3) ... 1255s Setting up libsqlite3-0:ppc64el (3.45.3-1) ... 1255s Setting up libuv1t64:ppc64el (1.48.0-4) ... 1255s Setting up libcurl3t64-gnutls:ppc64el (8.5.0-2ubuntu10.1) ... 1255s Setting up less (590-2ubuntu2.1) ... 1255s Setting up bc (1.07.1-4) ... 1255s Setting up pastebinit (1.7.0-1) ... 1255s Setting up libnss3:ppc64el (2:3.100-1) ... 1255s Setting up locales (2.39-0ubuntu8.1) ... 1255s Generating locales (this might take a while)... 1257s en_US.UTF-8... done 1257s Generation complete. 1257s Setting up xxd (2:9.1.0377-1ubuntu1) ... 1257s Setting up libelf1t64:ppc64el (0.191-1) ... 1257s Setting up python-babel-localedata (2.14.0-1) ... 1257s Setting up libdw1t64:ppc64el (0.191-1) ... 1257s Setting up tzdata (2024a-4ubuntu1) ... 1257s 1257s Current default time zone: 'Etc/UTC' 1257s Local time is now: Fri May 24 08:58:34 UTC 2024. 1257s Universal Time is now: Fri May 24 08:58:34 UTC 2024. 1257s Run 'dpkg-reconfigure tzdata' if you wish to change it. 1257s 1257s Setting up python3-six (1.16.0-6) ... 1257s Setting up apparmor (4.0.1-0ubuntu1) ... 1257s Installing new version of config file /etc/apparmor.d/abstractions/authentication ... 1257s Installing new version of config file /etc/apparmor.d/abstractions/samba ... 1257s Installing new version of config file /etc/apparmor.d/firefox ... 1258s Reloading AppArmor profiles 1259s Setting up libklibc:ppc64el (2.0.13-4ubuntu1) ... 1259s Setting up python3-jinja2 (3.1.3-1) ... 1259s Setting up libglib2.0-0t64:ppc64el (2.80.2-1ubuntu1) ... 1259s No schema files found: doing nothing. 1259s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 1259s Setting up vim-common (2:9.1.0377-1ubuntu1) ... 1259s Setting up libslang2:ppc64el (2.3.3-5) ... 1259s Setting up python3-pyparsing (3.1.2-1) ... 1259s Setting up libnvme1t64 (1.9-1) ... 1259s Setting up bash-completion (1:2.14.0-1) ... 1259s Installing new version of config file /etc/profile.d/bash_completion.sh ... 1259s Setting up perl-modules-5.38 (5.38.2-4) ... 1259s Setting up dhcpcd-base (1:10.0.6-5) ... 1259s Setting up python3-typing-extensions (4.11.0-1) ... 1259s Setting up gir1.2-glib-2.0:ppc64el (2.80.2-1ubuntu1) ... 1259s Setting up libwebp7:ppc64el (1.4.0-0.1) ... 1259s Setting up python3-netaddr (0.10.1-1) ... 1259s Setting up python-apt-common (2.9.0) ... 1259s Setting up dracut-install (060+5-8ubuntu1) ... 1259s Setting up groff-base (1.23.0-4) ... 1260s Setting up libeatmydata1:ppc64el (131-2) ... 1260s Setting up python3-httplib2 (0.22.0-1) ... 1260s Setting up libgirepository-1.0-1:ppc64el (1.80.1-3) ... 1260s Setting up libevent-core-2.1-7t64:ppc64el (2.1.12-stable-10) ... 1260s Setting up curl (8.5.0-2ubuntu10.1) ... 1260s Setting up libperl5.38t64:ppc64el (5.38.2-4) ... 1260s Setting up libc-dev-bin (2.39-0ubuntu8.1) ... 1260s Setting up klibc-utils (2.0.13-4ubuntu1) ... 1260s Setting up libbsd0:ppc64el (0.12.2-1) ... 1260s Setting up libgpg-error-l10n (1.49-2) ... 1260s Setting up liblocale-gettext-perl (1.07-7) ... 1260s Setting up libbpf1:ppc64el (1:1.4.1-1) ... 1260s Setting up rsync (3.3.0-1) ... 1261s rsync.service is a disabled or a static unit not running, not starting it. 1261s Setting up libc-devtools (2.39-0ubuntu8.1) ... 1261s Setting up libllvm18:ppc64el (1:18.1.6-1) ... 1261s Setting up initramfs-tools-bin (0.142ubuntu27) ... 1261s Setting up python3-blinker (1.8.2-1) ... 1261s Setting up libclang1-18 (1:18.1.6-1) ... 1261s Setting up eatmydata (131-2) ... 1261s Setting up libtirpc3t64:ppc64el (1.3.4+ds-1.3) ... 1261s Setting up python3-babel (2.14.0-1) ... 1261s Setting up python3-apt (2.9.0) ... 1261s Setting up iproute2 (6.9.0-1) ... 1261s Removing obsolete conffile /etc/iproute2/group ... 1261s Removing obsolete conffile /etc/iproute2/rt_realms ... 1261s Removing obsolete conffile /etc/iproute2/rt_scopes ... 1261s Removing obsolete conffile /etc/iproute2/rt_tables ... 1261s Removing obsolete conffile /etc/iproute2/rt_tables.d/README ... 1261s Removing obsolete conffile /etc/iproute2/rt_protos.d/README ... 1261s Removing obsolete conffile /etc/iproute2/rt_protos ... 1261s Removing obsolete conffile /etc/iproute2/rt_dsfield ... 1261s Removing obsolete conffile /etc/iproute2/nl_protos ... 1261s Removing obsolete conffile /etc/iproute2/ematch_map ... 1261s Removing obsolete conffile /etc/iproute2/bpf_pinning ... 1261s Setting up libfwupd2:ppc64el (1.9.20-1) ... 1261s Setting up vim-tiny (2:9.1.0377-1ubuntu1) ... 1261s Setting up man-db (2.12.1-1) ... 1262s Updating database of manual pages ... 1264s man-db.service is a disabled or a static unit not running, not starting it. 1264s Setting up python3-apport (2.28.1-0ubuntu4) ... 1264s Setting up perl (5.38.2-4) ... 1264s Setting up gir1.2-girepository-2.0:ppc64el (1.80.1-3) ... 1264s Setting up libdpkg-perl (1.22.6ubuntu10) ... 1264s Setting up libc6-dev:ppc64el (2.39-0ubuntu8.1) ... 1264s Setting up initramfs-tools-core (0.142ubuntu27) ... 1264s Setting up libclang-cpp18 (1:18.1.6-1) ... 1264s Setting up ubuntu-pro-client (32.1) ... 1264s Installing new version of config file /etc/apparmor.d/ubuntu_pro_apt_news ... 1266s Setting up fwupd (1.9.20-1) ... 1266s fwupd-offline-update.service is a disabled or a static unit not running, not starting it. 1266s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 1267s Setting up ubuntu-pro-client-l10n (32.1) ... 1267s Setting up initramfs-tools (0.142ubuntu27) ... 1267s update-initramfs: deferring update (trigger activated) 1267s Setting up dpkg-dev (1.22.6ubuntu10) ... 1267s Setting up apport-core-dump-handler (2.28.1-0ubuntu4) ... 1268s Setting up apport (2.28.1-0ubuntu4) ... 1268s Installing new version of config file /etc/apport/crashdb.conf ... 1268s apport-autoreport.service is a disabled or a static unit not running, not starting it. 1268s Processing triggers for dbus (1.14.10-4ubuntu4) ... 1268s Processing triggers for install-info (7.1-3build2) ... 1269s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 1269s Processing triggers for initramfs-tools (0.142ubuntu27) ... 1269s update-initramfs: Generating /boot/initrd.img-6.8.0-31-generic 1269s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 1276s Reading package lists... 1276s Building dependency tree... 1276s Reading state information... 1276s The following packages will be REMOVED: 1276s libatm1t64* 1276s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1276s After this operation, 136 kB disk space will be freed. 1276s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72612 files and directories currently installed.) 1276s Removing libatm1t64:ppc64el (1:2.5.1-5.1build1) ... 1276s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 1277s Hit:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 1277s Hit:2 http://ftpmaster.internal/ubuntu oracular InRelease 1277s Hit:3 http://ftpmaster.internal/ubuntu oracular-updates InRelease 1277s Hit:4 http://ftpmaster.internal/ubuntu oracular-security InRelease 1278s Reading package lists... 1278s Reading package lists... 1278s Building dependency tree... 1278s Reading state information... 1278s Calculating upgrade... 1278s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1278s Reading package lists... 1279s Building dependency tree... 1279s Reading state information... 1279s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1279s autopkgtest [08:58:56]: rebooting testbed after setup commands that affected boot 1283s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1316s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1422s Reading package lists... 1422s Building dependency tree... 1422s Reading state information... 1422s Starting pkgProblemResolver with broken count: 0 1422s Starting 2 pkgProblemResolver with broken count: 0 1422s Done 1423s The following additional packages will be installed: 1423s build-essential cpp cpp-13 cpp-13-powerpc64le-linux-gnu 1423s cpp-powerpc64le-linux-gnu dctrl-tools fontconfig fonts-glyphicons-halflings 1423s fonts-mathjax g++ g++-13 g++-13-powerpc64le-linux-gnu 1423s g++-powerpc64le-linux-gnu gcc gcc-13 gcc-13-base 1423s gcc-13-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu gfortran gfortran-13 1423s gfortran-13-powerpc64le-linux-gnu gfortran-powerpc64le-linux-gnu 1423s icu-devtools libasan8 libatomic1 libblas-dev libblas3 libbz2-dev libcairo2 1423s libcc1-0 libdatrie1 libdeflate-dev libgcc-13-dev libgfortran-13-dev 1423s libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libicu-dev 1423s libisl23 libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-bootstrap 1423s libjs-highlight.js libjs-jquery libjs-jquery-datatables libjs-mathjax 1423s liblapack-dev liblapack3 liblsan0 liblzma-dev libmpc3 libncurses-dev 1423s libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils 1423s libpaper1 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 1423s libpixman-1-0 libpkgconf3 libpng-dev libquadmath0 libreadline-dev libsm6 1423s libstdc++-13-dev libtcl8.6 libthai-data libthai0 libtirpc-dev libtk8.6 1423s libtsan2 libubsan1 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 1423s libxt6t64 node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin 1423s r-base-core r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace 1423s r-cran-commonmark r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 1423s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 1423s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 1423s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 1423s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r6 1423s r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble r-cran-utf8 1423s r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun r-cran-yaml unzip 1423s x11-common xdg-utils zip zlib1g-dev 1423s Suggested packages: 1423s cpp-doc gcc-13-locales cpp-13-doc debtags gcc-13-doc gcc-multilib 1423s manpages-dev autoconf automake libtool flex bison gdb gcc-doc 1423s gdb-powerpc64le-linux-gnu gfortran-doc gfortran-13-doc libcoarrays-dev 1423s liblapack-doc icu-doc fonts-mathjax-extras fonts-stix libjs-mathjax-doc 1423s liblzma-doc ncurses-doc readline-doc libstdc++-13-doc tcl8.6 tk8.6 1423s libjs-html5shiv elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html 1423s texlive-base texlive-latex-base texlive-plain-generic 1423s texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils 1423s texlive-latex-recommended texlive-latex-extra texinfo r-cran-kernsmooth 1423s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 1423s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 1423s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 1423s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 1423s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-bench 1423s r-cran-blob r-cran-brio r-cran-callr r-cran-crayon r-cran-here r-cran-hms 1423s r-cran-htmltools r-cran-pkgbuild r-cran-pkgload r-cran-purrr r-cran-tidyr 1423s Recommended packages: 1423s bzip2-doc javascript-common libpng-tools r-recommended r-doc-html 1423s r-cran-callr r-cran-covr r-cran-crayon r-cran-digest r-cran-htmltools 1423s r-cran-htmlwidgets r-cran-mockery r-cran-processx r-cran-ps r-cran-rmarkdown 1423s r-cran-rprojroot r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl 1423s r-cran-xml2 r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc 1423s r-cran-mapproj r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg 1423s r-cran-ragg r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 1423s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 1423s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 1423s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 1423s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 1423s r-cran-r.devices r-cran-r.rsp r-cran-lubridate r-cran-fs r-cran-usethis 1423s r-cran-bit64 r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table 1423s r-cran-mockr r-cran-formattable r-cran-generics r-cran-pkgdown 1423s r-cran-zeallot r-cran-mime r-cran-remotes r-cran-renv r-cran-jsonlite 1423s r-cran-runit libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl 1423s x11-utils x11-xserver-utils 1423s The following NEW packages will be installed: 1423s autopkgtest-satdep build-essential cpp cpp-13 cpp-13-powerpc64le-linux-gnu 1423s cpp-powerpc64le-linux-gnu dctrl-tools fontconfig fonts-glyphicons-halflings 1423s fonts-mathjax g++ g++-13 g++-13-powerpc64le-linux-gnu 1423s g++-powerpc64le-linux-gnu gcc gcc-13 gcc-13-base 1423s gcc-13-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu gfortran gfortran-13 1423s gfortran-13-powerpc64le-linux-gnu gfortran-powerpc64le-linux-gnu 1423s icu-devtools libasan8 libatomic1 libblas-dev libblas3 libbz2-dev libcairo2 1423s libcc1-0 libdatrie1 libdeflate-dev libgcc-13-dev libgfortran-13-dev 1423s libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libicu-dev 1423s libisl23 libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-bootstrap 1423s libjs-highlight.js libjs-jquery libjs-jquery-datatables libjs-mathjax 1423s liblapack-dev liblapack3 liblsan0 liblzma-dev libmpc3 libncurses-dev 1423s libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils 1423s libpaper1 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 1423s libpixman-1-0 libpkgconf3 libpng-dev libquadmath0 libreadline-dev libsm6 1423s libstdc++-13-dev libtcl8.6 libthai-data libthai0 libtirpc-dev libtk8.6 1423s libtsan2 libubsan1 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 1423s libxt6t64 node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin 1423s r-base-core r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace 1423s r-cran-commonmark r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 1423s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 1423s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 1423s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 1423s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r6 1423s r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble r-cran-utf8 1423s r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun r-cran-yaml unzip 1423s x11-common xdg-utils zip zlib1g-dev 1423s 0 upgraded, 134 newly installed, 0 to remove and 0 not upgraded. 1423s Need to get 172 MB/172 MB of archives. 1423s After this operation, 543 MB of additional disk space will be used. 1423s Get:1 /tmp/autopkgtest.qJ9Arj/2-autopkgtest-satdep.deb autopkgtest-satdep ppc64el 0 [760 B] 1423s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-13-base ppc64el 13.2.0-23ubuntu4 [49.0 kB] 1423s Get:3 http://ftpmaster.internal/ubuntu oracular/main ppc64el libisl23 ppc64el 0.26-3build1 [886 kB] 1423s Get:4 http://ftpmaster.internal/ubuntu oracular/main ppc64el libmpc3 ppc64el 1.3.1-1build1 [62.1 kB] 1423s Get:5 http://ftpmaster.internal/ubuntu oracular/main ppc64el cpp-13-powerpc64le-linux-gnu ppc64el 13.2.0-23ubuntu4 [10.7 MB] 1426s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el cpp-13 ppc64el 13.2.0-23ubuntu4 [1038 B] 1426s Get:7 http://ftpmaster.internal/ubuntu oracular/main ppc64el cpp-powerpc64le-linux-gnu ppc64el 4:13.2.0-7ubuntu1 [5330 B] 1426s Get:8 http://ftpmaster.internal/ubuntu oracular/main ppc64el cpp ppc64el 4:13.2.0-7ubuntu1 [22.5 kB] 1426s Get:9 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcc1-0 ppc64el 14.1.0-1ubuntu1 [48.1 kB] 1426s Get:10 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgomp1 ppc64el 14.1.0-1ubuntu1 [161 kB] 1426s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el libitm1 ppc64el 14.1.0-1ubuntu1 [32.4 kB] 1426s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el libatomic1 ppc64el 14.1.0-1ubuntu1 [10.7 kB] 1426s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el libasan8 ppc64el 14.1.0-1ubuntu1 [2971 kB] 1426s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblsan0 ppc64el 14.1.0-1ubuntu1 [1328 kB] 1426s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtsan2 ppc64el 14.1.0-1ubuntu1 [2708 kB] 1427s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el libubsan1 ppc64el 14.1.0-1ubuntu1 [1196 kB] 1427s Get:17 http://ftpmaster.internal/ubuntu oracular/main ppc64el libquadmath0 ppc64el 14.1.0-1ubuntu1 [158 kB] 1427s Get:18 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgcc-13-dev ppc64el 13.2.0-23ubuntu4 [1580 kB] 1427s Get:19 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-13-powerpc64le-linux-gnu ppc64el 13.2.0-23ubuntu4 [20.6 MB] 1430s Get:20 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-13 ppc64el 13.2.0-23ubuntu4 [482 kB] 1430s Get:21 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc-powerpc64le-linux-gnu ppc64el 4:13.2.0-7ubuntu1 [1224 B] 1430s Get:22 http://ftpmaster.internal/ubuntu oracular/main ppc64el gcc ppc64el 4:13.2.0-7ubuntu1 [5022 B] 1430s Get:23 http://ftpmaster.internal/ubuntu oracular/main ppc64el libstdc++-13-dev ppc64el 13.2.0-23ubuntu4 [2512 kB] 1430s Get:24 http://ftpmaster.internal/ubuntu oracular/main ppc64el g++-13-powerpc64le-linux-gnu ppc64el 13.2.0-23ubuntu4 [12.2 MB] 1431s Get:25 http://ftpmaster.internal/ubuntu oracular/main ppc64el g++-13 ppc64el 13.2.0-23ubuntu4 [14.5 kB] 1431s Get:26 http://ftpmaster.internal/ubuntu oracular/main ppc64el g++-powerpc64le-linux-gnu ppc64el 4:13.2.0-7ubuntu1 [968 B] 1431s Get:27 http://ftpmaster.internal/ubuntu oracular/main ppc64el g++ ppc64el 4:13.2.0-7ubuntu1 [1086 B] 1431s Get:28 http://ftpmaster.internal/ubuntu oracular/main ppc64el build-essential ppc64el 12.10ubuntu1 [4936 B] 1431s Get:29 http://ftpmaster.internal/ubuntu oracular/main ppc64el dctrl-tools ppc64el 2.24-3build3 [109 kB] 1431s Get:30 http://ftpmaster.internal/ubuntu oracular/main ppc64el fontconfig ppc64el 2.15.0-1.1ubuntu2 [192 kB] 1431s Get:31 http://ftpmaster.internal/ubuntu oracular/universe ppc64el fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 1431s Get:32 http://ftpmaster.internal/ubuntu oracular/main ppc64el fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 1432s Get:33 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgfortran5 ppc64el 14.1.0-1ubuntu1 [573 kB] 1432s Get:34 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgfortran-13-dev ppc64el 13.2.0-23ubuntu4 [604 kB] 1432s Get:35 http://ftpmaster.internal/ubuntu oracular/main ppc64el gfortran-13-powerpc64le-linux-gnu ppc64el 13.2.0-23ubuntu4 [11.2 MB] 1433s Get:36 http://ftpmaster.internal/ubuntu oracular/main ppc64el gfortran-13 ppc64el 13.2.0-23ubuntu4 [11.7 kB] 1433s Get:37 http://ftpmaster.internal/ubuntu oracular/main ppc64el gfortran-powerpc64le-linux-gnu ppc64el 4:13.2.0-7ubuntu1 [1030 B] 1433s Get:38 http://ftpmaster.internal/ubuntu oracular/main ppc64el gfortran ppc64el 4:13.2.0-7ubuntu1 [1170 B] 1433s Get:39 http://ftpmaster.internal/ubuntu oracular/main ppc64el icu-devtools ppc64el 74.2-1ubuntu3 [247 kB] 1433s Get:40 http://ftpmaster.internal/ubuntu oracular/main ppc64el libblas3 ppc64el 3.12.0-3build1 [227 kB] 1433s Get:41 http://ftpmaster.internal/ubuntu oracular/main ppc64el libblas-dev ppc64el 3.12.0-3build1 [301 kB] 1434s Get:42 http://ftpmaster.internal/ubuntu oracular/main ppc64el libbz2-dev ppc64el 1.0.8-5.1 [51.2 kB] 1434s Get:43 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpixman-1-0 ppc64el 0.42.2-1build1 [336 kB] 1434s Get:44 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb-render0 ppc64el 1.17.0-2 [17.2 kB] 1434s Get:45 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxcb-shm0 ppc64el 1.17.0-2 [5980 B] 1434s Get:46 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxrender1 ppc64el 1:0.9.10-1.1build1 [23.1 kB] 1434s Get:47 http://ftpmaster.internal/ubuntu oracular/main ppc64el libcairo2 ppc64el 1.18.0-3build1 [751 kB] 1434s Get:48 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdatrie1 ppc64el 0.2.13-3build1 [22.7 kB] 1434s Get:49 http://ftpmaster.internal/ubuntu oracular/main ppc64el libdeflate-dev ppc64el 1.20-1 [69.3 kB] 1434s Get:50 http://ftpmaster.internal/ubuntu oracular/main ppc64el libgraphite2-3 ppc64el 1.3.14-2build1 [84.6 kB] 1434s Get:51 http://ftpmaster.internal/ubuntu oracular/main ppc64el libharfbuzz0b ppc64el 8.3.0-2build2 [580 kB] 1434s Get:52 http://ftpmaster.internal/ubuntu oracular/main ppc64el x11-common all 1:7.7+23ubuntu3 [21.7 kB] 1434s Get:53 http://ftpmaster.internal/ubuntu oracular/main ppc64el libice6 ppc64el 2:1.0.10-1build3 [49.1 kB] 1434s Get:54 http://ftpmaster.internal/ubuntu oracular/main ppc64el libicu-dev ppc64el 74.2-1ubuntu3 [12.5 MB] 1436s Get:55 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjpeg-turbo8-dev ppc64el 2.1.5-2ubuntu2 [364 kB] 1436s Get:56 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjpeg8-dev ppc64el 8c-2ubuntu11 [1484 B] 1436s Get:57 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjpeg-dev ppc64el 8c-2ubuntu11 [1486 B] 1436s Get:58 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 1436s Get:59 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 1436s Get:60 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 1436s Get:61 http://ftpmaster.internal/ubuntu oracular/universe ppc64el libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 1436s Get:62 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblapack3 ppc64el 3.12.0-3build1 [2804 kB] 1437s Get:63 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblapack-dev ppc64el 3.12.0-3build1 [6100 kB] 1438s Get:64 http://ftpmaster.internal/ubuntu oracular/main ppc64el libncurses-dev ppc64el 6.4+20240113-1ubuntu2 [485 kB] 1438s Get:65 http://ftpmaster.internal/ubuntu oracular/main ppc64el libthai-data all 0.1.29-2build1 [158 kB] 1438s Get:66 http://ftpmaster.internal/ubuntu oracular/main ppc64el libthai0 ppc64el 0.1.29-2build1 [21.8 kB] 1438s Get:67 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpango-1.0-0 ppc64el 1.52.2+ds-1 [273 kB] 1438s Get:68 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpangoft2-1.0-0 ppc64el 1.52.2+ds-1 [49.8 kB] 1438s Get:69 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpangocairo-1.0-0 ppc64el 1.52.2+ds-1 [30.5 kB] 1438s Get:70 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpaper1 ppc64el 1.1.29build1 [13.7 kB] 1438s Get:71 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpaper-utils ppc64el 1.1.29build1 [8742 B] 1438s Get:72 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpcre2-16-0 ppc64el 10.42-4ubuntu2 [247 kB] 1438s Get:73 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpcre2-32-0 ppc64el 10.42-4ubuntu2 [230 kB] 1438s Get:74 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpcre2-posix3 ppc64el 10.42-4ubuntu2 [7068 B] 1438s Get:75 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpcre2-dev ppc64el 10.42-4ubuntu2 [801 kB] 1438s Get:76 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpkgconf3 ppc64el 1.8.1-2build1 [37.4 kB] 1438s Get:77 http://ftpmaster.internal/ubuntu oracular/main ppc64el zlib1g-dev ppc64el 1:1.3.dfsg-3.1ubuntu2 [902 kB] 1438s Get:78 http://ftpmaster.internal/ubuntu oracular/main ppc64el libpng-dev ppc64el 1.6.43-5build1 [328 kB] 1438s Get:79 http://ftpmaster.internal/ubuntu oracular/main ppc64el libreadline-dev ppc64el 8.2-4build1 [230 kB] 1438s Get:80 http://ftpmaster.internal/ubuntu oracular/main ppc64el libsm6 ppc64el 2:1.2.3-1build3 [17.6 kB] 1438s Get:81 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtcl8.6 ppc64el 8.6.14+dfsg-1build1 [1204 kB] 1438s Get:82 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxft2 ppc64el 2.3.6-1build1 [61.5 kB] 1438s Get:83 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxss1 ppc64el 1:1.2.3-1build3 [7980 B] 1438s Get:84 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtk8.6 ppc64el 8.6.14-1build1 [944 kB] 1438s Get:85 http://ftpmaster.internal/ubuntu oracular/main ppc64el libxt6t64 ppc64el 1:1.2.1-1.2build1 [202 kB] 1438s Get:86 http://ftpmaster.internal/ubuntu oracular/universe ppc64el node-normalize.css all 8.0.1-5 [10.8 kB] 1438s Get:87 http://ftpmaster.internal/ubuntu oracular/main ppc64el zip ppc64el 3.0-13build1 [198 kB] 1439s Get:88 http://ftpmaster.internal/ubuntu oracular/main ppc64el unzip ppc64el 6.0-28ubuntu4 [192 kB] 1439s Get:89 http://ftpmaster.internal/ubuntu oracular/main ppc64el xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 1439s Get:90 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-base-core ppc64el 4.4.0-2 [28.9 MB] 1444s Get:91 http://ftpmaster.internal/ubuntu oracular/main ppc64el liblzma-dev ppc64el 5.6.1+really5.4.5-1 [207 kB] 1445s Get:92 http://ftpmaster.internal/ubuntu oracular/main ppc64el pkgconf-bin ppc64el 1.8.1-2build1 [22.3 kB] 1445s Get:93 http://ftpmaster.internal/ubuntu oracular/main ppc64el pkgconf ppc64el 1.8.1-2build1 [16.8 kB] 1445s Get:94 http://ftpmaster.internal/ubuntu oracular/main ppc64el libtirpc-dev ppc64el 1.3.4+ds-1.3 [223 kB] 1445s Get:95 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-base-dev all 4.4.0-2 [4340 B] 1445s Get:96 http://ftpmaster.internal/ubuntu oracular/universe ppc64el pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 1445s Get:97 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-base64enc ppc64el 0.1-3-3 [28.1 kB] 1445s Get:98 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-cli ppc64el 3.6.2-1 [1405 kB] 1445s Get:99 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-colorspace ppc64el 2.1-0+dfsg-1 [1542 kB] 1445s Get:100 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-commonmark ppc64el 1.9.1-1 [142 kB] 1445s Get:101 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-evaluate all 0.23-1 [90.2 kB] 1445s Get:102 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-fansi ppc64el 1.0.5-1 [627 kB] 1446s Get:103 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-farver ppc64el 2.1.1-2 [1385 kB] 1446s Get:104 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-glue ppc64el 1.7.0-1 [155 kB] 1446s Get:105 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-rlang ppc64el 1.1.3-1 [1696 kB] 1447s Get:106 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 1447s Get:107 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 1447s Get:108 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-isoband ppc64el 0.2.7-1 [1486 kB] 1447s Get:109 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-mass ppc64el 7.3-60.0.1-1 [1126 kB] 1447s Get:110 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-lattice ppc64el 0.22-6-1 [1340 kB] 1447s Get:111 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-nlme ppc64el 3.1.164-1build1 [2278 kB] 1448s Get:112 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-matrix ppc64el 1.6-5-1 [4057 kB] 1449s Get:113 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-mgcv ppc64el 1.9-1-1 [3393 kB] 1449s Get:114 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-labeling all 0.4.3-1 [62.1 kB] 1449s Get:115 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-munsell all 0.5.0-2build1 [208 kB] 1449s Get:116 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-r6 all 2.5.1-1 [99.0 kB] 1449s Get:117 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 1449s Get:118 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-viridislite all 0.4.2-2 [1088 kB] 1449s Get:119 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-scales all 1.3.0-1 [603 kB] 1449s Get:120 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-magrittr ppc64el 2.0.3-1 [154 kB] 1450s Get:121 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-utf8 ppc64el 1.2.4-1 [148 kB] 1450s Get:122 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-vctrs ppc64el 0.6.5-1 [1399 kB] 1450s Get:123 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 1450s Get:124 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 1450s Get:125 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-tibble ppc64el 3.2.1+dfsg-2 [415 kB] 1450s Get:126 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-withr all 2.5.0-1 [225 kB] 1450s Get:127 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 1451s Get:128 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-xfun ppc64el 0.44+dfsg-1 [516 kB] 1451s Get:129 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-highr all 0.10+dfsg-2 [38.5 kB] 1451s Get:130 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-yaml ppc64el 2.3.8-2 [122 kB] 1451s Get:131 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 1452s Get:132 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-knitr all 1.46+dfsg-1 [911 kB] 1452s Get:133 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-markdown all 1.12+dfsg-2 [179 kB] 1453s Get:134 http://ftpmaster.internal/ubuntu oracular/universe ppc64el r-cran-matrixstats ppc64el 1.2.0-1 [530 kB] 1453s Preconfiguring packages ... 1455s Fetched 172 MB in 30s (5740 kB/s) 1455s Selecting previously unselected package gcc-13-base:ppc64el. 1455s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 72606 files and directories currently installed.) 1455s Preparing to unpack .../000-gcc-13-base_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking gcc-13-base:ppc64el (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package libisl23:ppc64el. 1455s Preparing to unpack .../001-libisl23_0.26-3build1_ppc64el.deb ... 1455s Unpacking libisl23:ppc64el (0.26-3build1) ... 1455s Selecting previously unselected package libmpc3:ppc64el. 1455s Preparing to unpack .../002-libmpc3_1.3.1-1build1_ppc64el.deb ... 1455s Unpacking libmpc3:ppc64el (1.3.1-1build1) ... 1455s Selecting previously unselected package cpp-13-powerpc64le-linux-gnu. 1455s Preparing to unpack .../003-cpp-13-powerpc64le-linux-gnu_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking cpp-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package cpp-13. 1455s Preparing to unpack .../004-cpp-13_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking cpp-13 (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package cpp-powerpc64le-linux-gnu. 1455s Preparing to unpack .../005-cpp-powerpc64le-linux-gnu_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking cpp-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package cpp. 1455s Preparing to unpack .../006-cpp_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking cpp (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package libcc1-0:ppc64el. 1455s Preparing to unpack .../007-libcc1-0_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libcc1-0:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libgomp1:ppc64el. 1455s Preparing to unpack .../008-libgomp1_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libgomp1:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libitm1:ppc64el. 1455s Preparing to unpack .../009-libitm1_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libitm1:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libatomic1:ppc64el. 1455s Preparing to unpack .../010-libatomic1_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libatomic1:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libasan8:ppc64el. 1455s Preparing to unpack .../011-libasan8_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libasan8:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package liblsan0:ppc64el. 1455s Preparing to unpack .../012-liblsan0_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking liblsan0:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libtsan2:ppc64el. 1455s Preparing to unpack .../013-libtsan2_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libtsan2:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libubsan1:ppc64el. 1455s Preparing to unpack .../014-libubsan1_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libubsan1:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libquadmath0:ppc64el. 1455s Preparing to unpack .../015-libquadmath0_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libquadmath0:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libgcc-13-dev:ppc64el. 1455s Preparing to unpack .../016-libgcc-13-dev_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking libgcc-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package gcc-13-powerpc64le-linux-gnu. 1455s Preparing to unpack .../017-gcc-13-powerpc64le-linux-gnu_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking gcc-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package gcc-13. 1455s Preparing to unpack .../018-gcc-13_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking gcc-13 (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package gcc-powerpc64le-linux-gnu. 1455s Preparing to unpack .../019-gcc-powerpc64le-linux-gnu_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking gcc-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package gcc. 1455s Preparing to unpack .../020-gcc_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking gcc (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package libstdc++-13-dev:ppc64el. 1455s Preparing to unpack .../021-libstdc++-13-dev_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking libstdc++-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package g++-13-powerpc64le-linux-gnu. 1455s Preparing to unpack .../022-g++-13-powerpc64le-linux-gnu_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking g++-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package g++-13. 1455s Preparing to unpack .../023-g++-13_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking g++-13 (13.2.0-23ubuntu4) ... 1455s Selecting previously unselected package g++-powerpc64le-linux-gnu. 1455s Preparing to unpack .../024-g++-powerpc64le-linux-gnu_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking g++-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package g++. 1455s Preparing to unpack .../025-g++_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1455s Unpacking g++ (4:13.2.0-7ubuntu1) ... 1455s Selecting previously unselected package build-essential. 1455s Preparing to unpack .../026-build-essential_12.10ubuntu1_ppc64el.deb ... 1455s Unpacking build-essential (12.10ubuntu1) ... 1455s Selecting previously unselected package dctrl-tools. 1455s Preparing to unpack .../027-dctrl-tools_2.24-3build3_ppc64el.deb ... 1455s Unpacking dctrl-tools (2.24-3build3) ... 1455s Selecting previously unselected package fontconfig. 1455s Preparing to unpack .../028-fontconfig_2.15.0-1.1ubuntu2_ppc64el.deb ... 1455s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 1455s Selecting previously unselected package fonts-glyphicons-halflings. 1455s Preparing to unpack .../029-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 1455s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1455s Selecting previously unselected package fonts-mathjax. 1455s Preparing to unpack .../030-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 1455s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 1455s Selecting previously unselected package libgfortran5:ppc64el. 1455s Preparing to unpack .../031-libgfortran5_14.1.0-1ubuntu1_ppc64el.deb ... 1455s Unpacking libgfortran5:ppc64el (14.1.0-1ubuntu1) ... 1455s Selecting previously unselected package libgfortran-13-dev:ppc64el. 1455s Preparing to unpack .../032-libgfortran-13-dev_13.2.0-23ubuntu4_ppc64el.deb ... 1455s Unpacking libgfortran-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1456s Selecting previously unselected package gfortran-13-powerpc64le-linux-gnu. 1456s Preparing to unpack .../033-gfortran-13-powerpc64le-linux-gnu_13.2.0-23ubuntu4_ppc64el.deb ... 1456s Unpacking gfortran-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1456s Selecting previously unselected package gfortran-13. 1456s Preparing to unpack .../034-gfortran-13_13.2.0-23ubuntu4_ppc64el.deb ... 1456s Unpacking gfortran-13 (13.2.0-23ubuntu4) ... 1456s Selecting previously unselected package gfortran-powerpc64le-linux-gnu. 1456s Preparing to unpack .../035-gfortran-powerpc64le-linux-gnu_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1456s Unpacking gfortran-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1456s Selecting previously unselected package gfortran. 1456s Preparing to unpack .../036-gfortran_4%3a13.2.0-7ubuntu1_ppc64el.deb ... 1456s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 1456s Selecting previously unselected package icu-devtools. 1456s Preparing to unpack .../037-icu-devtools_74.2-1ubuntu3_ppc64el.deb ... 1456s Unpacking icu-devtools (74.2-1ubuntu3) ... 1456s Selecting previously unselected package libblas3:ppc64el. 1456s Preparing to unpack .../038-libblas3_3.12.0-3build1_ppc64el.deb ... 1456s Unpacking libblas3:ppc64el (3.12.0-3build1) ... 1456s Selecting previously unselected package libblas-dev:ppc64el. 1456s Preparing to unpack .../039-libblas-dev_3.12.0-3build1_ppc64el.deb ... 1456s Unpacking libblas-dev:ppc64el (3.12.0-3build1) ... 1456s Selecting previously unselected package libbz2-dev:ppc64el. 1456s Preparing to unpack .../040-libbz2-dev_1.0.8-5.1_ppc64el.deb ... 1456s Unpacking libbz2-dev:ppc64el (1.0.8-5.1) ... 1456s Selecting previously unselected package libpixman-1-0:ppc64el. 1456s Preparing to unpack .../041-libpixman-1-0_0.42.2-1build1_ppc64el.deb ... 1456s Unpacking libpixman-1-0:ppc64el (0.42.2-1build1) ... 1456s Selecting previously unselected package libxcb-render0:ppc64el. 1456s Preparing to unpack .../042-libxcb-render0_1.17.0-2_ppc64el.deb ... 1456s Unpacking libxcb-render0:ppc64el (1.17.0-2) ... 1456s Selecting previously unselected package libxcb-shm0:ppc64el. 1456s Preparing to unpack .../043-libxcb-shm0_1.17.0-2_ppc64el.deb ... 1456s Unpacking libxcb-shm0:ppc64el (1.17.0-2) ... 1456s Selecting previously unselected package libxrender1:ppc64el. 1456s Preparing to unpack .../044-libxrender1_1%3a0.9.10-1.1build1_ppc64el.deb ... 1456s Unpacking libxrender1:ppc64el (1:0.9.10-1.1build1) ... 1456s Selecting previously unselected package libcairo2:ppc64el. 1456s Preparing to unpack .../045-libcairo2_1.18.0-3build1_ppc64el.deb ... 1456s Unpacking libcairo2:ppc64el (1.18.0-3build1) ... 1456s Selecting previously unselected package libdatrie1:ppc64el. 1456s Preparing to unpack .../046-libdatrie1_0.2.13-3build1_ppc64el.deb ... 1456s Unpacking libdatrie1:ppc64el (0.2.13-3build1) ... 1456s Selecting previously unselected package libdeflate-dev:ppc64el. 1456s Preparing to unpack .../047-libdeflate-dev_1.20-1_ppc64el.deb ... 1456s Unpacking libdeflate-dev:ppc64el (1.20-1) ... 1456s Selecting previously unselected package libgraphite2-3:ppc64el. 1456s Preparing to unpack .../048-libgraphite2-3_1.3.14-2build1_ppc64el.deb ... 1456s Unpacking libgraphite2-3:ppc64el (1.3.14-2build1) ... 1456s Selecting previously unselected package libharfbuzz0b:ppc64el. 1456s Preparing to unpack .../049-libharfbuzz0b_8.3.0-2build2_ppc64el.deb ... 1456s Unpacking libharfbuzz0b:ppc64el (8.3.0-2build2) ... 1456s Selecting previously unselected package x11-common. 1456s Preparing to unpack .../050-x11-common_1%3a7.7+23ubuntu3_all.deb ... 1456s Unpacking x11-common (1:7.7+23ubuntu3) ... 1456s Selecting previously unselected package libice6:ppc64el. 1456s Preparing to unpack .../051-libice6_2%3a1.0.10-1build3_ppc64el.deb ... 1456s Unpacking libice6:ppc64el (2:1.0.10-1build3) ... 1456s Selecting previously unselected package libicu-dev:ppc64el. 1456s Preparing to unpack .../052-libicu-dev_74.2-1ubuntu3_ppc64el.deb ... 1456s Unpacking libicu-dev:ppc64el (74.2-1ubuntu3) ... 1457s Selecting previously unselected package libjpeg-turbo8-dev:ppc64el. 1457s Preparing to unpack .../053-libjpeg-turbo8-dev_2.1.5-2ubuntu2_ppc64el.deb ... 1457s Unpacking libjpeg-turbo8-dev:ppc64el (2.1.5-2ubuntu2) ... 1457s Selecting previously unselected package libjpeg8-dev:ppc64el. 1457s Preparing to unpack .../054-libjpeg8-dev_8c-2ubuntu11_ppc64el.deb ... 1457s Unpacking libjpeg8-dev:ppc64el (8c-2ubuntu11) ... 1457s Selecting previously unselected package libjpeg-dev:ppc64el. 1457s Preparing to unpack .../055-libjpeg-dev_8c-2ubuntu11_ppc64el.deb ... 1457s Unpacking libjpeg-dev:ppc64el (8c-2ubuntu11) ... 1457s Selecting previously unselected package libjs-bootstrap. 1457s Preparing to unpack .../056-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 1457s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 1457s Selecting previously unselected package libjs-highlight.js. 1457s Preparing to unpack .../057-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 1457s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 1457s Selecting previously unselected package libjs-jquery. 1457s Preparing to unpack .../058-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 1457s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1457s Selecting previously unselected package libjs-jquery-datatables. 1457s Preparing to unpack .../059-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 1457s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 1457s Selecting previously unselected package liblapack3:ppc64el. 1457s Preparing to unpack .../060-liblapack3_3.12.0-3build1_ppc64el.deb ... 1457s Unpacking liblapack3:ppc64el (3.12.0-3build1) ... 1457s Selecting previously unselected package liblapack-dev:ppc64el. 1457s Preparing to unpack .../061-liblapack-dev_3.12.0-3build1_ppc64el.deb ... 1457s Unpacking liblapack-dev:ppc64el (3.12.0-3build1) ... 1457s Selecting previously unselected package libncurses-dev:ppc64el. 1457s Preparing to unpack .../062-libncurses-dev_6.4+20240113-1ubuntu2_ppc64el.deb ... 1457s Unpacking libncurses-dev:ppc64el (6.4+20240113-1ubuntu2) ... 1457s Selecting previously unselected package libthai-data. 1457s Preparing to unpack .../063-libthai-data_0.1.29-2build1_all.deb ... 1457s Unpacking libthai-data (0.1.29-2build1) ... 1457s Selecting previously unselected package libthai0:ppc64el. 1457s Preparing to unpack .../064-libthai0_0.1.29-2build1_ppc64el.deb ... 1457s Unpacking libthai0:ppc64el (0.1.29-2build1) ... 1457s Selecting previously unselected package libpango-1.0-0:ppc64el. 1457s Preparing to unpack .../065-libpango-1.0-0_1.52.2+ds-1_ppc64el.deb ... 1457s Unpacking libpango-1.0-0:ppc64el (1.52.2+ds-1) ... 1457s Selecting previously unselected package libpangoft2-1.0-0:ppc64el. 1457s Preparing to unpack .../066-libpangoft2-1.0-0_1.52.2+ds-1_ppc64el.deb ... 1457s Unpacking libpangoft2-1.0-0:ppc64el (1.52.2+ds-1) ... 1457s Selecting previously unselected package libpangocairo-1.0-0:ppc64el. 1457s Preparing to unpack .../067-libpangocairo-1.0-0_1.52.2+ds-1_ppc64el.deb ... 1457s Unpacking libpangocairo-1.0-0:ppc64el (1.52.2+ds-1) ... 1457s Selecting previously unselected package libpaper1:ppc64el. 1457s Preparing to unpack .../068-libpaper1_1.1.29build1_ppc64el.deb ... 1457s Unpacking libpaper1:ppc64el (1.1.29build1) ... 1457s Selecting previously unselected package libpaper-utils. 1457s Preparing to unpack .../069-libpaper-utils_1.1.29build1_ppc64el.deb ... 1457s Unpacking libpaper-utils (1.1.29build1) ... 1457s Selecting previously unselected package libpcre2-16-0:ppc64el. 1457s Preparing to unpack .../070-libpcre2-16-0_10.42-4ubuntu2_ppc64el.deb ... 1457s Unpacking libpcre2-16-0:ppc64el (10.42-4ubuntu2) ... 1457s Selecting previously unselected package libpcre2-32-0:ppc64el. 1457s Preparing to unpack .../071-libpcre2-32-0_10.42-4ubuntu2_ppc64el.deb ... 1457s Unpacking libpcre2-32-0:ppc64el (10.42-4ubuntu2) ... 1457s Selecting previously unselected package libpcre2-posix3:ppc64el. 1457s Preparing to unpack .../072-libpcre2-posix3_10.42-4ubuntu2_ppc64el.deb ... 1457s Unpacking libpcre2-posix3:ppc64el (10.42-4ubuntu2) ... 1457s Selecting previously unselected package libpcre2-dev:ppc64el. 1457s Preparing to unpack .../073-libpcre2-dev_10.42-4ubuntu2_ppc64el.deb ... 1457s Unpacking libpcre2-dev:ppc64el (10.42-4ubuntu2) ... 1457s Selecting previously unselected package libpkgconf3:ppc64el. 1457s Preparing to unpack .../074-libpkgconf3_1.8.1-2build1_ppc64el.deb ... 1457s Unpacking libpkgconf3:ppc64el (1.8.1-2build1) ... 1457s Selecting previously unselected package zlib1g-dev:ppc64el. 1457s Preparing to unpack .../075-zlib1g-dev_1%3a1.3.dfsg-3.1ubuntu2_ppc64el.deb ... 1457s Unpacking zlib1g-dev:ppc64el (1:1.3.dfsg-3.1ubuntu2) ... 1457s Selecting previously unselected package libpng-dev:ppc64el. 1457s Preparing to unpack .../076-libpng-dev_1.6.43-5build1_ppc64el.deb ... 1457s Unpacking libpng-dev:ppc64el (1.6.43-5build1) ... 1457s Selecting previously unselected package libreadline-dev:ppc64el. 1457s Preparing to unpack .../077-libreadline-dev_8.2-4build1_ppc64el.deb ... 1457s Unpacking libreadline-dev:ppc64el (8.2-4build1) ... 1457s Selecting previously unselected package libsm6:ppc64el. 1457s Preparing to unpack .../078-libsm6_2%3a1.2.3-1build3_ppc64el.deb ... 1457s Unpacking libsm6:ppc64el (2:1.2.3-1build3) ... 1457s Selecting previously unselected package libtcl8.6:ppc64el. 1457s Preparing to unpack .../079-libtcl8.6_8.6.14+dfsg-1build1_ppc64el.deb ... 1457s Unpacking libtcl8.6:ppc64el (8.6.14+dfsg-1build1) ... 1457s Selecting previously unselected package libxft2:ppc64el. 1457s Preparing to unpack .../080-libxft2_2.3.6-1build1_ppc64el.deb ... 1457s Unpacking libxft2:ppc64el (2.3.6-1build1) ... 1457s Selecting previously unselected package libxss1:ppc64el. 1457s Preparing to unpack .../081-libxss1_1%3a1.2.3-1build3_ppc64el.deb ... 1457s Unpacking libxss1:ppc64el (1:1.2.3-1build3) ... 1457s Selecting previously unselected package libtk8.6:ppc64el. 1457s Preparing to unpack .../082-libtk8.6_8.6.14-1build1_ppc64el.deb ... 1457s Unpacking libtk8.6:ppc64el (8.6.14-1build1) ... 1457s Selecting previously unselected package libxt6t64:ppc64el. 1457s Preparing to unpack .../083-libxt6t64_1%3a1.2.1-1.2build1_ppc64el.deb ... 1457s Unpacking libxt6t64:ppc64el (1:1.2.1-1.2build1) ... 1457s Selecting previously unselected package node-normalize.css. 1457s Preparing to unpack .../084-node-normalize.css_8.0.1-5_all.deb ... 1457s Unpacking node-normalize.css (8.0.1-5) ... 1457s Selecting previously unselected package zip. 1457s Preparing to unpack .../085-zip_3.0-13build1_ppc64el.deb ... 1457s Unpacking zip (3.0-13build1) ... 1457s Selecting previously unselected package unzip. 1457s Preparing to unpack .../086-unzip_6.0-28ubuntu4_ppc64el.deb ... 1457s Unpacking unzip (6.0-28ubuntu4) ... 1458s Selecting previously unselected package xdg-utils. 1458s Preparing to unpack .../087-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 1458s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 1458s Selecting previously unselected package r-base-core. 1458s Preparing to unpack .../088-r-base-core_4.4.0-2_ppc64el.deb ... 1458s Unpacking r-base-core (4.4.0-2) ... 1458s Selecting previously unselected package liblzma-dev:ppc64el. 1458s Preparing to unpack .../089-liblzma-dev_5.6.1+really5.4.5-1_ppc64el.deb ... 1458s Unpacking liblzma-dev:ppc64el (5.6.1+really5.4.5-1) ... 1458s Selecting previously unselected package pkgconf-bin. 1458s Preparing to unpack .../090-pkgconf-bin_1.8.1-2build1_ppc64el.deb ... 1458s Unpacking pkgconf-bin (1.8.1-2build1) ... 1458s Selecting previously unselected package pkgconf:ppc64el. 1458s Preparing to unpack .../091-pkgconf_1.8.1-2build1_ppc64el.deb ... 1458s Unpacking pkgconf:ppc64el (1.8.1-2build1) ... 1458s Selecting previously unselected package libtirpc-dev:ppc64el. 1458s Preparing to unpack .../092-libtirpc-dev_1.3.4+ds-1.3_ppc64el.deb ... 1458s Unpacking libtirpc-dev:ppc64el (1.3.4+ds-1.3) ... 1458s Selecting previously unselected package r-base-dev. 1458s Preparing to unpack .../093-r-base-dev_4.4.0-2_all.deb ... 1458s Unpacking r-base-dev (4.4.0-2) ... 1458s Selecting previously unselected package pkg-r-autopkgtest. 1458s Preparing to unpack .../094-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 1458s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 1458s Selecting previously unselected package r-cran-base64enc. 1458s Preparing to unpack .../095-r-cran-base64enc_0.1-3-3_ppc64el.deb ... 1458s Unpacking r-cran-base64enc (0.1-3-3) ... 1458s Selecting previously unselected package r-cran-cli. 1458s Preparing to unpack .../096-r-cran-cli_3.6.2-1_ppc64el.deb ... 1458s Unpacking r-cran-cli (3.6.2-1) ... 1458s Selecting previously unselected package r-cran-colorspace. 1458s Preparing to unpack .../097-r-cran-colorspace_2.1-0+dfsg-1_ppc64el.deb ... 1458s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 1458s Selecting previously unselected package r-cran-commonmark. 1458s Preparing to unpack .../098-r-cran-commonmark_1.9.1-1_ppc64el.deb ... 1458s Unpacking r-cran-commonmark (1.9.1-1) ... 1458s Selecting previously unselected package r-cran-evaluate. 1458s Preparing to unpack .../099-r-cran-evaluate_0.23-1_all.deb ... 1458s Unpacking r-cran-evaluate (0.23-1) ... 1458s Selecting previously unselected package r-cran-fansi. 1458s Preparing to unpack .../100-r-cran-fansi_1.0.5-1_ppc64el.deb ... 1458s Unpacking r-cran-fansi (1.0.5-1) ... 1458s Selecting previously unselected package r-cran-farver. 1458s Preparing to unpack .../101-r-cran-farver_2.1.1-2_ppc64el.deb ... 1458s Unpacking r-cran-farver (2.1.1-2) ... 1458s Selecting previously unselected package r-cran-glue. 1458s Preparing to unpack .../102-r-cran-glue_1.7.0-1_ppc64el.deb ... 1458s Unpacking r-cran-glue (1.7.0-1) ... 1458s Selecting previously unselected package r-cran-rlang. 1458s Preparing to unpack .../103-r-cran-rlang_1.1.3-1_ppc64el.deb ... 1458s Unpacking r-cran-rlang (1.1.3-1) ... 1458s Selecting previously unselected package r-cran-lifecycle. 1458s Preparing to unpack .../104-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 1458s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 1458s Selecting previously unselected package r-cran-gtable. 1458s Preparing to unpack .../105-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 1458s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 1458s Selecting previously unselected package r-cran-isoband. 1458s Preparing to unpack .../106-r-cran-isoband_0.2.7-1_ppc64el.deb ... 1458s Unpacking r-cran-isoband (0.2.7-1) ... 1458s Selecting previously unselected package r-cran-mass. 1458s Preparing to unpack .../107-r-cran-mass_7.3-60.0.1-1_ppc64el.deb ... 1458s Unpacking r-cran-mass (7.3-60.0.1-1) ... 1459s Selecting previously unselected package r-cran-lattice. 1459s Preparing to unpack .../108-r-cran-lattice_0.22-6-1_ppc64el.deb ... 1459s Unpacking r-cran-lattice (0.22-6-1) ... 1459s Selecting previously unselected package r-cran-nlme. 1459s Preparing to unpack .../109-r-cran-nlme_3.1.164-1build1_ppc64el.deb ... 1459s Unpacking r-cran-nlme (3.1.164-1build1) ... 1459s Selecting previously unselected package r-cran-matrix. 1459s Preparing to unpack .../110-r-cran-matrix_1.6-5-1_ppc64el.deb ... 1459s Unpacking r-cran-matrix (1.6-5-1) ... 1459s Selecting previously unselected package r-cran-mgcv. 1459s Preparing to unpack .../111-r-cran-mgcv_1.9-1-1_ppc64el.deb ... 1459s Unpacking r-cran-mgcv (1.9-1-1) ... 1459s Selecting previously unselected package r-cran-labeling. 1459s Preparing to unpack .../112-r-cran-labeling_0.4.3-1_all.deb ... 1459s Unpacking r-cran-labeling (0.4.3-1) ... 1459s Selecting previously unselected package r-cran-munsell. 1459s Preparing to unpack .../113-r-cran-munsell_0.5.0-2build1_all.deb ... 1459s Unpacking r-cran-munsell (0.5.0-2build1) ... 1459s Selecting previously unselected package r-cran-r6. 1459s Preparing to unpack .../114-r-cran-r6_2.5.1-1_all.deb ... 1459s Unpacking r-cran-r6 (2.5.1-1) ... 1459s Selecting previously unselected package r-cran-rcolorbrewer. 1459s Preparing to unpack .../115-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 1459s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 1459s Selecting previously unselected package r-cran-viridislite. 1459s Preparing to unpack .../116-r-cran-viridislite_0.4.2-2_all.deb ... 1459s Unpacking r-cran-viridislite (0.4.2-2) ... 1459s Selecting previously unselected package r-cran-scales. 1459s Preparing to unpack .../117-r-cran-scales_1.3.0-1_all.deb ... 1459s Unpacking r-cran-scales (1.3.0-1) ... 1459s Selecting previously unselected package r-cran-magrittr. 1459s Preparing to unpack .../118-r-cran-magrittr_2.0.3-1_ppc64el.deb ... 1459s Unpacking r-cran-magrittr (2.0.3-1) ... 1459s Selecting previously unselected package r-cran-utf8. 1459s Preparing to unpack .../119-r-cran-utf8_1.2.4-1_ppc64el.deb ... 1459s Unpacking r-cran-utf8 (1.2.4-1) ... 1459s Selecting previously unselected package r-cran-vctrs. 1459s Preparing to unpack .../120-r-cran-vctrs_0.6.5-1_ppc64el.deb ... 1459s Unpacking r-cran-vctrs (0.6.5-1) ... 1459s Selecting previously unselected package r-cran-pillar. 1459s Preparing to unpack .../121-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 1459s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 1459s Selecting previously unselected package r-cran-pkgconfig. 1459s Preparing to unpack .../122-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 1459s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 1459s Selecting previously unselected package r-cran-tibble. 1459s Preparing to unpack .../123-r-cran-tibble_3.2.1+dfsg-2_ppc64el.deb ... 1459s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 1459s Selecting previously unselected package r-cran-withr. 1459s Preparing to unpack .../124-r-cran-withr_2.5.0-1_all.deb ... 1459s Unpacking r-cran-withr (2.5.0-1) ... 1459s Selecting previously unselected package r-cran-ggplot2. 1459s Preparing to unpack .../125-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 1459s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 1459s Selecting previously unselected package r-cran-xfun. 1459s Preparing to unpack .../126-r-cran-xfun_0.44+dfsg-1_ppc64el.deb ... 1459s Unpacking r-cran-xfun (0.44+dfsg-1) ... 1459s Selecting previously unselected package r-cran-highr. 1459s Preparing to unpack .../127-r-cran-highr_0.10+dfsg-2_all.deb ... 1459s Unpacking r-cran-highr (0.10+dfsg-2) ... 1459s Selecting previously unselected package r-cran-yaml. 1459s Preparing to unpack .../128-r-cran-yaml_2.3.8-2_ppc64el.deb ... 1459s Unpacking r-cran-yaml (2.3.8-2) ... 1459s Selecting previously unselected package libjs-mathjax. 1459s Preparing to unpack .../129-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 1459s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 1460s Selecting previously unselected package r-cran-knitr. 1460s Preparing to unpack .../130-r-cran-knitr_1.46+dfsg-1_all.deb ... 1460s Unpacking r-cran-knitr (1.46+dfsg-1) ... 1460s Selecting previously unselected package r-cran-markdown. 1460s Preparing to unpack .../131-r-cran-markdown_1.12+dfsg-2_all.deb ... 1460s Unpacking r-cran-markdown (1.12+dfsg-2) ... 1460s Selecting previously unselected package r-cran-matrixstats. 1460s Preparing to unpack .../132-r-cran-matrixstats_1.2.0-1_ppc64el.deb ... 1460s Unpacking r-cran-matrixstats (1.2.0-1) ... 1461s Selecting previously unselected package autopkgtest-satdep. 1461s Preparing to unpack .../133-2-autopkgtest-satdep.deb ... 1461s Unpacking autopkgtest-satdep (0) ... 1461s Setting up libgraphite2-3:ppc64el (1.3.14-2build1) ... 1461s Setting up libpixman-1-0:ppc64el (0.42.2-1build1) ... 1461s Setting up libpaper1:ppc64el (1.1.29build1) ... 1461s 1461s Creating config file /etc/papersize with new version 1461s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 1463s Regenerating fonts cache... done. 1463s Setting up libjpeg-turbo8-dev:ppc64el (2.1.5-2ubuntu2) ... 1463s Setting up libncurses-dev:ppc64el (6.4+20240113-1ubuntu2) ... 1463s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 1463s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 1463s Setting up libxrender1:ppc64el (1:0.9.10-1.1build1) ... 1463s Setting up libdatrie1:ppc64el (0.2.13-3build1) ... 1463s Setting up libxcb-render0:ppc64el (1.17.0-2) ... 1463s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1463s Setting up unzip (6.0-28ubuntu4) ... 1463s Setting up x11-common (1:7.7+23ubuntu3) ... 1463s Setting up libxcb-shm0:ppc64el (1.17.0-2) ... 1463s Setting up libpaper-utils (1.1.29build1) ... 1463s Setting up libreadline-dev:ppc64el (8.2-4build1) ... 1463s Setting up libgomp1:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libcairo2:ppc64el (1.18.0-3build1) ... 1463s Setting up libpcre2-16-0:ppc64el (10.42-4ubuntu2) ... 1463s Setting up zip (3.0-13build1) ... 1463s Setting up libpcre2-32-0:ppc64el (10.42-4ubuntu2) ... 1463s Setting up libblas3:ppc64el (3.12.0-3build1) ... 1463s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/blas/libblas.so.3 to provide /usr/lib/powerpc64le-linux-gnu/libblas.so.3 (libblas.so.3-powerpc64le-linux-gnu) in auto mode 1463s Setting up libtirpc-dev:ppc64el (1.3.4+ds-1.3) ... 1463s Setting up libpkgconf3:ppc64el (1.8.1-2build1) ... 1463s Setting up gcc-13-base:ppc64el (13.2.0-23ubuntu4) ... 1463s Setting up libquadmath0:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libmpc3:ppc64el (1.3.1-1build1) ... 1463s Setting up libatomic1:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libtcl8.6:ppc64el (8.6.14+dfsg-1build1) ... 1463s Setting up icu-devtools (74.2-1ubuntu3) ... 1463s Setting up pkgconf-bin (1.8.1-2build1) ... 1463s Setting up libgfortran5:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up liblzma-dev:ppc64el (5.6.1+really5.4.5-1) ... 1463s Setting up libubsan1:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up zlib1g-dev:ppc64el (1:1.3.dfsg-3.1ubuntu2) ... 1463s Setting up libpcre2-posix3:ppc64el (10.42-4ubuntu2) ... 1463s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 1463s Setting up libasan8:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libharfbuzz0b:ppc64el (8.3.0-2build2) ... 1463s Setting up libthai-data (0.1.29-2build1) ... 1463s Setting up libxss1:ppc64el (1:1.2.3-1build3) ... 1463s Setting up libtsan2:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1463s Setting up libjpeg8-dev:ppc64el (8c-2ubuntu11) ... 1463s Setting up libisl23:ppc64el (0.26-3build1) ... 1463s Setting up cpp-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1463s Setting up libdeflate-dev:ppc64el (1.20-1) ... 1463s Setting up node-normalize.css (8.0.1-5) ... 1463s Setting up libicu-dev:ppc64el (74.2-1ubuntu3) ... 1463s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 1463s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 1463s Setting up libcc1-0:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up liblsan0:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up libblas-dev:ppc64el (3.12.0-3build1) ... 1463s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/blas/libblas.so to provide /usr/lib/powerpc64le-linux-gnu/libblas.so (libblas.so-powerpc64le-linux-gnu) in auto mode 1463s Setting up dctrl-tools (2.24-3build3) ... 1463s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 1463s Setting up libitm1:ppc64el (14.1.0-1ubuntu1) ... 1463s Setting up cpp-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1463s Setting up libbz2-dev:ppc64el (1.0.8-5.1) ... 1463s Setting up libice6:ppc64el (2:1.0.10-1build3) ... 1463s Setting up liblapack3:ppc64el (3.12.0-3build1) ... 1463s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/powerpc64le-linux-gnu/liblapack.so.3 (liblapack.so.3-powerpc64le-linux-gnu) in auto mode 1463s Setting up libxft2:ppc64el (2.3.6-1build1) ... 1463s Setting up libpcre2-dev:ppc64el (10.42-4ubuntu2) ... 1463s Setting up cpp-13 (13.2.0-23ubuntu4) ... 1463s Setting up libtk8.6:ppc64el (8.6.14-1build1) ... 1463s Setting up libpng-dev:ppc64el (1.6.43-5build1) ... 1463s Setting up libjpeg-dev:ppc64el (8c-2ubuntu11) ... 1463s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 1463s Setting up pkgconf:ppc64el (1.8.1-2build1) ... 1463s Setting up libthai0:ppc64el (0.1.29-2build1) ... 1463s Setting up liblapack-dev:ppc64el (3.12.0-3build1) ... 1463s update-alternatives: using /usr/lib/powerpc64le-linux-gnu/lapack/liblapack.so to provide /usr/lib/powerpc64le-linux-gnu/liblapack.so (liblapack.so-powerpc64le-linux-gnu) in auto mode 1463s Setting up libgcc-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1463s Setting up cpp (4:13.2.0-7ubuntu1) ... 1463s Setting up libgfortran-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1463s Setting up libsm6:ppc64el (2:1.2.3-1build3) ... 1463s Setting up libstdc++-13-dev:ppc64el (13.2.0-23ubuntu4) ... 1463s Setting up libpango-1.0-0:ppc64el (1.52.2+ds-1) ... 1463s Setting up gcc-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1463s Setting up libxt6t64:ppc64el (1:1.2.1-1.2build1) ... 1463s Setting up gcc-13 (13.2.0-23ubuntu4) ... 1463s Setting up libpangoft2-1.0-0:ppc64el (1.52.2+ds-1) ... 1463s Setting up libpangocairo-1.0-0:ppc64el (1.52.2+ds-1) ... 1463s Setting up gfortran-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1463s Setting up g++-13-powerpc64le-linux-gnu (13.2.0-23ubuntu4) ... 1463s Setting up gcc-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1463s Setting up gfortran-13 (13.2.0-23ubuntu4) ... 1463s Setting up r-base-core (4.4.0-2) ... 1464s 1464s Creating config file /etc/R/Renviron with new version 1464s Setting up r-cran-labeling (0.4.3-1) ... 1464s Setting up r-cran-lattice (0.22-6-1) ... 1464s Setting up r-cran-nlme (3.1.164-1build1) ... 1464s Setting up r-cran-farver (2.1.1-2) ... 1464s Setting up r-cran-viridislite (0.4.2-2) ... 1464s Setting up r-cran-commonmark (1.9.1-1) ... 1464s Setting up r-cran-r6 (2.5.1-1) ... 1464s Setting up r-cran-magrittr (2.0.3-1) ... 1464s Setting up g++-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1464s Setting up g++-13 (13.2.0-23ubuntu4) ... 1464s Setting up r-cran-rlang (1.1.3-1) ... 1464s Setting up r-cran-matrixstats (1.2.0-1) ... 1464s Setting up r-cran-xfun (0.44+dfsg-1) ... 1464s Setting up r-cran-withr (2.5.0-1) ... 1464s Setting up r-cran-base64enc (0.1-3-3) ... 1464s Setting up r-cran-yaml (2.3.8-2) ... 1464s Setting up r-cran-evaluate (0.23-1) ... 1464s Setting up r-cran-highr (0.10+dfsg-2) ... 1464s Setting up r-cran-fansi (1.0.5-1) ... 1464s Setting up r-cran-mass (7.3-60.0.1-1) ... 1464s Setting up r-cran-glue (1.7.0-1) ... 1464s Setting up r-cran-cli (3.6.2-1) ... 1464s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 1464s Setting up gcc (4:13.2.0-7ubuntu1) ... 1464s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 1464s Setting up r-cran-utf8 (1.2.4-1) ... 1464s Setting up gfortran-powerpc64le-linux-gnu (4:13.2.0-7ubuntu1) ... 1464s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 1464s Setting up r-cran-markdown (1.12+dfsg-2) ... 1464s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 1464s Setting up r-cran-isoband (0.2.7-1) ... 1464s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 1464s Setting up r-cran-matrix (1.6-5-1) ... 1464s Setting up r-cran-knitr (1.46+dfsg-1) ... 1464s Setting up r-cran-mgcv (1.9-1-1) ... 1464s Setting up g++ (4:13.2.0-7ubuntu1) ... 1464s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 1464s Setting up build-essential (12.10ubuntu1) ... 1464s Setting up r-cran-vctrs (0.6.5-1) ... 1464s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 1464s Setting up r-cran-munsell (0.5.0-2build1) ... 1464s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 1464s Setting up gfortran (4:13.2.0-7ubuntu1) ... 1464s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 1464s update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist 1464s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 1464s update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist 1464s Setting up r-cran-scales (1.3.0-1) ... 1464s Setting up r-base-dev (4.4.0-2) ... 1464s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 1464s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 1464s Setting up autopkgtest-satdep (0) ... 1464s Processing triggers for man-db (2.12.1-1) ... 1465s Processing triggers for install-info (7.1-3build2) ... 1465s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 1478s (Reading database ... 85014 files and directories currently installed.) 1478s Removing autopkgtest-satdep (0) ... 1613s autopkgtest [09:04:30]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 1613s autopkgtest [09:04:30]: test pkg-r-autopkgtest: [----------------------- 1636s Test: Try to load the R library matrixStats 1636s 1636s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1636s Copyright (C) 2024 The R Foundation for Statistical Computing 1636s Platform: powerpc64le-unknown-linux-gnu 1636s 1636s R is free software and comes with ABSOLUTELY NO WARRANTY. 1636s You are welcome to redistribute it under certain conditions. 1636s Type 'license()' or 'licence()' for distribution details. 1636s 1636s R is a collaborative project with many contributors. 1636s Type 'contributors()' for more information and 1636s 'citation()' on how to cite R or R packages in publications. 1636s 1636s Type 'demo()' for some demos, 'help()' for on-line help, or 1636s 'help.start()' for an HTML browser interface to help. 1636s Type 'q()' to quit R. 1636s 1636s > library('matrixStats') 1636s > 1636s > 1636s Other tests are currently unsupported! 1636s They will be progressively added. 1700s autopkgtest [09:05:44]: test pkg-r-autopkgtest: -----------------------] 1738s autopkgtest [09:06:35]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 1738s pkg-r-autopkgtest PASS 1739s autopkgtest [09:06:36]: @@@@@@@@@@@@@@@@@@@@ summary 1739s run-unit-test PASS 1739s pkg-r-autopkgtest PASS 1866s Creating nova instance adt-oracular-ppc64el-r-cran-matrixstats-20240524-083737-juju-7f2275-prod-proposed-migration-environment-3-014a47bf-10bd-42c1-bb53-d2ac18ba0068 from image adt/ubuntu-oracular-ppc64el-server-20240509.img (UUID 1c85ce1c-4944-4b4e-a1c6-2159ec573517)... 1866s Creating nova instance adt-oracular-ppc64el-r-cran-matrixstats-20240524-083737-juju-7f2275-prod-proposed-migration-environment-3-014a47bf-10bd-42c1-bb53-d2ac18ba0068 from image adt/ubuntu-oracular-ppc64el-server-20240509.img (UUID 1c85ce1c-4944-4b4e-a1c6-2159ec573517)...