0s autopkgtest [08:21:52]: starting date and time: 2024-05-24 08:21:52+0000 0s autopkgtest [08:21:52]: git checkout: d60bd36 autopkgtest-build-lxd: Add missing remote prefix in get_boot_id(). 0s autopkgtest [08:21:52]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.7n6d0e2n/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_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\n" >> /etc/environment' --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 -- lxd -r lxd-armhf-10.44.124.113 lxd-armhf-10.44.124.113:autopkgtest/ubuntu/oracular/armhf 49s autopkgtest [08:22:41]: testbed dpkg architecture: armhf 52s autopkgtest [08:22:44]: testbed apt version: 2.7.14build2 52s autopkgtest [08:22:44]: @@@@@@@@@@@@@@@@@@@@ test bed setup 54s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 54s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 55s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [53.5 kB] 55s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [497 kB] 55s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 55s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main armhf Packages [112 kB] 55s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf Packages [432 kB] 55s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse armhf Packages [1968 B] 55s Fetched 1176 kB in 1s (946 kB/s) 55s Reading package lists... 79s tee: /proc/self/fd/2: Permission denied 107s Hit:1 http://ftpmaster.internal/ubuntu oracular InRelease 107s Hit:2 http://ftpmaster.internal/ubuntu oracular-updates InRelease 107s Hit:3 http://ftpmaster.internal/ubuntu oracular-security InRelease 107s Hit:4 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 110s Reading package lists... 110s Reading package lists... 111s Building dependency tree... 111s Reading state information... 112s Calculating upgrade... 113s The following package was automatically installed and is no longer required: 113s libatm1t64 113s Use 'apt autoremove' to remove it. 113s The following NEW packages will be installed: 113s python3-jaraco.context python3-jaraco.functools 113s The following packages will be upgraded: 113s apparmor apport apport-core-dump-handler apt apt-utils bash-completion curl 113s dhcpcd-base dpkg dpkg-dev dracut-install eatmydata fwupd gcc-14-base 113s gir1.2-girepository-2.0 gir1.2-glib-2.0 groff-base initramfs-tools 113s initramfs-tools-bin initramfs-tools-core iproute2 klibc-utils less libacl1 113s libapparmor1 libapt-pkg6.0t64 libbpf1 libbsd0 libc-bin libc6 libcap-ng0 113s libcurl3t64-gnutls libcurl4t64 libdpkg-perl libeatmydata1 libelf1t64 113s libevent-core-2.1-7t64 libexpat1 libfwupd2 libgcc-s1 libgcrypt20 113s libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-data libgnutls30t64 113s libgpg-error-l10n libgpg-error0 libklibc liblocale-gettext-perl liblz4-1 113s libnss3 libnvme1t64 libpam-modules libpam-modules-bin libpam-runtime 113s libpam0g libperl5.38t64 libslang2 libsqlite3-0 libstdc++6 libtirpc-common 113s libtirpc3t64 libuv1t64 libxcb1 locales man-db pastebinit perl perl-base 113s perl-modules-5.38 python-apt-common python-babel-localedata python3-apport 113s python3-apt python3-babel python3-blinker python3-httplib2 python3-jinja2 113s python3-keyring python3-problem-report python3-pyparsing python3-six rsync 113s tzdata ubuntu-pro-client ubuntu-pro-client-l10n vim-common vim-tiny xxd 114s 89 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 114s Need to get 48.8 MB of archives. 114s After this operation, 267 kB of additional disk space will be used. 114s Get:1 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-14-base armhf 14.1.0-1ubuntu1 [48.4 kB] 114s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf libgcc-s1 armhf 14.1.0-1ubuntu1 [41.5 kB] 114s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf libstdc++6 armhf 14.1.0-1ubuntu1 [714 kB] 114s Get:4 http://ftpmaster.internal/ubuntu oracular/main armhf libc6 armhf 2.39-0ubuntu8.1 [2828 kB] 114s Get:5 http://ftpmaster.internal/ubuntu oracular/main armhf libgpg-error-l10n all 1.49-2 [8228 B] 114s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf libgpg-error0 armhf 1.49-2 [62.7 kB] 114s Get:7 http://ftpmaster.internal/ubuntu oracular/main armhf libgcrypt20 armhf 1.10.3-3 [454 kB] 114s Get:8 http://ftpmaster.internal/ubuntu oracular/main armhf liblz4-1 armhf 1.9.4-2 [58.0 kB] 114s Get:9 http://ftpmaster.internal/ubuntu oracular/main armhf libapt-pkg6.0t64 armhf 2.9.3 [1013 kB] 114s Get:10 http://ftpmaster.internal/ubuntu oracular/main armhf dpkg armhf 1.22.6ubuntu10 [1230 kB] 114s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf libperl5.38t64 armhf 5.38.2-4 [4102 kB] 115s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf perl armhf 5.38.2-4 [231 kB] 115s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf perl-base armhf 5.38.2-4 [1671 kB] 115s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf perl-modules-5.38 all 5.38.2-4 [3110 kB] 115s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf libc-bin armhf 2.39-0ubuntu8.1 [530 kB] 115s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf apt armhf 2.9.3 [1397 kB] 115s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf apt-utils armhf 2.9.3 [217 kB] 115s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf libgnutls30t64 armhf 3.8.5-2ubuntu1 [958 kB] 115s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf libpam0g armhf 1.5.3-7ubuntu1 [62.3 kB] 115s Get:20 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-modules-bin armhf 1.5.3-7ubuntu1 [47.0 kB] 115s Get:21 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-modules armhf 1.5.3-7ubuntu1 [266 kB] 115s Get:22 http://ftpmaster.internal/ubuntu oracular/main armhf liblocale-gettext-perl armhf 1.07-7 [14.8 kB] 115s Get:23 http://ftpmaster.internal/ubuntu oracular/main armhf libacl1 armhf 2.3.2-2 [15.1 kB] 115s Get:24 http://ftpmaster.internal/ubuntu oracular/main armhf rsync armhf 3.3.0-1 [414 kB] 115s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf python-apt-common all 2.9.0 [20.1 kB] 115s Get:26 http://ftpmaster.internal/ubuntu oracular/main armhf python3-apt armhf 2.9.0 [162 kB] 115s Get:27 http://ftpmaster.internal/ubuntu oracular/main armhf python3-pyparsing all 3.1.2-1 [86.4 kB] 115s Get:28 http://ftpmaster.internal/ubuntu oracular/main armhf python3-httplib2 all 0.22.0-1 [30.4 kB] 115s Get:29 http://ftpmaster.internal/ubuntu oracular/main armhf python3-problem-report all 2.28.1-0ubuntu4 [23.9 kB] 115s Get:30 http://ftpmaster.internal/ubuntu oracular/main armhf python3-apport all 2.28.1-0ubuntu4 [92.1 kB] 115s Get:31 http://ftpmaster.internal/ubuntu oracular/main armhf gir1.2-girepository-2.0 armhf 1.80.1-3 [24.7 kB] 115s Get:32 http://ftpmaster.internal/ubuntu oracular/main armhf gir1.2-glib-2.0 armhf 2.80.2-1ubuntu1 [182 kB] 115s Get:33 http://ftpmaster.internal/ubuntu oracular/main armhf libglib2.0-0t64 armhf 2.80.2-1ubuntu1 [1421 kB] 115s Get:34 http://ftpmaster.internal/ubuntu oracular/main armhf libgirepository-1.0-1 armhf 1.80.1-3 [107 kB] 115s Get:35 http://ftpmaster.internal/ubuntu oracular/main armhf apport-core-dump-handler all 2.28.1-0ubuntu4 [16.9 kB] 115s Get:36 http://ftpmaster.internal/ubuntu oracular/main armhf apport all 2.28.1-0ubuntu4 [83.4 kB] 115s Get:37 http://ftpmaster.internal/ubuntu oracular/main armhf libcap-ng0 armhf 0.8.5-1 [13.6 kB] 115s Get:38 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-runtime all 1.5.3-7ubuntu1 [40.8 kB] 115s Get:39 http://ftpmaster.internal/ubuntu oracular/main armhf dhcpcd-base armhf 1:10.0.6-5 [186 kB] 115s Get:40 http://ftpmaster.internal/ubuntu oracular/main armhf libelf1t64 armhf 0.191-1 [49.8 kB] 115s Get:41 http://ftpmaster.internal/ubuntu oracular/main armhf libbpf1 armhf 1:1.4.1-1 [151 kB] 115s Get:42 http://ftpmaster.internal/ubuntu oracular/main armhf libtirpc-common all 1.3.4+ds-1.3 [8106 B] 115s Get:43 http://ftpmaster.internal/ubuntu oracular/main armhf libtirpc3t64 armhf 1.3.4+ds-1.3 [73.3 kB] 115s Get:44 http://ftpmaster.internal/ubuntu oracular/main armhf iproute2 armhf 6.9.0-1 [1083 kB] 115s Get:45 http://ftpmaster.internal/ubuntu oracular/main armhf less armhf 590-2ubuntu2.1 [131 kB] 115s Get:46 http://ftpmaster.internal/ubuntu oracular/main armhf libapparmor1 armhf 4.0.1-0ubuntu1 [45.5 kB] 115s Get:47 http://ftpmaster.internal/ubuntu oracular/main armhf libbsd0 armhf 0.12.2-1 [36.5 kB] 115s Get:48 http://ftpmaster.internal/ubuntu oracular/main armhf libexpat1 armhf 2.6.2-1 [65.9 kB] 115s Get:49 http://ftpmaster.internal/ubuntu oracular/main armhf libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 115s Get:50 http://ftpmaster.internal/ubuntu oracular/main armhf libslang2 armhf 2.3.3-5 [478 kB] 115s Get:51 http://ftpmaster.internal/ubuntu oracular/main armhf libsqlite3-0 armhf 3.45.3-1 [601 kB] 115s Get:52 http://ftpmaster.internal/ubuntu oracular/main armhf locales all 2.39-0ubuntu8.1 [4234 kB] 115s Get:53 http://ftpmaster.internal/ubuntu oracular/main armhf tzdata all 2024a-4ubuntu1 [274 kB] 115s Get:54 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client-l10n armhf 32.1 [19.4 kB] 115s Get:55 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client armhf 32.1 [230 kB] 115s Get:56 http://ftpmaster.internal/ubuntu oracular/main armhf vim-tiny armhf 2:9.1.0377-1ubuntu1 [670 kB] 115s Get:57 http://ftpmaster.internal/ubuntu oracular/main armhf vim-common all 2:9.1.0377-1ubuntu1 [385 kB] 115s Get:58 http://ftpmaster.internal/ubuntu oracular/main armhf xxd armhf 2:9.1.0377-1ubuntu1 [63.0 kB] 115s Get:59 http://ftpmaster.internal/ubuntu oracular/main armhf apparmor armhf 4.0.1-0ubuntu1 [565 kB] 115s Get:60 http://ftpmaster.internal/ubuntu oracular/main armhf bash-completion all 1:2.14.0-1 [206 kB] 115s Get:61 http://ftpmaster.internal/ubuntu oracular/main armhf groff-base armhf 1.23.0-4 [946 kB] 115s Get:62 http://ftpmaster.internal/ubuntu oracular/main armhf libuv1t64 armhf 1.48.0-4 [83.2 kB] 116s Get:63 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb1 armhf 1.17.0-2 [46.3 kB] 116s Get:64 http://ftpmaster.internal/ubuntu oracular/main armhf man-db armhf 2.12.1-1 [1201 kB] 116s Get:65 http://ftpmaster.internal/ubuntu oracular/main armhf curl armhf 8.5.0-2ubuntu10.1 [219 kB] 116s Get:66 http://ftpmaster.internal/ubuntu oracular/main armhf libcurl4t64 armhf 8.5.0-2ubuntu10.1 [296 kB] 116s Get:67 http://ftpmaster.internal/ubuntu oracular/main armhf dpkg-dev all 1.22.6ubuntu10 [1074 kB] 116s Get:68 http://ftpmaster.internal/ubuntu oracular/main armhf libdpkg-perl all 1.22.6ubuntu10 [269 kB] 116s Get:69 http://ftpmaster.internal/ubuntu oracular/main armhf dracut-install armhf 060+5-8ubuntu1 [34.3 kB] 116s Get:70 http://ftpmaster.internal/ubuntu oracular/main armhf libeatmydata1 armhf 131-2 [7106 B] 116s Get:71 http://ftpmaster.internal/ubuntu oracular/main armhf eatmydata all 131-2 [5576 B] 116s Get:72 http://ftpmaster.internal/ubuntu oracular/main armhf libcurl3t64-gnutls armhf 8.5.0-2ubuntu10.1 [290 kB] 116s Get:73 http://ftpmaster.internal/ubuntu oracular/main armhf libfwupd2 armhf 1.9.20-1 [126 kB] 116s Get:74 http://ftpmaster.internal/ubuntu oracular/main armhf fwupd armhf 1.9.20-1 [4368 kB] 116s Get:75 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools all 0.142ubuntu27 [7898 B] 116s Get:76 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools-core all 0.142ubuntu27 [49.5 kB] 116s Get:77 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools-bin armhf 0.142ubuntu27 [20.9 kB] 116s Get:78 http://ftpmaster.internal/ubuntu oracular/main armhf klibc-utils armhf 2.0.13-4ubuntu1 [93.8 kB] 116s Get:79 http://ftpmaster.internal/ubuntu oracular/main armhf libklibc armhf 2.0.13-4ubuntu1 [45.0 kB] 116s Get:80 http://ftpmaster.internal/ubuntu oracular/main armhf libevent-core-2.1-7t64 armhf 2.1.12-stable-10 [82.5 kB] 116s Get:81 http://ftpmaster.internal/ubuntu oracular/main armhf libnss3 armhf 2:3.100-1 [1331 kB] 116s Get:82 http://ftpmaster.internal/ubuntu oracular/main armhf libnvme1t64 armhf 1.9-1 [69.9 kB] 116s Get:83 http://ftpmaster.internal/ubuntu oracular/main armhf pastebinit all 1.7.0-1 [14.9 kB] 116s Get:84 http://ftpmaster.internal/ubuntu oracular/main armhf python3-babel all 2.14.0-1 [96.4 kB] 116s Get:85 http://ftpmaster.internal/ubuntu oracular/main armhf python-babel-localedata all 2.14.0-1 [6385 kB] 116s Get:86 http://ftpmaster.internal/ubuntu oracular/main armhf python3-blinker all 1.8.2-1 [11.4 kB] 116s Get:87 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jaraco.context all 4.3.0-1 [6994 B] 116s Get:88 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jaraco.functools all 4.0.0-1 [10.7 kB] 116s Get:89 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jinja2 all 3.1.3-1 [107 kB] 116s Get:90 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-keyring all 25.2.1-1 [39.9 kB] 116s Get:91 http://ftpmaster.internal/ubuntu oracular/main armhf python3-six all 1.16.0-6 [13.0 kB] 117s Preconfiguring packages ... 118s Fetched 48.8 MB in 3s (19.0 MB/s) 118s (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 ... 58082 files and directories currently installed.) 118s Preparing to unpack .../gcc-14-base_14.1.0-1ubuntu1_armhf.deb ... 118s Unpacking gcc-14-base:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 118s Setting up gcc-14-base:armhf (14.1.0-1ubuntu1) ... 118s (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 ... 58082 files and directories currently installed.) 118s Preparing to unpack .../libgcc-s1_14.1.0-1ubuntu1_armhf.deb ... 118s Unpacking libgcc-s1:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 118s Setting up libgcc-s1:armhf (14.1.0-1ubuntu1) ... 119s (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 ... 58082 files and directories currently installed.) 119s Preparing to unpack .../libstdc++6_14.1.0-1ubuntu1_armhf.deb ... 119s Unpacking libstdc++6:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 119s Setting up libstdc++6:armhf (14.1.0-1ubuntu1) ... 119s (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 ... 58082 files and directories currently installed.) 119s Preparing to unpack .../libc6_2.39-0ubuntu8.1_armhf.deb ... 119s Unpacking libc6:armhf (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 120s Setting up libc6:armhf (2.39-0ubuntu8.1) ... 121s (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 ... 58082 files and directories currently installed.) 121s Preparing to unpack .../libgpg-error-l10n_1.49-2_all.deb ... 121s Unpacking libgpg-error-l10n (1.49-2) over (1.47-3build2) ... 121s Preparing to unpack .../libgpg-error0_1.49-2_armhf.deb ... 121s Unpacking libgpg-error0:armhf (1.49-2) over (1.47-3build2) ... 121s Setting up libgpg-error0:armhf (1.49-2) ... 121s (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 ... 58082 files and directories currently installed.) 121s Preparing to unpack .../libgcrypt20_1.10.3-3_armhf.deb ... 121s Unpacking libgcrypt20:armhf (1.10.3-3) over (1.10.3-2build1) ... 121s Setting up libgcrypt20:armhf (1.10.3-3) ... 121s (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 ... 58082 files and directories currently installed.) 121s Preparing to unpack .../liblz4-1_1.9.4-2_armhf.deb ... 121s Unpacking liblz4-1:armhf (1.9.4-2) over (1.9.4-1build1) ... 121s Setting up liblz4-1:armhf (1.9.4-2) ... 121s (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 ... 58082 files and directories currently installed.) 121s Preparing to unpack .../libapt-pkg6.0t64_2.9.3_armhf.deb ... 121s Unpacking libapt-pkg6.0t64:armhf (2.9.3) over (2.7.14build2) ... 122s Setting up libapt-pkg6.0t64:armhf (2.9.3) ... 122s (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 ... 58082 files and directories currently installed.) 122s Preparing to unpack .../dpkg_1.22.6ubuntu10_armhf.deb ... 122s Unpacking dpkg (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 122s Setting up dpkg (1.22.6ubuntu10) ... 123s (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 ... 58082 files and directories currently installed.) 123s Preparing to unpack .../libperl5.38t64_5.38.2-4_armhf.deb ... 123s Unpacking libperl5.38t64:armhf (5.38.2-4) over (5.38.2-3.2build2) ... 124s Preparing to unpack .../perl_5.38.2-4_armhf.deb ... 124s Unpacking perl (5.38.2-4) over (5.38.2-3.2build2) ... 124s Preparing to unpack .../perl-base_5.38.2-4_armhf.deb ... 124s Unpacking perl-base (5.38.2-4) over (5.38.2-3.2build2) ... 125s Setting up perl-base (5.38.2-4) ... 125s (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 ... 58082 files and directories currently installed.) 125s Preparing to unpack .../perl-modules-5.38_5.38.2-4_all.deb ... 125s Unpacking perl-modules-5.38 (5.38.2-4) over (5.38.2-3.2build2) ... 126s Preparing to unpack .../libc-bin_2.39-0ubuntu8.1_armhf.deb ... 126s Unpacking libc-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 126s Setting up libc-bin (2.39-0ubuntu8.1) ... 126s (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 ... 58082 files and directories currently installed.) 126s Preparing to unpack .../archives/apt_2.9.3_armhf.deb ... 127s Unpacking apt (2.9.3) over (2.7.14build2) ... 127s Setting up apt (2.9.3) ... 128s (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 ... 58082 files and directories currently installed.) 128s Preparing to unpack .../apt-utils_2.9.3_armhf.deb ... 128s Unpacking apt-utils (2.9.3) over (2.7.14build2) ... 129s Preparing to unpack .../libgnutls30t64_3.8.5-2ubuntu1_armhf.deb ... 129s Unpacking libgnutls30t64:armhf (3.8.5-2ubuntu1) over (3.8.3-1.1ubuntu3) ... 129s Setting up libgnutls30t64:armhf (3.8.5-2ubuntu1) ... 129s (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 ... 58083 files and directories currently installed.) 129s Preparing to unpack .../libpam0g_1.5.3-7ubuntu1_armhf.deb ... 129s Unpacking libpam0g:armhf (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 129s Setting up libpam0g:armhf (1.5.3-7ubuntu1) ... 129s (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 ... 58083 files and directories currently installed.) 129s Preparing to unpack .../libpam-modules-bin_1.5.3-7ubuntu1_armhf.deb ... 129s Unpacking libpam-modules-bin (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 129s Setting up libpam-modules-bin (1.5.3-7ubuntu1) ... 130s pam_namespace.service is a disabled or a static unit not running, not starting it. 130s (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 ... 58083 files and directories currently installed.) 130s Preparing to unpack .../libpam-modules_1.5.3-7ubuntu1_armhf.deb ... 130s Unpacking libpam-modules:armhf (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 131s Setting up libpam-modules:armhf (1.5.3-7ubuntu1) ... 131s (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 ... 58086 files and directories currently installed.) 131s Preparing to unpack .../liblocale-gettext-perl_1.07-7_armhf.deb ... 131s Unpacking liblocale-gettext-perl (1.07-7) over (1.07-6ubuntu5) ... 131s Preparing to unpack .../libacl1_2.3.2-2_armhf.deb ... 131s Unpacking libacl1:armhf (2.3.2-2) over (2.3.2-1build1) ... 131s Setting up libacl1:armhf (2.3.2-2) ... 131s (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 ... 58086 files and directories currently installed.) 131s Preparing to unpack .../00-rsync_3.3.0-1_armhf.deb ... 131s Unpacking rsync (3.3.0-1) over (3.2.7-1ubuntu1) ... 131s Preparing to unpack .../01-python-apt-common_2.9.0_all.deb ... 131s Unpacking python-apt-common (2.9.0) over (2.7.7ubuntu1) ... 131s Preparing to unpack .../02-python3-apt_2.9.0_armhf.deb ... 131s Unpacking python3-apt (2.9.0) over (2.7.7ubuntu1) ... 132s Preparing to unpack .../03-python3-pyparsing_3.1.2-1_all.deb ... 132s Unpacking python3-pyparsing (3.1.2-1) over (3.1.1-1) ... 132s Preparing to unpack .../04-python3-httplib2_0.22.0-1_all.deb ... 132s Unpacking python3-httplib2 (0.22.0-1) over (0.20.4-3) ... 132s Preparing to unpack .../05-python3-problem-report_2.28.1-0ubuntu4_all.deb ... 132s Unpacking python3-problem-report (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 132s Preparing to unpack .../06-python3-apport_2.28.1-0ubuntu4_all.deb ... 132s Unpacking python3-apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 133s Preparing to unpack .../07-gir1.2-girepository-2.0_1.80.1-3_armhf.deb ... 133s Unpacking gir1.2-girepository-2.0:armhf (1.80.1-3) over (1.80.1-1) ... 133s Preparing to unpack .../08-gir1.2-glib-2.0_2.80.2-1ubuntu1_armhf.deb ... 133s Unpacking gir1.2-glib-2.0:armhf (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 133s Preparing to unpack .../09-libglib2.0-0t64_2.80.2-1ubuntu1_armhf.deb ... 133s Unpacking libglib2.0-0t64:armhf (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 133s Preparing to unpack .../10-libgirepository-1.0-1_1.80.1-3_armhf.deb ... 133s Unpacking libgirepository-1.0-1:armhf (1.80.1-3) over (1.80.1-1) ... 133s Preparing to unpack .../11-apport-core-dump-handler_2.28.1-0ubuntu4_all.deb ... 133s Unpacking apport-core-dump-handler (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 133s Preparing to unpack .../12-apport_2.28.1-0ubuntu4_all.deb ... 133s Unpacking apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 133s Preparing to unpack .../13-libcap-ng0_0.8.5-1_armhf.deb ... 133s Unpacking libcap-ng0:armhf (0.8.5-1) over (0.8.4-2build2) ... 134s Setting up libcap-ng0:armhf (0.8.5-1) ... 134s (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 ... 58088 files and directories currently installed.) 134s Preparing to unpack .../libpam-runtime_1.5.3-7ubuntu1_all.deb ... 134s Unpacking libpam-runtime (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 134s Setting up libpam-runtime (1.5.3-7ubuntu1) ... 135s (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 ... 58088 files and directories currently installed.) 135s Preparing to unpack .../00-dhcpcd-base_1%3a10.0.6-5_armhf.deb ... 135s Unpacking dhcpcd-base (1:10.0.6-5) over (1:10.0.6-1ubuntu3) ... 135s Preparing to unpack .../01-libelf1t64_0.191-1_armhf.deb ... 135s Unpacking libelf1t64:armhf (0.191-1) over (0.190-1.1build4) ... 135s Preparing to unpack .../02-libbpf1_1%3a1.4.1-1_armhf.deb ... 135s Unpacking libbpf1:armhf (1:1.4.1-1) over (1:1.3.0-2build2) ... 135s Preparing to unpack .../03-libtirpc-common_1.3.4+ds-1.3_all.deb ... 135s Unpacking libtirpc-common (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 135s Preparing to unpack .../04-libtirpc3t64_1.3.4+ds-1.3_armhf.deb ... 135s Unpacking libtirpc3t64:armhf (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 135s Preparing to unpack .../05-iproute2_6.9.0-1_armhf.deb ... 136s Unpacking iproute2 (6.9.0-1) over (6.1.0-1ubuntu6) ... 136s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_tables.d': Directory not empty 136s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_protos.d': Directory not empty 136s dpkg: warning: unable to delete old directory '/etc/iproute2': Directory not empty 136s Preparing to unpack .../06-less_590-2ubuntu2.1_armhf.deb ... 136s Unpacking less (590-2ubuntu2.1) over (590-2ubuntu2) ... 136s Preparing to unpack .../07-libapparmor1_4.0.1-0ubuntu1_armhf.deb ... 136s Unpacking libapparmor1:armhf (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 136s Preparing to unpack .../08-libbsd0_0.12.2-1_armhf.deb ... 136s Unpacking libbsd0:armhf (0.12.2-1) over (0.12.1-1build1) ... 136s Preparing to unpack .../09-libexpat1_2.6.2-1_armhf.deb ... 136s Unpacking libexpat1:armhf (2.6.2-1) over (2.6.1-2build1) ... 136s Preparing to unpack .../10-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 136s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 136s Preparing to unpack .../11-libslang2_2.3.3-5_armhf.deb ... 136s Unpacking libslang2:armhf (2.3.3-5) over (2.3.3-3build2) ... 136s Preparing to unpack .../12-libsqlite3-0_3.45.3-1_armhf.deb ... 136s Unpacking libsqlite3-0:armhf (3.45.3-1) over (3.45.1-1ubuntu2) ... 137s Preparing to unpack .../13-locales_2.39-0ubuntu8.1_all.deb ... 137s Unpacking locales (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 137s Preparing to unpack .../14-tzdata_2024a-4ubuntu1_all.deb ... 137s Unpacking tzdata (2024a-4ubuntu1) over (2024a-2ubuntu1) ... 138s Preparing to unpack .../15-ubuntu-pro-client-l10n_32.1_armhf.deb ... 138s Unpacking ubuntu-pro-client-l10n (32.1) over (31.2.3) ... 138s Preparing to unpack .../16-ubuntu-pro-client_32.1_armhf.deb ... 138s Unpacking ubuntu-pro-client (32.1) over (31.2.3) ... 138s Preparing to unpack .../17-vim-tiny_2%3a9.1.0377-1ubuntu1_armhf.deb ... 138s Unpacking vim-tiny (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 138s Preparing to unpack .../18-vim-common_2%3a9.1.0377-1ubuntu1_all.deb ... 138s Unpacking vim-common (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 139s Preparing to unpack .../19-xxd_2%3a9.1.0377-1ubuntu1_armhf.deb ... 139s Unpacking xxd (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 139s Preparing to unpack .../20-apparmor_4.0.1-0ubuntu1_armhf.deb ... 140s Unpacking apparmor (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 141s Preparing to unpack .../21-bash-completion_1%3a2.14.0-1_all.deb ... 141s Unpacking bash-completion (1:2.14.0-1) over (1:2.11-8) ... 142s Preparing to unpack .../22-groff-base_1.23.0-4_armhf.deb ... 142s Unpacking groff-base (1.23.0-4) over (1.23.0-3build2) ... 142s Preparing to unpack .../23-libuv1t64_1.48.0-4_armhf.deb ... 142s Unpacking libuv1t64:armhf (1.48.0-4) over (1.48.0-1.1build1) ... 142s Preparing to unpack .../24-libxcb1_1.17.0-2_armhf.deb ... 142s Unpacking libxcb1:armhf (1.17.0-2) over (1.15-1ubuntu2) ... 142s Preparing to unpack .../25-man-db_2.12.1-1_armhf.deb ... 142s Unpacking man-db (2.12.1-1) over (2.12.0-4build2) ... 142s Preparing to unpack .../26-curl_8.5.0-2ubuntu10.1_armhf.deb ... 142s Unpacking curl (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 142s Preparing to unpack .../27-libcurl4t64_8.5.0-2ubuntu10.1_armhf.deb ... 142s Unpacking libcurl4t64:armhf (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 143s Preparing to unpack .../28-dpkg-dev_1.22.6ubuntu10_all.deb ... 143s Unpacking dpkg-dev (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 143s Preparing to unpack .../29-libdpkg-perl_1.22.6ubuntu10_all.deb ... 143s Unpacking libdpkg-perl (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 143s Preparing to unpack .../30-dracut-install_060+5-8ubuntu1_armhf.deb ... 143s Unpacking dracut-install (060+5-8ubuntu1) over (060+5-1ubuntu3) ... 143s Preparing to unpack .../31-libeatmydata1_131-2_armhf.deb ... 143s Unpacking libeatmydata1:armhf (131-2) over (131-1ubuntu1) ... 143s Preparing to unpack .../32-eatmydata_131-2_all.deb ... 143s Unpacking eatmydata (131-2) over (131-1ubuntu1) ... 143s Preparing to unpack .../33-libcurl3t64-gnutls_8.5.0-2ubuntu10.1_armhf.deb ... 143s Unpacking libcurl3t64-gnutls:armhf (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 143s Preparing to unpack .../34-libfwupd2_1.9.20-1_armhf.deb ... 143s Unpacking libfwupd2:armhf (1.9.20-1) over (1.9.16-1) ... 143s Preparing to unpack .../35-fwupd_1.9.20-1_armhf.deb ... 144s Unpacking fwupd (1.9.20-1) over (1.9.16-1) ... 144s Preparing to unpack .../36-initramfs-tools_0.142ubuntu27_all.deb ... 144s Unpacking initramfs-tools (0.142ubuntu27) over (0.142ubuntu25) ... 144s Preparing to unpack .../37-initramfs-tools-core_0.142ubuntu27_all.deb ... 144s Unpacking initramfs-tools-core (0.142ubuntu27) over (0.142ubuntu25) ... 144s Preparing to unpack .../38-initramfs-tools-bin_0.142ubuntu27_armhf.deb ... 144s Unpacking initramfs-tools-bin (0.142ubuntu27) over (0.142ubuntu25) ... 144s Preparing to unpack .../39-klibc-utils_2.0.13-4ubuntu1_armhf.deb ... 144s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 144s Preparing to unpack .../40-libklibc_2.0.13-4ubuntu1_armhf.deb ... 144s Unpacking libklibc:armhf (2.0.13-4ubuntu1) over (2.0.13-4) ... 144s Preparing to unpack .../41-libevent-core-2.1-7t64_2.1.12-stable-10_armhf.deb ... 144s Unpacking libevent-core-2.1-7t64:armhf (2.1.12-stable-10) over (2.1.12-stable-9ubuntu2) ... 145s Preparing to unpack .../42-libnss3_2%3a3.100-1_armhf.deb ... 145s Unpacking libnss3:armhf (2:3.100-1) over (2:3.98-1build1) ... 145s Preparing to unpack .../43-libnvme1t64_1.9-1_armhf.deb ... 145s Unpacking libnvme1t64 (1.9-1) over (1.8-3build1) ... 145s Preparing to unpack .../44-pastebinit_1.7.0-1_all.deb ... 145s Unpacking pastebinit (1.7.0-1) over (1.6.2-1) ... 145s Preparing to unpack .../45-python3-babel_2.14.0-1_all.deb ... 145s Unpacking python3-babel (2.14.0-1) over (2.10.3-3build1) ... 145s Preparing to unpack .../46-python-babel-localedata_2.14.0-1_all.deb ... 145s Unpacking python-babel-localedata (2.14.0-1) over (2.10.3-3build1) ... 146s Preparing to unpack .../47-python3-blinker_1.8.2-1_all.deb ... 146s Unpacking python3-blinker (1.8.2-1) over (1.8.1-1) ... 146s Selecting previously unselected package python3-jaraco.context. 146s Preparing to unpack .../48-python3-jaraco.context_4.3.0-1_all.deb ... 146s Unpacking python3-jaraco.context (4.3.0-1) ... 146s Selecting previously unselected package python3-jaraco.functools. 146s Preparing to unpack .../49-python3-jaraco.functools_4.0.0-1_all.deb ... 146s Unpacking python3-jaraco.functools (4.0.0-1) ... 146s Preparing to unpack .../50-python3-jinja2_3.1.3-1_all.deb ... 147s Unpacking python3-jinja2 (3.1.3-1) over (3.1.2-1ubuntu1) ... 147s Preparing to unpack .../51-python3-keyring_25.2.1-1_all.deb ... 147s Unpacking python3-keyring (25.2.1-1) over (24.3.1-1) ... 147s Preparing to unpack .../52-python3-six_1.16.0-6_all.deb ... 147s Unpacking python3-six (1.16.0-6) over (1.16.0-4) ... 147s Setting up libexpat1:armhf (2.6.2-1) ... 147s Setting up libapparmor1:armhf (4.0.1-0ubuntu1) ... 147s Setting up libxcb1:armhf (1.17.0-2) ... 147s Setting up apt-utils (2.9.3) ... 147s Setting up python3-jaraco.functools (4.0.0-1) ... 147s Setting up python3-jaraco.context (4.3.0-1) ... 148s Setting up libcurl4t64:armhf (8.5.0-2ubuntu10.1) ... 148s Setting up python3-problem-report (2.28.1-0ubuntu4) ... 148s Setting up libtirpc-common (1.3.4+ds-1.3) ... 148s Setting up libsqlite3-0:armhf (3.45.3-1) ... 148s Setting up libuv1t64:armhf (1.48.0-4) ... 148s Setting up libcurl3t64-gnutls:armhf (8.5.0-2ubuntu10.1) ... 148s Setting up less (590-2ubuntu2.1) ... 148s Setting up pastebinit (1.7.0-1) ... 148s Setting up libnss3:armhf (2:3.100-1) ... 148s Setting up locales (2.39-0ubuntu8.1) ... 149s Generating locales (this might take a while)... 155s en_US.UTF-8... done 155s Generation complete. 155s Setting up xxd (2:9.1.0377-1ubuntu1) ... 155s Setting up libelf1t64:armhf (0.191-1) ... 155s Setting up python-babel-localedata (2.14.0-1) ... 155s Setting up tzdata (2024a-4ubuntu1) ... 155s 155s Current default time zone: 'Etc/UTC' 155s Local time is now: Fri May 24 08:24:27 UTC 2024. 155s Universal Time is now: Fri May 24 08:24:27 UTC 2024. 155s Run 'dpkg-reconfigure tzdata' if you wish to change it. 155s 155s Setting up python3-six (1.16.0-6) ... 156s Setting up apparmor (4.0.1-0ubuntu1) ... 156s Installing new version of config file /etc/apparmor.d/abstractions/authentication ... 156s Installing new version of config file /etc/apparmor.d/abstractions/samba ... 156s Installing new version of config file /etc/apparmor.d/firefox ... 156s apparmor_parser: Unable to replace "lsb_release". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 156s 156s apparmor_parser: Unable to replace "kmod". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 156s 156s apparmor_parser: Unable to replace "nvidia_modprobe". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 156s 158s Reloading AppArmor profiles 158s /sbin/apparmor_parser: Unable to replace "1password". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "Discord". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "MongoDB Compass". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "balena-etcher". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "brave". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "buildah". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "busybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "cam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "ch-checkns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "ch-run". /sbin/apparmor_parser: Unable to replace "vscode". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "chrome". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "crun". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "devhelp". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "element-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "epiphany". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "evolution". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "firefox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "flatpak". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "foliate". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "bwrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "geary". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "github-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "goldendict". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "ipa_verify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "kchmviewer". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "keybase". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "libcamerify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "linux-sandbox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lc-compliance". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "loupe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-create". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-destroy". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-stop". /sbin/apparmor_parser: Unable to replace "lxc-execute". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-usernsexec". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "mmdebstrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "msedge". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "nautilus". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "notepadqq". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-unshare". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "obsidian". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lxc-attach". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "opam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "opera". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "pageedit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "qcam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "privacybrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "qutebrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "qmapshack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "rpm". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "runc". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "rssguard". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "polypane". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "podman". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-abort". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-adduser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "rootlesskit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-clean". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-createchroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-destroychroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "plasmashell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-distupgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-shell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-apt". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-unhold". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-update". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-upgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "scide". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-checkpackages". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "sbuild-hold". /sbin/apparmor_parser: Unable to replace "signal-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "steam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "stress-ng". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "slack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "thunderbird". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "toybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "systemd-coredump". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "surfshark". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "trinity". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "slirp4netns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "tup". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "tuxedo-control-center". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "unprivileged_userns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "lsb_release". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "kmod". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "nvidia_modprobe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "userbindmount". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "uwsgi-core". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "vdens". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "virtiofsd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "vivaldi-bin". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "vpnns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "wike". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "wpcom". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "unix-chkpwd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "ubuntu_pro_apt_news". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "/usr/bin/man". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "/usr/lib/NetworkManager/nm-dhcp-client.action". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "rsyslogd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 158s /sbin/apparmor_parser: Unable to replace "tcpdump". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 158s 159s /sbin/apparmor_parser: Unable to replace "transmission-cli". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 159s 159s Error: At least one profile failed to load 159s Setting up libklibc:armhf (2.0.13-4ubuntu1) ... 159s Setting up python3-jinja2 (3.1.3-1) ... 160s Setting up libglib2.0-0t64:armhf (2.80.2-1ubuntu1) ... 160s No schema files found: doing nothing. 160s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 160s Setting up vim-common (2:9.1.0377-1ubuntu1) ... 160s Setting up libslang2:armhf (2.3.3-5) ... 160s Setting up python3-pyparsing (3.1.2-1) ... 160s Setting up libnvme1t64 (1.9-1) ... 160s Setting up bash-completion (1:2.14.0-1) ... 160s Installing new version of config file /etc/profile.d/bash_completion.sh ... 160s Setting up perl-modules-5.38 (5.38.2-4) ... 160s Setting up dhcpcd-base (1:10.0.6-5) ... 160s Setting up gir1.2-glib-2.0:armhf (2.80.2-1ubuntu1) ... 160s Setting up python-apt-common (2.9.0) ... 160s Setting up dracut-install (060+5-8ubuntu1) ... 160s Setting up groff-base (1.23.0-4) ... 160s Setting up libeatmydata1:armhf (131-2) ... 160s Setting up python3-keyring (25.2.1-1) ... 161s Setting up python3-httplib2 (0.22.0-1) ... 161s Setting up libgirepository-1.0-1:armhf (1.80.1-3) ... 161s Setting up libevent-core-2.1-7t64:armhf (2.1.12-stable-10) ... 161s Setting up curl (8.5.0-2ubuntu10.1) ... 161s Setting up libperl5.38t64:armhf (5.38.2-4) ... 161s Setting up klibc-utils (2.0.13-4ubuntu1) ... 161s Setting up libbsd0:armhf (0.12.2-1) ... 161s Setting up libgpg-error-l10n (1.49-2) ... 161s Setting up liblocale-gettext-perl (1.07-7) ... 161s Setting up libbpf1:armhf (1:1.4.1-1) ... 161s Setting up rsync (3.3.0-1) ... 162s rsync.service is a disabled or a static unit not running, not starting it. 162s Setting up initramfs-tools-bin (0.142ubuntu27) ... 162s Setting up python3-blinker (1.8.2-1) ... 163s Setting up eatmydata (131-2) ... 163s Setting up libtirpc3t64:armhf (1.3.4+ds-1.3) ... 163s Setting up python3-babel (2.14.0-1) ... 163s Setting up python3-apt (2.9.0) ... 164s Setting up iproute2 (6.9.0-1) ... 164s Removing obsolete conffile /etc/iproute2/group ... 164s Removing obsolete conffile /etc/iproute2/rt_realms ... 164s Removing obsolete conffile /etc/iproute2/rt_scopes ... 164s Removing obsolete conffile /etc/iproute2/rt_tables ... 164s Removing obsolete conffile /etc/iproute2/rt_tables.d/README ... 164s Removing obsolete conffile /etc/iproute2/rt_protos.d/README ... 164s Removing obsolete conffile /etc/iproute2/rt_protos ... 164s Removing obsolete conffile /etc/iproute2/rt_dsfield ... 164s Removing obsolete conffile /etc/iproute2/nl_protos ... 164s Removing obsolete conffile /etc/iproute2/ematch_map ... 164s Removing obsolete conffile /etc/iproute2/bpf_pinning ... 164s Setting up libfwupd2:armhf (1.9.20-1) ... 164s Setting up vim-tiny (2:9.1.0377-1ubuntu1) ... 164s Setting up man-db (2.12.1-1) ... 164s Updating database of manual pages ... 167s apparmor_parser: Unable to replace "/usr/bin/man". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 167s 168s man-db.service is a disabled or a static unit not running, not starting it. 168s Setting up python3-apport (2.28.1-0ubuntu4) ... 168s Setting up perl (5.38.2-4) ... 168s Setting up gir1.2-girepository-2.0:armhf (1.80.1-3) ... 168s Setting up libdpkg-perl (1.22.6ubuntu10) ... 168s Setting up initramfs-tools-core (0.142ubuntu27) ... 168s Setting up ubuntu-pro-client (32.1) ... 168s Installing new version of config file /etc/apparmor.d/ubuntu_pro_apt_news ... 169s apparmor_parser: Unable to replace "ubuntu_pro_apt_news". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 169s 170s apparmor_parser: Unable to replace "apt_methods". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 170s 170s apparmor_parser: Unable to replace "ubuntu_pro_esm_cache". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 170s 172s Setting up fwupd (1.9.20-1) ... 173s fwupd-offline-update.service is a disabled or a static unit not running, not starting it. 173s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 174s fwupd.service is a disabled or a static unit not running, not starting it. 174s Setting up ubuntu-pro-client-l10n (32.1) ... 174s Setting up initramfs-tools (0.142ubuntu27) ... 174s update-initramfs: deferring update (trigger activated) 174s Setting up dpkg-dev (1.22.6ubuntu10) ... 174s Setting up apport-core-dump-handler (2.28.1-0ubuntu4) ... 175s Setting up apport (2.28.1-0ubuntu4) ... 175s Installing new version of config file /etc/apport/crashdb.conf ... 177s apport-autoreport.service is a disabled or a static unit not running, not starting it. 177s Processing triggers for dbus (1.14.10-4ubuntu4) ... 177s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 177s Processing triggers for initramfs-tools (0.142ubuntu27) ... 179s Reading package lists... 180s Building dependency tree... 180s Reading state information... 181s The following packages will be REMOVED: 181s libatm1t64* 182s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 182s After this operation, 94.2 kB disk space will be freed. 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 ... 58570 files and directories currently installed.) 182s Removing libatm1t64:armhf (1:2.5.1-5.1build1) ... 182s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 185s autopkgtest [08:24:57]: rebooting testbed after setup commands that affected boot 231s autopkgtest [08:25:43]: testbed running kernel: Linux 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 15:13:37 UTC 2024 262s autopkgtest [08:26:14]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-matrixstats 274s Get:1 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (dsc) [2230 B] 274s Get:2 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (tar) [211 kB] 274s Get:3 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (diff) [4752 B] 274s gpgv: Signature made Mon Jan 8 21:38:59 2024 UTC 274s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 274s gpgv: issuer "tille@debian.org" 274s gpgv: Can't check signature: No public key 274s dpkg-source: warning: cannot verify inline signature for ./r-cran-matrixstats_1.2.0-1.dsc: no acceptable signature found 274s autopkgtest [08:26:26]: testing package r-cran-matrixstats version 1.2.0-1 276s autopkgtest [08:26:28]: build not needed 284s autopkgtest [08:26:36]: test run-unit-test: preparing testbed 294s Reading package lists... 295s Building dependency tree... 295s Reading state information... 296s Starting pkgProblemResolver with broken count: 0 296s Starting 2 pkgProblemResolver with broken count: 0 296s Done 297s The following additional packages will be installed: 297s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono 297s fonts-glyphicons-halflings fonts-mathjax libblas3 libcairo2 libdatrie1 297s libdeflate0 libfontconfig1 libfreetype6 libgfortran5 libgomp1 libgraphite2-3 297s libharfbuzz0b libice6 libjbig0 libjpeg-turbo8 libjpeg8 libjs-bootstrap 297s libjs-highlight.js libjs-jquery libjs-jquery-datatables libjs-mathjax 297s liblapack3 liblerc4 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 297s libpaper-utils libpaper1 libpixman-1-0 libsharpyuv0 libsm6 libtcl8.6 297s libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 libxcb-shm0 297s libxft2 libxrender1 libxss1 libxt6t64 node-normalize.css r-base-core 297s r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 297s r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 297s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 297s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 297s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 297s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 297s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 297s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 297s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 297s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 297s Suggested packages: 297s fonts-mathjax-extras fonts-stix libjs-mathjax-doc tk8.6 libjs-html5shiv 297s elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html r-cran-kernsmooth 297s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 297s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 297s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 297s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 297s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-cairo 297s r-cran-codetools r-cran-bench r-cran-blob r-cran-brio r-cran-callr 297s r-cran-crayon r-cran-here r-cran-hms r-cran-htmltools r-cran-pkgbuild 297s r-cran-pkgload r-cran-purrr r-cran-tidyr tcl-tclreadline 297s Recommended packages: 297s javascript-common r-recommended r-base-dev r-doc-html r-cran-callr 297s r-cran-covr r-cran-crayon r-cran-htmltools r-cran-htmlwidgets r-cran-mockery 297s r-cran-processx r-cran-ps r-cran-rmarkdown r-cran-rprojroot 297s r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl r-cran-xml2 297s r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc r-cran-mapproj 297s r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg r-cran-ragg 297s r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 297s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 297s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 297s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 297s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 297s r-cran-lubridate libjs-remark-slide r-cran-fs r-cran-usethis r-cran-bit64 297s r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table r-cran-mockr 297s r-cran-formattable r-cran-generics r-cran-pkgdown r-cran-zeallot r-cran-mime 297s r-cran-remotes r-cran-renv r-cran-jsonlite r-cran-runit 297s libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl x11-utils 297s x11-xserver-utils 297s The following NEW packages will be installed: 297s autopkgtest-satdep fontconfig fontconfig-config fonts-dejavu-core 297s fonts-dejavu-mono fonts-glyphicons-halflings fonts-mathjax libblas3 297s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libfreetype6 libgfortran5 297s libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 libjpeg-turbo8 297s libjpeg8 libjs-bootstrap libjs-highlight.js libjs-jquery 297s libjs-jquery-datatables libjs-mathjax liblapack3 liblerc4 libpango-1.0-0 297s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 297s libsharpyuv0 libsm6 libtcl8.6 libthai-data libthai0 libtiff6 libtk8.6 297s libwebp7 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 297s node-normalize.css r-base-core r-cran-base64enc r-cran-cli r-cran-colorspace 297s r-cran-commonmark r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver 297s r-cran-ggplot2 r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband 297s r-cran-knitr r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 297s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 297s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 297s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 297s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 297s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 297s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 297s 0 upgraded, 100 newly installed, 0 to remove and 0 not upgraded. 297s Need to get 82.3 MB/82.3 MB of archives. 297s After this operation, 175 MB of additional disk space will be used. 297s Get:1 /tmp/autopkgtest.nMUE6C/1-autopkgtest-satdep.deb autopkgtest-satdep armhf 0 [760 B] 298s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf libfreetype6 armhf 2.13.2+dfsg-1build3 [331 kB] 298s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-dejavu-mono all 2.37-8 [502 kB] 298s Get:4 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-dejavu-core all 2.37-8 [835 kB] 298s Get:5 http://ftpmaster.internal/ubuntu oracular/main armhf fontconfig-config armhf 2.15.0-1.1ubuntu2 [37.4 kB] 298s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf libfontconfig1 armhf 2.15.0-1.1ubuntu2 [113 kB] 298s Get:7 http://ftpmaster.internal/ubuntu oracular/main armhf fontconfig armhf 2.15.0-1.1ubuntu2 [189 kB] 298s Get:8 http://ftpmaster.internal/ubuntu oracular/universe armhf fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 298s Get:9 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 298s Get:10 http://ftpmaster.internal/ubuntu oracular/main armhf libblas3 armhf 3.12.0-3build1 [123 kB] 298s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf libpixman-1-0 armhf 0.42.2-1build1 [193 kB] 298s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb-render0 armhf 1.17.0-2 [15.3 kB] 298s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb-shm0 armhf 1.17.0-2 [5774 B] 298s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf libxrender1 armhf 1:0.9.10-1.1build1 [16.0 kB] 298s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf libcairo2 armhf 1.18.0-3build1 [482 kB] 298s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf libdatrie1 armhf 0.2.13-3build1 [15.7 kB] 298s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf libdeflate0 armhf 1.20-1 [38.3 kB] 298s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf libgfortran5 armhf 14.1.0-1ubuntu1 [311 kB] 298s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf libgomp1 armhf 14.1.0-1ubuntu1 [125 kB] 298s Get:20 http://ftpmaster.internal/ubuntu oracular/main armhf libgraphite2-3 armhf 1.3.14-2build1 [64.6 kB] 298s Get:21 http://ftpmaster.internal/ubuntu oracular/main armhf libharfbuzz0b armhf 8.3.0-2build2 [446 kB] 298s Get:22 http://ftpmaster.internal/ubuntu oracular/main armhf x11-common all 1:7.7+23ubuntu3 [21.7 kB] 298s Get:23 http://ftpmaster.internal/ubuntu oracular/main armhf libice6 armhf 2:1.0.10-1build3 [35.4 kB] 298s Get:24 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg-turbo8 armhf 2.1.5-2ubuntu2 [125 kB] 298s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg8 armhf 8c-2ubuntu11 [2148 B] 298s Get:26 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 298s Get:27 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 298s Get:28 http://ftpmaster.internal/ubuntu oracular/main armhf libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 299s Get:29 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 299s Get:30 http://ftpmaster.internal/ubuntu oracular/main armhf liblapack3 armhf 3.12.0-3build1 [2085 kB] 299s Get:31 http://ftpmaster.internal/ubuntu oracular/main armhf liblerc4 armhf 4.0.0+ds-4ubuntu2 [151 kB] 299s Get:32 http://ftpmaster.internal/ubuntu oracular/main armhf libthai-data all 0.1.29-2build1 [158 kB] 299s Get:33 http://ftpmaster.internal/ubuntu oracular/main armhf libthai0 armhf 0.1.29-2build1 [15.2 kB] 299s Get:34 http://ftpmaster.internal/ubuntu oracular/main armhf libpango-1.0-0 armhf 1.52.2+ds-1 [209 kB] 299s Get:35 http://ftpmaster.internal/ubuntu oracular/main armhf libpangoft2-1.0-0 armhf 1.52.2+ds-1 [36.4 kB] 299s Get:36 http://ftpmaster.internal/ubuntu oracular/main armhf libpangocairo-1.0-0 armhf 1.52.2+ds-1 [24.9 kB] 299s Get:37 http://ftpmaster.internal/ubuntu oracular/main armhf libpaper1 armhf 1.1.29build1 [12.6 kB] 299s Get:38 http://ftpmaster.internal/ubuntu oracular/main armhf libpaper-utils armhf 1.1.29build1 [8184 B] 299s Get:39 http://ftpmaster.internal/ubuntu oracular/main armhf libsharpyuv0 armhf 1.4.0-0.1 [16.3 kB] 299s Get:40 http://ftpmaster.internal/ubuntu oracular/main armhf libsm6 armhf 2:1.2.3-1build3 [14.1 kB] 299s Get:41 http://ftpmaster.internal/ubuntu oracular/main armhf libtcl8.6 armhf 8.6.14+dfsg-1build1 [903 kB] 299s Get:42 http://ftpmaster.internal/ubuntu oracular/main armhf libjbig0 armhf 2.1-6.1ubuntu2 [24.9 kB] 299s Get:43 http://ftpmaster.internal/ubuntu oracular/main armhf libwebp7 armhf 1.4.0-0.1 [184 kB] 299s Get:44 http://ftpmaster.internal/ubuntu oracular/main armhf libtiff6 armhf 4.5.1+git230720-4ubuntu2 [178 kB] 299s Get:45 http://ftpmaster.internal/ubuntu oracular/main armhf libxft2 armhf 2.3.6-1build1 [37.4 kB] 299s Get:46 http://ftpmaster.internal/ubuntu oracular/main armhf libxss1 armhf 1:1.2.3-1build3 [6500 B] 299s Get:47 http://ftpmaster.internal/ubuntu oracular/main armhf libtk8.6 armhf 8.6.14-1build1 [681 kB] 299s Get:48 http://ftpmaster.internal/ubuntu oracular/main armhf libxt6t64 armhf 1:1.2.1-1.2build1 [145 kB] 299s Get:49 http://ftpmaster.internal/ubuntu oracular/universe armhf node-normalize.css all 8.0.1-5 [10.8 kB] 299s Get:50 http://ftpmaster.internal/ubuntu oracular/main armhf zip armhf 3.0-13build1 [163 kB] 299s Get:51 http://ftpmaster.internal/ubuntu oracular/main armhf unzip armhf 6.0-28ubuntu4 [163 kB] 299s Get:52 http://ftpmaster.internal/ubuntu oracular/main armhf xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 299s Get:53 http://ftpmaster.internal/ubuntu oracular/universe armhf r-base-core armhf 4.4.0-2 [28.1 MB] 300s Get:54 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-base64enc armhf 0.1-3-3 [27.3 kB] 300s Get:55 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-cli armhf 3.6.2-1 [1363 kB] 300s Get:56 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-colorspace armhf 2.1-0+dfsg-1 [1538 kB] 300s Get:57 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-commonmark armhf 1.9.1-1 [110 kB] 300s Get:58 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-digest armhf 0.6.35-1 [202 kB] 300s Get:59 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-evaluate all 0.23-1 [90.2 kB] 300s Get:60 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-fansi armhf 1.0.5-1 [611 kB] 300s Get:61 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-farver armhf 2.1.1-2 [1353 kB] 300s Get:62 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-glue armhf 1.7.0-1 [153 kB] 300s Get:63 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-rlang armhf 1.1.3-1 [1658 kB] 300s Get:64 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 300s Get:65 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 300s Get:66 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-isoband armhf 0.2.7-1 [1477 kB] 300s Get:67 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-mass armhf 7.3-60.0.1-1 [1118 kB] 300s Get:68 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-lattice armhf 0.22-6-1 [1363 kB] 300s Get:69 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-nlme armhf 3.1.164-1build1 [2248 kB] 300s Get:70 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-matrix armhf 1.6-5-1 [3762 kB] 301s Get:71 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-mgcv armhf 1.9-1-1 [3205 kB] 301s Get:72 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-labeling all 0.4.3-1 [62.1 kB] 301s Get:73 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-munsell all 0.5.0-2build1 [208 kB] 301s Get:74 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r6 all 2.5.1-1 [99.0 kB] 301s Get:75 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 301s Get:76 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-viridislite all 0.4.2-2 [1088 kB] 301s Get:77 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-scales all 1.3.0-1 [603 kB] 301s Get:78 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-magrittr armhf 2.0.3-1 [154 kB] 301s Get:79 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-utf8 armhf 1.2.4-1 [136 kB] 301s Get:80 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-vctrs armhf 0.6.5-1 [1310 kB] 301s Get:81 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 301s Get:82 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 301s Get:83 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-tibble armhf 3.2.1+dfsg-2 [415 kB] 301s Get:84 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-withr all 2.5.0-1 [225 kB] 301s Get:85 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 301s Get:86 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-xfun armhf 0.44+dfsg-1 [517 kB] 301s Get:87 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-highr all 0.10+dfsg-2 [38.5 kB] 301s Get:88 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-yaml armhf 2.3.8-2 [100 kB] 301s Get:89 http://ftpmaster.internal/ubuntu oracular/main armhf libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 301s Get:90 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-knitr all 1.46+dfsg-1 [911 kB] 301s Get:91 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-markdown all 1.12+dfsg-2 [179 kB] 301s Get:92 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-matrixstats armhf 1.2.0-1 [478 kB] 301s Get:93 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.methodss3 all 1.8.2-1 [84.0 kB] 301s Get:94 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.oo all 1.26.0-1 [955 kB] 301s Get:95 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.utils all 2.12.3-1 [1386 kB] 301s Get:96 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.cache all 0.16.0-1 [113 kB] 301s Get:97 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.devices all 2.17.2+ds-1 [398 kB] 301s Get:98 http://ftpmaster.internal/ubuntu oracular/main armhf tcl8.6 armhf 8.6.14+dfsg-1build1 [14.6 kB] 301s Get:99 http://ftpmaster.internal/ubuntu oracular/main armhf tcl armhf 8.6.14build1 [4124 B] 301s Get:100 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r.rsp all 0.46.0+ds-1 [1412 kB] 303s Preconfiguring packages ... 303s Fetched 82.3 MB in 4s (20.7 MB/s) 303s Selecting previously unselected package libfreetype6:armhf. 303s (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 ... 58565 files and directories currently installed.) 303s Preparing to unpack .../00-libfreetype6_2.13.2+dfsg-1build3_armhf.deb ... 303s Unpacking libfreetype6:armhf (2.13.2+dfsg-1build3) ... 303s Selecting previously unselected package fonts-dejavu-mono. 303s Preparing to unpack .../01-fonts-dejavu-mono_2.37-8_all.deb ... 303s Unpacking fonts-dejavu-mono (2.37-8) ... 303s Selecting previously unselected package fonts-dejavu-core. 303s Preparing to unpack .../02-fonts-dejavu-core_2.37-8_all.deb ... 303s Unpacking fonts-dejavu-core (2.37-8) ... 303s Selecting previously unselected package fontconfig-config. 303s Preparing to unpack .../03-fontconfig-config_2.15.0-1.1ubuntu2_armhf.deb ... 304s Unpacking fontconfig-config (2.15.0-1.1ubuntu2) ... 304s Selecting previously unselected package libfontconfig1:armhf. 304s Preparing to unpack .../04-libfontconfig1_2.15.0-1.1ubuntu2_armhf.deb ... 304s Unpacking libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 304s Selecting previously unselected package fontconfig. 304s Preparing to unpack .../05-fontconfig_2.15.0-1.1ubuntu2_armhf.deb ... 304s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 304s Selecting previously unselected package fonts-glyphicons-halflings. 304s Preparing to unpack .../06-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 304s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 304s Selecting previously unselected package fonts-mathjax. 304s Preparing to unpack .../07-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 304s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 304s Selecting previously unselected package libblas3:armhf. 304s Preparing to unpack .../08-libblas3_3.12.0-3build1_armhf.deb ... 304s Unpacking libblas3:armhf (3.12.0-3build1) ... 304s Selecting previously unselected package libpixman-1-0:armhf. 304s Preparing to unpack .../09-libpixman-1-0_0.42.2-1build1_armhf.deb ... 304s Unpacking libpixman-1-0:armhf (0.42.2-1build1) ... 305s Selecting previously unselected package libxcb-render0:armhf. 305s Preparing to unpack .../10-libxcb-render0_1.17.0-2_armhf.deb ... 305s Unpacking libxcb-render0:armhf (1.17.0-2) ... 305s Selecting previously unselected package libxcb-shm0:armhf. 305s Preparing to unpack .../11-libxcb-shm0_1.17.0-2_armhf.deb ... 305s Unpacking libxcb-shm0:armhf (1.17.0-2) ... 305s Selecting previously unselected package libxrender1:armhf. 305s Preparing to unpack .../12-libxrender1_1%3a0.9.10-1.1build1_armhf.deb ... 305s Unpacking libxrender1:armhf (1:0.9.10-1.1build1) ... 305s Selecting previously unselected package libcairo2:armhf. 305s Preparing to unpack .../13-libcairo2_1.18.0-3build1_armhf.deb ... 305s Unpacking libcairo2:armhf (1.18.0-3build1) ... 305s Selecting previously unselected package libdatrie1:armhf. 305s Preparing to unpack .../14-libdatrie1_0.2.13-3build1_armhf.deb ... 305s Unpacking libdatrie1:armhf (0.2.13-3build1) ... 305s Selecting previously unselected package libdeflate0:armhf. 305s Preparing to unpack .../15-libdeflate0_1.20-1_armhf.deb ... 305s Unpacking libdeflate0:armhf (1.20-1) ... 305s Selecting previously unselected package libgfortran5:armhf. 305s Preparing to unpack .../16-libgfortran5_14.1.0-1ubuntu1_armhf.deb ... 305s Unpacking libgfortran5:armhf (14.1.0-1ubuntu1) ... 305s Selecting previously unselected package libgomp1:armhf. 305s Preparing to unpack .../17-libgomp1_14.1.0-1ubuntu1_armhf.deb ... 305s Unpacking libgomp1:armhf (14.1.0-1ubuntu1) ... 305s Selecting previously unselected package libgraphite2-3:armhf. 305s Preparing to unpack .../18-libgraphite2-3_1.3.14-2build1_armhf.deb ... 305s Unpacking libgraphite2-3:armhf (1.3.14-2build1) ... 305s Selecting previously unselected package libharfbuzz0b:armhf. 305s Preparing to unpack .../19-libharfbuzz0b_8.3.0-2build2_armhf.deb ... 305s Unpacking libharfbuzz0b:armhf (8.3.0-2build2) ... 305s Selecting previously unselected package x11-common. 305s Preparing to unpack .../20-x11-common_1%3a7.7+23ubuntu3_all.deb ... 305s Unpacking x11-common (1:7.7+23ubuntu3) ... 305s Selecting previously unselected package libice6:armhf. 305s Preparing to unpack .../21-libice6_2%3a1.0.10-1build3_armhf.deb ... 305s Unpacking libice6:armhf (2:1.0.10-1build3) ... 305s Selecting previously unselected package libjpeg-turbo8:armhf. 305s Preparing to unpack .../22-libjpeg-turbo8_2.1.5-2ubuntu2_armhf.deb ... 305s Unpacking libjpeg-turbo8:armhf (2.1.5-2ubuntu2) ... 305s Selecting previously unselected package libjpeg8:armhf. 305s Preparing to unpack .../23-libjpeg8_8c-2ubuntu11_armhf.deb ... 305s Unpacking libjpeg8:armhf (8c-2ubuntu11) ... 306s Selecting previously unselected package libjs-bootstrap. 306s Preparing to unpack .../24-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 306s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 306s Selecting previously unselected package libjs-highlight.js. 306s Preparing to unpack .../25-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 306s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 306s Selecting previously unselected package libjs-jquery. 306s Preparing to unpack .../26-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 306s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 306s Selecting previously unselected package libjs-jquery-datatables. 306s Preparing to unpack .../27-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 306s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 306s Selecting previously unselected package liblapack3:armhf. 306s Preparing to unpack .../28-liblapack3_3.12.0-3build1_armhf.deb ... 306s Unpacking liblapack3:armhf (3.12.0-3build1) ... 306s Selecting previously unselected package liblerc4:armhf. 306s Preparing to unpack .../29-liblerc4_4.0.0+ds-4ubuntu2_armhf.deb ... 306s Unpacking liblerc4:armhf (4.0.0+ds-4ubuntu2) ... 306s Selecting previously unselected package libthai-data. 306s Preparing to unpack .../30-libthai-data_0.1.29-2build1_all.deb ... 306s Unpacking libthai-data (0.1.29-2build1) ... 306s Selecting previously unselected package libthai0:armhf. 306s Preparing to unpack .../31-libthai0_0.1.29-2build1_armhf.deb ... 306s Unpacking libthai0:armhf (0.1.29-2build1) ... 306s Selecting previously unselected package libpango-1.0-0:armhf. 306s Preparing to unpack .../32-libpango-1.0-0_1.52.2+ds-1_armhf.deb ... 306s Unpacking libpango-1.0-0:armhf (1.52.2+ds-1) ... 306s Selecting previously unselected package libpangoft2-1.0-0:armhf. 306s Preparing to unpack .../33-libpangoft2-1.0-0_1.52.2+ds-1_armhf.deb ... 306s Unpacking libpangoft2-1.0-0:armhf (1.52.2+ds-1) ... 306s Selecting previously unselected package libpangocairo-1.0-0:armhf. 306s Preparing to unpack .../34-libpangocairo-1.0-0_1.52.2+ds-1_armhf.deb ... 306s Unpacking libpangocairo-1.0-0:armhf (1.52.2+ds-1) ... 307s Selecting previously unselected package libpaper1:armhf. 307s Preparing to unpack .../35-libpaper1_1.1.29build1_armhf.deb ... 307s Unpacking libpaper1:armhf (1.1.29build1) ... 307s Selecting previously unselected package libpaper-utils. 307s Preparing to unpack .../36-libpaper-utils_1.1.29build1_armhf.deb ... 307s Unpacking libpaper-utils (1.1.29build1) ... 307s Selecting previously unselected package libsharpyuv0:armhf. 307s Preparing to unpack .../37-libsharpyuv0_1.4.0-0.1_armhf.deb ... 307s Unpacking libsharpyuv0:armhf (1.4.0-0.1) ... 307s Selecting previously unselected package libsm6:armhf. 307s Preparing to unpack .../38-libsm6_2%3a1.2.3-1build3_armhf.deb ... 307s Unpacking libsm6:armhf (2:1.2.3-1build3) ... 307s Selecting previously unselected package libtcl8.6:armhf. 307s Preparing to unpack .../39-libtcl8.6_8.6.14+dfsg-1build1_armhf.deb ... 307s Unpacking libtcl8.6:armhf (8.6.14+dfsg-1build1) ... 307s Selecting previously unselected package libjbig0:armhf. 307s Preparing to unpack .../40-libjbig0_2.1-6.1ubuntu2_armhf.deb ... 307s Unpacking libjbig0:armhf (2.1-6.1ubuntu2) ... 307s Selecting previously unselected package libwebp7:armhf. 307s Preparing to unpack .../41-libwebp7_1.4.0-0.1_armhf.deb ... 307s Unpacking libwebp7:armhf (1.4.0-0.1) ... 307s Selecting previously unselected package libtiff6:armhf. 307s Preparing to unpack .../42-libtiff6_4.5.1+git230720-4ubuntu2_armhf.deb ... 307s Unpacking libtiff6:armhf (4.5.1+git230720-4ubuntu2) ... 307s Selecting previously unselected package libxft2:armhf. 307s Preparing to unpack .../43-libxft2_2.3.6-1build1_armhf.deb ... 307s Unpacking libxft2:armhf (2.3.6-1build1) ... 307s Selecting previously unselected package libxss1:armhf. 307s Preparing to unpack .../44-libxss1_1%3a1.2.3-1build3_armhf.deb ... 307s Unpacking libxss1:armhf (1:1.2.3-1build3) ... 307s Selecting previously unselected package libtk8.6:armhf. 307s Preparing to unpack .../45-libtk8.6_8.6.14-1build1_armhf.deb ... 307s Unpacking libtk8.6:armhf (8.6.14-1build1) ... 307s Selecting previously unselected package libxt6t64:armhf. 307s Preparing to unpack .../46-libxt6t64_1%3a1.2.1-1.2build1_armhf.deb ... 307s Unpacking libxt6t64:armhf (1:1.2.1-1.2build1) ... 308s Selecting previously unselected package node-normalize.css. 308s Preparing to unpack .../47-node-normalize.css_8.0.1-5_all.deb ... 308s Unpacking node-normalize.css (8.0.1-5) ... 308s Selecting previously unselected package zip. 308s Preparing to unpack .../48-zip_3.0-13build1_armhf.deb ... 308s Unpacking zip (3.0-13build1) ... 308s Selecting previously unselected package unzip. 308s Preparing to unpack .../49-unzip_6.0-28ubuntu4_armhf.deb ... 308s Unpacking unzip (6.0-28ubuntu4) ... 308s Selecting previously unselected package xdg-utils. 308s Preparing to unpack .../50-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 308s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 308s Selecting previously unselected package r-base-core. 308s Preparing to unpack .../51-r-base-core_4.4.0-2_armhf.deb ... 308s Unpacking r-base-core (4.4.0-2) ... 309s Selecting previously unselected package r-cran-base64enc. 309s Preparing to unpack .../52-r-cran-base64enc_0.1-3-3_armhf.deb ... 309s Unpacking r-cran-base64enc (0.1-3-3) ... 309s Selecting previously unselected package r-cran-cli. 309s Preparing to unpack .../53-r-cran-cli_3.6.2-1_armhf.deb ... 309s Unpacking r-cran-cli (3.6.2-1) ... 309s Selecting previously unselected package r-cran-colorspace. 309s Preparing to unpack .../54-r-cran-colorspace_2.1-0+dfsg-1_armhf.deb ... 309s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 309s Selecting previously unselected package r-cran-commonmark. 309s Preparing to unpack .../55-r-cran-commonmark_1.9.1-1_armhf.deb ... 309s Unpacking r-cran-commonmark (1.9.1-1) ... 309s Selecting previously unselected package r-cran-digest. 309s Preparing to unpack .../56-r-cran-digest_0.6.35-1_armhf.deb ... 309s Unpacking r-cran-digest (0.6.35-1) ... 309s Selecting previously unselected package r-cran-evaluate. 309s Preparing to unpack .../57-r-cran-evaluate_0.23-1_all.deb ... 309s Unpacking r-cran-evaluate (0.23-1) ... 309s Selecting previously unselected package r-cran-fansi. 309s Preparing to unpack .../58-r-cran-fansi_1.0.5-1_armhf.deb ... 309s Unpacking r-cran-fansi (1.0.5-1) ... 309s Selecting previously unselected package r-cran-farver. 309s Preparing to unpack .../59-r-cran-farver_2.1.1-2_armhf.deb ... 309s Unpacking r-cran-farver (2.1.1-2) ... 310s Selecting previously unselected package r-cran-glue. 310s Preparing to unpack .../60-r-cran-glue_1.7.0-1_armhf.deb ... 310s Unpacking r-cran-glue (1.7.0-1) ... 310s Selecting previously unselected package r-cran-rlang. 310s Preparing to unpack .../61-r-cran-rlang_1.1.3-1_armhf.deb ... 310s Unpacking r-cran-rlang (1.1.3-1) ... 310s Selecting previously unselected package r-cran-lifecycle. 310s Preparing to unpack .../62-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 310s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 310s Selecting previously unselected package r-cran-gtable. 310s Preparing to unpack .../63-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 310s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 310s Selecting previously unselected package r-cran-isoband. 310s Preparing to unpack .../64-r-cran-isoband_0.2.7-1_armhf.deb ... 310s Unpacking r-cran-isoband (0.2.7-1) ... 310s Selecting previously unselected package r-cran-mass. 310s Preparing to unpack .../65-r-cran-mass_7.3-60.0.1-1_armhf.deb ... 310s Unpacking r-cran-mass (7.3-60.0.1-1) ... 310s Selecting previously unselected package r-cran-lattice. 310s Preparing to unpack .../66-r-cran-lattice_0.22-6-1_armhf.deb ... 310s Unpacking r-cran-lattice (0.22-6-1) ... 310s Selecting previously unselected package r-cran-nlme. 310s Preparing to unpack .../67-r-cran-nlme_3.1.164-1build1_armhf.deb ... 310s Unpacking r-cran-nlme (3.1.164-1build1) ... 310s Selecting previously unselected package r-cran-matrix. 310s Preparing to unpack .../68-r-cran-matrix_1.6-5-1_armhf.deb ... 310s Unpacking r-cran-matrix (1.6-5-1) ... 311s Selecting previously unselected package r-cran-mgcv. 311s Preparing to unpack .../69-r-cran-mgcv_1.9-1-1_armhf.deb ... 311s Unpacking r-cran-mgcv (1.9-1-1) ... 311s Selecting previously unselected package r-cran-labeling. 311s Preparing to unpack .../70-r-cran-labeling_0.4.3-1_all.deb ... 311s Unpacking r-cran-labeling (0.4.3-1) ... 311s Selecting previously unselected package r-cran-munsell. 311s Preparing to unpack .../71-r-cran-munsell_0.5.0-2build1_all.deb ... 311s Unpacking r-cran-munsell (0.5.0-2build1) ... 311s Selecting previously unselected package r-cran-r6. 311s Preparing to unpack .../72-r-cran-r6_2.5.1-1_all.deb ... 311s Unpacking r-cran-r6 (2.5.1-1) ... 311s Selecting previously unselected package r-cran-rcolorbrewer. 311s Preparing to unpack .../73-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 311s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 311s Selecting previously unselected package r-cran-viridislite. 311s Preparing to unpack .../74-r-cran-viridislite_0.4.2-2_all.deb ... 311s Unpacking r-cran-viridislite (0.4.2-2) ... 311s Selecting previously unselected package r-cran-scales. 311s Preparing to unpack .../75-r-cran-scales_1.3.0-1_all.deb ... 311s Unpacking r-cran-scales (1.3.0-1) ... 311s Selecting previously unselected package r-cran-magrittr. 311s Preparing to unpack .../76-r-cran-magrittr_2.0.3-1_armhf.deb ... 311s Unpacking r-cran-magrittr (2.0.3-1) ... 311s Selecting previously unselected package r-cran-utf8. 311s Preparing to unpack .../77-r-cran-utf8_1.2.4-1_armhf.deb ... 311s Unpacking r-cran-utf8 (1.2.4-1) ... 311s Selecting previously unselected package r-cran-vctrs. 311s Preparing to unpack .../78-r-cran-vctrs_0.6.5-1_armhf.deb ... 311s Unpacking r-cran-vctrs (0.6.5-1) ... 311s Selecting previously unselected package r-cran-pillar. 311s Preparing to unpack .../79-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 311s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 312s Selecting previously unselected package r-cran-pkgconfig. 312s Preparing to unpack .../80-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 312s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 312s Selecting previously unselected package r-cran-tibble. 312s Preparing to unpack .../81-r-cran-tibble_3.2.1+dfsg-2_armhf.deb ... 312s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 312s Selecting previously unselected package r-cran-withr. 312s Preparing to unpack .../82-r-cran-withr_2.5.0-1_all.deb ... 312s Unpacking r-cran-withr (2.5.0-1) ... 312s Selecting previously unselected package r-cran-ggplot2. 312s Preparing to unpack .../83-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 312s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 312s Selecting previously unselected package r-cran-xfun. 312s Preparing to unpack .../84-r-cran-xfun_0.44+dfsg-1_armhf.deb ... 312s Unpacking r-cran-xfun (0.44+dfsg-1) ... 312s Selecting previously unselected package r-cran-highr. 312s Preparing to unpack .../85-r-cran-highr_0.10+dfsg-2_all.deb ... 312s Unpacking r-cran-highr (0.10+dfsg-2) ... 312s Selecting previously unselected package r-cran-yaml. 312s Preparing to unpack .../86-r-cran-yaml_2.3.8-2_armhf.deb ... 312s Unpacking r-cran-yaml (2.3.8-2) ... 313s Selecting previously unselected package libjs-mathjax. 313s Preparing to unpack .../87-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 313s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 314s Selecting previously unselected package r-cran-knitr. 314s Preparing to unpack .../88-r-cran-knitr_1.46+dfsg-1_all.deb ... 314s Unpacking r-cran-knitr (1.46+dfsg-1) ... 314s Selecting previously unselected package r-cran-markdown. 315s Preparing to unpack .../89-r-cran-markdown_1.12+dfsg-2_all.deb ... 315s Unpacking r-cran-markdown (1.12+dfsg-2) ... 315s Selecting previously unselected package r-cran-matrixstats. 315s Preparing to unpack .../90-r-cran-matrixstats_1.2.0-1_armhf.deb ... 315s Unpacking r-cran-matrixstats (1.2.0-1) ... 315s Selecting previously unselected package r-cran-r.methodss3. 315s Preparing to unpack .../91-r-cran-r.methodss3_1.8.2-1_all.deb ... 315s Unpacking r-cran-r.methodss3 (1.8.2-1) ... 315s Selecting previously unselected package r-cran-r.oo. 315s Preparing to unpack .../92-r-cran-r.oo_1.26.0-1_all.deb ... 315s Unpacking r-cran-r.oo (1.26.0-1) ... 315s Selecting previously unselected package r-cran-r.utils. 315s Preparing to unpack .../93-r-cran-r.utils_2.12.3-1_all.deb ... 315s Unpacking r-cran-r.utils (2.12.3-1) ... 315s Selecting previously unselected package r-cran-r.cache. 315s Preparing to unpack .../94-r-cran-r.cache_0.16.0-1_all.deb ... 315s Unpacking r-cran-r.cache (0.16.0-1) ... 315s Selecting previously unselected package r-cran-r.devices. 315s Preparing to unpack .../95-r-cran-r.devices_2.17.2+ds-1_all.deb ... 315s Unpacking r-cran-r.devices (2.17.2+ds-1) ... 315s Selecting previously unselected package tcl8.6. 315s Preparing to unpack .../96-tcl8.6_8.6.14+dfsg-1build1_armhf.deb ... 315s Unpacking tcl8.6 (8.6.14+dfsg-1build1) ... 315s Selecting previously unselected package tcl. 315s Preparing to unpack .../97-tcl_8.6.14build1_armhf.deb ... 315s Unpacking tcl (8.6.14build1) ... 315s Selecting previously unselected package r-cran-r.rsp. 315s Preparing to unpack .../98-r-cran-r.rsp_0.46.0+ds-1_all.deb ... 315s Unpacking r-cran-r.rsp (0.46.0+ds-1) ... 316s Selecting previously unselected package autopkgtest-satdep. 316s Preparing to unpack .../99-1-autopkgtest-satdep.deb ... 316s Unpacking autopkgtest-satdep (0) ... 316s Setting up libgraphite2-3:armhf (1.3.14-2build1) ... 316s Setting up libpixman-1-0:armhf (0.42.2-1build1) ... 316s Setting up libsharpyuv0:armhf (1.4.0-0.1) ... 316s Setting up libpaper1:armhf (1.1.29build1) ... 316s 316s Creating config file /etc/papersize with new version 316s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 316s Setting up liblerc4:armhf (4.0.0+ds-4ubuntu2) ... 316s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 316s Setting up libxrender1:armhf (1:0.9.10-1.1build1) ... 316s Setting up libdatrie1:armhf (0.2.13-3build1) ... 316s Setting up libxcb-render0:armhf (1.17.0-2) ... 316s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 316s Setting up unzip (6.0-28ubuntu4) ... 316s Setting up x11-common (1:7.7+23ubuntu3) ... 317s Setting up libdeflate0:armhf (1.20-1) ... 317s Setting up libxcb-shm0:armhf (1.17.0-2) ... 317s Setting up libpaper-utils (1.1.29build1) ... 317s Setting up libgomp1:armhf (14.1.0-1ubuntu1) ... 317s Setting up libjbig0:armhf (2.1-6.1ubuntu2) ... 317s Setting up zip (3.0-13build1) ... 317s Setting up libblas3:armhf (3.12.0-3build1) ... 317s update-alternatives: using /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3 to provide /usr/lib/arm-linux-gnueabihf/libblas.so.3 (libblas.so.3-arm-linux-gnueabihf) in auto mode 317s Setting up libfreetype6:armhf (2.13.2+dfsg-1build3) ... 317s Setting up fonts-dejavu-mono (2.37-8) ... 317s Setting up libtcl8.6:armhf (8.6.14+dfsg-1build1) ... 317s Setting up fonts-dejavu-core (2.37-8) ... 317s Setting up libjpeg-turbo8:armhf (2.1.5-2ubuntu2) ... 317s Setting up libgfortran5:armhf (14.1.0-1ubuntu1) ... 317s Setting up libwebp7:armhf (1.4.0-0.1) ... 317s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 317s Setting up libharfbuzz0b:armhf (8.3.0-2build2) ... 317s Setting up libthai-data (0.1.29-2build1) ... 317s Setting up libxss1:armhf (1:1.2.3-1build3) ... 317s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 317s Setting up node-normalize.css (8.0.1-5) ... 317s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 317s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 317s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 317s Setting up libjpeg8:armhf (8c-2ubuntu11) ... 317s Setting up libice6:armhf (2:1.0.10-1build3) ... 317s Setting up tcl8.6 (8.6.14+dfsg-1build1) ... 317s Setting up liblapack3:armhf (3.12.0-3build1) ... 317s update-alternatives: using /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3 to provide /usr/lib/arm-linux-gnueabihf/liblapack.so.3 (liblapack.so.3-arm-linux-gnueabihf) in auto mode 317s Setting up fontconfig-config (2.15.0-1.1ubuntu2) ... 317s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 317s Setting up libthai0:armhf (0.1.29-2build1) ... 317s Setting up libtiff6:armhf (4.5.1+git230720-4ubuntu2) ... 317s Setting up tcl (8.6.14build1) ... 317s Setting up libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 317s Setting up libsm6:armhf (2:1.2.3-1build3) ... 317s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 320s Regenerating fonts cache... done. 320s Setting up libxft2:armhf (2.3.6-1build1) ... 320s Setting up libtk8.6:armhf (8.6.14-1build1) ... 320s Setting up libpango-1.0-0:armhf (1.52.2+ds-1) ... 320s Setting up libcairo2:armhf (1.18.0-3build1) ... 320s Setting up libxt6t64:armhf (1:1.2.1-1.2build1) ... 320s Setting up libpangoft2-1.0-0:armhf (1.52.2+ds-1) ... 320s Setting up libpangocairo-1.0-0:armhf (1.52.2+ds-1) ... 320s Setting up r-base-core (4.4.0-2) ... 320s 320s Creating config file /etc/R/Renviron with new version 320s Setting up r-cran-labeling (0.4.3-1) ... 320s Setting up r-cran-lattice (0.22-6-1) ... 320s Setting up r-cran-nlme (3.1.164-1build1) ... 320s Setting up r-cran-farver (2.1.1-2) ... 320s Setting up r-cran-viridislite (0.4.2-2) ... 320s Setting up r-cran-commonmark (1.9.1-1) ... 320s Setting up r-cran-r6 (2.5.1-1) ... 320s Setting up r-cran-magrittr (2.0.3-1) ... 320s Setting up r-cran-rlang (1.1.3-1) ... 320s Setting up r-cran-matrixstats (1.2.0-1) ... 320s Setting up r-cran-xfun (0.44+dfsg-1) ... 320s Setting up r-cran-withr (2.5.0-1) ... 320s Setting up r-cran-base64enc (0.1-3-3) ... 320s Setting up r-cran-digest (0.6.35-1) ... 320s Setting up r-cran-yaml (2.3.8-2) ... 320s Setting up r-cran-evaluate (0.23-1) ... 320s Setting up r-cran-highr (0.10+dfsg-2) ... 320s Setting up r-cran-fansi (1.0.5-1) ... 320s Setting up r-cran-mass (7.3-60.0.1-1) ... 320s Setting up r-cran-glue (1.7.0-1) ... 320s Setting up r-cran-cli (3.6.2-1) ... 320s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 320s Setting up r-cran-r.methodss3 (1.8.2-1) ... 320s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 320s Setting up r-cran-utf8 (1.2.4-1) ... 320s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 320s Setting up r-cran-markdown (1.12+dfsg-2) ... 320s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 320s Setting up r-cran-isoband (0.2.7-1) ... 320s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 320s Setting up r-cran-matrix (1.6-5-1) ... 320s Setting up r-cran-knitr (1.46+dfsg-1) ... 320s Setting up r-cran-mgcv (1.9-1-1) ... 320s Setting up r-cran-vctrs (0.6.5-1) ... 320s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 320s Setting up r-cran-munsell (0.5.0-2build1) ... 320s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 320s Setting up r-cran-r.oo (1.26.0-1) ... 320s Setting up r-cran-scales (1.3.0-1) ... 320s Setting up r-cran-r.utils (2.12.3-1) ... 320s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 320s Setting up r-cran-r.devices (2.17.2+ds-1) ... 320s Setting up r-cran-r.cache (0.16.0-1) ... 320s Setting up r-cran-r.rsp (0.46.0+ds-1) ... 320s Setting up autopkgtest-satdep (0) ... 320s Processing triggers for man-db (2.12.1-1) ... 321s Processing triggers for install-info (7.1-3build2) ... 321s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 350s (Reading database ... 69797 files and directories currently installed.) 350s Removing autopkgtest-satdep (0) ... 357s autopkgtest [08:27:48]: test run-unit-test: [----------------------- 359s 359s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 359s Copyright (C) 2024 The R Foundation for Statistical Computing 359s Platform: arm-unknown-linux-gnueabihf (32-bit) 359s 359s R is free software and comes with ABSOLUTELY NO WARRANTY. 359s You are welcome to redistribute it under certain conditions. 359s Type 'license()' or 'licence()' for distribution details. 359s 359s R is a collaborative project with many contributors. 359s Type 'contributors()' for more information and 359s 'citation()' on how to cite R or R packages in publications. 359s 359s Type 'demo()' for some demos, 'help()' for on-line help, or 359s 'help.start()' for an HTML browser interface to help. 359s Type 'q()' to quit R. 359s 360s > library("matrixStats") 360s > 360s > allocArray_R <- function(nrow, ncol, value = NA) { 360s + array(data = value, dim = dim) 360s + } 360s > 360s > values <- list( 360s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 360s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 360s + .Machine$double.xmin, .Machine$double.xmax, 360s + .Machine$double.eps, .Machine$double.neg.eps, 360s + FALSE, TRUE, NA 360s + ) 360s > 360s > dim <- c(2L, 4L, 3L) 360s > for (value in values) { 360s + x0 <- allocArray_R(dim, value = value) 360s + x <- allocArray(dim, value = value) 360s + if (!identical(x, x0)) { 360s + str(list(dim = dim, value = value, x = x, x0 = x0)) 360s + stopifnot(identical(x, x0)) 360s + } 360s + } 360s > 360s 360s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 360s Copyright (C) 2024 The R Foundation for Statistical Computing 360s Platform: arm-unknown-linux-gnueabihf (32-bit) 360s 360s R is free software and comes with ABSOLUTELY NO WARRANTY. 360s You are welcome to redistribute it under certain conditions. 360s Type 'license()' or 'licence()' for distribution details. 360s 360s R is a collaborative project with many contributors. 360s Type 'contributors()' for more information and 360s 'citation()' on how to cite R or R packages in publications. 360s 360s Type 'demo()' for some demos, 'help()' for on-line help, or 360s 'help.start()' for an HTML browser interface to help. 360s Type 'q()' to quit R. 360s 360s > library("matrixStats") 360s > 360s > allocMatrix_R <- function(nrow, ncol, value = NA) { 360s + matrix(data = value, nrow = nrow, ncol = ncol) 360s + } 360s > 360s > values <- list( 360s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 360s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 360s + .Machine$double.xmin, .Machine$double.xmax, 360s + .Machine$double.eps, .Machine$double.neg.eps, 360s + FALSE, TRUE, NA 360s + ) 360s > 360s > nrow <- 2L 360s > ncol <- 3L 360s > for (value in values) { 360s + x0 <- allocMatrix_R(nrow, ncol, value = value) 360s + x <- allocMatrix(nrow, ncol, value = value) 360s + if (!identical(x, x0)) { 360s + str(list(nrow = nrow, ncol = ncol, value = value, x = x, x0 = x0)) 360s + stopifnot(identical(x, x0)) 360s + } 360s + } 360s > 361s 361s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 361s Copyright (C) 2024 The R Foundation for Statistical Computing 361s Platform: arm-unknown-linux-gnueabihf (32-bit) 361s 361s R is free software and comes with ABSOLUTELY NO WARRANTY. 361s You are welcome to redistribute it under certain conditions. 361s Type 'license()' or 'licence()' for distribution details. 361s 361s R is a collaborative project with many contributors. 361s Type 'contributors()' for more information and 361s 'citation()' on how to cite R or R packages in publications. 361s 361s Type 'demo()' for some demos, 'help()' for on-line help, or 361s 'help.start()' for an HTML browser interface to help. 361s Type 'q()' to quit R. 361s 361s > library("matrixStats") 361s > 361s > allocVector_R <- function(length, value = NA) { 361s + x <- vector(mode = typeof(value), length = length) 361s + if (!is.finite(value) || value != 0) x[] <- value 361s + x 361s + } 361s > 361s > values <- list( 361s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 361s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 361s + .Machine$double.xmin, .Machine$double.xmax, 361s + .Machine$double.eps, .Machine$double.neg.eps, 361s + FALSE, TRUE, NA 361s + ) 361s > 361s > n <- 10L 361s > for (value in values) { 361s + x0 <- allocVector_R(n, value = value) 361s + x <- allocVector(n, value = value) 361s + if (!identical(x, x0)) { 361s + str(list(n = n, value = value, x = x, x0 = x0)) 361s + stopifnot(identical(x, x0)) 361s + } 361s + } 361s > 361s 361s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 361s Copyright (C) 2024 The R Foundation for Statistical Computing 361s Platform: arm-unknown-linux-gnueabihf (32-bit) 361s 361s R is free software and comes with ABSOLUTELY NO WARRANTY. 361s You are welcome to redistribute it under certain conditions. 361s Type 'license()' or 'licence()' for distribution details. 361s 361s R is a collaborative project with many contributors. 361s Type 'contributors()' for more information and 361s 'citation()' on how to cite R or R packages in publications. 361s 361s Type 'demo()' for some demos, 'help()' for on-line help, or 361s 'help.start()' for an HTML browser interface to help. 361s Type 'q()' to quit R. 361s 362s > library("matrixStats") 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Setup 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > data <- data.frame( 362s + logical = c(TRUE, FALSE, TRUE), 362s + integer = 1:3, 362s + double = seq(from = 1.0, to = 3.0, by = 1.0), 362s + complex = seq(from = 1.0, to = 3.0, by = 1.0) + 1.0i, 362s + character = letters[1:3], 362s + stringsAsFactors = FALSE 362s + ) 362s > 362s > modes <- names(data) 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Special cases 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > cat("NULL...\n") 362s NULL... 362s > stopifnot(identical(anyMissing(NULL), FALSE)) 362s > cat("NULL...done\n") 362s NULL...done 362s > 362s > cat("raw...\n") 362s raw... 362s > stopifnot(identical(anyMissing(as.raw(0:2)), FALSE)) 362s > cat("raw...done\n") 362s raw...done 362s > 362s > cat("list(NULL)...\n") 362s list(NULL)... 362s > stopifnot(identical(anyMissing(list(NULL)), FALSE)) 362s > cat("list(NULL)...done\n") 362s list(NULL)...done 362s > 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Scalars, vectors, and matrices of various modes 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > for (mode in modes) { 362s + cat(sprintf("Mode: %s...\n", mode)) 362s + values <- data[[mode]] 362s + 362s + # Scalars 362s + cat(" scalar\n") 362s + x <- values[1L] 362s + print(x) 362s + stopifnot(identical(anyMissing(x), FALSE)) 362s + is.na(x) <- TRUE 362s + print(x) 362s + stopifnot(identical(anyMissing(x), TRUE)) 362s + 362s + # Vectors 362s + cat(" vector\n") 362s + x <- values 362s + print(x) 362s + stopifnot(identical(anyMissing(x), FALSE)) 362s + is.na(x)[2L] <- TRUE 362s + print(x) 362s + stopifnot(identical(anyMissing(x), TRUE)) 362s + 362s + # Matrices 362s + cat(" matrix\n") 362s + x <- matrix(c(values, values), ncol = 2L) 362s + print(x) 362s + stopifnot(identical(anyMissing(x), FALSE)) 362s + is.na(x)[2L] <- TRUE 362s + print(x) 362s + stopifnot(identical(anyMissing(x), TRUE)) 362s + 362s + cat(sprintf("Mode: %s...done\n", mode)) 362s + } # for (mode ...) 362s Mode: logical... 362s scalar 362s [1] TRUE 362s [1] NA 362s vector 362s [1] TRUE FALSE TRUE 362s [1] TRUE NA TRUE 362s matrix 362s [,1] [,2] 362s [1,] TRUE TRUE 362s [2,] FALSE FALSE 362s [3,] TRUE TRUE 362s [,1] [,2] 362s [1,] TRUE TRUE 362s [2,] NA FALSE 362s [3,] TRUE TRUE 362s Mode: logical...done 362s Mode: integer... 362s scalar 362s [1] 1 362s [1] NA 362s vector 362s [1] 1 2 3 362s [1] 1 NA 3 362s matrix 362s [,1] [,2] 362s [1,] 1 1 362s [2,] 2 2 362s [3,] 3 3 362s [,1] [,2] 362s [1,] 1 1 362s [2,] NA 2 362s [3,] 3 3 362s Mode: integer...done 362s Mode: double... 362s scalar 362s [1] 1 362s [1] NA 362s vector 362s [1] 1 2 3 362s [1] 1 NA 3 362s matrix 362s [,1] [,2] 362s [1,] 1 1 362s [2,] 2 2 362s [3,] 3 3 362s [,1] [,2] 362s [1,] 1 1 362s [2,] NA 2 362s [3,] 3 3 362s Mode: double...done 362s Mode: complex... 362s scalar 362s [1] 1+1i 362s [1] NA 362s vector 362s [1] 1+1i 2+1i 3+1i 362s [1] 1+1i NA 3+1i 362s matrix 362s [,1] [,2] 362s [1,] 1+1i 1+1i 362s [2,] 2+1i 2+1i 362s [3,] 3+1i 3+1i 362s [,1] [,2] 362s [1,] 1+1i 1+1i 362s [2,] NA 2+1i 362s [3,] 3+1i 3+1i 362s Mode: complex...done 362s Mode: character... 362s scalar 362s [1] "a" 362s [1] NA 362s vector 362s [1] "a" "b" "c" 362s [1] "a" NA "c" 362s matrix 362s [,1] [,2] 362s [1,] "a" "a" 362s [2,] "b" "b" 362s [3,] "c" "c" 362s [,1] [,2] 362s [1,] "a" "a" 362s [2,] NA "b" 362s [3,] "c" "c" 362s Mode: character...done 362s > 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Data frames 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > cat("data.frame...\n") 362s data.frame... 362s > x <- data 362s > stopifnot(identical(anyMissing(x), FALSE)) 362s > for (mode in modes) { 362s + x <- data 362s + is.na(x[[mode]])[2L] <- TRUE 362s + print(x) 362s + stopifnot(identical(anyMissing(x), TRUE)) 362s + } # for (mode ...) 362s logical integer double complex character 362s 1 TRUE 1 1 1+1i a 362s 2 NA 2 2 2+1i b 362s 3 TRUE 3 3 3+1i c 362s logical integer double complex character 362s 1 TRUE 1 1 1+1i a 362s 2 FALSE NA 2 2+1i b 362s 3 TRUE 3 3 3+1i c 362s logical integer double complex character 362s 1 TRUE 1 1 1+1i a 362s 2 FALSE 2 NA 2+1i b 362s 3 TRUE 3 3 3+1i c 362s logical integer double complex character 362s 1 TRUE 1 1 1+1i a 362s 2 FALSE 2 2 NA b 362s 3 TRUE 3 3 3+1i c 362s logical integer double complex character 362s 1 TRUE 1 1 1+1i a 362s 2 FALSE 2 2 2+1i 362s 3 TRUE 3 3 3+1i c 362s > cat("data.frame...done\n") 362s data.frame...done 362s > 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Lists 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > cat("list...\n") 362s list... 362s > x <- as.list(data) 362s > stopifnot(identical(anyMissing(x), FALSE)) 362s > for (mode in modes) { 362s + x <- as.list(data) 362s + is.na(x[[mode]])[2L] <- TRUE 362s + print(x) 362s + stopifnot(identical(anyMissing(x), TRUE)) 362s + } # for (mode ...) 362s $logical 362s [1] TRUE NA TRUE 362s 362s $integer 362s [1] 1 2 3 362s 362s $double 362s [1] 1 2 3 362s 362s $complex 362s [1] 1+1i 2+1i 3+1i 362s 362s $character 362s [1] "a" "b" "c" 362s 362s $logical 362s [1] TRUE FALSE TRUE 362s 362s $integer 362s [1] 1 NA 3 362s 362s $double 362s [1] 1 2 3 362s 362s $complex 362s [1] 1+1i 2+1i 3+1i 362s 362s $character 362s [1] "a" "b" "c" 362s 362s $logical 362s [1] TRUE FALSE TRUE 362s 362s $integer 362s [1] 1 2 3 362s 362s $double 362s [1] 1 NA 3 362s 362s $complex 362s [1] 1+1i 2+1i 3+1i 362s 362s $character 362s [1] "a" "b" "c" 362s 362s $logical 362s [1] TRUE FALSE TRUE 362s 362s $integer 362s [1] 1 2 3 362s 362s $double 362s [1] 1 2 3 362s 362s $complex 362s [1] 1+1i NA 3+1i 362s 362s $character 362s [1] "a" "b" "c" 362s 362s $logical 362s [1] TRUE FALSE TRUE 362s 362s $integer 362s [1] 1 2 3 362s 362s $double 362s [1] 1 2 3 362s 362s $complex 362s [1] 1+1i 2+1i 3+1i 362s 362s $character 362s [1] "a" NA "c" 362s 362s > cat("list...done\n") 362s list...done 362s > 362s 362s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 362s Copyright (C) 2024 The R Foundation for Statistical Computing 362s Platform: arm-unknown-linux-gnueabihf (32-bit) 362s 362s R is free software and comes with ABSOLUTELY NO WARRANTY. 362s You are welcome to redistribute it under certain conditions. 362s Type 'license()' or 'licence()' for distribution details. 362s 362s R is a collaborative project with many contributors. 362s Type 'contributors()' for more information and 362s 'citation()' on how to cite R or R packages in publications. 362s 362s Type 'demo()' for some demos, 'help()' for on-line help, or 362s 'help.start()' for an HTML browser interface to help. 362s Type 'q()' to quit R. 362s 362s > library("matrixStats") 362s > 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > # Subsetted tests 362s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 362s > source("utils/validateIndicesFramework.R") 362s > x <- runif(4, min = -3, max = 3) 362s > x[2] <- NA 362s > for (mode in c("integer", "numeric")) { 362s + storage.mode(x) <- mode 362s + for (idxs in index_cases) { 362s + validateIndicesTestVector(x, idxs, 362s + ftest = anyMissing, fsure = function(x, ...) { 362s + anyValue(x, value = NA) 362s + }) 362s + } 362s + } 362s > 363s 363s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 363s Copyright (C) 2024 The R Foundation for Statistical Computing 363s Platform: arm-unknown-linux-gnueabihf (32-bit) 363s 363s R is free software and comes with ABSOLUTELY NO WARRANTY. 363s You are welcome to redistribute it under certain conditions. 363s Type 'license()' or 'licence()' for distribution details. 363s 363s R is a collaborative project with many contributors. 363s Type 'contributors()' for more information and 363s 'citation()' on how to cite R or R packages in publications. 363s 363s Type 'demo()' for some demos, 'help()' for on-line help, or 363s 'help.start()' for an HTML browser interface to help. 363s Type 'q()' to quit R. 363s 363s > ## 1. Don't test with valgrind 363s > ## 2. Test only R (>= 3.0.2) because of that's what knitr requires 363s > if (getRversion() >= "3.0.2" && Sys.getenv("_R_CHECK_USE_VALGRIND_") == "") { 363s + 363s + ## 3. Make sure all suggested packages are installed / can be loaded 363s + pkgs <- c("base64enc", "ggplot2", "knitr", "markdown", "microbenchmark", 363s + "R.devices", "R.rsp") 363s + if (all(unlist(lapply(pkgs, FUN = requireNamespace)))) { 363s + html <- matrixStats:::benchmark("binCounts") 363s + print(html) 363s + } 363s + 363s + rm(list = "pkgs") 363s + 363s + } 363s Loading required namespace: base64enc 363s Loading required namespace: ggplot2 364s Loading required namespace: knitr 364s Loading required namespace: markdown 364s Loading required namespace: microbenchmark 364s Failed with error: ‘there is no package called ‘microbenchmark’’ 364s Loading required namespace: R.devices 365s Loading required namespace: R.rsp 365s > 365s 365s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 365s Copyright (C) 2024 The R Foundation for Statistical Computing 365s Platform: arm-unknown-linux-gnueabihf (32-bit) 365s 365s R is free software and comes with ABSOLUTELY NO WARRANTY. 365s You are welcome to redistribute it under certain conditions. 365s Type 'license()' or 'licence()' for distribution details. 365s 365s R is a collaborative project with many contributors. 365s Type 'contributors()' for more information and 365s 'citation()' on how to cite R or R packages in publications. 365s 365s Type 'demo()' for some demos, 'help()' for on-line help, or 365s 'help.start()' for an HTML browser interface to help. 365s Type 'q()' to quit R. 365s 365s > library("matrixStats") 365s > library("stats") 365s > 365s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 365s > # Local functions 365s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 365s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 365s + n0 <- graphics::hist(x, breaks = bx, right = right, 365s + include.lowest = TRUE, plot = FALSE)$counts 365s + } 365s > 365s > 365s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 365s > # Non-sorted and sorted positions 365s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 365s > nx <- 1000L # Number of data points 365s > nb <- 200L # Number of bins 365s > 365s > # Uniformely distributed bins 365s > bx <- seq(from = 0, to = 1, length.out = nb + 1L) 365s > bx <- c(-1, bx, 2) 365s > 365s > # Sample data points 365s > set.seed(0xBEEF) 365s > x <- runif(nx, min = 0, max = 1) 365s > 365s > for (kk in 1:2) { 365s + n0 <- binCounts_hist(x, bx = bx) 365s + n1 <- binCounts(x, bx = bx) 365s + # Sanity check 365s + stopifnot(identical(n1, n0)) 365s + 365s + # Check reversed 365s + n1r <- rev(binCounts(-x, bx = rev(-bx), right = TRUE)) 365s + stopifnot(identical(n1r, n1)) 365s + 365s + # Retry with a sorted vector 365s + x <- sort(x) 365s + } # for (kk in 1:2) 366s > 366s > 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Missing values 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > x <- 1:40 366s > x[20] <- NA_integer_ 366s > nx <- length(x) 366s > 366s > # Bins 366s > bx <- c(0.5, 50.5, 100.5, 150.5, 200.5) 366s > 366s > y_smooth0 <- binCounts_hist(x, bx = bx) 366s > y_smooth <- binCounts(x, bx = bx) 366s > # Sanity check 366s > stopifnot(all.equal(y_smooth, y_smooth0)) 366s > 366s > 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Border cases 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > x <- 1:10 366s > bx <- min(x) - c(10, 1) 366s > y_smooth <- binCounts(x, bx = bx) 366s > stopifnot(all.equal(y_smooth, 0L)) 366s > bx <- range(x) 366s > y_smooth <- binCounts(x, bx = bx) 366s > stopifnot(all.equal(y_smooth, length(x) - 1L)) 366s > bx <- max(x) + c(1, 10) 366s > y_smooth <- binCounts(x, bx = bx) 366s > stopifnot(all.equal(y_smooth, 0L)) 366s > 366s > # Every second empty 366s > x <- 1:10 366s > bx <- rep(x, each = 2L) 366s > y_smooth <- binCounts(x, bx = bx) 366s > stopifnot(all.equal(y_smooth, rep(c(0L, 1L), length.out = length(bx) - 1L))) 366s > ## NOTE: binCounts_hist() does not give the same last bin count 366s > 366s > 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Exception handling 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Zero bin bounderies (invalid bin definition) 366s > bx <- double(0L) 366s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 366s > stopifnot(inherits(res, "try-error")) 366s > 366s > # One bin boundery (invalid bin definition) 366s > bx <- double(1L) 366s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 366s > stopifnot(inherits(res, "try-error")) 366s > 366s 366s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 366s Copyright (C) 2024 The R Foundation for Statistical Computing 366s Platform: arm-unknown-linux-gnueabihf (32-bit) 366s 366s R is free software and comes with ABSOLUTELY NO WARRANTY. 366s You are welcome to redistribute it under certain conditions. 366s Type 'license()' or 'licence()' for distribution details. 366s 366s R is a collaborative project with many contributors. 366s Type 'contributors()' for more information and 366s 'citation()' on how to cite R or R packages in publications. 366s 366s Type 'demo()' for some demos, 'help()' for on-line help, or 366s 'help.start()' for an HTML browser interface to help. 366s Type 'q()' to quit R. 366s 366s > library("matrixStats") 366s > 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Local functions 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 366s + n0 <- graphics::hist(x, breaks = bx, right = right, 366s + include.lowest = TRUE, plot = FALSE)$counts 366s + } 366s > 366s > 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > # Subsetted tests 366s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 366s > source("utils/validateIndicesFramework.R") 366s > x <- runif(6, min = -6, max = 6) 366s > storage.mode(x) <- "integer" 366s > bx <- c(-6, 0, 3, 4, 10) 366s > for (idxs in index_cases) { 366s + validateIndicesTestVector(x, idxs, 366s + ftest = binCounts, fsure = binCounts_hist, 366s + bx = bx, right = FALSE) 366s + validateIndicesTestVector(x, idxs, 366s + ftest = binCounts, fsure = binCounts_hist, 366s + bx = bx, right = TRUE) 366s + } 366s > 366s 366s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 366s Copyright (C) 2024 The R Foundation for Statistical Computing 366s Platform: arm-unknown-linux-gnueabihf (32-bit) 366s 366s R is free software and comes with ABSOLUTELY NO WARRANTY. 366s You are welcome to redistribute it under certain conditions. 366s Type 'license()' or 'licence()' for distribution details. 366s 366s R is a collaborative project with many contributors. 366s Type 'contributors()' for more information and 366s 'citation()' on how to cite R or R packages in publications. 366s 366s Type 'demo()' for some demos, 'help()' for on-line help, or 366s 'help.start()' for an HTML browser interface to help. 366s Type 'q()' to quit R. 366s 367s > library("matrixStats") 367s > library("stats") 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Naive R implementation of binMeans() 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 367s + n_smooth <- length(bx) - 1L 367s + res <- double(n_smooth) 367s + counts <- rep(NaN, times = n_smooth) 367s + 367s + if (na.rm) { 367s + keep <- !is.na(x) & !is.na(y) 367s + x <- x[keep] 367s + y <- y[keep] 367s + } 367s + 367s + # For each bin... 367s + for (kk in seq_len(n_smooth)) { 367s + if (right) { 367s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 367s + } else { 367s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 367s + } 367s + y_kk <- y[idxs] 367s + res[kk] <- mean(y_kk) 367s + counts[kk] <- length(idxs) 367s + } # for (kk ...) 367s + 367s + if (count) attr(res, "count") <- counts 367s + res 367s + } 367s > 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Case #1 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > x <- 1:100 367s > nx <- length(x) 367s > y <- double(nx) 367s > y[1:25] <- 5 367s > y[51:75] <- -5 367s > y <- y + rnorm(nx) 367s > 367s > # Bins 367s > bx <- c(0.5, 25.5, 50.5, 75.5, 100.5) 367s > 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 367s > y_smooth <- binMeans(y, x = x, bx = bx) 367s > n_smooth <- binCounts(x, bx = bx) 367s > # Sanity check 367s > stopifnot(all.equal(y_smooth, y_smooth0)) 367s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 367s > 367s > y_smooth0r <- rev(binMeans0(y, x = -x, bx = rev(-bx), 367s + count = FALSE, right = TRUE)) 367s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx), 367s + count = FALSE, right = TRUE)) 367s > # Sanity check 367s > stopifnot(all.equal(y_smooth0r, y_smooth0, check.attributes = FALSE)) 367s > stopifnot(all.equal(y_smoothr, y_smooth0r)) 367s > 367s > 367s > # Integer input 367s > y <- as.integer(y) 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 367s > y_smooth <- binMeans(y, x = x, bx = bx) 367s > n_smooth <- binCounts(x, bx = bx) 367s > # Sanity check 367s > stopifnot(is.integer(y), 367s + all.equal(y_smooth, y_smooth0), 367s + all.equal(attr(y_smooth, "count"), n_smooth)) 367s > 367s > # Logical input 367s > y <- as.logical(y) 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 367s > y_smooth <- binMeans(y, x = x, bx = bx) 367s > n_smooth <- binCounts(x, bx = bx) 367s > # Sanity check 367s > stopifnot(is.logical(y), 367s + all.equal(y_smooth, y_smooth0), 367s + all.equal(attr(y_smooth, "count"), n_smooth)) 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Case #2 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > nx <- 1e3 367s > x <- runif(nx) 367s > y <- runif(nx) 367s > 367s > nb <- 10 367s > bx <- do.call(seq, c(as.list(range(x)), length.out = nb)) 367s > bx1 <- c(bx[-1], bx[nb] + 1) 367s > 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx1) 367s > y_smooth <- binMeans(y, x = x, bx = bx1) 367s > n_smooth <- binCounts(x, bx = bx1) 367s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx1), right = TRUE)) 367s > 367s > # Sanity check 367s > stopifnot(all.equal(y_smooth, y_smooth0)) 367s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 367s > stopifnot(all.equal(y_smoothr, y_smooth, check.attributes = FALSE)) 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Empty bins 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > x <- c(6:8, 16:19) 367s > nx <- length(x) 367s > y <- runif(nx) 367s > bx <- c(0, 5, 10, 15, 20, 25) 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 367s > y_smooth <- binMeans(y, x = x, bx = bx) 367s > n_smooth <- binCounts(x, bx = bx) 367s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 367s > stopifnot(all.equal(y_smooth, y_smooth0)) 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Missing values 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > x <- 1:100 367s > x[50] <- NA_integer_ 367s > nx <- length(x) 367s > y <- double(nx) 367s > y[1:25] <- 5 367s > y[51:75] <- -5 367s > y[82:92] <- NA_real_ 367s > y <- y + rnorm(nx) 367s > 367s > # Bins 367s > bx <- c(0.5, 25.5, 75.5, 82.5, 100.5) 367s > 367s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 367s > y_smooth <- binMeans(y, x = x, bx = bx) 367s > # Sanity check 367s > stopifnot(all.equal(y_smooth, y_smooth0)) 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Exception handling 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Zero bin bounderies (invalid bin definition) 367s > bx <- double(0L) 367s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 367s > stopifnot(inherits(res, "try-error")) 367s > 367s > # One bin boundery (invalid bin definition) 367s > bx <- double(1L) 367s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 367s > stopifnot(inherits(res, "try-error")) 367s > 367s 367s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 367s Copyright (C) 2024 The R Foundation for Statistical Computing 367s Platform: arm-unknown-linux-gnueabihf (32-bit) 367s 367s R is free software and comes with ABSOLUTELY NO WARRANTY. 367s You are welcome to redistribute it under certain conditions. 367s Type 'license()' or 'licence()' for distribution details. 367s 367s R is a collaborative project with many contributors. 367s Type 'contributors()' for more information and 367s 'citation()' on how to cite R or R packages in publications. 367s 367s Type 'demo()' for some demos, 'help()' for on-line help, or 367s 'help.start()' for an HTML browser interface to help. 367s Type 'q()' to quit R. 367s 367s > library("matrixStats") 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Naive R implementation of binMeans() 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 367s + n_smooth <- length(bx) - 1L 367s + res <- double(n_smooth) 367s + counts <- rep(NaN, times = n_smooth) 367s + 367s + if (na.rm) { 367s + keep <- !is.na(x) & !is.na(y) 367s + x <- x[keep] 367s + y <- y[keep] 367s + } 367s + 367s + # For each bin... 367s + for (kk in seq_len(n_smooth)) { 367s + if (right) { 367s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 367s + } else { 367s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 367s + } 367s + y_kk <- y[idxs] 367s + res[kk] <- mean(y_kk) 367s + counts[kk] <- length(idxs) 367s + } # for (kk ...) 367s + 367s + if (count) attr(res, "count") <- counts 367s + res 367s + } 367s > 367s > 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > # Subsetted tests 367s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367s > source("utils/validateIndicesFramework.R") 367s > y <- runif(6, min = -6, max = 6) 367s > x <- runif(6, min = -6, max = 6) 367s > storage.mode(x) <- "integer" 367s > bx <- c(-6, 0, 3, 4, 10) 367s > for (idxs in index_cases) { 367s + for (na.rm in c(TRUE, FALSE)) { 367s + validateIndicesTestVector_w(y, x, idxs, 367s + ftest = binMeans, fsure = binMeans0, 367s + bx = bx, na.rm = na.rm, 367s + count = TRUE, right = FALSE) 367s + validateIndicesTestVector_w(y, x, idxs, 367s + ftest = binMeans, fsure = binMeans0, 367s + bx = bx, na.rm = na.rm, 367s + count = TRUE, right = TRUE) 367s + } 367s + } 368s > 368s 368s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 368s Copyright (C) 2024 The R Foundation for Statistical Computing 368s Platform: arm-unknown-linux-gnueabihf (32-bit) 368s 368s R is free software and comes with ABSOLUTELY NO WARRANTY. 368s You are welcome to redistribute it under certain conditions. 368s Type 'license()' or 'licence()' for distribution details. 368s 368s R is a collaborative project with many contributors. 368s Type 'contributors()' for more information and 368s 'citation()' on how to cite R or R packages in publications. 368s 368s Type 'demo()' for some demos, 'help()' for on-line help, or 368s 'help.start()' for an HTML browser interface to help. 368s Type 'q()' to quit R. 368s 368s > library("matrixStats") 368s > 368s > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 368s + if (is.na(value)) { 368s + counts <- sum(is.na(x)) 368s + } else { 368s + counts <- sum(x == value, na.rm = na.rm) 368s + } 368s + as.integer(counts) 368s + } 368s > 368s > 368s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 368s > # Data type: integer and numeric 368s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 368s > for (mode in c("integer", "double")) { 368s + x <- runif(20 * 5, min = -3, max = 3) 368s + x[sample.int(length(x), size = 7)] <- 0 368s + storage.mode(x) <- mode 368s + 368s + for (na.rm in c(FALSE, TRUE)) { 368s + # Count zeros 368s + n0 <- count_R(x, value = 0, na.rm = na.rm) 368s + n1 <- count(x, value = 0, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + all <- allValue(x, value = 0, na.rm = na.rm) 368s + any <- anyValue(x, value = 0, na.rm = na.rm) 368s + 368s + # Count NAs 368s + n0 <- count_R(x, value = NA, na.rm = na.rm) 368s + n1 <- count(x, value = NA, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + all <- allValue(x, value = NA, na.rm = na.rm) 368s + any <- anyValue(x, value = NA, na.rm = na.rm) 368s + 368s + if (mode == "integer") { 368s + ux <- unique(as.vector(x)) 368s + n0 <- n1 <- integer(length(x)) 368s + for (value in ux) { 368s + n0 <- n0 + count_R(x, value = value, na.rm = na.rm) 368s + n1 <- n1 + count(x, value = value, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + } 368s + stopifnot(all(n0 == ncol(x))) 368s + } # if (mode == "integer") 368s + 368s + } # for (na.rm ...) 368s + } # for (mode ...) 368s > 368s > # All NAs 368s > na_list <- list(NA_integer_, NA_real_, NaN) 368s > for (na_value in na_list) { 368s + x <- rep(na_value, times = 10L) 368s + for (na.rm in c(FALSE, TRUE)) { 368s + n0 <- count_R(x, na.rm = na.rm) 368s + n1 <- count(x, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + 368s + # Count NAs 368s + n0 <- count_R(x, value = NA, na.rm = na.rm) 368s + n1 <- count(x, value = NA, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + any <- anyValue(x, value = NA, na.rm = na.rm) 368s + all <- allValue(x, value = NA, na.rm = na.rm) 368s + stopifnot(any) 368s + stopifnot(all) 368s + } 368s + } # for (na_value ...) 368s > 368s > 368s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 368s > # Data type: logical 368s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 368s > x <- logical(length = 10L) 368s > x[3:7] <- TRUE 368s > 368s > # Row/column counts 368s > for (na.rm in c(FALSE, TRUE)) { 368s + n0 <- count_R(x, na.rm = na.rm) 368s + n1 <- count(x, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + 368s + n_true <- count(x, value = TRUE, na.rm = na.rm) 368s + n_false <- count(x, value = FALSE, na.rm = na.rm) 368s + stopifnot(n_true + n_false == ncol(x)) 368s + 368s + # Count NAs 368s + n0 <- count_R(x, value = NA, na.rm = na.rm) 368s + n1 <- count(x, value = NA, na.rm = na.rm) 368s + stopifnot(identical(n1, n0)) 368s + } 368s > 368s 368s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 368s Copyright (C) 2024 The R Foundation for Statistical Computing 368s Platform: arm-unknown-linux-gnueabihf (32-bit) 368s 368s R is free software and comes with ABSOLUTELY NO WARRANTY. 368s You are welcome to redistribute it under certain conditions. 368s Type 'license()' or 'licence()' for distribution details. 368s 368s R is a collaborative project with many contributors. 368s Type 'contributors()' for more information and 368s 'citation()' on how to cite R or R packages in publications. 368s 368s Type 'demo()' for some demos, 'help()' for on-line help, or 368s 'help.start()' for an HTML browser interface to help. 368s Type 'q()' to quit R. 368s 369s > library("matrixStats") 369s > 369s > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 369s + if (is.na(value)) { 369s + counts <- sum(is.na(x)) 369s + } else { 369s + counts <- sum(x == value, na.rm = na.rm) 369s + } 369s + as.integer(counts) 369s + } 369s > 369s > 369s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 369s > # Subsetted tests 369s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 369s > source("utils/validateIndicesFramework.R") 369s > x <- runif(6, min = -3, max = 3) 369s > storage.mode(x) <- "integer" 369s > for (idxs in index_cases) { 369s + validateIndicesTestVector(x, idxs, 369s + ftest = count, fsure = count_R, 369s + value = 0, na.rm = TRUE) 369s + validateIndicesTestVector(x, idxs, 369s + ftest = count, fsure = count_R, 369s + value = 0, na.rm = FALSE) 369s + validateIndicesTestVector(x, idxs, 369s + ftest = count, fsure = count_R, 369s + value = NA_integer_) 369s + } 369s > 369s 369s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 369s Copyright (C) 2024 The R Foundation for Statistical Computing 369s Platform: arm-unknown-linux-gnueabihf (32-bit) 369s 369s R is free software and comes with ABSOLUTELY NO WARRANTY. 369s You are welcome to redistribute it under certain conditions. 369s Type 'license()' or 'licence()' for distribution details. 369s 369s R is a collaborative project with many contributors. 369s Type 'contributors()' for more information and 369s 'citation()' on how to cite R or R packages in publications. 369s 369s Type 'demo()' for some demos, 'help()' for on-line help, or 369s 'help.start()' for an HTML browser interface to help. 369s Type 'q()' to quit R. 369s 369s > library("matrixStats") 369s > 369s > diff2_R <- function(..., useNames = NA){ 369s + res <- diff(...) 369s + if (is.na(useNames) || !useNames) names(res) <- NULL 369s + res 369s + } 369s > 369s > set.seed(0x42) 369s > 369s > for (mode in c("integer", "double")) { 369s + x <- rnorm(10, sd = 5) 369s + storage.mode(x) <- mode 369s + str(x) 369s + 369s + for (has_na in c(FALSE, TRUE)) { 369s + for (setNames in c(TRUE, FALSE)) { 369s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 369s + if (has_na) { 369s + x[sample(1:10, size = 3)] <- NA 369s + } 369s + if (setNames) { 369s + names(x) <- LETTERS[1:10] 369s + } 369s + for (l in 1:3) { 369s + for (d in 1:4) { 369s + cat(sprintf("%s: NAs = %s, lag = %d, differences = %d, setNames = %d, useNames = %d\n", 369s + mode, has_na, l, d, setNames, useNames)) 369s + y0 <- diff2_R(x, lag = l, differences = d, useNames = useNames) 369s + str(y0) 369s + y1 <- diff2(x, lag = l, differences = d, useNames = useNames) 369s + str(y1) 369s + stopifnot(identical(y1, y0)) 369s + } 369s + } 369s + } 369s + } 369s + } # for (has_na ...) 369s + } 369s int [1:10] 11 1 2 0 -1 -3 -3 6 0 0 369s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 369s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 369s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 369s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 369s Named int [1:8] 11 -3 1 -1 2 9 -15 6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s Named int [1:8] 11 -3 1 -1 2 9 -15 6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 369s Named int [1:7] -14 4 -2 3 7 -24 21 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s Named int [1:7] -14 4 -2 3 7 -24 21 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 369s Named int [1:6] 18 -6 5 4 -31 45 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s Named int [1:6] 18 -6 5 4 -31 45 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 369s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 369s Named int [1:6] 6 -2 1 12 5 -15 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s Named int [1:6] 6 -2 1 12 5 -15 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 369s Named int [1:4] -5 14 4 -27 369s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 369s Named int [1:4] -5 14 4 -27 369s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 369s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 369s Named int [1:2] 9 -41 369s - attr(*, "names")= chr [1:2] "I" "J" 369s Named int [1:2] 9 -41 369s - attr(*, "names")= chr [1:2] "I" "J" 369s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 369s Named int [1:7] -11 -2 -5 -3 7 3 3 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s Named int [1:7] -11 -2 -5 -3 7 3 3 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 369s Named int [1:4] 8 9 8 6 369s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 369s Named int [1:4] 8 9 8 6 369s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 369s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 369s Named int -2 369s - attr(*, "names")= chr "J" 369s Named int -2 369s - attr(*, "names")= chr "J" 369s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 369s Named int(0) 369s - attr(*, "names")= chr(0) 369s Named int(0) 369s - attr(*, "names")= chr(0) 369s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 369s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 369s int [1:8] 11 -3 1 -1 2 9 -15 6 369s int [1:8] 11 -3 1 -1 2 9 -15 6 369s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 369s int [1:7] -14 4 -2 3 7 -24 21 369s int [1:7] -14 4 -2 3 7 -24 21 369s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 369s int [1:6] 18 -6 5 4 -31 45 369s int [1:6] 18 -6 5 4 -31 45 369s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 369s int [1:8] -9 -1 -3 -3 -2 9 3 -6 369s int [1:8] -9 -1 -3 -3 -2 9 3 -6 369s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 369s int [1:6] 6 -2 1 12 5 -15 369s int [1:6] 6 -2 1 12 5 -15 369s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 369s int [1:4] -5 14 4 -27 369s int [1:4] -5 14 4 -27 369s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 369s int [1:2] 9 -41 369s int [1:2] 9 -41 369s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 369s int [1:7] -11 -2 -5 -3 7 3 3 369s int [1:7] -11 -2 -5 -3 7 3 3 369s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 369s int [1:4] 8 9 8 6 369s int [1:4] 8 9 8 6 369s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 369s int -2 369s int -2 369s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 369s int(0) 369s int(0) 369s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 369s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 369s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 369s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 369s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 369s Named int [1:8] 11 -3 1 -1 2 9 -15 6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s Named int [1:8] 11 -3 1 -1 2 9 -15 6 369s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 369s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 369s Named int [1:7] -14 4 -2 3 7 -24 21 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s Named int [1:7] -14 4 -2 3 7 -24 21 369s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 369s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 369s Named int [1:6] 18 -6 5 4 -31 45 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s Named int [1:6] 18 -6 5 4 -31 45 369s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 369s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 369s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 370s Named int [1:6] 6 -2 1 12 5 -15 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named int [1:6] 6 -2 1 12 5 -15 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 370s Named int [1:4] -5 14 4 -27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] -5 14 4 -27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 370s Named int [1:2] 9 -41 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named int [1:2] 9 -41 370s - attr(*, "names")= chr [1:2] "I" "J" 370s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 370s Named int [1:7] -11 -2 -5 -3 7 3 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named int [1:7] -11 -2 -5 -3 7 3 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 370s Named int [1:4] 8 9 8 6 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] 8 9 8 6 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 370s Named int -2 370s - attr(*, "names")= chr "J" 370s Named int -2 370s - attr(*, "names")= chr "J" 370s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 370s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 370s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 370s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 370s int [1:8] 11 -3 1 -1 2 9 -15 6 370s int [1:8] 11 -3 1 -1 2 9 -15 6 370s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 370s int [1:7] -14 4 -2 3 7 -24 21 370s int [1:7] -14 4 -2 3 7 -24 21 370s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 370s int [1:6] 18 -6 5 4 -31 45 370s int [1:6] 18 -6 5 4 -31 45 370s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 370s int [1:8] -9 -1 -3 -3 -2 9 3 -6 370s int [1:8] -9 -1 -3 -3 -2 9 3 -6 370s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 370s int [1:6] 6 -2 1 12 5 -15 370s int [1:6] 6 -2 1 12 5 -15 370s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 370s int [1:4] -5 14 4 -27 370s int [1:4] -5 14 4 -27 370s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 370s int [1:2] 9 -41 370s int [1:2] 9 -41 370s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 370s int [1:7] -11 -2 -5 -3 7 3 3 370s int [1:7] -11 -2 -5 -3 7 3 3 370s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 370s int [1:4] 8 9 8 6 370s int [1:4] 8 9 8 6 370s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 370s int -2 370s int -2 370s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 370s int(0) 370s int(0) 370s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 370s Named int [1:9] NA NA NA NA NA 0 9 -6 0 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named int [1:9] NA NA NA NA NA 0 9 -6 0 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 370s Named int [1:8] NA NA NA NA NA 9 -15 6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named int [1:8] NA NA NA NA NA 9 -15 6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 370s Named int [1:7] NA NA NA NA NA -24 21 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named int [1:7] NA NA NA NA NA -24 21 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 370s Named int [1:6] NA NA NA NA NA 45 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named int [1:6] NA NA NA NA NA 45 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 370s Named int [1:8] -9 NA NA NA NA 9 3 -6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named int [1:8] -9 NA NA NA NA 9 3 -6 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 370s Named int [1:6] NA NA NA NA NA -15 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named int [1:6] NA NA NA NA NA -15 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 370s Named int [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named int [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 370s Named int [1:7] NA NA -5 NA NA 3 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named int [1:7] NA NA -5 NA NA 3 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 370s Named int [1:4] NA NA 8 NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] NA NA 8 NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 370s Named int NA 370s - attr(*, "names")= chr "J" 370s Named int NA 370s - attr(*, "names")= chr "J" 370s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 370s int [1:9] NA NA NA NA NA 0 9 NA NA 370s int [1:9] NA NA NA NA NA 0 9 NA NA 370s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 370s int [1:8] NA NA NA NA NA 9 NA NA 370s int [1:8] NA NA NA NA NA 9 NA NA 370s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 370s int [1:7] NA NA NA NA NA NA NA 370s int [1:7] NA NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 370s int [1:6] NA NA NA NA NA NA 370s int [1:6] NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 370s int [1:8] NA NA NA NA NA 9 NA -6 370s int [1:8] NA NA NA NA NA 9 NA -6 370s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 370s int [1:6] NA NA NA NA NA -15 370s int [1:6] NA NA NA NA NA -15 370s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 370s int [1:4] NA NA NA NA 370s int [1:4] NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 370s int [1:2] NA NA 370s int [1:2] NA NA 370s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 370s int [1:7] NA NA NA NA NA NA 3 370s int [1:7] NA NA NA NA NA NA 3 370s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 370s int [1:4] NA NA NA NA 370s int [1:4] NA NA NA NA 370s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 370s int NA 370s int NA 370s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 370s int(0) 370s int(0) 370s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 370s Named int [1:9] NA NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named int [1:9] NA NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 370s Named int [1:8] NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named int [1:8] NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 370s Named int [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named int [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 370s Named int [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named int [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 370s Named int [1:8] NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named int [1:8] NA NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 370s Named int [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named int [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 370s Named int [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named int [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 370s Named int [1:7] NA NA NA NA NA NA 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named int [1:7] NA NA NA NA NA NA 3 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named int [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 370s Named int NA 370s - attr(*, "names")= chr "J" 370s Named int NA 370s - attr(*, "names")= chr "J" 370s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s Named int(0) 370s - attr(*, "names")= chr(0) 370s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 370s int [1:9] NA NA NA NA NA NA NA NA NA 370s int [1:9] NA NA NA NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 370s int [1:8] NA NA NA NA NA NA NA NA 370s int [1:8] NA NA NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 370s int [1:7] NA NA NA NA NA NA NA 370s int [1:7] NA NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 370s int [1:6] NA NA NA NA NA NA 370s int [1:6] NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 370s int [1:8] NA NA NA NA NA NA NA NA 370s int [1:8] NA NA NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 370s int [1:6] NA NA NA NA NA NA 370s int [1:6] NA NA NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 370s int [1:4] NA NA NA NA 370s int [1:4] NA NA NA NA 370s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 370s int [1:2] NA NA 370s int [1:2] NA NA 370s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 370s int [1:7] NA NA NA NA NA NA 3 370s int [1:7] NA NA NA NA NA NA 3 370s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 370s int [1:4] NA NA NA NA 370s int [1:4] NA NA NA NA 370s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 370s int NA 370s int NA 370s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 370s int(0) 370s int(0) 370s num [1:10] 2.586 -0.344 0.33 9.155 -3.254 ... 370s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 370s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 370s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 370s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 370s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 370s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 370s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 370s Named num [1:4] 0.368 42.988 15.396 -29.313 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] 0.368 42.988 15.396 -29.313 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 370s Named num [1:2] 15 -72.3 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named num [1:2] 15 -72.3 370s - attr(*, "names")= chr [1:2] "I" "J" 370s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 370s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 370s Named num [1:4] -23.52 7.92 11.38 23.27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] -23.52 7.92 11.38 23.27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 370s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 370s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 370s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 370s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 370s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 370s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 370s num [1:4] 0.368 42.988 15.396 -29.313 370s num [1:4] 0.368 42.988 15.396 -29.313 370s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 370s num [1:2] 15 -72.3 370s num [1:2] 15 -72.3 370s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 370s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 370s num [1:4] -23.52 7.92 11.38 23.27 370s num [1:4] -23.52 7.92 11.38 23.27 370s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 370s num 46.8 370s num 46.8 370s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 370s num(0) 370s num(0) 370s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 370s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 370s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 370s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 370s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 370s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 370s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 370s Named num [1:4] 0.368 42.988 15.396 -29.313 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] 0.368 42.988 15.396 -29.313 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 370s Named num [1:2] 15 -72.3 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named num [1:2] 15 -72.3 370s - attr(*, "names")= chr [1:2] "I" "J" 370s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 370s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 370s Named num [1:4] -23.52 7.92 11.38 23.27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] -23.52 7.92 11.38 23.27 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 370s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 370s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 370s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 370s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 370s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 370s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 370s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 370s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 370s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 370s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 370s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 370s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 370s num [1:4] 0.368 42.988 15.396 -29.313 370s num [1:4] 0.368 42.988 15.396 -29.313 370s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 370s num [1:2] 15 -72.3 370s num [1:2] 15 -72.3 370s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 370s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 370s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 370s num [1:4] -23.52 7.92 11.38 23.27 370s num [1:4] -23.52 7.92 11.38 23.27 370s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 370s num 46.8 370s num 46.8 370s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 370s num(0) 370s num(0) 370s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 370s Named num [1:9] -2.929 0.673 8.826 NA NA ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named num [1:9] -2.929 0.673 8.826 NA NA ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 370s Named num [1:8] 3.6 8.15 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] 3.6 8.15 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 370s Named num [1:7] 4.55 NA NA NA NA ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 4.55 NA NA NA NA ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 370s Named num [1:8] -2.26 9.5 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] -2.26 9.5 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 370s Named num [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named num [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 370s Named num [1:7] 6.57 NA NA -16.95 NA ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] 6.57 NA NA -16.95 NA ... 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 370s Named num [1:4] -23.5 NA NA 23.3 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] -23.5 NA NA 23.3 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s Named num 46.8 370s - attr(*, "names")= chr "J" 370s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 370s num [1:9] NA 0.673 8.826 NA NA ... 370s num [1:9] NA 0.673 8.826 NA NA ... 370s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 370s num [1:8] NA 8.15 NA NA NA ... 370s num [1:8] NA 8.15 NA NA NA ... 370s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 370s num [1:7] NA NA NA NA NA NA NA 370s num [1:7] NA NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 370s num [1:6] NA NA NA NA NA NA 370s num [1:6] NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 370s num [1:8] NA 9.5 NA NA NA ... 370s num [1:8] NA 9.5 NA NA NA ... 370s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 370s num [1:6] NA NA NA NA NA NA 370s num [1:6] NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 370s num [1:4] NA NA NA NA 370s num [1:4] NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 370s num [1:2] NA NA 370s num [1:2] NA NA 370s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 370s num [1:7] NA NA NA NA NA NA NA 370s num [1:7] NA NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 370s num [1:4] NA NA NA NA 370s num [1:4] NA NA NA NA 370s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 370s num NA 370s num NA 370s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 370s num(0) 370s num(0) 370s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 370s Named num [1:9] NA 0.673 8.826 NA NA ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s Named num [1:9] NA 0.673 8.826 NA NA ... 370s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 370s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 370s Named num [1:8] NA 8.15 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] NA 8.15 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 370s Named num [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 370s Named num [1:8] NA 9.5 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s Named num [1:8] NA 9.5 NA NA NA ... 370s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 370s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s Named num [1:6] NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 370s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 370s Named num [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s Named num [1:2] NA NA 370s - attr(*, "names")= chr [1:2] "I" "J" 370s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 370s Named num [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s Named num [1:7] NA NA NA NA NA NA NA 370s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 370s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s Named num [1:4] NA NA NA NA 370s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 370s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 370s Named num NA 370s - attr(*, "names")= chr "J" 370s Named num NA 370s - attr(*, "names")= chr "J" 370s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s Named num(0) 370s - attr(*, "names")= chr(0) 370s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 370s num [1:9] NA 0.673 8.826 NA NA ... 370s num [1:9] NA 0.673 8.826 NA NA ... 370s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 370s num [1:8] NA 8.15 NA NA NA ... 370s num [1:8] NA 8.15 NA NA NA ... 370s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 370s num [1:7] NA NA NA NA NA NA NA 370s num [1:7] NA NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 370s num [1:6] NA NA NA NA NA NA 370s num [1:6] NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 370s num [1:8] NA 9.5 NA NA NA ... 370s num [1:8] NA 9.5 NA NA NA ... 370s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 370s num [1:6] NA NA NA NA NA NA 370s num [1:6] NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 370s num [1:4] NA NA NA NA 370s num [1:4] NA NA NA NA 370s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 370s num [1:2] NA NA 370s num [1:2] NA NA 370s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 370s num [1:7] NA NA NA NA NA NA NA 370s num [1:7] NA NA NA NA NA NA NA 370s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 370s num [1:4] NA NA NA NA 370s num [1:4] NA NA NA NA 370s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 370s num NA 370s num NA 370s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 370s num(0) 370s num(0) 370s > 370s 370s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 370s Copyright (C) 2024 The R Foundation for Statistical Computing 370s Platform: arm-unknown-linux-gnueabihf (32-bit) 370s 370s R is free software and comes with ABSOLUTELY NO WARRANTY. 370s You are welcome to redistribute it under certain conditions. 370s Type 'license()' or 'licence()' for distribution details. 370s 370s R is a collaborative project with many contributors. 370s Type 'contributors()' for more information and 370s 'citation()' on how to cite R or R packages in publications. 370s 370s Type 'demo()' for some demos, 'help()' for on-line help, or 370s 'help.start()' for an HTML browser interface to help. 370s Type 'q()' to quit R. 370s 371s > library("matrixStats") 371s > 371s > diff2_R <- function(..., useNames=NA){ 371s + res <- diff(...) 371s + if (is.na(useNames) || !useNames) names(res) <- NULL 371s + res 371s + } 371s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 371s > # Subsetted tests 371s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 371s > source("utils/validateIndicesFramework.R") 371s > x <- runif(6, min = -6, max = 6) 371s > for (setNames in c(TRUE, FALSE)) { 371s + if (setNames) names(x) <- LETTERS[1:6] 371s + else names(x) <- NULL 371s + for (l in 1:2) { 371s + for (d in 1:2) { 371s + for (idxs in index_cases) { 371s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 371s + validateIndicesTestVector(x, idxs, 371s + ftest = diff2, fsure = diff2_R, 371s + lag = l, differences = d, useNames = useNames) 371s + } 371s + } 371s + } 371s + } 371s + } 371s > 371s 371s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 371s Copyright (C) 2024 The R Foundation for Statistical Computing 371s Platform: arm-unknown-linux-gnueabihf (32-bit) 371s 371s R is free software and comes with ABSOLUTELY NO WARRANTY. 371s You are welcome to redistribute it under certain conditions. 371s Type 'license()' or 'licence()' for distribution details. 371s 371s R is a collaborative project with many contributors. 371s Type 'contributors()' for more information and 371s 'citation()' on how to cite R or R packages in publications. 371s 371s Type 'demo()' for some demos, 'help()' for on-line help, or 371s 'help.start()' for an HTML browser interface to help. 371s Type 'q()' to quit R. 371s 371s > library("matrixStats") 371s > 371s > indexByRow_R1 <- function(dim, idxs = NULL, ...) { 371s + n <- prod(dim) 371s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 371s + if (!is.null(idxs)) 371s + x <- x[idxs] 371s + as.vector(x) 371s + } 371s > 371s > 371s > indexByRow_R2 <- function(dim, idxs = NULL, ...) { 371s + n <- prod(dim) 371s + if (is.null(idxs)) { 371s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 371s + as.vector(x) 371s + } else { 371s + idxs <- idxs - 1L 371s + cols <- idxs %/% dim[2L] 371s + rows <- idxs %% dim[2L] 371s + cols + dim[1L] * rows + 1L 371s + } 371s + } 371s > 371s > 371s > dim <- c(5L, 4L) 371s > x <- matrix(NA_integer_, nrow = dim[1L], ncol = dim[2L]) 371s > y <- t(x) 371s > idxs_by_cols <- seq_along(x) 371s > 371s > # Assign by columns 371s > x[idxs_by_cols] <- idxs_by_cols 371s > print(x) 371s [,1] [,2] [,3] [,4] 371s [1,] 1 6 11 16 371s [2,] 2 7 12 17 371s [3,] 3 8 13 18 371s [4,] 4 9 14 19 371s [5,] 5 10 15 20 371s > 371s > # Truth 371s > y0 <- t(x) 371s > idxs_by_rows <- as.vector(y0) 371s > 371s > # Assert 371s > idxs <- indexByRow(dim) 371s > stopifnot(all.equal(idxs, idxs_by_rows)) 371s > y <- x 371s > y[idxs_by_rows] <- idxs 371s > print(y) 371s [,1] [,2] [,3] [,4] 371s [1,] 1 6 11 16 371s [2,] 2 7 12 17 371s [3,] 3 8 13 18 371s [4,] 4 9 14 19 371s [5,] 5 10 15 20 371s > stopifnot(all(as.vector(y) == as.vector(x))) 371s > 371s > idxs_R1 <- indexByRow_R1(dim) 371s > stopifnot(all.equal(idxs_R1, idxs_by_rows)) 371s > 371s > idxs_R2 <- indexByRow_R2(dim) 371s > stopifnot(all.equal(idxs_R2, idxs_by_rows)) 371s > 371s > # Assert 371s > idxs_by_cols <- seq(from = 1, to = length(x), by = 3L) 371s > idxs_by_rows <- as.vector(t(x)[idxs_by_cols]) 371s > 371s > idxs <- indexByRow(dim, idxs = idxs_by_cols) 371s > stopifnot(all(idxs == idxs_by_rows)) 371s > 371s > idxs_R1 <- indexByRow_R1(dim, idxs = idxs_by_cols) 371s > stopifnot(all(idxs_R1 == idxs_by_rows)) 371s > 371s > idxs_R2 <- indexByRow_R2(dim, idxs = idxs_by_cols) 371s > stopifnot(all(idxs_R2 == idxs_by_rows)) 371s > 371s > 371s > ## DEFUNCT: Backward compatibility 371s > res <- tryCatch({ 371s + idxs1 <- indexByRow(x) 371s + }, error = identity) 371s > stopifnot(inherits(res, "error")) 371s > 371s > 371s > ## Exceptions: 371s > ## Too large matrices are not supported, which happens 371s > ## when prod(dim) > .Machine$integer.max 371s > dim_too_large <- c(.Machine$integer.max, 2L) 371s > res <- tryCatch({ 371s + idxs <- indexByRow(dim_too_large, idxs = 1L) 371s + }, error = identity) 371s > stopifnot(inherits(res, "error")) 371s > 371s > ## Non-positive indices are not supported 371s > res <- tryCatch({ 371s + idxs <- indexByRow(c(1,1), idxs = 0L) 371s + }, error = identity) 371s > stopifnot(inherits(res, "error")) 371s > 371s > res <- tryCatch({ 371s + idxs <- indexByRow(c(1,1), idxs = -1L) 371s + }, error = identity) 371s > stopifnot(inherits(res, "error")) 371s > 372s 372s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 372s Copyright (C) 2024 The R Foundation for Statistical Computing 372s Platform: arm-unknown-linux-gnueabihf (32-bit) 372s 372s R is free software and comes with ABSOLUTELY NO WARRANTY. 372s You are welcome to redistribute it under certain conditions. 372s Type 'license()' or 'licence()' for distribution details. 372s 372s R is a collaborative project with many contributors. 372s Type 'contributors()' for more information and 372s 'citation()' on how to cite R or R packages in publications. 372s 372s Type 'demo()' for some demos, 'help()' for on-line help, or 372s 'help.start()' for an HTML browser interface to help. 372s Type 'q()' to quit R. 372s 372s > library("matrixStats") 372s > library("stats") 372s > 372s > logSumExp_R <- function(lx, na.rm = FALSE) { 372s + log(sum(exp(lx), na.rm = na.rm)) 372s + } 372s > 372s > ## R-help thread \emph{'[R] Beyond double-precision?'} on May 9, 2009. 372s > 372s > for (mode in c("integer", "double")) { 372s + cat("mode: ", mode, "\n", sep = "") 372s + 372s + set.seed(1) 372s + x <- runif(20, min = 1.0, max = 3.0) 372s + storage.mode(x) <- mode 372s + str(x) 372s + 372s + ## The logarithm of the harmonic mean 372s + y0 <- log(1 / mean(1 / x)) 372s + print(y0) ## -1.600885 372s + 372s + lx <- log(x) 372s + y1 <- log(length(x)) - logSumExp(-lx) 372s + print(y1) ## [1] -1.600885 372s + 372s + # Sanity check 372s + stopifnot(all.equal(y1, y0)) 372s + 372s + y2 <- log(length(x)) - logSumExp_R(-lx) 372s + # Sanity check 372s + stopifnot(all.equal(y2, y0)) 372s + } # for (mode ...) 372s mode: integer 372s int [1:20] 1 1 2 2 1 2 2 2 2 1 ... 372s [1] 0.3215836 372s [1] 0.3215836 372s mode: double 372s num [1:20] 1.53 1.74 2.15 2.82 1.4 ... 372s [1] 0.6673156 372s [1] 0.6673156 372s > 372s > 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > # Missing values 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > ## NA values 372s > lx <- c(1, 2, 3) 372s > lx[2] <- NA_real_ 372s > y0 <- logSumExp_R(lx, na.rm = FALSE) 372s > y <- logSumExp(lx, na.rm = FALSE) 372s > print(y) 372s [1] NA 372s > stopifnot(identical(y, NA_real_)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > y0 <- logSumExp_R(lx, na.rm = TRUE) 372s > y <- logSumExp(lx, na.rm = TRUE) 372s > print(y) 372s [1] 3.126928 372s > stopifnot(all.equal(y, y0)) 372s > 372s > ## NaN values 372s > lx <- c(1, 2, 3) 372s > lx[2] <- NaN 372s > y0 <- logSumExp_R(lx, na.rm = FALSE) 372s > y <- logSumExp(lx, na.rm = FALSE) 372s > print(y) 372s [1] NA 372s > stopifnot(identical(y, NA_real_)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > y0 <- logSumExp_R(lx, na.rm = TRUE) 372s > y <- logSumExp(lx, na.rm = TRUE) 372s > print(y) 372s [1] 3.126928 372s > stopifnot(all.equal(y, y0)) 372s > 372s > 372s > 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > # Corner cases 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > ## Zero-length vectors 372s > lx <- numeric(0L) 372s > y0 <- logSumExp_R(lx) 372s > y <- logSumExp(lx) 372s > print(y) 372s [1] -Inf 372s > stopifnot(identical(y, -Inf)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > ## Vectors of length one 372s > lx <- 1.0 372s > y0 <- logSumExp_R(lx) 372s > y <- logSumExp(lx) 372s > print(y) 372s [1] 1 372s > stopifnot(identical(y, lx)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > lx <- NA_real_ 372s > y0 <- logSumExp_R(lx, na.rm = TRUE) 372s > y <- logSumExp(lx, na.rm = TRUE) 372s > print(y) 372s [1] -Inf 372s > stopifnot(identical(y, -Inf)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > ## All missing values 372s > lx <- c(NA_real_, NA_real_) 372s > y0 <- logSumExp_R(lx, na.rm = TRUE) 372s > y <- logSumExp(lx, na.rm = TRUE) 372s > print(y) 372s [1] -Inf 372s > stopifnot(identical(y, -Inf)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > lx <- c(NA_real_, NA_real_) 372s > y0 <- logSumExp_R(lx, na.rm = FALSE) 372s > y <- logSumExp(lx, na.rm = FALSE) 372s > print(y) 372s [1] NA 372s > stopifnot(identical(y, NA_real_)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > 372s > ## +Inf values 372s > lx <- c(1, 2, +Inf) 372s > y0 <- logSumExp_R(lx) 372s > y <- logSumExp(lx) 372s > print(y) 372s [1] Inf 372s > stopifnot(identical(y, +Inf)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > ## First element is a missing value, cf. PR #33 372s > lx <- c(NA_real_, 1) 372s > y0 <- logSumExp_R(lx) 372s > print(y0) 372s [1] NA 372s > y <- logSumExp(lx, na.rm = FALSE) 372s > print(y) 372s [1] NA 372s > stopifnot(identical(y, NA_real_)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > y0 <- logSumExp_R(lx, na.rm = TRUE) 372s > print(y0) 372s [1] 1 372s > y <- logSumExp(lx, na.rm = TRUE) 372s > print(y) 372s [1] 1 372s > stopifnot(identical(y, 1)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > ## Multiple -Inf values, cf. issue #84 372s > lx <- c(-Inf, -Inf) 372s > y0 <- logSumExp_R(lx) 372s > y <- logSumExp(lx) 372s > print(y) 372s [1] -Inf 372s > stopifnot(identical(y, -Inf)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s > lx <- c(-Inf, 5, -Inf) 372s > y0 <- logSumExp_R(lx) 372s > y <- logSumExp(lx) 372s > print(y) 372s [1] 5 372s > stopifnot(identical(y, 5)) 372s > stopifnot(all.equal(y, y0)) 372s > 372s 372s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 372s Copyright (C) 2024 The R Foundation for Statistical Computing 372s Platform: arm-unknown-linux-gnueabihf (32-bit) 372s 372s R is free software and comes with ABSOLUTELY NO WARRANTY. 372s You are welcome to redistribute it under certain conditions. 372s Type 'license()' or 'licence()' for distribution details. 372s 372s R is a collaborative project with many contributors. 372s Type 'contributors()' for more information and 372s 'citation()' on how to cite R or R packages in publications. 372s 372s Type 'demo()' for some demos, 'help()' for on-line help, or 372s 'help.start()' for an HTML browser interface to help. 372s Type 'q()' to quit R. 372s 372s > library("matrixStats") 372s > 372s > logSumExp_R <- function(lx, na.rm = FALSE) { 372s + log(sum(exp(lx), na.rm = na.rm)) 372s + } 372s > 372s > 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > # Subsetted tests 372s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 372s > source("utils/validateIndicesFramework.R") 372s > x <- runif(6, min = -6, max = 6) 372s > for (idxs in index_cases) { 372s + validateIndicesTestVector(x, idxs, 372s + ftest = logSumExp, fsure = logSumExp_R, 372s + na.rm = FALSE) 372s + validateIndicesTestVector(x, idxs, 372s + ftest = logSumExp, fsure = logSumExp_R, 372s + na.rm = TRUE) 372s + } 373s > 373s 373s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 373s Copyright (C) 2024 The R Foundation for Statistical Computing 373s Platform: arm-unknown-linux-gnueabihf (32-bit) 373s 373s R is free software and comes with ABSOLUTELY NO WARRANTY. 373s You are welcome to redistribute it under certain conditions. 373s Type 'license()' or 'licence()' for distribution details. 373s 373s R is a collaborative project with many contributors. 373s Type 'contributors()' for more information and 373s 'citation()' on how to cite R or R packages in publications. 373s 373s Type 'demo()' for some demos, 'help()' for on-line help, or 373s 'help.start()' for an HTML browser interface to help. 373s Type 'q()' to quit R. 373s 373s > library("matrixStats") 373s > 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > # Consistency checks 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > set.seed(1) 373s > 373s > mean2_R <- function(x, na.rm = FALSE, idxs = NULL) { 373s + if (is.null(idxs)) { 373s + mean(x, na.rm = na.rm) 373s + } else { 373s + mean(x[idxs], na.rm = na.rm) 373s + } 373s + } # mean2_R() 373s > 373s > 373s > cat("Consistency checks:\n") 373s Consistency checks: 373s > for (kk in 1:20) { 373s + cat("Random test #", kk, "\n", sep = "") 373s + 373s + # Simulate data in a matrix of any shape 373s + n <- sample(100L, size = 1L) 373s + x <- rnorm(n, sd = 100) 373s + 373s + # Add NAs? 373s + if ((kk %% 4) %in% c(3, 0)) { 373s + cat("Adding NAs\n") 373s + nna <- sample(n, size = 1L) 373s + na_values <- c(NA_real_, NaN) 373s + t <- sample(na_values, size = nna, replace = TRUE) 373s + x[sample(length(x), size = nna)] <- t 373s + } 373s + 373s + # Integer or double? 373s + if ((kk %% 4) %in% c(2, 0)) { 373s + cat("Coercing to integers\n") 373s + storage.mode(x) <- "integer" 373s + } 373s + 373s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 373s + 373s + # Sum over all 373s + y0 <- mean2_R(x, na.rm = na.rm) 373s + y1 <- mean2(x, na.rm = na.rm) 373s + stopifnot(all.equal(y1, y0)) 373s + 373s + # Sum over subset 373s + nidxs <- sample(n, size = 1L) 373s + idxs <- sample(n, size = nidxs) 373s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 373s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 373s + stopifnot(all.equal(y1, y0)) 373s + 373s + if (storage.mode(x) == "integer") { 373s + storage.mode(x) <- "logical" 373s + 373s + y0 <- mean2_R(x, na.rm = na.rm) 373s + y1 <- mean2(x, na.rm = na.rm) 373s + stopifnot(all.equal(y1, y0)) 373s + 373s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 373s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 373s + stopifnot(all.equal(y1, y0)) 373s + } 373s + } # for (kk ...) 373s Random test #1 373s Random test #2 373s Coercing to integers 373s Random test #3 373s Adding NAs 373s Random test #4 373s Adding NAs 373s Coercing to integers 373s Random test #5 373s Random test #6 373s Coercing to integers 373s Random test #7 373s Adding NAs 373s Random test #8 373s Adding NAs 373s Coercing to integers 373s Random test #9 373s Random test #10 373s Coercing to integers 373s Random test #11 373s Adding NAs 373s Random test #12 373s Adding NAs 373s Coercing to integers 373s Random test #13 373s Random test #14 373s Coercing to integers 373s Random test #15 373s Adding NAs 373s Random test #16 373s Adding NAs 373s Coercing to integers 373s Random test #17 373s Random test #18 373s Coercing to integers 373s Random test #19 373s Adding NAs 373s Random test #20 373s Adding NAs 373s Coercing to integers 373s > 373s > 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > # Special cases 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > for (na.rm in c(FALSE, TRUE)) { 373s + # Averaging over zero elements (integers) 373s + x <- integer(0) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + x <- 1:5 373s + idxs <- integer(0) 373s + s1 <- mean(x[idxs], na.rm = na.rm) 373s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over NA_integer_:s 373s + x <- rep(NA_integer_, times = 5L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + x <- rep(NA_integer_, times = 5L) 373s + idxs <- 1:3 373s + s1 <- mean(x[idxs], na.rm = na.rm) 373s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + 373s + # Averaging over zero elements (doubles) 373s + x <- double(0) 373s + s1 <- mean(x) 373s + s2 <- mean2(x) 373s + stopifnot(identical(s1, s2)) 373s + 373s + x <- as.double(1:10) 373s + idxs <- integer(0) 373s + s1 <- mean(x[idxs]) 373s + s2 <- mean2(x, idxs = idxs) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over NA_real_:s 373s + x <- rep(NA_real_, times = 5L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + x <- rep(NA_real_, times = 5L) 373s + idxs <- 1:3 373s + s1 <- mean(x[idxs], na.rm = na.rm) 373s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over -Inf:s 373s + x <- rep(-Inf, times = 3L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over +Inf:s 373s + x <- rep(+Inf, times = 3L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over mix of -Inf:s and +Inf:s 373s + x <- rep(c(-Inf, +Inf), times = 3L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over mix of -Inf:s and +Inf:s and numerics 373s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + stopifnot(identical(s1, s2)) 373s + 373s + # Averaging over mix of NaN, NA, +Inf, and numerics 373s + x <- c(NaN, NA, +Inf, 3.14) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + if (na.rm) { 373s + stopifnot(identical(s2, s1)) 373s + } else { 373s + stopifnot(is.na(s1), is.na(s2)) 373s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 373s + ## returned here (as one would expect). NaN might very well be returned, 373s + ## when both NA and NaN are involved. This is an accepted feature in R, 373s + ## which is documented in help("is.nan"). See also 373s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 373s + ## Thus, we cannot guarantee that s1 is identical to s0. 373s + } 373s + 373s + # Averaging over mix of NaN, NA_real_, +Inf, and numerics 373s + x <- c(NA_real_, NaN, +Inf, 3.14) 373s + s1 <- mean(x, na.rm = na.rm) 373s + s2 <- mean2(x, na.rm = na.rm) 373s + if (na.rm) { 373s + stopifnot(identical(s2, s1)) 373s + } else { 373s + stopifnot(is.na(s1), is.na(s2)) 373s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 373s + ## returned here (as one would expect). NaN might very well be returned, 373s + ## when both NA and NaN are involved. This is an accepted feature in R, 373s + ## which is documented in help("is.nan"). See also 373s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 373s + ## Thus, we cannot guarantee that s1 is identical to s0. 373s + } 373s + } 373s > 373s > 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > # Argument 'idxs' 373s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 373s > x <- 1:5 373s > idxs_list <- list( 373s + integer = 1:3, 373s + double = as.double(1:3), 373s + logical = (x <= 3) 373s + ) 373s > 373s > for (idxs in idxs_list) { 373s + cat("idxs:\n") 373s + str(idxs) 373s + s1 <- mean(x[idxs], na.rm = TRUE) 373s + s2 <- mean2(x, idxs = idxs, na.rm = TRUE) 373s + stopifnot(identical(s1, s2)) 373s + } 373s idxs: 374s int [1:3] 1 2 3 374s idxs: 374s num [1:3] 1 2 3 374s idxs: 374s logi [1:5] TRUE TRUE TRUE FALSE FALSE 374s > 374s 374s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 374s Copyright (C) 2024 The R Foundation for Statistical Computing 374s Platform: arm-unknown-linux-gnueabihf (32-bit) 374s 374s R is free software and comes with ABSOLUTELY NO WARRANTY. 374s You are welcome to redistribute it under certain conditions. 374s Type 'license()' or 'licence()' for distribution details. 374s 374s R is a collaborative project with many contributors. 374s Type 'contributors()' for more information and 374s 'citation()' on how to cite R or R packages in publications. 374s 374s Type 'demo()' for some demos, 'help()' for on-line help, or 374s 'help.start()' for an HTML browser interface to help. 374s Type 'q()' to quit R. 374s 374s > library("matrixStats") 374s > 374s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 374s > # Subsetted tests 374s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 374s > source("utils/validateIndicesFramework.R") 374s > x <- runif(6, min = -6, max = 6) 374s > storage.mode(x) <- "integer" 374s > for (idxs in index_cases) { 374s + validateIndicesTestVector(x, idxs, 374s + ftest = mean2, fsure = mean, 374s + na.rm = FALSE) 374s + validateIndicesTestVector(x, idxs, 374s + ftest = mean2, fsure = mean, 374s + na.rm = TRUE) 374s + } 374s > 374s 374s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 374s Copyright (C) 2024 The R Foundation for Statistical Computing 374s Platform: arm-unknown-linux-gnueabihf (32-bit) 374s 374s R is free software and comes with ABSOLUTELY NO WARRANTY. 374s You are welcome to redistribute it under certain conditions. 374s Type 'license()' or 'licence()' for distribution details. 374s 374s R is a collaborative project with many contributors. 374s Type 'contributors()' for more information and 374s 'citation()' on how to cite R or R packages in publications. 374s 374s Type 'demo()' for some demos, 'help()' for on-line help, or 374s 'help.start()' for an HTML browser interface to help. 374s Type 'q()' to quit R. 374s 375s > library("matrixStats") 375s > 375s > for (mode in c("integer", "double")) { 375s + cat("mode: ", mode, "\n", sep = "") 375s + 375s + # Empty vector 375s + x <- 0 375s + storage.mode(x) <- mode 375s + y <- prod(x, na.rm = TRUE) 375s + print(y) 375s + z <- product(x, na.rm = TRUE) 375s + print(z) 375s + stopifnot(all.equal(z, y)) 375s + 375s + # Test negative values 375s + x <- c(1, -4, 2) 375s + storage.mode(x) <- mode 375s + y <- prod(x, na.rm = TRUE) 375s + print(y) 375s + z <- product(x, na.rm = TRUE) 375s + print(z) 375s + stopifnot(all.equal(z, y)) 375s + 375s + # Test missing values 375s + x <- c(1, NA, NaN, 2) 375s + storage.mode(x) <- mode 375s + y <- prod(x, na.rm = TRUE) 375s + print(y) 375s + z <- product(x, na.rm = TRUE) 375s + print(z) 375s + stopifnot(all.equal(z, y)) 375s + 375s + x <- c(1, NA, NaN, 2) 375s + storage.mode(x) <- mode 375s + y <- prod(x, na.rm = FALSE) 375s + print(y) 375s + z <- product(x, na.rm = FALSE) 375s + print(z) 375s + stopifnot(all(is.na(z), is.na(y))) 375s + 375s + x <- c(1, NaN, 2) 375s + storage.mode(x) <- mode 375s + y <- prod(x, na.rm = FALSE) 375s + print(y) 375s + stopifnot(is.na(y)) 375s + z <- product(x, na.rm = FALSE) 375s + print(z) 375s + stopifnot(is.na(z)) 375s + 375s + } # for (mode ...) 375s mode: integer 375s [1] 0 375s [1] 0 375s [1] -8 375s [1] -8 375s [1] 2 375s [1] 2 375s [1] NA 375s [1] NA 375s [1] NA 375s [1] NA 375s mode: double 375s [1] 0 375s [1] 0 375s [1] -8 375s [1] -8 375s [1] 2 375s [1] 2 375s [1] NA 375s [1] NA 375s [1] NaN 375s [1] NA 375s > 375s > 375s > # NAs following 0s 375s > x <- c(0L, NA_integer_) 375s > y <- prod(x, na.rm = FALSE) 375s > print(y) 375s [1] NA 375s > z <- product(x, na.rm = FALSE) 375s > print(z) 375s [1] NA 375s > stopifnot(identical(z, y)) 375s > 375s 375s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 375s Copyright (C) 2024 The R Foundation for Statistical Computing 375s Platform: arm-unknown-linux-gnueabihf (32-bit) 375s 375s R is free software and comes with ABSOLUTELY NO WARRANTY. 375s You are welcome to redistribute it under certain conditions. 375s Type 'license()' or 'licence()' for distribution details. 375s 375s R is a collaborative project with many contributors. 375s Type 'contributors()' for more information and 375s 'citation()' on how to cite R or R packages in publications. 375s 375s Type 'demo()' for some demos, 'help()' for on-line help, or 375s 'help.start()' for an HTML browser interface to help. 375s Type 'q()' to quit R. 375s 375s > library("matrixStats") 375s > 375s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 375s > # Subsetted tests 375s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 375s > source("utils/validateIndicesFramework.R") 375s > x <- runif(6, min = -6, max = 6) 375s > storage.mode(x) <- "integer" 375s > for (idxs in index_cases) { 375s + validateIndicesTestVector(x, idxs, 375s + ftest = product, fsure = prod, 375s + na.rm = TRUE) 375s + validateIndicesTestVector(x, idxs, 375s + ftest = product, fsure = prod, 375s + na.rm = FALSE) 375s + } 375s > 375s 375s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 375s Copyright (C) 2024 The R Foundation for Statistical Computing 375s Platform: arm-unknown-linux-gnueabihf (32-bit) 375s 375s R is free software and comes with ABSOLUTELY NO WARRANTY. 375s You are welcome to redistribute it under certain conditions. 375s Type 'license()' or 'licence()' for distribution details. 375s 375s R is a collaborative project with many contributors. 375s Type 'contributors()' for more information and 375s 'citation()' on how to cite R or R packages in publications. 375s 375s Type 'demo()' for some demos, 'help()' for on-line help, or 375s 'help.start()' for an HTML browser interface to help. 375s Type 'q()' to quit R. 375s 376s > library("matrixStats") 376s > library("utils") ## utils::str 376s > 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > # Local functions 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > psortKM_R <- function(x, k, m) { 376s + x <- sort(x) 376s + x[(k - m + 1):k] 376s + } 376s > 376s > psortKM_R2 <- function(x, k, m) { 376s + partial <- (k - m + 1):k 376s + x <- sort.int(x, partial = partial) 376s + x[partial] 376s + } 376s > 376s > 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > # Consistency checks 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > set.seed(1) 376s > 376s > cat("Consistency checks:\n") 376s Consistency checks: 376s > x <- 1:30 376s > x[18:20] <- 20 376s > y <- sample(x) 376s > cat("x:\n") 376s x: 376s > str(x) 376s num [1:30] 1 2 3 4 5 6 7 8 9 10 ... 376s > cat("sample(x):\n") 376s sample(x): 376s > str(y) 376s num [1:30] 25 4 7 1 2 23 11 14 20 20 ... 376s > 376s > for (k in c(1L, 2L, 20L, 21L, length(x))) { 376s + for (m in 1:min(5L, k)) { 376s + px0 <- psortKM_R(x, k = k, m = m) 376s + px0b <- psortKM_R2(x, k = k, m = m) 376s + stopifnot(identical(px0b, px0)) 376s + px1 <- matrixStats:::.psortKM(x, k = k, m = m) 376s + cat(sprintf(".psortKM(x, k = %d, m = %d):\n", k, m)) 376s + print(px1) 376s + stopifnot(identical(px1, px0)) 376s + 376s + py0 <- psortKM_R(y, k = k, m = m) 376s + py0b <- psortKM_R2(y, k = k, m = m) 376s + stopifnot(identical(py0b, py0)) 376s + py1 <- matrixStats:::.psortKM(y, k = k, m = m) 376s + cat(sprintf(".psortKM(y, k = %d, m = %d):\n", k, m)) 376s + print(py1) 376s + stopifnot(identical(py1, py0)) 376s + stopifnot(identical(py1, px1)) 376s + } # for (m ...) 376s + } # for (k ...) 376s .psortKM(x, k = 1, m = 1): 376s [1] 1 376s .psortKM(y, k = 1, m = 1): 376s [1] 1 376s .psortKM(x, k = 2, m = 1): 376s [1] 2 376s .psortKM(y, k = 2, m = 1): 376s [1] 2 376s .psortKM(x, k = 2, m = 2): 376s [1] 1 2 376s .psortKM(y, k = 2, m = 2): 376s [1] 1 2 376s .psortKM(x, k = 20, m = 1): 376s [1] 20 376s .psortKM(y, k = 20, m = 1): 376s [1] 20 376s .psortKM(x, k = 20, m = 2): 376s [1] 20 20 376s .psortKM(y, k = 20, m = 2): 376s [1] 20 20 376s .psortKM(x, k = 20, m = 3): 376s [1] 20 20 20 376s .psortKM(y, k = 20, m = 3): 376s [1] 20 20 20 376s .psortKM(x, k = 20, m = 4): 376s [1] 17 20 20 20 376s .psortKM(y, k = 20, m = 4): 376s [1] 17 20 20 20 376s .psortKM(x, k = 20, m = 5): 376s [1] 16 17 20 20 20 376s .psortKM(y, k = 20, m = 5): 376s [1] 16 17 20 20 20 376s .psortKM(x, k = 21, m = 1): 376s [1] 21 376s .psortKM(y, k = 21, m = 1): 376s [1] 21 376s .psortKM(x, k = 21, m = 2): 376s [1] 20 21 376s .psortKM(y, k = 21, m = 2): 376s [1] 20 21 376s .psortKM(x, k = 21, m = 3): 376s [1] 20 20 21 376s .psortKM(y, k = 21, m = 3): 376s [1] 20 20 21 376s .psortKM(x, k = 21, m = 4): 376s [1] 20 20 20 21 376s .psortKM(y, k = 21, m = 4): 376s [1] 20 20 20 21 376s .psortKM(x, k = 21, m = 5): 376s [1] 17 20 20 20 21 376s .psortKM(y, k = 21, m = 5): 376s [1] 17 20 20 20 21 376s .psortKM(x, k = 30, m = 1): 376s [1] 30 376s .psortKM(y, k = 30, m = 1): 376s [1] 30 376s .psortKM(x, k = 30, m = 2): 376s [1] 29 30 376s .psortKM(y, k = 30, m = 2): 376s [1] 29 30 376s .psortKM(x, k = 30, m = 3): 376s [1] 28 29 30 376s .psortKM(y, k = 30, m = 3): 376s [1] 28 29 30 376s .psortKM(x, k = 30, m = 4): 376s [1] 27 28 29 30 376s .psortKM(y, k = 30, m = 4): 376s [1] 27 28 29 30 376s .psortKM(x, k = 30, m = 5): 376s [1] 26 27 28 29 30 376s .psortKM(y, k = 30, m = 5): 376s [1] 26 27 28 29 30 376s > 376s 376s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 376s Copyright (C) 2024 The R Foundation for Statistical Computing 376s Platform: arm-unknown-linux-gnueabihf (32-bit) 376s 376s R is free software and comes with ABSOLUTELY NO WARRANTY. 376s You are welcome to redistribute it under certain conditions. 376s Type 'license()' or 'licence()' for distribution details. 376s 376s R is a collaborative project with many contributors. 376s Type 'contributors()' for more information and 376s 'citation()' on how to cite R or R packages in publications. 376s 376s Type 'demo()' for some demos, 'help()' for on-line help, or 376s 'help.start()' for an HTML browser interface to help. 376s Type 'q()' to quit R. 376s 376s > library("matrixStats") 376s > 376s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 376s + if (is.na(value)) { 376s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 376s + } else { 376s + y <- x == value 376s + 376s + # Preserve dimnames attribute 376s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 376s + if (!isTRUE(all.equal(dim(y), dim))) { 376s + dim(y) <- dim 376s + dimnames(y) <- dimnames(x) 376s + } 376s + 376s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 376s + } 376s + if (is.na(useNames) || !useNames) names(res) <- NULL 376s + res 376s + } 376s > 376s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 376s + if (is.na(value)) { 376s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 376s + } else { 376s + y <- x == value 376s + 376s + # Preserve dimnames attribute 376s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 376s + if (!isTRUE(all.equal(dim(y), dim))) { 376s + dim(y) <- dim 376s + dimnames(y) <- dimnames(x) 376s + } 376s + 376s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 376s + } 376s + if (is.na(useNames) || !useNames) names(res) <- NULL 376s + res 376s + } 376s > 376s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 376s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 376s + if (is.na(useNames) || !useNames) names(res) <- NULL 376s + res 376s + } 376s > 376s > 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > # Data type: logical 376s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 376s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 376s > x[7:8, 2:3] <- TRUE 376s > x[1:3, ] <- TRUE 376s > x[, 1] <- TRUE 376s > x[4, ] <- FALSE 376s > x[, 4] <- FALSE 376s > x[2, ] <- FALSE 376s > x[3, ] <- TRUE 376s > 376s > # To check names attribute 376s > dimnames <- list(letters[1:10], LETTERS[1:4]) 376s > 376s > for (kk in 1:3) { 376s + if (kk == 2) { 376s + x[2, 2] <- NA 376s + } else if (kk == 3) { 376s + x[, 2] <- NA 376s + x[2, ] <- NA 376s + } 376s + 376s + # Test with and without dimnames on x 376s + for (setDimnames in c(TRUE, FALSE)) { 376s + dimnames(x) <- if (setDimnames) dimnames else NULL 376s + 376s + for (na.rm in c(FALSE, TRUE)) { 376s + # Check names attribute 376s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 376s + m0 <- rowAlls_R(x, na.rm = na.rm, useNames = useNames) 376s + m1 <- rowAlls(x, na.rm = na.rm, useNames = useNames) 376s + m2 <- colAlls(t(x), na.rm = na.rm, useNames = useNames) 376s + str(list("all()", m0 = m0, m1 = m1, m2 = m2)) 376s + stopifnot(identical(m1, m0)) 376s + stopifnot(identical(m2, m0)) 376s + 376s + m0 <- rowAnys_R(x, na.rm = na.rm, useNames = useNames) 376s + m1 <- rowAnys(x, na.rm = na.rm, useNames = useNames) 376s + m2 <- colAnys(t(x), na.rm = na.rm, useNames = useNames) 376s + str(list("any()", m0 = m0, m1 = m1, m2 = m2)) 376s + stopifnot(identical(m1, m0)) 376s + stopifnot(identical(m2, m0)) 376s + 376s + m0 <- rowAnyMissings_R(x, useNames = useNames) 376s + m1 <- rowAnyMissings(x, useNames = useNames) 376s + m2 <- colAnyMissings(t(x), useNames = useNames) 376s + str(list("anyMissing()", m0 = m0, m1 = m1, m2 = m2)) 376s + stopifnot(identical(m1, m0)) 376s + stopifnot(identical(m2, m0)) 376s + } 376s + } 376s + } 376s + } # for (kk ...) 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "any()" 377s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s List of 4 377s $ : chr "all()" 377s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 377s List of 4 377s $ : chr "any()" 377s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 377s List of 4 377s $ : chr "anyMissing()" 377s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 377s > 377s > 377s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 377s > # Data type: integer 377s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 377s > x <- matrix(rep(1:6, length.out = 4 * 5), nrow = 4L, ncol = 5L) 377s > x[2, ] <- 7L 377s > x[3, 1] <- 7L 377s > x[2:3, 3:4] <- NA_integer_ 377s > 377s > # To check names attribute 377s > dimnames <- list(letters[1:4], LETTERS[1:5]) 377s > 377s > # Row/column counts 377s > value <- 7L 377s > 377s > # Test with and without dimnames on x 377s > for (setDimnames in c(TRUE, FALSE)) { 377s + dimnames(x) <- if (setDimnames) dimnames else NULL 377s + for (na.rm in c(FALSE, TRUE)) { 377s + # Check names attribute 377s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 377s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 377s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 377s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 377s + stopifnot(identical(r1, r0)) 377s + stopifnot(identical(r2, r1)) 377s + if (!is.na(useNames) && !useNames && !setDimnames) { 377s + for (rr in seq_len(nrow(x))) { 377s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 377s + stopifnot(identical(c, r1[rr])) 377s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 377s + stopifnot(identical(c, r1[rr])) 377s + } 377s + } 377s + 377s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 377s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 377s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 377s + stopifnot(identical(r1, r0)) 377s + stopifnot(identical(r2, r1)) 377s + if (!is.na(useNames) && !useNames && !setDimnames) { 377s + for (rr in seq_len(nrow(x))) { 377s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 377s + stopifnot(identical(c, r1[rr])) 377s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 377s + stopifnot(identical(c, r1[rr])) 377s + } 377s + } 377s + } 377s + } 377s + } 377s > 377s > 377s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 377s > # rowAlls(x) et al. on numeric 'x' with logical 'value' 377s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 377s > x <- matrix(0, nrow = 4L, ncol = 5L) 377s > x[2:4, 2] <- (1:3) / 4 377s > x[2, 2:4] <- (1:3) / 4 377s > x[3:4, 3] <- (3:4) / 4 377s > x[3, 3:4] <- (3:4) / 4 377s > x[1:4, 5] <- (1:4) / 5 377s > x[4, 4] <- NA_real_ 377s > 377s > # To check names attribute 377s > dimnames <- list(letters[1:4], LETTERS[1:5]) 377s > 377s > for (value in c(TRUE, FALSE)) { 377s + for (na.rm in c(FALSE, TRUE)) { 377s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 377s + y <- rowAnys(x, na.rm = na.rm, value = value) 377s + stopifnot(identical(y, y0)) 377s + # Check names attribute 377s + dimnames(x) <- dimnames 377s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 377s + stopifnot(all.equal(y, y0)) 377s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 377s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 377s + stopifnot(all.equal(y, y0)) 377s + dimnames(x) <- NULL 377s + 377s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 377s + y <- colAnys(x, na.rm = na.rm, value = value) 377s + stopifnot(identical(y, y0)) 377s + # Check names attribute 377s + dimnames(x) <- dimnames 377s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 377s + stopifnot(all.equal(y, y0)) 377s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 377s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 377s + stopifnot(all.equal(y, y0)) 377s + dimnames(x) <- NULL 377s + 377s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 377s + y <- rowAlls(x, na.rm = na.rm, value = value) 377s + stopifnot(identical(y, y0)) 377s + # Check names attribute 377s + dimnames(x) <- dimnames 377s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 377s + stopifnot(all.equal(y, y0)) 377s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 377s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 377s + stopifnot(all.equal(y, y0)) 377s + dimnames(x) <- NULL 377s + 377s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 377s + y <- colAlls(x, na.rm = na.rm, value = value) 377s + stopifnot(identical(y, y0)) 377s + print(y0) 377s + # Check names attribute 377s + dimnames(x) <- dimnames 377s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 377s + stopifnot(all.equal(y, y0)) 377s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 377s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 377s + stopifnot(all.equal(y, y0)) 377s + dimnames(x) <- NULL 377s + } ## for (na.rm ...) 377s + } ## for(value ...) 378s [1] FALSE FALSE FALSE FALSE TRUE 378s [1] FALSE FALSE FALSE FALSE TRUE 378s [1] TRUE FALSE FALSE FALSE FALSE 378s [1] TRUE FALSE FALSE FALSE FALSE 378s > 378s > 378s > 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > # Data type: character (not sure if this should be supported) 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > all_R <- function(x, value = TRUE, ...) { 378s + if (is.na(value)) { 378s + all(is.na(x), ...) 378s + } else { 378s + all(x == value, ...) 378s + } 378s + } 378s > 378s > any_R <- function(x, value = TRUE, ...) { 378s + if (is.na(value)) { 378s + any(is.na(x), ...) 378s + } else { 378s + any(x == value, ...) 378s + } 378s + } 378s > 378s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 378s > x[2, ] <- "g" 378s > x[2:4, 3:4] <- NA_character_ 378s > 378s > # To check names attribute 378s > dimnames <- list(letters[1:10], LETTERS[1:5]) 378s > 378s > # Test with and without dimnames on x 378s > for (setDimnames in c(TRUE, FALSE)) { 378s + dimnames(x) <- if (setDimnames) dimnames else NULL 378s + 378s + # Row/column counts 378s + for (value in c("g", NA_character_)) { 378s + for (na.rm in c(FALSE, TRUE)) { 378s + # Check names attribute 378s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 378s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 378s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 378s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 378s + stopifnot(identical(r1, r0)) 378s + stopifnot(identical(r2, r1)) 378s + if (!is.na(useNames) && !useNames && !setDimnames) { 378s + for (rr in seq_len(nrow(x))) { 378s + c0 <- all_R(x[rr, ], value, na.rm = na.rm) 378s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 378s + stopifnot(identical(c, r1[rr])) 378s + stopifnot(identical(c, c0)) 378s + } 378s + } 378s + 378s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 378s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 378s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 378s + stopifnot(identical(r1, r0)) 378s + stopifnot(identical(r2, r1)) 378s + if (!is.na(useNames) && !useNames && !setDimnames) { 378s + for (rr in seq_len(nrow(x))) { 378s + c0 <- any_R(x[rr, ], value, na.rm = na.rm) 378s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 378s + stopifnot(identical(c, c0)) 378s + stopifnot(identical(c, r1[rr])) 378s + } 378s + } 378s + } 378s + } 378s + } 378s + } 378s > 378s > 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > # NA 0 test 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > x <- matrix(0, nrow = 3L, ncol = 3L) 378s > x[1, ] <- c(NA_real_, NA_real_, 0) 378s > x[3, ] <- c(1, 0, 1) 378s > 378s > dimnames <- list(letters[1:3], LETTERS[1:3]) 378s > 378s > # Test with and without dimnames on x 378s > for (setDimnames in c(TRUE, FALSE)) { 378s + dimnames(x) <- if (setDimnames) dimnames else NULL 378s + # Check names attribute 378s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 378s + r0 <- rowAnys_R(x, value = 0, useNames = useNames) 378s + r1 <- rowAnys(x, value = 0, useNames = useNames) 378s + stopifnot(identical(r0, r1)) 378s + } 378s + } 378s > 378s 378s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 378s Copyright (C) 2024 The R Foundation for Statistical Computing 378s Platform: arm-unknown-linux-gnueabihf (32-bit) 378s 378s R is free software and comes with ABSOLUTELY NO WARRANTY. 378s You are welcome to redistribute it under certain conditions. 378s Type 'license()' or 'licence()' for distribution details. 378s 378s R is a collaborative project with many contributors. 378s Type 'contributors()' for more information and 378s 'citation()' on how to cite R or R packages in publications. 378s 378s Type 'demo()' for some demos, 'help()' for on-line help, or 378s 'help.start()' for an HTML browser interface to help. 378s Type 'q()' to quit R. 378s 378s > library("matrixStats") 378s > 378s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 378s + if (is.na(value)) { 378s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 378s + } else { 378s + y <- x == value 378s + 378s + # Preserve dimnames attribute 378s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 378s + if (!isTRUE(all.equal(dim(y), dim))) { 378s + dim(y) <- dim 378s + dimnames(y) <- dimnames(x) 378s + } 378s + 378s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 378s + } 378s + if (is.na(useNames) || !useNames) names(res) <- NULL 378s + res 378s + } 378s > 378s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 378s + if (is.na(value)) { 378s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 378s + } else { 378s + y <- x == value 378s + 378s + # Preserve dimnames attribute 378s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 378s + if (!isTRUE(all.equal(dim(y), dim))) { 378s + dim(y) <- dim 378s + dimnames(y) <- dimnames(x) 378s + } 378s + 378s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 378s + } 378s + if (is.na(useNames) || !useNames) names(res) <- NULL 378s + res 378s + } 378s > 378s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 378s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 378s + if (is.na(useNames) || !useNames) names(res) <- NULL 378s + res 378s + } 378s > 378s > 378s > all_R <- function(x, value = TRUE, ...) { 378s + if (is.na(value)) { 378s + all(is.na(x), ...) 378s + } else { 378s + all(x == value, ...) 378s + } 378s + } 378s > 378s > any_R <- function(x, value = TRUE, ...) { 378s + if (is.na(value)) { 378s + any(is.na(x), ...) 378s + } else { 378s + any(x == value, ...) 378s + } 378s + } 378s > 378s > 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > # Subsetted tests 378s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 378s > source("utils/validateIndicesFramework.R") 378s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 378s > storage.mode(x) <- "integer" 378s > x[2:3, ] <- NA_integer_ 378s > x[2, 1] <- 0L 378s > x[4:5, ] <- 0L 378s > x[4, 6] <- NA_integer_ 378s > 378s > # To check names attribute 378s > dimnames <- list(letters[1:6], LETTERS[1:6]) 378s > 378s > # Test with and without dimnames on x 378s > for (setDimnames in c(TRUE, FALSE)) { 378s + if (setDimnames) dimnames(x) <- dimnames 378s + else dimnames(x) <- NULL 378s + 378s + count <- 0L 378s + for (rows in index_cases) { 378s + for (cols in index_cases) { 378s + count <- count + 1L 378s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 378s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 378s + useNames <- useNames[count %% length(useNames) + 1] 378s + 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAlls, fsure = rowAlls_R, 378s + value = 0, na.rm = TRUE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAlls, fsure = rowAlls_R, 378s + value = 0, na.rm = FALSE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAlls, fsure = rowAlls_R, 378s + value = NA_integer_, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAlls, fsure = rowAlls_R, 378s + value = 0, na.rm = TRUE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAlls, fsure = rowAlls_R, 378s + value = 0, na.rm = FALSE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAlls, fsure = rowAlls_R, 378s + value = NA_integer_, useNames = useNames) 378s + 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAnys, fsure = rowAnys_R, 378s + value = 0, na.rm = TRUE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAnys, fsure = rowAnys_R, 378s + value = 0, na.rm = FALSE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAnys, fsure = rowAnys_R, 378s + value = NA_integer_, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAnys, fsure = rowAnys_R, 378s + value = 0, na.rm = TRUE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAnys, fsure = rowAnys_R, 378s + value = 0, na.rm = FALSE, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAnys, fsure = rowAnys_R, 378s + value = NA_integer_, useNames = useNames) 378s + 378s + validateIndicesTestMatrix(x, rows, cols, 378s + ftest = rowAnyMissings, 378s + fsure = rowAnyMissings_R, useNames = useNames) 378s + validateIndicesTestMatrix(x, rows, cols, 378s + fcoltest = colAnyMissings, 378s + fsure = rowAnyMissings_R, useNames = useNames) 378s + } 378s + } 378s + } 384s > 384s > for (rr in seq_len(nrow(x))) { 384s + for (idxs in index_cases) { 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = allValue, fsure = all_R, 384s + value = 0, na.rm = TRUE) 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = allValue, fsure = all_R, 384s + value = 0, na.rm = FALSE) 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = allValue, fsure = all_R, 384s + value = NA_integer_) 384s + 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = anyValue, fsure = any_R, 384s + value = 0, na.rm = TRUE) 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = anyValue, fsure = any_R, 384s + value = 0, na.rm = FALSE) 384s + validateIndicesTestVector(x[rr, ], idxs, 384s + ftest = anyValue, fsure = any_R, 384s + value = NA_integer_) 384s + } 384s + } 384s > 384s > 384s > storage.mode(x) <- "character" 384s > # Test with and without dimnames on x 384s > for (setDimnames in c(TRUE, FALSE)) { 384s + if (setDimnames) dimnames(x) <- dimnames 384s + else dimnames(x) <- NULL 384s + for (rows in index_cases) { 384s + for (cols in index_cases) { 384s + # Check names attribute 384s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAlls, fsure = rowAlls_R, 384s + value = "0", na.rm = TRUE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAlls, fsure = rowAlls_R, 384s + value = "0", na.rm = FALSE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAlls, fsure = rowAlls_R, 384s + value = NA_character_, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAlls, fsure = rowAlls_R, 384s + value = "0", na.rm = TRUE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAlls, fsure = rowAlls_R, 384s + value = "0", na.rm = FALSE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAlls, fsure = rowAlls_R, 384s + value = NA_character_, useNames = useNames) 384s + 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAnys, fsure = rowAnys_R, 384s + value = "0", na.rm = TRUE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAnys, fsure = rowAnys_R, 384s + value = "0", na.rm = FALSE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAnys, fsure = rowAnys_R, 384s + value = NA_character_, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAnys, fsure = rowAnys_R, 384s + value = "0", na.rm = TRUE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAnys, fsure = rowAnys_R, 384s + value = "0", na.rm = FALSE, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAnys, fsure = rowAnys_R, 384s + value = NA_character_, useNames = useNames) 384s + 384s + validateIndicesTestMatrix(x, rows, cols, 384s + ftest = rowAnyMissings, 384s + fsure = rowAnyMissings_R, useNames = useNames) 384s + validateIndicesTestMatrix(x, rows, cols, 384s + fcoltest = colAnyMissings, 384s + fsure = rowAnyMissings_R, useNames = useNames) 384s + } 384s + } 384s + } 384s + } 396s > 396s > for (rr in seq_len(nrow(x))) { 396s + for (idxs in index_cases) { 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = allValue, fsure = all_R, 396s + value = "0", na.rm = TRUE) 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = allValue, fsure = all_R, 396s + value = "0", na.rm = FALSE) 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = allValue, fsure = all_R, 396s + value = NA_integer_) 396s + 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = anyValue, fsure = any_R, 396s + value = "0", na.rm = TRUE) 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = anyValue, fsure = any_R, 396s + value = "0", na.rm = FALSE) 396s + validateIndicesTestVector(x[rr, ], idxs, 396s + ftest = anyValue, fsure = any_R, 396s + value = NA_integer_) 396s + } 396s + } 396s > 397s 397s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 397s Copyright (C) 2024 The R Foundation for Statistical Computing 397s Platform: arm-unknown-linux-gnueabihf (32-bit) 397s 397s R is free software and comes with ABSOLUTELY NO WARRANTY. 397s You are welcome to redistribute it under certain conditions. 397s Type 'license()' or 'licence()' for distribution details. 397s 397s R is a collaborative project with many contributors. 397s Type 'contributors()' for more information and 397s 'citation()' on how to cite R or R packages in publications. 397s 397s Type 'demo()' for some demos, 'help()' for on-line help, or 397s 'help.start()' for an HTML browser interface to help. 397s Type 'q()' to quit R. 397s 397s > library("matrixStats") 397s > 397s > X <- matrix(rnorm(20 * 6), nrow = 20, ncol = 6) 397s > rownames(X) <- LETTERS[1:nrow(X)] 397s > colnames(X) <- letters[1:ncol(X)] 397s > print(X) 397s a b c d e f 397s A 0.24755802 0.78725362 1.817437783 0.49043022 -1.970867986 -0.21447018 397s B 1.52991248 -0.31612605 -0.627909763 -0.64239510 0.078793508 -0.53001451 397s C 1.62494184 0.12505493 0.129710156 0.18129344 -0.589465458 1.24434125 397s D -0.62789450 1.97626930 1.042860727 -0.49450495 0.775122959 0.65897072 397s E -1.27661046 -0.54748568 -1.797639761 0.17343191 0.448319283 -0.68754177 397s F 0.94190608 1.45786668 2.296576906 -0.99208386 -0.323983810 -0.42461257 397s G -0.91031169 1.20027048 0.551340887 -0.82985355 0.816238033 -1.98745718 397s H 0.37449912 0.70823779 0.380754862 -0.72839684 -0.606466439 0.71520895 397s I 0.61616812 1.14246413 2.146720647 1.31154529 0.834303719 2.20299753 397s J 0.94182677 -0.61911255 1.195840261 -0.34348517 0.945112355 0.08350315 397s K 0.43560166 -1.01884421 -0.005459353 -1.91851754 0.614635592 0.18138340 397s L -1.74428932 0.39600835 -0.039401289 0.39448634 0.124168722 -1.56032129 397s M -0.04716203 2.23366367 -2.714259211 0.71315088 1.373660261 0.29968997 397s N -0.83864279 0.69164539 -1.095680917 1.81064225 -0.009257926 -0.10876738 397s O 0.50732849 -0.57983042 -1.512027943 1.09591180 -0.700318671 -0.22125037 397s P -1.62780584 1.37871689 -0.656988886 2.03332022 -0.282365704 0.88041191 397s Q 0.46276336 -0.09729563 -0.728130532 -1.25366612 0.516118721 1.46533430 397s R 0.89587930 -0.82172558 1.625835393 0.09099432 0.401872995 0.75590357 397s S 0.94043428 0.18660576 -0.968303756 0.95437880 0.411551338 -0.26131770 397s T 0.88422145 -1.05012116 0.861511799 0.19102103 1.351167883 1.64093516 397s > 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Apply rowMeans() for 3 sets of 2 columns 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > nbr_of_sets <- 3L 397s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 397s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 397s > print(S) 397s s1 s2 s3 397s [1,] 1 3 5 397s [2,] 2 4 6 397s > 397s > Z <- rowAvgsPerColSet(X, S = S) 397s > print(Z) 397s s1 s2 s3 397s A 0.51740582 1.153934004 -1.09266908 397s B 0.60689322 -0.635152433 -0.22561050 397s C 0.87499839 0.155501799 0.32743790 397s D 0.67418740 0.274177891 0.71704684 397s E -0.91204807 -0.812103924 -0.11961124 397s F 1.19988638 0.652246521 -0.37429819 397s G 0.14497939 -0.139256330 -0.58560957 397s H 0.54136846 -0.173820988 0.05437125 397s I 0.87931612 1.729132970 1.51865063 397s J 0.16135711 0.426177547 0.51430775 397s K -0.29162127 -0.961988445 0.39800949 397s L -0.67414049 0.177542526 -0.71807628 397s M 1.09325082 -1.000554165 0.83667511 397s N -0.07349870 0.357480668 -0.05901266 397s O -0.03625096 -0.208058070 -0.46078452 397s P -0.12454448 0.688165665 0.29902310 397s Q 0.18273387 -0.990898323 0.99072651 397s R 0.03707686 0.858414857 0.57888828 397s S 0.56352002 -0.006962479 0.07511682 397s T -0.08294986 0.526266412 1.49605152 397s > 397s > # Validation 397s > Z0 <- cbind(s1 = rowMeans(X[, 1:2]), s2 = rowMeans(X[, 3:4]), 397s + s3 = rowMeans(X[, 5:6])) 397s > stopifnot(identical(drop(Z), Z0)) 397s > 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Apply colMeans() for 5 sets of 4 rows 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > nbr_of_sets <- 5L 397s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 397s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 397s > print(S) 397s s1 s2 s3 s4 s5 397s [1,] 1 5 9 13 17 397s [2,] 2 6 10 14 18 397s [3,] 3 7 11 15 19 397s [4,] 4 8 12 16 20 397s > 397s > Z <- colAvgsPerRowSet(X, S = S) 397s > print(Z) 397s a b c d e f 397s s1 0.6936295 0.64311295 0.5905247 -0.116294095 -0.42660424 0.2897068 397s s2 -0.2176292 0.70472232 0.3577582 -0.594225584 0.08352677 -0.5961006 397s s3 0.0623268 -0.02487107 0.8244251 -0.138992768 0.62955510 0.2268907 397s s4 -0.5015705 0.93104888 -1.4947392 1.413256288 0.09542949 0.2125210 397s s5 0.7958246 -0.44563415 0.1977282 -0.004317993 0.67017773 0.9002138 397s > 397s > # Validation 397s > Z0 <- rbind(s1 = colMeans(X[1:4, ]), s2 = colMeans(X[5:8, ]), 397s + s3 = colMeans(X[9:12, ]), s4 = colMeans(X[13:16, ]), 397s + s5 = colMeans(X[17:20, ])) 397s > stopifnot(identical(drop(Z), Z0)) 397s > 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # When there is only one "complete" set 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > nbr_of_sets <- 1L 397s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 397s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 397s > print(S) 397s s1 397s [1,] 1 397s [2,] 2 397s [3,] 3 397s [4,] 4 397s [5,] 5 397s [6,] 6 397s > 397s > Z <- rowAvgsPerColSet(X, S = S, FUN = rowMeans) 397s > print(Z) 397s s1 397s A 0.19289025 397s B -0.08462324 397s C 0.45264603 397s D 0.55513738 397s E -0.61458774 397s F 0.49261157 397s G -0.19329550 397s H 0.14063957 397s I 1.37569991 397s J 0.36728080 397s K -0.28520007 397s L -0.40489141 397s M 0.30979059 397s N 0.07498977 397s O -0.23503118 397s P 0.28754810 397s Q 0.06085402 397s R 0.49146000 397s S 0.21055812 397s T 0.64645603 397s > 397s > Z0 <- rowMeans(X) 397s > stopifnot(identical(drop(Z), Z0)) 397s > 397s > 397s > nbr_of_sets <- 1L 397s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 397s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 397s > print(S) 397s s1 397s [1,] 1 397s [2,] 2 397s [3,] 3 397s [4,] 4 397s [5,] 5 397s [6,] 6 397s [7,] 7 397s [8,] 8 397s [9,] 9 397s [10,] 10 397s [11,] 11 397s [12,] 12 397s [13,] 13 397s [14,] 14 397s [15,] 15 397s [16,] 16 397s [17,] 17 397s [18,] 18 397s [19,] 19 397s [20,] 20 397s > 397s > Z <- colAvgsPerRowSet(X, S = S, FUN = colMeans) 397s > print(Z) 397s a b c d e f 397s s1 0.1665162 0.3616758 0.0951394 0.1118852 0.210417 0.2066463 397s > 397s > Z0 <- colMeans(X) 397s > stopifnot(identical(drop(Z), Z0)) 397s > 397s > 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Use weights 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > nbr_of_sets <- 3L 397s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 397s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 397s > print(S) 397s s1 s2 s3 397s [1,] 1 3 5 397s [2,] 2 4 6 397s > 397s > W <- matrix(runif(length(X)), nrow = nrow(X), ncol = ncol(X)) 397s > Z1 <- rowAvgsPerColSet(X, W = W, S = S, FUN = rowWeightedMeans) 397s > print(Z1) 397s s1 s2 s3 397s A 0.51740582 1.153934004 -1.09266908 397s B 0.60689322 -0.635152433 -0.22561050 397s C 0.87499839 0.155501799 0.32743790 397s D 0.67418740 0.274177891 0.71704684 397s E -0.91204807 -0.812103924 -0.11961124 397s F 1.19988638 0.652246521 -0.37429819 397s G 0.14497939 -0.139256330 -0.58560957 397s H 0.54136846 -0.173820988 0.05437125 397s I 0.87931612 1.729132970 1.51865063 397s J 0.16135711 0.426177547 0.51430775 397s K -0.29162127 -0.961988445 0.39800949 397s L -0.67414049 0.177542526 -0.71807628 397s M 1.09325082 -1.000554165 0.83667511 397s N -0.07349870 0.357480668 -0.05901266 397s O -0.03625096 -0.208058070 -0.46078452 397s P -0.12454448 0.688165665 0.29902310 397s Q 0.18273387 -0.990898323 0.99072651 397s R 0.03707686 0.858414857 0.57888828 397s S 0.56352002 -0.006962479 0.07511682 397s T -0.08294986 0.526266412 1.49605152 397s > Z2 <- colAvgsPerRowSet(X, W = W, S = S, FUN = colWeightedMeans) 397s > print(Z2) 397s a b c d e f 397s s1 0.8887353 0.2355638 0.5947640 -0.07598244 -0.94603724 -0.3722423 397s s2 0.4985237 1.0506621 0.5862854 -0.15660575 0.09282875 0.9516560 397s s3 -0.1673522 0.4551905 0.2494686 -0.40932598 0.06216774 -0.5560772 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Result should always be a matrix, including when nrow(X) <= 1 397s > # (https://github.com/HenrikBengtsson/matrixStats/issues/108) 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > X <- matrix(1:3, nrow = 1L, ncol = 3L) 397s > S <- matrix(1, nrow = 1L, ncol = 1L) 397s > Z1 <- rowAvgsPerColSet(X, S = S) 397s > stopifnot(is.matrix(Z1)) 397s > Z2 <- rowAvgsPerColSet(X, S = S, rows = 0) 397s > stopifnot(is.matrix(Z2)) 397s > 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Works with many, one or zero columns / rows 397s > # (https://github.com/HenrikBengtsson/matrixStats/issues/172) 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > S <- cbind(1:2, 3:4, 5:6) 397s > X <- matrix(rnorm(2 * 6), nrow = 6, ncol = 2) 397s > Z2 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 397s > Z2_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 397s + colSums2(X[S[,2], ,drop=FALSE]), 397s + colSums2(X[S[,3], ,drop=FALSE])) 397s > stopifnot(identical(Z2, Z2_ref)) 397s > X <- matrix(rnorm(6), nrow = 6, ncol = 1) 397s > Z1 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 397s > Z1_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 397s + colSums2(X[S[,2], ,drop=FALSE]), 397s + colSums2(X[S[,3], ,drop=FALSE])) 397s > stopifnot(identical(Z1, Z1_ref)) 397s > X <- matrix(numeric(0), nrow = 6, ncol = 0) 397s > Z0 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 397s > Z0_ref <- matrix(numeric(0), nrow = ncol(S), ncol = 0) 397s > stopifnot(identical(Z0, unname(Z0_ref))) 397s > 397s > 397s > S <- rbind(1:4, 5:8) 397s > X <- matrix(rnorm(n = 2 * 8), nrow = 2, ncol = 8) 397s > Z2 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 397s > Z2_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 397s + rowMeans2(X[,S[,2],drop=FALSE]), 397s + rowMeans2(X[,S[,3],drop=FALSE]), 397s + rowMeans2(X[,S[,4],drop=FALSE])) 397s > stopifnot(identical(Z2, Z2_ref)) 397s > X <- matrix(rnorm(n = 8), nrow = 1, ncol = 8) 397s > Z1 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 397s > Z1_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 397s + rowMeans2(X[,S[,2],drop=FALSE]), 397s + rowMeans2(X[,S[,3],drop=FALSE]), 397s + rowMeans2(X[,S[,4],drop=FALSE])) 397s > stopifnot(identical(Z1, Z1_ref)) 397s > X <- matrix(numeric(0), nrow = 0, ncol = 8) 397s > Z0 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 397s > Z0_ref <- matrix(numeric(0), nrow = 0, ncol = ncol(S)) 397s > stopifnot(identical(Z0, Z0_ref)) 397s > 397s 397s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 397s Copyright (C) 2024 The R Foundation for Statistical Computing 397s Platform: arm-unknown-linux-gnueabihf (32-bit) 397s 397s R is free software and comes with ABSOLUTELY NO WARRANTY. 397s You are welcome to redistribute it under certain conditions. 397s Type 'license()' or 'licence()' for distribution details. 397s 397s R is a collaborative project with many contributors. 397s Type 'contributors()' for more information and 397s 'citation()' on how to cite R or R packages in publications. 397s 397s Type 'demo()' for some demos, 'help()' for on-line help, or 397s 'help.start()' for an HTML browser interface to help. 397s Type 'q()' to quit R. 397s 397s > library("matrixStats") 397s > 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > # Subsetted tests 397s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 397s > source("utils/validateIndicesFramework.R") 397s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 397s > #W <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 397s > for (rows in index_cases) { 397s + for (cols in index_cases) { 397s + if (is.null(rows)) { 397s + rows <- seq_len(nrow(x)) 397s + rows_finite <- rows 397s + } else { 397s + rows_finite <- rows[is.finite(rows)] 397s + } 397s + 397s + if (is.null(cols)) { 397s + cols <- seq_len(ncol(x)) 397s + cols_finite <- cols 397s + } else { 397s + cols_finite <- cols[is.finite(cols)] 397s + } 397s + 397s + suppressWarnings({ 397s + actual <- tryCatch({ 397s + rowAvgsPerColSet(x, rows = rows, S = matrix(cols, ncol = 1), 397s + FUN = rowMeans) 397s + }, error = function(c) "error") 397s + expect <- tryCatch({ 397s + rowMeans(x[rows, cols_finite, drop = FALSE], na.rm = TRUE) 397s + }, error = function(c) "error") 397s + }) 397s + stopifnot(all.equal(as.vector(actual), expect)) 397s + 397s + suppressWarnings({ 397s + actual <- tryCatch({ 397s + colAvgsPerRowSet(x, cols = cols, S = matrix(rows, ncol = 1), 397s + FUN = colMeans) 397s + }, error = function(c) "error") 397s + expect <- tryCatch({ 397s + colMeans(x[rows_finite, cols, drop = FALSE], na.rm = TRUE) 397s + }, error = function(c) "error") 397s + }) 397s + stopifnot(all.equal(as.vector(actual), expect)) 397s + } 397s + } 398s > 398s 398s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 398s Copyright (C) 2024 The R Foundation for Statistical Computing 398s Platform: arm-unknown-linux-gnueabihf (32-bit) 398s 398s R is free software and comes with ABSOLUTELY NO WARRANTY. 398s You are welcome to redistribute it under certain conditions. 398s Type 'license()' or 'licence()' for distribution details. 398s 398s R is a collaborative project with many contributors. 398s Type 'contributors()' for more information and 398s 'citation()' on how to cite R or R packages in publications. 398s 398s Type 'demo()' for some demos, 'help()' for on-line help, or 398s 'help.start()' for an HTML browser interface to help. 398s Type 'q()' to quit R. 398s 399s > library("matrixStats") 399s > 399s > x <- matrix(1:27, ncol = 3) 399s > 399s > # To check names attribute 399s > dimnames <- list(letters[1:9], LETTERS[1:3]) 399s > 399s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 399s + res <- x[, idxs] 399s + # Preserve names attribute? 399s + if (is.na(useNames) || !useNames) names(res) <- NULL 399s + res 399s + } 399s > 399s > idxs <- 1L 399s > # Test with and without dimnames on x 399s > for (setDimnames in c(TRUE, FALSE)) { 399s + if (setDimnames) dimnames(x) <- dimnames 399s + else dimnames(x) <- NULL 399s + # Check names attribute 399s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 399s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 399s + y <- rowCollapse(x, idxs, useNames = useNames) 399s + stopifnot(identical(y, y_truth)) 399s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 399s + stopifnot(identical(y2, y)) 399s + } 399s + } 399s > 399s > idxs <- 2L 399s > # Test with and without dimnames on x 399s > for (setDimnames in c(TRUE, FALSE)) { 399s + if (setDimnames) dimnames(x) <- dimnames 399s + else dimnames(x) <- NULL 399s + # Check names attribute 399s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 399s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 399s + y <- rowCollapse(x, idxs, useNames = useNames) 399s + stopifnot(identical(y, y_truth)) 399s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 399s + stopifnot(identical(y2, y)) 399s + } 399s + } 399s > 399s > 399s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 399s + res <- c(x[1:5, 1], x[6:9, 3]) 399s + # Preserve names attribute? 399s + if (is.na(useNames) || !useNames) names(res) <- NULL 399s + res 399s + } 399s > 399s > idxs <- c(1, 1, 1, 1, 1, 3, 3, 3, 3) 399s > # Test with and without dimnames on x 399s > for (setDimnames in c(TRUE, FALSE)) { 399s + if (setDimnames) dimnames(x) <- dimnames 399s + else dimnames(x) <- NULL 399s + # Check names attribute 399s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 399s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 399s + y <- rowCollapse(x, idxs, useNames = useNames) 399s + stopifnot(identical(y, y_truth)) 399s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 399s + stopifnot(identical(y2, y)) 399s + } 399s + } 399s > 399s > 399s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 399s + res <- c(x[1, 1], x[2, 2], x[3, 3], x[4, 1], x[5, 2], 399s + x[6, 3], x[7, 1], x[8, 2], x[9, 3]) 399s + # Preserve names attribute? 399s + if (isTRUE(useNames)) { 399s + names <- rownames(x) 399s + if (!is.null(names)) names(res) <- names 399s + } 399s + res 399s + } 399s > 399s > idxs <- 1:3 399s > # Test with and without dimnames on x 399s > for (setDimnames in c(TRUE, FALSE)) { 399s + if (setDimnames) dimnames(x) <- dimnames 399s + else dimnames(x) <- NULL 399s + # Check names attribute 399s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 399s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 399s + y <- rowCollapse(x, idxs, useNames = useNames) 399s + stopifnot(identical(y, y_truth)) 399s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 399s + stopifnot(identical(y2, y)) 399s + } 399s + } 399s > 399s 399s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 399s Copyright (C) 2024 The R Foundation for Statistical Computing 399s Platform: arm-unknown-linux-gnueabihf (32-bit) 399s 399s R is free software and comes with ABSOLUTELY NO WARRANTY. 399s You are welcome to redistribute it under certain conditions. 399s Type 'license()' or 'licence()' for distribution details. 399s 399s R is a collaborative project with many contributors. 399s Type 'contributors()' for more information and 399s 'citation()' on how to cite R or R packages in publications. 399s 399s Type 'demo()' for some demos, 'help()' for on-line help, or 399s 'help.start()' for an HTML browser interface to help. 399s Type 'q()' to quit R. 399s 399s > library("matrixStats") 399s > 399s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 399s + ans <- c() 399s + storage.mode(ans) <- storage.mode(x) 399s + for (ii in seq_len(length(idxs))) { 399s + ans[ii] <- x[ii, idxs[ii]] 399s + } 399s + 399s + # Preserve names attribute 399s + if (isTRUE(useNames)) { 399s + names <- rownames(x) 399s + if (!is.null(names)) names(ans) <- names 399s + } 399s + 399s + ans 399s + } 399s > 399s > 399s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 399s > # Subsetted tests 399s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 399s > source("utils/validateIndicesFramework.R") 399s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 399s > storage.mode(x) <- "integer" 399s > 399s > # To check names attribute 399s > dimnames <- list(letters[1:6], LETTERS[1:6]) 399s > 399s > for (rows in index_cases) { 399s + if (is.null(rows)) rows <- seq_len(nrow(x)) 399s + 399s + for (idxs in list(2L, seq_len(6L))) { 399s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 399s + suppressWarnings({ 399s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 399s + error = function(c) "error") 399s + expect <- tryCatch({ 399s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 399s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 399s + }, error = function(c) "error") 399s + }) 399s + stopifnot(all.equal(actual, expect)) 399s + 399s + suppressWarnings({ 399s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 399s + error = function(c) "error") 399s + }) 399s + stopifnot(all.equal(actual, expect)) 399s + 399s + # Check names attribute 399s + dimnames(x) <- dimnames 399s + suppressWarnings({ 399s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 399s + error = function(c) "error") 399s + expect <- tryCatch({ 399s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 399s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 399s + }, error = function(c) "error") 399s + }) 399s + stopifnot(all.equal(actual, expect)) 399s + 399s + suppressWarnings({ 399s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 399s + error = function(c) "error") 399s + }) 399s + stopifnot(all.equal(actual, expect)) 399s + 399s + dimnames(x) <- NULL 399s + } 399s + } 399s + } 400s > 400s 400s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 400s Copyright (C) 2024 The R Foundation for Statistical Computing 400s Platform: arm-unknown-linux-gnueabihf (32-bit) 400s 400s R is free software and comes with ABSOLUTELY NO WARRANTY. 400s You are welcome to redistribute it under certain conditions. 400s Type 'license()' or 'licence()' for distribution details. 400s 400s R is a collaborative project with many contributors. 400s Type 'contributors()' for more information and 400s 'citation()' on how to cite R or R packages in publications. 400s 400s Type 'demo()' for some demos, 'help()' for on-line help, or 400s 'help.start()' for an HTML browser interface to help. 400s Type 'q()' to quit R. 400s 400s > library("matrixStats") 400s > 400s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 400s + if (is.na(value)) { 400s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 400s + sum(is.na(x)) 400s + ) 400s + } else { 400s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 400s + sum(x == value, na.rm = na.rm) 400s + ) 400s + } 400s + # Preserve names attribute 400s + names <- names(counts) 400s + counts <- as.integer(counts) 400s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 400s + counts 400s + } 400s > 400s > 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > # Data type: integer and numeric 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > for (mode in c("integer", "double")) { 400s + x <- matrix(runif(10 * 5, min = -3, max = 3), nrow = 10L, ncol = 5L) 400s + x[sample.int(length(x), size = 7L)] <- 0 400s + storage.mode(x) <- mode 400s + 400s + dimnames = list(letters[1:10], LETTERS[1:5]) 400s + 400s + # Test with and without dimnames on x 400s + for (setDimnames in c(TRUE, FALSE)) { 400s + if (setDimnames) dimnames(x) <- dimnames 400s + else dimnames(x) <- NULL 400s + for (na.rm in c(FALSE, TRUE)) { 400s + # Check names attribute 400s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 400s + # Count zeros 400s + r0 <- rowCounts_R(x, value = 0, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, value = 0, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), value = 0, na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + 400s + # Count NAs 400s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + 400s + if (mode == "integer") { 400s + ux <- unique(as.vector(x)) 400s + r0 <- r1 <- r2 <- integer(nrow(x)) 400s + for (value in ux) { 400s + r0 <- r0 + rowCounts_R(x, value = value, na.rm = na.rm, useNames = useNames) 400s + r1 <- r1 + rowCounts(x, value = value, na.rm = na.rm, useNames = useNames) 400s + r2 <- r2 + colCounts(t(x), value = value, na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + } 400s + stopifnot(all(r0 == ncol(x))) 400s + } # if (mode == "integer") 400s + } # for (useNames ...) 400s + } # for (na.rm ...) 400s + } # for (setDimnames ...) 400s + } # for (mode ...) 400s > 400s > 400s > # All NAs 400s > na_list <- list(NA_integer_, NA_real_, NaN) 400s > for (na_value in na_list) { 400s + x <- matrix(na_value, nrow = 10L, ncol = 5L) 400s + # Test with and without dimnames on x 400s + for (setDimnames in c(TRUE, FALSE)) { 400s + if (setDimnames) dimnames(x) <- dimnames 400s + else dimnames(x) <- NULL 400s + for (na.rm in c(FALSE, TRUE)) { 400s + # Check names attribute 400s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 400s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + 400s + # Count NAs 400s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 400s + stopifnot(all(r0 == ncol(x))) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + } 400s + } 400s + } 400s + } # for (na_value ...) 400s > 400s > 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > # Data type: logical 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 400s > x[7:8, 2:3] <- TRUE 400s > x[1:3, ] <- TRUE 400s > x[, 1] <- TRUE 400s > x[4, ] <- FALSE 400s > x[, 4] <- FALSE 400s > x[2, ] <- FALSE 400s > x[3, ] <- TRUE 400s > 400s > # To check names attribute 400s > dimnames <- list(letters[1:10], LETTERS[1:4]) 400s > 400s > # Test with and without dimnames on x 400s > for (setDimnames in c(TRUE, FALSE)) { 400s + if (setDimnames) dimnames(x) <- dimnames 400s + else dimnames(x) <- NULL 400s + # Row/column counts 400s + for (na.rm in c(FALSE, TRUE)) { 400s + # Check names attribute 400s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 400s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + 400s + r_true <- rowCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 400s + r_false <- rowCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 400s + stopifnot(r_true + r_false == ncol(x)) 400s + 400s + c_true <- colCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 400s + c_false <- colCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 400s + stopifnot(c_true + c_false == nrow(x)) 400s + 400s + # Count NAs 400s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 400s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + } 400s + } 400s + } 400s > 400s > 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > # Data type: character (not sure if this should be supported) 400s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 400s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 400s > x[2:3, 3:4] <- NA_character_ 400s > 400s > # Row/column counts 400s > for (na.rm in c(FALSE, TRUE)) { 400s + for (value in c("g", NA_character_)) { 400s + r0 <- rowCounts_R(x, value = value, na.rm = na.rm) 400s + r1 <- rowCounts(x, value = value, na.rm = na.rm) 400s + r2 <- colCounts(t(x), value = value, na.rm = na.rm) 400s + stopifnot(identical(r1, r0)) 400s + stopifnot(identical(r2, r0)) 400s + 400s + c <- count(x[1, ], value = value, na.rm = na.rm) 400s + stopifnot(identical(c, r1[1])) 400s + 400s + c <- count(x[2, ], value = value, na.rm = na.rm) 400s + stopifnot(identical(c, r1[2])) 400s + } 400s + } 401s > 401s > # NA row 401s > x <- matrix(0, nrow = 2L, ncol = 2L) 401s > x[1, ] <- NA_integer_ 401s > 401s > dimnames <- list(letters[1:2], LETTERS[1:2]) 401s > 401s > # Test with and without dimnames on x 401s > for (setDimnames in c(TRUE, FALSE)) { 401s + if (setDimnames) dimnames(x) <- dimnames 401s + else dimnames(x) <- NULL 401s + # Check names attribute 401s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 401s + r0 <- rowCounts(x, value = 0, useNames = useNames) 401s + r1 <- rowCounts_R(x, value = 0, useNames = useNames) 401s + stopifnot(identical(r0, r1)) 401s + } 401s + } 401s > 401s 401s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 401s Copyright (C) 2024 The R Foundation for Statistical Computing 401s Platform: arm-unknown-linux-gnueabihf (32-bit) 401s 401s R is free software and comes with ABSOLUTELY NO WARRANTY. 401s You are welcome to redistribute it under certain conditions. 401s Type 'license()' or 'licence()' for distribution details. 401s 401s R is a collaborative project with many contributors. 401s Type 'contributors()' for more information and 401s 'citation()' on how to cite R or R packages in publications. 401s 401s Type 'demo()' for some demos, 'help()' for on-line help, or 401s 'help.start()' for an HTML browser interface to help. 401s Type 'q()' to quit R. 401s 401s > library("matrixStats") 401s > 401s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 401s + if (is.na(value)) { 401s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 401s + sum(is.na(x)) 401s + ) 401s + } else { 401s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 401s + sum(x == value, na.rm = na.rm) 401s + ) 401s + } 401s + # Preserve names attribute 401s + names <- names(counts) 401s + counts <- as.integer(counts) 401s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 401s + counts 401s + } # rowCounts_R() 401s > 401s > 401s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 401s > # Subsetted tests 401s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 401s > source("utils/validateIndicesFramework.R") 401s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 401s > x[2:3, 3:4] <- NA_real_ 401s > storage.mode(x) <- "integer" 401s > 401s > # To check names attribute 401s > dimnames <- list(letters[1:6], LETTERS[1:6]) 401s > 401s > # Test with and without dimnames on x 401s > for (setDimnames in c(TRUE, FALSE)) { 401s + if (setDimnames) dimnames(x) <- dimnames 401s + else dimnames(x) <- NULL 401s + for (rows in index_cases) { 401s + for (cols in index_cases) { 401s + # Check names attribute 401s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 401s + validateIndicesTestMatrix(x, rows, cols, 401s + ftest = rowCounts, fsure = rowCounts_R, 401s + value = 0, na.rm = TRUE, useNames = useNames) 401s + validateIndicesTestMatrix(x, rows, cols, 401s + fcoltest = colCounts, fsure = rowCounts_R, 401s + value = 0, na.rm = TRUE, useNames = useNames) 401s + for (value in c(0, NA_integer_)) { 401s + validateIndicesTestMatrix(x, rows, cols, 401s + ftest = rowCounts, fsure = rowCounts_R, 401s + value = value, useNames = useNames) 401s + validateIndicesTestMatrix(x, rows, cols, 401s + fcoltest = colCounts, fsure = rowCounts_R, 401s + value = value, useNames = useNames) 401s + } 401s + } 401s + } 401s + } 401s + } 406s > 406s > x <- matrix(rep(letters, length.out = 6 * 6), nrow = 6, ncol = 6) 406s > x[2:3, 3:4] <- NA_character_ 406s > # Test with and without dimnames on x 406s > for (setDimnames in c(TRUE, FALSE)) { 406s + if (setDimnames) dimnames(x) <- dimnames 406s + else dimnames(x) <- NULL 406s + 406s + count <- 0L 406s + for (rows in index_cases) { 406s + for (cols in index_cases) { 406s + count <- count + 1L 406s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 406s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 406s + useNames <- useNames[count %% length(useNames) + 1] 406s + 406s + validateIndicesTestMatrix(x, rows, cols, 406s + ftest = rowCounts, fsure = rowCounts_R, 406s + value = "g", na.rm = TRUE, useNames = useNames) 406s + validateIndicesTestMatrix(x, rows, cols, 406s + fcoltest = colCounts, fsure = rowCounts_R, 406s + value = "g", na.rm = TRUE, useNames = useNames) 406s + for (value in c("g", NA_character_)) { 406s + validateIndicesTestMatrix(x, rows, cols, 406s + ftest = rowCounts, fsure = rowCounts_R, 406s + value = value, useNames = useNames) 406s + validateIndicesTestMatrix(x, rows, cols, 406s + fcoltest = colCounts, fsure = rowCounts_R, 406s + value = value, useNames = useNames) 406s + } 406s + } 406s + } 406s + } 409s > 409s 409s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 409s Copyright (C) 2024 The R Foundation for Statistical Computing 409s Platform: arm-unknown-linux-gnueabihf (32-bit) 409s 409s R is free software and comes with ABSOLUTELY NO WARRANTY. 409s You are welcome to redistribute it under certain conditions. 409s Type 'license()' or 'licence()' for distribution details. 409s 409s R is a collaborative project with many contributors. 409s Type 'contributors()' for more information and 409s 'citation()' on how to cite R or R packages in publications. 409s 409s Type 'demo()' for some demos, 'help()' for on-line help, or 409s 'help.start()' for an HTML browser interface to help. 409s Type 'q()' to quit R. 409s 409s > library("matrixStats") 409s > 409s > rowCummins_R <- function(x, ..., useNames = NA) { 409s + suppressWarnings({ 409s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 409s + }) 409s + 409s + # Preserve dimnames attribute? 409s + dim(y) <- dim(x) 409s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 409s + y 409s + } 409s > 409s > rowCummaxs_R <- function(x, ..., useNames = NA) { 409s + mode <- storage.mode(x) 409s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 409s + storage.mode(x) <- "numeric" 409s + suppressWarnings({ 409s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 409s + }) 409s + 409s + # Preserve dimnames attribute? 409s + dim(y) <- dim(x) 409s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 409s + 409s + y 409s + } 409s > 409s > 409s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 409s > # With and without some NAs 409s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 409s > for (mode in c("logical", "integer", "double")) { 409s + for (add_na in c(FALSE, TRUE)) { 409s + cat("add_na = ", add_na, "\n", sep = "") 409s + 409s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 409s + diag(x) <- 0 409s + if (add_na) { 409s + x[3:7, c(2, 4)] <- NA_real_ 409s + } 409s + cat("mode: ", mode, "\n", sep = "") 409s + storage.mode(x) <- mode 409s + str(x) 409s + 409s + # To check dimnames attribute 409s + dimnames <- list(letters[1:10], LETTERS[1:5]) 409s + 409s + # Test with and without dimnames on x 409s + for (setDimnames in c(TRUE, FALSE)) { 409s + if (setDimnames) dimnames(x) <- dimnames 409s + else dimnames(x) <- NULL 409s + # Check names attribute 409s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 409s + # Row/column ranges 409s + r0 <- rowCummins_R(x, useNames = useNames) 409s + r1 <- rowCummins(x, useNames = useNames) 409s + r2 <- t(colCummins(t(x), useNames = useNames)) 409s + stopifnot(all.equal(r1, r2)) 409s + stopifnot(all.equal(r1, r0)) 409s + stopifnot(all.equal(r2, r0)) 409s + 409s + r0 <- rowCummaxs_R(x, useNames = useNames) 409s + r1 <- rowCummaxs(x, useNames = useNames) 409s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 409s + stopifnot(all.equal(r1, r2)) 409s + stopifnot(all.equal(r1, r0)) 409s + stopifnot(all.equal(r2, r0)) 409s + } # for (useNames ...) 409s + } # for (setDimnames ...) 409s + } # for (add_na ...) 409s + } # for (mode ...) 409s add_na = FALSE 409s mode: logical 410s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 410s add_na = TRUE 410s mode: logical 410s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 410s add_na = FALSE 410s mode: integer 410s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 410s add_na = TRUE 410s mode: integer 410s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 410s add_na = FALSE 410s mode: double 410s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 410s add_na = TRUE 410s mode: double 410s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 410s > 410s > 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > # All NAs 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > for (mode in c("logical", "integer", "double")) { 410s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 410s + cat("mode: ", mode, "\n", sep = "") 410s + storage.mode(x) <- mode 410s + str(x) 410s + 410s + # Test with and without dimnames on x 410s + for (setDimnames in c(TRUE, FALSE)) { 410s + if (setDimnames) dimnames(x) <- dimnames 410s + else dimnames(x) <- NULL 410s + # Check names attribute 410s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 410s + r0 <- rowCummins_R(x, useNames = useNames) 410s + r1 <- rowCummins(x, useNames = useNames) 410s + r2 <- t(colCummins(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + 410s + r0 <- rowCummaxs_R(x, useNames = useNames) 410s + r1 <- rowCummaxs(x, useNames = useNames) 410s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + } # for (useNames ...) 410s + } # for (setDimnames ...) 410s + } # for (mode ...) 410s mode: logical 410s logi [1:10, 1:5] NA NA NA NA NA NA ... 410s mode: integer 410s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 410s mode: double 410s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 410s > 410s > 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > # A 1x1 matrix 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > for (mode in c("logical", "integer", "double")) { 410s + x <- matrix(0, nrow = 1L, ncol = 1L) 410s + cat("mode: ", mode, "\n", sep = "") 410s + storage.mode(x) <- mode 410s + str(x) 410s + 410s + # To check dimnames attribute 410s + dimnames <- list("a", "A") 410s + 410s + # Test with and without dimnames on x 410s + for (setDimnames in c(TRUE, FALSE)) { 410s + if (setDimnames) dimnames(x) <- dimnames 410s + else dimnames(x) <- NULL 410s + # Check names attribute 410s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 410s + r0 <- rowCummins_R(x, useNames = useNames) 410s + r1 <- rowCummins(x, useNames = useNames) 410s + r2 <- t(colCummins(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + 410s + r0 <- rowCummaxs_R(x, useNames = useNames) 410s + r1 <- rowCummaxs(x, useNames = useNames) 410s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + } # for (useNames ...) 410s + } # for (setDimnames ...) 410s + } # for (mode ...) 410s mode: logical 410s logi [1, 1] FALSE 410s mode: integer 410s int [1, 1] 0 410s mode: double 410s num [1, 1] 0 410s > 410s > 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > # Corner cases 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > for (mode in c("logical", "integer", "double")) { 410s + cat("mode: ", mode, "\n", sep = "") 410s + value <- 0 410s + storage.mode(value) <- mode 410s + value0 <- if (mode == "logical") 0L else value 410s + 410s + # A 0x0 matrix 410s + x <- matrix(value, nrow = 0L, ncol = 0L) 410s + str(x) 410s + r0 <- matrix(value0, nrow = nrow(x), ncol = ncol(x)) 410s + r1 <- rowCummins(x) 410s + r2 <- t(colCummins(t(x))) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + 410s + # A 0xK matrix 410s + x <- matrix(value, nrow = 0L, ncol = 5L) 410s + str(x) 410s + colnames <- LETTERS[1:5] 410s + # Test with and without dimnames on x 410s + for (setDimnames in c(TRUE, FALSE)) { 410s + if (setDimnames) colnames(x) <- colnames 410s + else dimnames(x) <- NULL 410s + # Check names attribute 410s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 410s + r0 <- rowCummins_R(x, useNames = useNames) 410s + r1 <- rowCummins(x, useNames = useNames) 410s + r2 <- t(colCummins(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + r0 <- rowCummaxs_R(x, useNames = useNames) 410s + r1 <- rowCummaxs(x, useNames = useNames) 410s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + } # for (useNames ...) 410s + } # for (setDimnames ...) 410s + 410s + # A Nx0 matrix 410s + x <- matrix(value, nrow = 5L, ncol = 0L) 410s + str(x) 410s + rownames <- LETTERS[1:5] 410s + # Test with and without dimnames on x 410s + for (setDimnames in c(TRUE, FALSE)) { 410s + if (setDimnames) rownames(x) <- rownames 410s + else dimnames(x) <- NULL 410s + # Check names attribute 410s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 410s + r0 <- rowCummins_R(x, useNames = useNames) 410s + r1 <- rowCummins(x, useNames = useNames) 410s + r2 <- t(colCummins(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + 410s + r0 <- rowCummaxs_R(x, useNames = useNames) 410s + r1 <- rowCummaxs(x, useNames = useNames) 410s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 410s + stopifnot(all.equal(r1, r2)) 410s + stopifnot(all.equal(r1, r0)) 410s + stopifnot(all.equal(r2, r0)) 410s + } # for (useNames ...) 410s + } # for (setDimnames ...) 410s + } # for (mode ...) 410s mode: logical 410s logi[0 , 0 ] 410s logi[0 , 1:5] 410s logi[1:5, 0 ] 410s mode: integer 410s int[0 , 0 ] 410s int[0 , 1:5] 410s int[1:5, 0 ] 410s mode: double 410s num[0 , 0 ] 410s num[0 , 1:5] 410s num[1:5, 0 ] 410s > 410s 410s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 410s Copyright (C) 2024 The R Foundation for Statistical Computing 410s Platform: arm-unknown-linux-gnueabihf (32-bit) 410s 410s R is free software and comes with ABSOLUTELY NO WARRANTY. 410s You are welcome to redistribute it under certain conditions. 410s Type 'license()' or 'licence()' for distribution details. 410s 410s R is a collaborative project with many contributors. 410s Type 'contributors()' for more information and 410s 'citation()' on how to cite R or R packages in publications. 410s 410s Type 'demo()' for some demos, 'help()' for on-line help, or 410s 'help.start()' for an HTML browser interface to help. 410s Type 'q()' to quit R. 410s 410s > library("matrixStats") 410s > 410s > rowCummins_R <- function(x, ..., useNames = NA) { 410s + suppressWarnings({ 410s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 410s + }) 410s + 410s + # Preserve dimnames attribute? 410s + dim(y) <- dim(x) 410s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 410s + 410s + y 410s + } 410s > 410s > rowCummaxs_R <- function(x, ..., useNames = NA) { 410s + mode <- storage.mode(x) 410s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 410s + storage.mode(x) <- "numeric" 410s + suppressWarnings({ 410s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 410s + }) 410s + 410s + # Preserve dimnames attribute? 410s + dim(y) <- dim(x) 410s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 410s + 410s + storage.mode(y) <- mode 410s + y 410s + } 410s > 410s > 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > # Subsetted tests 410s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 410s > source("utils/validateIndicesFramework.R") 410s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 410s > storage.mode(x) <- "integer" 410s > 410s > # To check dimnames attribute 410s > dimnames <- list(letters[1:6], LETTERS[1:6]) 410s > 410s > # Test with and without dimnames on x 410s > for (setDimnames in c(TRUE, FALSE)) { 410s + if (setDimnames) dimnames(x) <- dimnames 410s + else dimnames(x) <- NULL 410s + for (rows in index_cases) { 410s + for (cols in index_cases) { 410s + # Check names attribute 410s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 410s + validateIndicesTestMatrix(x, rows, cols, 410s + ftest = rowCummins, fsure = rowCummins_R, useNames = useNames,verbose=TRUE) 410s + validateIndicesTestMatrix(x, rows, cols, 410s + ftest = function(x, rows, cols, ..., useNames) { 410s + t(colCummins(t(x), rows = cols, cols = rows, useNames = useNames)) 410s + }, fsure = rowCummins_R, useNames = useNames) 410s + 410s + validateIndicesTestMatrix(x, rows, cols, 410s + ftest = rowCummaxs, fsure = rowCummaxs_R, useNames = useNames) 410s + validateIndicesTestMatrix(x, rows, cols, 410s + ftest = function(x, rows, cols, ..., useNames) { 410s + t(colCummaxs(t(x), rows = cols, cols = rows, useNames = useNames)) 410s + }, fsure = rowCummaxs_R, useNames = useNames) 410s + } 410s + } 410s + } 410s + } 417s > 417s 417s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 417s Copyright (C) 2024 The R Foundation for Statistical Computing 417s Platform: arm-unknown-linux-gnueabihf (32-bit) 417s 417s R is free software and comes with ABSOLUTELY NO WARRANTY. 417s You are welcome to redistribute it under certain conditions. 417s Type 'license()' or 'licence()' for distribution details. 417s 417s R is a collaborative project with many contributors. 417s Type 'contributors()' for more information and 417s 'citation()' on how to cite R or R packages in publications. 417s 417s Type 'demo()' for some demos, 'help()' for on-line help, or 417s 'help.start()' for an HTML browser interface to help. 417s Type 'q()' to quit R. 417s 418s > library("matrixStats") 418s > 418s > rowCumprods_R <- function(x, ..., useNames = NA) { 418s + suppressWarnings({ 418s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 418s + }) 418s + 418s + # Preserve dimnames attribute? 418s + dim(y) <- dim(x) 418s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 418s + 418s + y 418s + } 418s > 418s > 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > # With and without some NAs 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > for (mode in c("logical", "integer", "double")) { 418s + for (add_na in c(FALSE, TRUE)) { 418s + cat("add_na = ", add_na, "\n", sep = "") 418s + 418s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 418s + if (add_na) { 418s + x[3:7, c(2, 4)] <- NA_real_ 418s + } 418s + cat("mode: ", mode, "\n", sep = "") 418s + storage.mode(x) <- mode 418s + str(x) 418s + 418s + # To check dimnames attribute 418s + dimnames <- list(letters[1:10], LETTERS[1:5]) 418s + 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) dimnames(x) <- dimnames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + # Row/column ranges 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(colCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + } # for (add_na ...) 418s + } # for (mode ...) 418s add_na = FALSE 418s mode: logical 418s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 418s add_na = TRUE 418s mode: logical 418s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 418s add_na = FALSE 418s mode: integer 418s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 418s add_na = TRUE 418s mode: integer 418s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 418s add_na = FALSE 418s mode: double 418s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 418s add_na = TRUE 418s mode: double 418s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 418s > 418s > 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > # All NAs 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > for (mode in c("logical", "integer", "double")) { 418s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 418s + cat("mode: ", mode, "\n", sep = "") 418s + storage.mode(x) <- mode 418s + str(x) 418s + 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) dimnames(x) <- dimnames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + # Row/column ranges 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(colCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + } # for (mode ...) 418s mode: logical 418s logi [1:10, 1:5] NA NA NA NA NA NA ... 418s mode: integer 418s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 418s mode: double 418s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 418s > 418s > 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > # A 1x1 matrix 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > for (mode in c("logical", "integer", "double")) { 418s + x <- matrix(0, nrow = 1L, ncol = 1L) 418s + cat("mode: ", mode, "\n", sep = "") 418s + storage.mode(x) <- mode 418s + str(x) 418s + 418s + dimnames <- list("a", "A") 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) dimnames(x) <- dimnames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + # Row/column ranges 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(colCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + } 418s mode: logical 418s logi [1, 1] FALSE 418s mode: integer 418s int [1, 1] 0 418s mode: double 418s num [1, 1] 0 418s > 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > # BUG FIX TEST: Assert zeros don't trump NAs in integer matrices 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > for (mode in c("logical", "integer", "double")) { 418s + x <- matrix(NA_real_, nrow = 3L, ncol = 2L) 418s + x[1, 2] <- 0 418s + x[2, 2] <- 1 418s + x[3, 1] <- 0 418s + storage.mode(x) <- mode 418s + cat("mode: ", mode, "\n", sep = "") 418s + str(x) 418s + 418s + dimnames <- list(letters[1:3], LETTERS[1:2]) 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) dimnames(x) <- dimnames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + # Row/column ranges 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(colCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + } 418s mode: logical 418s logi [1:3, 1:2] NA NA FALSE FALSE TRUE NA 418s mode: integer 418s int [1:3, 1:2] NA NA 0 0 1 NA 418s mode: double 418s num [1:3, 1:2] NA NA 0 0 1 NA 418s > 418s > 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > # Corner cases 418s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 418s > for (mode in c("logical", "integer", "double")) { 418s + cat("mode: ", mode, "\n", sep = "") 418s + value <- 0 418s + storage.mode(value) <- mode 418s + if (mode == "logical") value2 <- 0L 418s + 418s + # A 0x0 matrix 418s + x <- matrix(value, nrow = 0L, ncol = 0L) 418s + str(x) 418s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 418s + r1 <- rowCumprods(x) 418s + r2 <- t(colCumprods(t(x))) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + 418s + # A 0xK matrix 418s + x <- matrix(value, nrow = 0L, ncol = 5L) 418s + str(x) 418s + colnames <- LETTERS[1:5] 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) colnames(x) <- colnames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + 418s + # A Nx0 matrix 418s + x <- matrix(value, nrow = 5L, ncol = 0L) 418s + str(x) 418s + rownames <- LETTERS[1:5] 418s + # Test with and without dimnames on x 418s + for (setDimnames in c(TRUE, FALSE)) { 418s + if (setDimnames) rownames(x) <- rownames 418s + else dimnames(x) <- NULL 418s + # Check names attribute 418s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 418s + r0 <- rowCumprods_R(x, useNames = useNames) 418s + r1 <- rowCumprods(x, useNames = useNames) 418s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 418s + stopifnot(all.equal(r1, r2)) 418s + stopifnot(all.equal(r1, r0)) 418s + stopifnot(all.equal(r2, r0)) 418s + } # for (useNames ...) 418s + } # for (setDimnames ...) 418s + } # for (mode ...) 418s mode: logical 418s logi[0 , 0 ] 418s logi[0 , 1:5] 418s logi[1:5, 0 ] 418s mode: integer 418s int[0 , 0 ] 418s int[0 , 1:5] 418s int[1:5, 0 ] 418s mode: double 418s num[0 , 0 ] 418s num[0 , 1:5] 418s num[1:5, 0 ] 418s > 418s 418s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 418s Copyright (C) 2024 The R Foundation for Statistical Computing 418s Platform: arm-unknown-linux-gnueabihf (32-bit) 418s 418s R is free software and comes with ABSOLUTELY NO WARRANTY. 418s You are welcome to redistribute it under certain conditions. 418s Type 'license()' or 'licence()' for distribution details. 418s 418s R is a collaborative project with many contributors. 418s Type 'contributors()' for more information and 418s 'citation()' on how to cite R or R packages in publications. 418s 418s Type 'demo()' for some demos, 'help()' for on-line help, or 418s 'help.start()' for an HTML browser interface to help. 418s Type 'q()' to quit R. 418s 419s > library("matrixStats") 419s > 419s > rowCumprods_R <- function(x, ..., useNames = NA) { 419s + suppressWarnings({ 419s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 419s + }) 419s + 419s + # Preserve dimnames attribute? 419s + dim(y) <- dim(x) 419s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 419s + 419s + y 419s + } 419s > 419s > 419s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 419s > # Subsetted tests 419s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 419s > source("utils/validateIndicesFramework.R") 419s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 419s > storage.mode(x) <- "integer" 419s > 419s > # To check dimnames attribute 419s > dimnames <- list(letters[1:6], LETTERS[1:6]) 419s > 419s > # Test with and without dimnames on x 419s > for (setDimnames in c(TRUE, FALSE)) { 419s + if (setDimnames) dimnames(x) <- dimnames 419s + else dimnames(x) <- NULL 419s + for (rows in index_cases) { 419s + for (cols in index_cases) { 419s + # Check names attribute 419s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 419s + validateIndicesTestMatrix(x, rows, cols, 419s + ftest = rowCumprods, fsure = rowCumprods_R, useNames = useNames) 419s + validateIndicesTestMatrix(x, rows, cols, 419s + ftest = function(x, rows, cols, ..., useNames) { 419s + t(colCumprods(t(x), rows = cols, cols = rows, useNames = useNames)) 419s + }, fsure = rowCumprods_R, useNames = useNames) 419s + } 419s + } 419s + } 419s + } 422s > 422s 422s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 422s Copyright (C) 2024 The R Foundation for Statistical Computing 422s Platform: arm-unknown-linux-gnueabihf (32-bit) 422s 422s R is free software and comes with ABSOLUTELY NO WARRANTY. 422s You are welcome to redistribute it under certain conditions. 422s Type 'license()' or 'licence()' for distribution details. 422s 422s R is a collaborative project with many contributors. 422s Type 'contributors()' for more information and 422s 'citation()' on how to cite R or R packages in publications. 422s 422s Type 'demo()' for some demos, 'help()' for on-line help, or 422s 'help.start()' for an HTML browser interface to help. 422s Type 'q()' to quit R. 422s 422s > library("matrixStats") 422s > 422s > rowCumsums_R <- function(x, ..., useNames = NA) { 422s + suppressWarnings({ 422s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 422s + }) 422s + 422s + # Preserve dimnames attribute? 422s + dim(y) <- dim(x) 422s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 422s + 422s + y 422s + } 422s > 422s > 422s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 422s > # With and without some NAs 422s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 422s > dimnames <- list(letters[1:10], LETTERS[1:5]) # to check dimnames attribute 422s > for (mode in c("logical", "integer", "double")) { 422s + for (add_na in c(FALSE, TRUE)) { 422s + cat("add_na = ", add_na, "\n", sep = "") 422s + 422s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 422s + if (add_na) { 422s + x[3:7, c(2, 4)] <- NA_real_ 422s + } 422s + cat("mode: ", mode, "\n", sep = "") 422s + storage.mode(x) <- mode 422s + str(x) 422s + 422s + # Test with and without dimnames on x 422s + for (setDimnames in c(TRUE, FALSE)) { 422s + if (setDimnames) dimnames(x) <- dimnames 422s + else dimnames(x) <- NULL 422s + # Check names attribute 422s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 422s + # Row/column ranges 422s + r0 <- rowCumsums_R(x, useNames = useNames) 422s + r1 <- rowCumsums(x, useNames = useNames) 422s + r2 <- t(colCumsums(t(x), useNames = useNames)) 422s + stopifnot(all.equal(r1, r2)) 422s + stopifnot(all.equal(r1, r0)) 422s + stopifnot(all.equal(r2, r0)) 422s + } # for (useNames ...) 422s + } # for (setDimnames ...) 422s + } # for (add_na ...) 422s + } 422s add_na = FALSE 422s mode: logical 422s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 422s add_na = TRUE 422s mode: logical 422s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 422s add_na = FALSE 422s mode: integer 422s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 422s add_na = TRUE 422s mode: integer 422s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 422s add_na = FALSE 422s mode: double 422s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 422s add_na = TRUE 422s mode: double 422s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 422s > 422s > 422s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 422s > # All NAs 422s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 422s > for (mode in c("logical", "integer", "double")) { 422s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 422s + cat("mode: ", mode, "\n", sep = "") 422s + storage.mode(x) <- mode 422s + str(x) 422s + 422s + # Test with and without dimnames on x 422s + for (setDimnames in c(TRUE, FALSE)) { 422s + if (setDimnames) dimnames(x) <- dimnames 422s + else dimnames(x) <- NULL 422s + # Check names attribute 422s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 422s + # Row/column ranges 422s + r0 <- rowCumsums_R(x, useNames = useNames) 422s + r1 <- rowCumsums(x, useNames = useNames) 422s + r2 <- t(colCumsums(t(x), useNames = useNames)) 422s + stopifnot(all.equal(r1, r2)) 422s + stopifnot(all.equal(r1, r0)) 422s + stopifnot(all.equal(r2, r0)) 422s + } # for (useNames ...) 422s + } # for (setDimnames ...) 422s + } # for (mode ...) 423s mode: logical 423s logi [1:10, 1:5] NA NA NA NA NA NA ... 423s mode: integer 423s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 423s mode: double 423s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 423s > 423s > 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > # A 1x1 matrix 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > dimnames <- list("a", "A") # to check dimnames attribute 423s > for (mode in c("logical", "integer", "double")) { 423s + x <- matrix(0, nrow = 1L, ncol = 1L) 423s + cat("mode: ", mode, "\n", sep = "") 423s + storage.mode(x) <- mode 423s + str(x) 423s + 423s + r0 <- rowCumsums_R(x) 423s + r1 <- rowCumsums(x) 423s + r2 <- t(colCumsums(t(x))) 423s + stopifnot(all.equal(r1, r2)) 423s + stopifnot(all.equal(r1, r0)) 423s + stopifnot(all.equal(r2, r0)) 423s + 423s + # Check dimnames attribute 423s + dimnames(x) <- dimnames 423s + # r0 <- rowCumsums_R(x) 423s + # > r0 423s + # a 423s + # [1,] 0 423s + r1 <- rowCumsums(x, useNames = TRUE) 423s + r2 <- t(colCumsums(t(x), useNames = TRUE)) 423s + stopifnot(identical(dimnames(r1), dimnames)) 423s + stopifnot(identical(dimnames(r2), dimnames)) 423s + dimnames(x) <- NULL 423s + } 423s mode: logical 423s logi [1, 1] FALSE 423s mode: integer 423s int [1, 1] 0 423s mode: double 423s num [1, 1] 0 423s > 423s > 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > # Corner cases 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > names <- LETTERS[1:5] # to check dimnames attribute 423s > for (mode in c("logical", "integer", "double")) { 423s + cat("mode: ", mode, "\n", sep = "") 423s + value <- 0 423s + storage.mode(value) <- mode 423s + value2 <- value 423s + if (mode == "logical") value2 <- 0L 423s + 423s + # A 0x0 matrix 423s + x <- matrix(value, nrow = 0L, ncol = 0L) 423s + str(x) 423s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 423s + r1 <- rowCumsums(x) 423s + r2 <- t(colCumsums(t(x))) 423s + stopifnot(all.equal(r1, r2)) 423s + stopifnot(all.equal(r1, r0)) 423s + stopifnot(all.equal(r2, r0)) 423s + 423s + # A 0xK matrix 423s + x <- matrix(value, nrow = 0L, ncol = 5L) 423s + str(x) 423s + colnames <- LETTERS[1:5] 423s + # Test with and without dimnames on x 423s + for (setDimnames in c(TRUE, FALSE)) { 423s + if (setDimnames) colnames(x) <- colnames 423s + else dimnames(x) <- NULL 423s + # Check names attribute 423s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 423s + r0 <- rowCumsums_R(x, useNames = useNames) 423s + r1 <- rowCumsums(x, useNames = useNames) 423s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 423s + stopifnot(all.equal(r1, r2)) 423s + stopifnot(all.equal(r1, r0)) 423s + stopifnot(all.equal(r2, r0)) 423s + } # for (useNames ...) 423s + } # for (setDimnames ...) 423s + 423s + # A Nx0 matrix 423s + x <- matrix(value, nrow = 5L, ncol = 0L) 423s + str(x) 423s + rownames <- LETTERS[1:5] 423s + # Test with and without dimnames on x 423s + for (setDimnames in c(TRUE, FALSE)) { 423s + if (setDimnames) rownames(x) <- rownames 423s + else dimnames(x) <- NULL 423s + # Check names attribute 423s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 423s + r0 <- rowCumsums_R(x, useNames = useNames) 423s + r1 <- rowCumsums(x, useNames = useNames) 423s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 423s + stopifnot(all.equal(r1, r2)) 423s + stopifnot(all.equal(r1, r0)) 423s + stopifnot(all.equal(r2, r0)) 423s + } # for (useNames ...) 423s + } # for (setDimnames ...) 423s + } # for (mode ...) 423s mode: logical 423s logi[0 , 0 ] 423s logi[0 , 1:5] 423s logi[1:5, 0 ] 423s mode: integer 423s int[0 , 0 ] 423s int[0 , 1:5] 423s int[1:5, 0 ] 423s mode: double 423s num[0 , 0 ] 423s num[0 , 1:5] 423s num[1:5, 0 ] 423s > 423s 423s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 423s Copyright (C) 2024 The R Foundation for Statistical Computing 423s Platform: arm-unknown-linux-gnueabihf (32-bit) 423s 423s R is free software and comes with ABSOLUTELY NO WARRANTY. 423s You are welcome to redistribute it under certain conditions. 423s Type 'license()' or 'licence()' for distribution details. 423s 423s R is a collaborative project with many contributors. 423s Type 'contributors()' for more information and 423s 'citation()' on how to cite R or R packages in publications. 423s 423s Type 'demo()' for some demos, 'help()' for on-line help, or 423s 'help.start()' for an HTML browser interface to help. 423s Type 'q()' to quit R. 423s 423s > library("matrixStats") 423s > 423s > rowCumsums_R <- function(x, ..., useNames = NA) { 423s + suppressWarnings({ 423s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 423s + }) 423s + 423s + # Preserve dimnames attribute? 423s + dim(y) <- dim(x) 423s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 423s + 423s + y 423s + } 423s > 423s > 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > # Subsetted tests 423s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 423s > source("utils/validateIndicesFramework.R") 423s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 423s > storage.mode(x) <- "integer" 423s > 423s > # To check dimnames attribute 423s > dimnames <- list(letters[1:6], LETTERS[1:6]) 423s > 423s > # Test with and without dimnames on x 423s > for (setDimnames in c(TRUE, FALSE)) { 423s + if (setDimnames) dimnames(x) <- dimnames 423s + else dimnames(x) <- NULL 423s + for (rows in index_cases) { 423s + for (cols in index_cases) { 423s + # Check names attribute 423s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 423s + validateIndicesTestMatrix(x, rows, cols, 423s + ftest = rowCumsums, fsure = rowCumsums_R, useNames = useNames) 423s + validateIndicesTestMatrix(x, rows, cols, 423s + ftest = function(x, rows, cols, ..., useNames) { 423s + t(colCumsums(t(x), rows = cols, cols = rows, useNames = useNames)) 423s + }, fsure = rowCumsums_R, useNames = useNames) 423s + } 423s + } 423s + } 423s + } 426s > 426s 426s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 426s Copyright (C) 2024 The R Foundation for Statistical Computing 426s Platform: arm-unknown-linux-gnueabihf (32-bit) 426s 426s R is free software and comes with ABSOLUTELY NO WARRANTY. 426s You are welcome to redistribute it under certain conditions. 426s Type 'license()' or 'licence()' for distribution details. 426s 426s R is a collaborative project with many contributors. 426s Type 'contributors()' for more information and 426s 'citation()' on how to cite R or R packages in publications. 426s 426s Type 'demo()' for some demos, 'help()' for on-line help, or 426s 'help.start()' for an HTML browser interface to help. 426s Type 'q()' to quit R. 426s 427s > library("matrixStats") 427s > 427s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 427s + ncol2 <- ncol(x) - lag * differences 427s + if (ncol2 <= 0) { 427s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 427s + # Preserve names attribute 427s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 427s + return(y) 427s + } 427s + suppressWarnings({ 427s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 427s + }) 427s + y <- t(y) 427s + 427s + # Preserve dimnames attribute 427s + dim(y) <- c(nrow(x), ncol2) 427s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 427s + colnames <- colnames(x) 427s + if (!is.null(colnames)) { 427s + len <- length(colnames) 427s + colnames <- colnames[(len - ncol2 + 1):len] 427s + } 427s + dimnames(y) <- list(rownames(x), colnames) 427s + } 427s + else dimnames(y) <- NULL 427s + 427s + y 427s + } 427s > 427s > 427s > set.seed(0x42) 427s > 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > # With and without some NAs 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > for (mode in c("integer", "double")) { 427s + cat("mode: ", mode, "\n", sep = "") 427s + 427s + for (add_na in c(FALSE, TRUE)) { 427s + cat("add_na = ", add_na, "\n", sep = "") 427s + 427s + x <- matrix(sample(10 * 8) + 0.1, nrow = 10L, ncol = 8L) 427s + if (add_na) { 427s + x[3:7, c(2, 4)] <- NA_real_ 427s + } 427s + storage.mode(x) <- mode 427s + str(x) 427s + 427s + dimnames <- list(letters[1:10], LETTERS[1:8]) 427s + 427s + # Test with and without dimnames on x 427s + for (setDimnames in c(TRUE, FALSE)) { 427s + if (setDimnames) dimnames(x) <- dimnames 427s + else dimnames(x) <- NULL 427s + # Check dimnames attribute 427s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 427s + for (lag in 1:4) { 427s + for (differences in 1:3) { 427s + cat(sprintf("mode: %s, lag = %d, differences = %d\n", 427s + mode, lag, differences)) 427s + # Row/column ranges 427s + r0 <- rowDiffs_R(x, lag = lag, differences = differences, useNames = useNames) 427s + r1 <- rowDiffs(x, lag = lag, differences = differences, useNames = useNames) 427s + r2 <- t(colDiffs(t(x), lag = lag, differences = differences, useNames = useNames)) 427s + stopifnot(all.equal(r1, r0)) 427s + stopifnot(all.equal(r2, r0)) 427s + stopifnot(all.equal(r1, r2)) 427s + } 427s + } 427s + } # for (useNames ...) 427s + } # for (setDimnames ...) 427s + } # for (add_na ...) 427s + } # for (mode ...) 427s mode: integer 427s add_na = FALSE 427s int [1:10, 1:8] 68 26 29 47 48 10 1 38 16 40 ... 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s add_na = TRUE 427s int [1:10, 1:8] 80 71 7 52 79 22 31 10 29 63 ... 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: integer, lag = 1, differences = 1 427s mode: integer, lag = 1, differences = 2 427s mode: integer, lag = 1, differences = 3 427s mode: integer, lag = 2, differences = 1 427s mode: integer, lag = 2, differences = 2 427s mode: integer, lag = 2, differences = 3 427s mode: integer, lag = 3, differences = 1 427s mode: integer, lag = 3, differences = 2 427s mode: integer, lag = 3, differences = 3 427s mode: integer, lag = 4, differences = 1 427s mode: integer, lag = 4, differences = 2 427s mode: integer, lag = 4, differences = 3 427s mode: double 427s add_na = FALSE 427s 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 ... 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s add_na = TRUE 427s 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 ... 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s mode: double, lag = 1, differences = 1 427s mode: double, lag = 1, differences = 2 427s mode: double, lag = 1, differences = 3 427s mode: double, lag = 2, differences = 1 427s mode: double, lag = 2, differences = 2 427s mode: double, lag = 2, differences = 3 427s mode: double, lag = 3, differences = 1 427s mode: double, lag = 3, differences = 2 427s mode: double, lag = 3, differences = 3 427s mode: double, lag = 4, differences = 1 427s mode: double, lag = 4, differences = 2 427s mode: double, lag = 4, differences = 3 427s > 427s > 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > # All NAs 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > for (mode in c("integer", "double")) { 427s + cat("mode: ", mode, "\n", sep = "") 427s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 427s + storage.mode(x) <- mode 427s + str(x) 427s + 427s + dimnames <- list(letters[1:10], LETTERS[1:5]) 427s + 427s + # Test with and without dimnames on x 427s + for (setDimnames in c(TRUE, FALSE)) { 427s + if (setDimnames) dimnames(x) <- dimnames 427s + else dimnames(x) <- NULL 427s + # Check dimnames attribute 427s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 427s + r0 <- rowDiffs_R(x, useNames = useNames) 427s + r1 <- rowDiffs(x, useNames = useNames) 427s + r2 <- t(colDiffs(t(x), useNames = useNames)) 427s + stopifnot(all.equal(r1, r0)) 427s + stopifnot(all.equal(r2, r0)) 427s + stopifnot(all.equal(r1, r2)) 427s + } # for (useNames ...) 427s + } # for (setDimnames ...) 427s + } # for (mode ...) 427s mode: integer 427s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 427s mode: double 427s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 427s > 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > # A 1x1 matrix 427s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 427s > x <- matrix(0, nrow = 1L, ncol = 1L) 427s > dimnames <- list("a", "A") 427s > # Test with and without dimnames on x 427s > for (setDimnames in c(TRUE, FALSE)) { 427s + if (setDimnames) dimnames(x) <- dimnames 427s + else dimnames(x) <- NULL 427s + # Check dimnames attribute 427s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 427s + r0 <- rowDiffs_R(x, useNames = useNames) 427s + r1 <- rowDiffs(x, useNames = useNames) 427s + r2 <- t(colDiffs(t(x), useNames = useNames)) 427s + stopifnot(all.equal(r1, r0)) 427s + stopifnot(all.equal(r2, r0)) 427s + stopifnot(all.equal(r1, r2)) 427s + } # for (useNames ...) 427s + } # for (setDimnames ...) 427s > 428s 428s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 428s Copyright (C) 2024 The R Foundation for Statistical Computing 428s Platform: arm-unknown-linux-gnueabihf (32-bit) 428s 428s R is free software and comes with ABSOLUTELY NO WARRANTY. 428s You are welcome to redistribute it under certain conditions. 428s Type 'license()' or 'licence()' for distribution details. 428s 428s R is a collaborative project with many contributors. 428s Type 'contributors()' for more information and 428s 'citation()' on how to cite R or R packages in publications. 428s 428s Type 'demo()' for some demos, 'help()' for on-line help, or 428s 'help.start()' for an HTML browser interface to help. 428s Type 'q()' to quit R. 428s 428s > library("matrixStats") 428s > 428s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 428s + ncol2 <- ncol(x) - lag * differences 428s + if (ncol2 <= 0) { 428s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 428s + # Preserve names attribute 428s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 428s + return(y) 428s + } 428s + suppressWarnings({ 428s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 428s + }) 428s + y <- t(y) 428s + 428s + # Preserve dimnames attribute 428s + dim(y) <- c(nrow(x), ncol2) 428s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 428s + colnames <- colnames(x) 428s + if (!is.null(colnames)) { 428s + len <- length(colnames) 428s + colnames <- colnames[(len - ncol2 + 1):len] 428s + } 428s + dimnames(y) <- list(rownames(x), colnames) 428s + } 428s + else dimnames(y) <- NULL 428s + 428s + y 428s + } 428s > 428s > 428s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 428s > # Subsetted tests 428s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 428s > source("utils/validateIndicesFramework.R") 428s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 428s > storage.mode(x) <- "integer" 428s > 428s > # To check dimnames attribute 428s > dimnames <- list(letters[1:6], LETTERS[1:6]) 428s > 428s > # Test with and without dimnames on x 428s > for (setDimnames in c(TRUE, FALSE)) { 428s + if (setDimnames) dimnames(x) <- dimnames 428s + else dimnames(x) <- NULL 428s + 428s + count <- 0L 428s + for (rows in index_cases) { 428s + for (cols in index_cases) { 428s + count <- count + 1L 428s + for (lag in 1:2) { 428s + for (differences in 1:3) { 428s + # Check dimnames attribute 428s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 428s + useNames <- useNames[count %% length(useNames) + 1] 428s + validateIndicesTestMatrix(x, rows, cols, 428s + ftest = rowDiffs, fsure = rowDiffs_R, 428s + lag = lag, differences = differences, useNames = useNames) 428s + validateIndicesTestMatrix(x, rows, cols, 428s + ftest = function(x, rows, cols, ..., useNames) { 428s + t(colDiffs(t(x), rows = cols, cols = rows, ..., useNames = useNames)) 428s + }, fsure = rowDiffs_R, 428s + lag = lag, differences = differences, useNames = useNames) 428s + } 428s + } 428s + } 428s + } 428s + } 437s > 437s 437s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 437s Copyright (C) 2024 The R Foundation for Statistical Computing 437s Platform: arm-unknown-linux-gnueabihf (32-bit) 437s 437s R is free software and comes with ABSOLUTELY NO WARRANTY. 437s You are welcome to redistribute it under certain conditions. 437s Type 'license()' or 'licence()' for distribution details. 437s 437s R is a collaborative project with many contributors. 437s Type 'contributors()' for more information and 437s 'citation()' on how to cite R or R packages in publications. 437s 437s Type 'demo()' for some demos, 'help()' for on-line help, or 437s 'help.start()' for an HTML browser interface to help. 437s Type 'q()' to quit R. 437s 437s > library("matrixStats") 437s > 437s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 437s + quantile_na <- function(x, ..., na.rm = FALSE) { 437s + if (!na.rm && anyMissing(x)) 437s + return(c(NA_real_, NA_real_)) 437s + quantile(x, ..., na.rm = na.rm) 437s + } 437s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 437s + probs = c(0.25, 0.75), na.rm = na.rm) 437s + rownames(q) <- NULL # Not needed anymore 437s + 437s + # Preserve names attribute 437s + dim(q) <- c(2L, nrow(x)) 437s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 437s + 437s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 437s + } 437s > 437s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 437s > # Test with multiple quantiles 437s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 437s > for (mode in c("integer", "double")) { 437s + cat("mode: ", mode, "\n", sep = "") 437s + x <- matrix(1:100 + 0.1, nrow = 10, ncol = 10) 437s + storage.mode(x) <- mode 437s + str(x) 437s + 437s + # To check names attribute 437s + dimnames <- list(letters[1:10], LETTERS[1:10]) 437s + 437s + for (add_na in c(FALSE, TRUE)) { 437s + if (add_na) { 437s + x[3:5, 6:9] <- NA 437s + } 437s + # Test with and without dimnames on x 437s + for (setDimnames in c(TRUE, FALSE)) { 437s + if (setDimnames) dimnames(x) <- dimnames 437s + else dimnames(x) <- NULL 437s + for (na.rm in c(FALSE, TRUE)) { 437s + # Check names attribute 437s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 437s + probs <- c(0, 0.5, 1) 437s + q0 <- rowIQRs_R(x, na.rm = na.rm, useNames = useNames) 437s + print(q0) 437s + q1 <- rowIQRs(x, na.rm = na.rm, useNames = useNames) 437s + print(q1) 437s + stopifnot(all.equal(q1, q0)) 437s + q2 <- colIQRs(t(x), na.rm = na.rm, useNames = useNames) 437s + stopifnot(all.equal(q2, q0)) 437s + 437s + q <- iqr(x[3, ], na.rm = na.rm) 437s + print(q) 437s + } # for (useNames ...) 437s + } # for (na.rm ...) 437s + } # for (setDimnames ...) 437s + } # for (add_na ...) 437s + } # for (mode ...) 437s mode: integer 437s int [1:10, 1:10] 1 2 3 4 5 6 7 8 9 10 ... 437s a b c d e f g h i j 437s 45 45 45 45 45 45 45 45 45 45 437s a b c d e f g h i j 437s 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s a b c d e f g h i j 437s 45 45 45 45 45 45 45 45 45 45 437s a b c d e f g h i j 437s 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 45 45 45 45 45 45 45 45 45 437s [1] 45 437s a b c d e f g h i j 437s 45 45 NA NA NA 45 45 45 45 45 437s a b c d e f g h i j 437s 45 45 NA NA NA 45 45 45 45 45 437s [1] NA 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] NA 437s a b c d e f g h i j 437s 45 45 25 25 25 45 45 45 45 45 437s a b c d e f g h i j 437s 45 45 25 25 25 45 45 45 45 45 437s [1] 25 437s [1] 45 45 25 25 25 45 45 45 45 45 437s [1] 45 45 25 25 25 45 45 45 45 45 437s [1] 25 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] NA 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] 45 45 NA NA NA 45 45 45 45 45 437s [1] NA 437s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s mode: double 438s 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 ... 438s a b c d e f g h i j 438s 45 45 45 45 45 45 45 45 45 45 438s a b c d e f g h i j 438s 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s a b c d e f g h i j 438s 45 45 45 45 45 45 45 45 45 45 438s a b c d e f g h i j 438s 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 45 45 45 45 45 45 45 45 45 438s [1] 45 438s a b c d e f g h i j 438s 45 45 NA NA NA 45 45 45 45 45 438s a b c d e f g h i j 438s 45 45 NA NA NA 45 45 45 45 45 438s [1] NA 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] NA 438s a b c d e f g h i j 438s 45 45 25 25 25 45 45 45 45 45 438s a b c d e f g h i j 438s 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] NA 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] 45 45 NA NA NA 45 45 45 45 45 438s [1] NA 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 45 45 25 25 25 45 45 45 45 45 438s [1] 25 438s > 438s > 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > # Test corner cases 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > for (mode in c("integer", "double")) { 438s + cat("mode: ", mode, "\n", sep = "") 438s + # Empty vectors 438s + x <- integer(0L) 438s + storage.mode(x) <- mode 438s + str(x) 438s + q <- iqr(x) 438s + print(q) 438s + stopifnot(identical(q, NA_real_)) 438s + 438s + # Scalar 438s + x <- 1L 438s + storage.mode(x) <- mode 438s + str(x) 438s + q <- iqr(x) 438s + str(q) 438s + stopifnot(identical(q, 0)) 438s + } 438s mode: integer 438s int(0) 438s [1] NA 438s int 1 438s num 0 438s mode: double 438s num(0) 438s [1] NA 438s num 1 438s num 0 438s > 438s > 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > # Single row matrices 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > x <- matrix(1, nrow = 1L, ncol = 2L) 438s > dimnames <- list("a", LETTERS[1:2]) 438s > # Test with and without dimnames on x 438s > for (setDimnames in c(TRUE, FALSE)) { 438s + if (setDimnames) dimnames(x) <- dimnames 438s + else dimnames(x) <- NULL 438s + # Check names attribute 438s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 438s + q0 <- rowIQRs_R(x, useNames = useNames) 438s + q1 <- rowIQRs(x, useNames = useNames) 438s + q2 <- colIQRs(t(x), useNames = useNames) 438s + stopifnot(all.equal(q0, q1)) 438s + stopifnot(all.equal(q0, q2)) 438s + } 438s + } 438s > 438s > x <- matrix(1, nrow = 2L, ncol = 1L) 438s > q <- colIQRs(x) 438s > stopifnot(identical(q, 0)) 438s > 438s 438s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 438s Copyright (C) 2024 The R Foundation for Statistical Computing 438s Platform: arm-unknown-linux-gnueabihf (32-bit) 438s 438s R is free software and comes with ABSOLUTELY NO WARRANTY. 438s You are welcome to redistribute it under certain conditions. 438s Type 'license()' or 'licence()' for distribution details. 438s 438s R is a collaborative project with many contributors. 438s Type 'contributors()' for more information and 438s 'citation()' on how to cite R or R packages in publications. 438s 438s Type 'demo()' for some demos, 'help()' for on-line help, or 438s 'help.start()' for an HTML browser interface to help. 438s Type 'q()' to quit R. 438s 438s > library("matrixStats") 438s > 438s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 438s + quantile_na <- function(x, ..., na.rm = FALSE) { 438s + if (!na.rm && anyMissing(x)) 438s + return(c(NA_real_, NA_real_)) 438s + quantile(x, ..., na.rm = na.rm) 438s + } 438s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 438s + probs = c(0.25, 0.75), na.rm = na.rm) 438s + rownames(q) <- NULL # Not needed anymore 438s + 438s + # Preserve names attribute 438s + dim(q) <- c(2L, nrow(x)) 438s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 438s + 438s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 438s + } 438s > 438s > 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > # Subsetted tests 438s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 438s > source("utils/validateIndicesFramework.R") 438s > x <- runif(6, min = -6, max = 6) 438s > for (idxs in index_cases) { 438s + for (na.rm in c(TRUE, FALSE)) { 438s + validateIndicesTestVector(x, idxs, ftest = iqr, fsure = function(x, na.rm) { 438s + dim(x) <- c(1L, length(x)) 438s + rowIQRs_R(x, na.rm = na.rm) 438s + }, na.rm = na.rm) 438s + } 438s + } 438s > 438s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 438s > 438s > # To check names attribute 438s > dimnames <- list(letters[1:6], LETTERS[1:6]) 438s > 438s > # Test with and without dimnames on x 438s > for (setDimnames in c(TRUE, FALSE)) { 438s + if (setDimnames) dimnames(x) <- dimnames 438s + else dimnames(x) <- NULL 438s + 438s + count <- 0L 438s + for (rows in index_cases) { 438s + for (cols in index_cases) { 438s + count <- count + 1L 438s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 438s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 438s + useNames <- useNames[count %% length(useNames) + 1] 438s + 438s + validateIndicesTestMatrix(x, rows, cols, 438s + ftest = rowIQRs, fsure = rowIQRs_R, 438s + na.rm = na.rm, useNames = useNames) 438s + validateIndicesTestMatrix(x, rows, cols, 438s + fcoltest = colIQRs, fsure = rowIQRs_R, 438s + na.rm = na.rm, useNames = useNames) 438s + } 438s + } 438s + } 442s > 442s 442s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 442s Copyright (C) 2024 The R Foundation for Statistical Computing 442s Platform: arm-unknown-linux-gnueabihf (32-bit) 442s 442s R is free software and comes with ABSOLUTELY NO WARRANTY. 442s You are welcome to redistribute it under certain conditions. 442s Type 'license()' or 'licence()' for distribution details. 442s 442s R is a collaborative project with many contributors. 442s Type 'contributors()' for more information and 442s 'citation()' on how to cite R or R packages in publications. 442s 442s Type 'demo()' for some demos, 'help()' for on-line help, or 442s 'help.start()' for an HTML browser interface to help. 442s Type 'q()' to quit R. 442s 443s > # Test inspired by the harmonic mean example in R-help 443s > # thread '[R] Beyond double-precision?' on May 9, 2009. 443s > 443s > library("matrixStats") 443s > library("stats") 443s > 443s > logSumExp0 <- function(lx) { 443s + idx_max <- which.max(lx) 443s + log1p(sum(exp(lx[-idx_max] - lx[idx_max]))) + lx[idx_max] 443s + } 443s > 443s > n <- 200L 443s > set.seed(1) 443s > 443s > for (mode in c("integer", "double")) { 443s + cat("mode: ", mode, "\n", sep = "") 443s + x <- matrix(runif(n, min = 1.0, max = 3.0), nrow = 20L) 443s + storage.mode(x) <- mode 443s + str(x) 443s + 443s + # The logarithm of the harmonic mean by rows 443s + y_h <- log(1 / rowMeans(1 / x)) 443s + str(y_h) 443s + 443s + lx_neg <- -log(x) 443s + 443s + y0 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp0) 443s + stopifnot(all.equal(y0, y_h)) 443s + 443s + y1 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp) 443s + stopifnot(all.equal(y1, y0)) 443s + 443s + y2 <- log(ncol(x)) - rowLogSumExps(lx_neg) 443s + stopifnot(all.equal(y2, y0)) 443s + 443s + y3 <- log(ncol(x)) - colLogSumExps(t(lx_neg)) 443s + stopifnot(all.equal(y3, y0)) 443s + 443s + 443s + # The logarithm of the harmonic mean by columns 443s + y_h <- log(1 / colMeans(1 / x)) 443s + str(y_h) 443s + 443s + y0 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp0) 443s + stopifnot(all.equal(y0, y_h)) 443s + 443s + y1 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp) 443s + stopifnot(all.equal(y1, y0)) 443s + 443s + y2 <- log(nrow(x)) - colLogSumExps(lx_neg) 443s + stopifnot(all.equal(y2, y0)) 443s + 443s + y3 <- log(nrow(x)) - rowLogSumExps(t(lx_neg)) 443s + stopifnot(all.equal(y3, y0)) 443s + 443s + # Testing names 443s + rownames(lx_neg) <- seq_len(nrow(x)) 443s + colnames(lx_neg) <- seq_len(ncol(x)) 443s + y2 <- rowLogSumExps(lx_neg, useNames = TRUE) 443s + stopifnot(identical(names(y2), rownames(lx_neg))) 443s + y3 <- colLogSumExps(t(lx_neg), useNames = TRUE) 443s + stopifnot(identical(names(y3), rownames(lx_neg))) 443s + } # for (mode ...) 443s mode: integer 443s int [1:20, 1:10] 1 1 2 2 1 2 2 2 2 1 ... 443s num [1:20] 0.357 0.223 0.223 0.288 0.511 ... 443s num [1:10] 0.322 0.223 0.322 0.255 0.255 ... 443s mode: double 443s num [1:20, 1:10] 1.54 1.44 2.03 1.54 1.36 ... 443s num [1:20] 0.526 0.466 0.734 0.638 0.604 ... 443s num [1:10] 0.627 0.582 0.617 0.474 0.418 ... 443s > 443s > 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > # Corner cases 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > ## Zero-size matrices 443s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 0L) 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s numeric(0) 443s > stopifnot(length(y) == nrow(lx)) 443s > 443s > y <- colLogSumExps(lx) 443s > print(y) 443s numeric(0) 443s > stopifnot(length(y) == ncol(lx)) 443s > 443s > ## Zero-height matrices 443s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 5L) 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s numeric(0) 443s > stopifnot(length(y) == nrow(lx)) 443s > 443s > y <- colLogSumExps(lx) 443s > print(y) 443s [1] -Inf -Inf -Inf -Inf -Inf 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(all(y == -Inf)) 443s > 443s > ## Zero-width matrices 443s > lx <- matrix(numeric(0L), nrow = 5L, ncol = 0L) 443s > y <- colLogSumExps(lx) 443s > print(y) 443s numeric(0) 443s > stopifnot(length(y) == ncol(lx)) 443s > 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s [1] -Inf -Inf -Inf -Inf -Inf 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(y == -Inf)) 443s > 443s > 443s > ## Matrices with one element 443s > lx <- matrix(1.0, nrow = 1L, ncol = 1L) 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s [1] 1 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(y == lx)) 443s > 443s > y <- colLogSumExps(lx) 443s > print(y) 443s [1] 1 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(all(y == lx)) 443s > 443s > ## All missing values 443s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 443s > y <- rowLogSumExps(lx, na.rm = TRUE) 443s > print(y) 443s [1] -Inf 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(identical(y, -Inf)) 443s > 443s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 443s > y <- colLogSumExps(lx, na.rm = TRUE) 443s > print(y) 443s [1] -Inf 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(identical(y, -Inf)) 443s > 443s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 443s > y <- rowLogSumExps(lx, na.rm = TRUE) 443s > print(y) 443s [1] -Inf -Inf 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(y == -Inf)) 443s > 443s > y <- rowLogSumExps(lx, na.rm = FALSE) 443s > print(y) 443s [1] NA NA 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(is.na(y) & !is.nan(y))) 443s > 443s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 443s > y <- colLogSumExps(lx, na.rm = TRUE) 443s > print(y) 443s [1] -Inf -Inf 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(all(y == -Inf)) 443s > 443s > y <- colLogSumExps(lx, na.rm = FALSE) 443s > print(y) 443s [1] NA NA 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(all(is.na(y) & !is.nan(y))) 443s > 443s > ## +Inf values 443s > lx <- matrix(c(1, 2, +Inf), nrow = 3L, ncol = 2L) 443s > y <- colLogSumExps(lx, na.rm = TRUE) 443s > print(y) 443s [1] Inf Inf 443s > stopifnot(length(y) == ncol(lx)) 443s > stopifnot(all(y == +Inf)) 443s > 443s > ## multiple -Inf values 443s > lx <- matrix(c(-Inf, -Inf), nrow = 2L, ncol = 3L) 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s [1] -Inf -Inf 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(y == -Inf)) 443s > 443s > lx <- matrix(c(-Inf, 5, -Inf), nrow = 2L, ncol = 3L, byrow = TRUE) 443s > y <- rowLogSumExps(lx) 443s > print(y) 443s [1] 5 5 443s > stopifnot(length(y) == nrow(lx)) 443s > stopifnot(all(y == 5)) 443s > 443s > ## Bug report #104 (https://github.com/HenrikBengtsson/matrixStats/issues/104) 443s > ## (This would core dump on Windows) 443s > x <- matrix(0.0, nrow = 2L, ncol = 32762L) 443s > y <- colLogSumExps(x) 443s > str(y) 443s num [1:32762] 0.693 0.693 0.693 0.693 0.693 ... 443s > 443s > ## Bug report #120 (https://github.com/HenrikBengtsson/matrixStats/issues/120) 443s > ## (This would error if x had rownames/colnames and non-NULL rows/cols were 443s > ## used) 443s > x <- matrix(runif(6), nrow = 2L, ncol = 3L, 443s + dimnames = list(c("A", "B"), c("a", "b", "c"))) 443s > y <- colLogSumExps(x, cols = 3:1, useNames = TRUE) 443s > stopifnot(names(y) == c("c", "b", "a")) 443s > y <- rowLogSumExps(x, rows = 2, useNames = TRUE) 443s > stopifnot(names(y) == "B") 443s > 443s > 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > # Check names attributes 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > 443s > ## Create isFALSE() if running on an old version of R 443s > if (!exists("isFALSE", mode="function")) { 443s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 443s + } 443s > 443s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 443s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 443s + log(sum(exp(rx), ...)) 443s + }, ...) 443s + if (isFALSE(useNames)) names(res) <- NULL 443s + res 443s + } 443s > 443s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 443s > 443s > # To check names attribute 443s > dimnames <- list(letters[1:6], LETTERS[1:6]) 443s > 443s > # Test with and without dimnames on x 443s > for (setDimnames in c(TRUE, FALSE)) { 443s + if (setDimnames) dimnames(x) <- dimnames 443s + else dimnames(x) <- NULL 443s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 443s + y0 <- rowLogSumExps_R(x, useNames = useNames) 443s + y1 <- rowLogSumExps(x, useNames = useNames) 443s + y2 <- colLogSumExps(t(x), useNames = useNames) 443s + stopifnot(all.equal(y1, y0)) 443s + stopifnot(all.equal(y2, y0)) 443s + } 443s + } 443s > 443s 443s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 443s Copyright (C) 2024 The R Foundation for Statistical Computing 443s Platform: arm-unknown-linux-gnueabihf (32-bit) 443s 443s R is free software and comes with ABSOLUTELY NO WARRANTY. 443s You are welcome to redistribute it under certain conditions. 443s Type 'license()' or 'licence()' for distribution details. 443s 443s R is a collaborative project with many contributors. 443s Type 'contributors()' for more information and 443s 'citation()' on how to cite R or R packages in publications. 443s 443s Type 'demo()' for some demos, 'help()' for on-line help, or 443s 'help.start()' for an HTML browser interface to help. 443s Type 'q()' to quit R. 443s 443s > library("matrixStats") 443s > 443s > ## Create isFALSE() if running on an old version of R 443s > if (!exists("isFALSE", mode="function")) { 443s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 443s + } 443s > 443s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 443s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 443s + log(sum(exp(rx), ...)) 443s + }, ...) 443s + if (isFALSE(useNames)) names(res) <- NULL 443s + res 443s + } 443s > 443s > 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > # Subsetted tests 443s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 443s > source("utils/validateIndicesFramework.R") 443s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 443s > 443s > # To check names attribute 443s > dimnames <- list(letters[1:6], LETTERS[1:6]) 443s > 443s > # Test with and without dimnames on x 443s > for (setDimnames in c(TRUE, FALSE)) { 443s + if (setDimnames) dimnames(x) <- dimnames 443s + else dimnames(x) <- NULL 443s + for (rows in index_cases) { 443s + for (cols in index_cases) { 443s + for (na.rm in c(TRUE, FALSE)) { 443s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 443s + validateIndicesTestMatrix(x, rows, cols, 443s + ftest = rowLogSumExps, 443s + fsure = rowLogSumExps_R, 443s + na.rm = na.rm, useNames = useNames) 443s + validateIndicesTestMatrix(x, rows, cols, 443s + fcoltest = colLogSumExps, 443s + fsure = rowLogSumExps_R, 443s + na.rm = na.rm, useNames = useNames) 443s + } 443s + } 443s + } 443s + } 443s + } 447s > 447s 447s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 447s Copyright (C) 2024 The R Foundation for Statistical Computing 447s Platform: arm-unknown-linux-gnueabihf (32-bit) 447s 447s R is free software and comes with ABSOLUTELY NO WARRANTY. 447s You are welcome to redistribute it under certain conditions. 447s Type 'license()' or 'licence()' for distribution details. 447s 447s R is a collaborative project with many contributors. 447s Type 'contributors()' for more information and 447s 'citation()' on how to cite R or R packages in publications. 447s 447s Type 'demo()' for some demos, 'help()' for on-line help, or 447s 'help.start()' for an HTML browser interface to help. 447s Type 'q()' to quit R. 447s 447s > library("matrixStats") 447s > 447s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 447s > options(matrixStats.center.onUse = "ignore") 447s > 447s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 447s + suppressWarnings({ 447s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 447s + }) 447s + if (is.na(useNames) || !useNames) names(res) <- NULL 447s + res 447s + } 447s > 447s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 447s + suppressWarnings({ 447s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 447s + }) 447s + if (is.na(useNames) || !useNames) names(res) <- NULL 447s + res 447s + } 447s > 447s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 447s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 447s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 447s + } 447s > 447s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 447s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 447s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 447s + } 447s > 447s > 447s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 447s > # A 3x3 matrix (no ties) 447s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 447s > for (mode in c("integer", "double")) { 447s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 447s + cat("mode: ", mode, "\n", sep = "") 447s + storage.mode(x) <- mode 447s + str(x) 447s + 447s + # To check name attribute 447s + dimnames <- list(letters[1:3], LETTERS[1:3]) 447s + 447s + # Test with and without dimnames on x 447s + for (setDimnames in c(TRUE, FALSE)) { 447s + if (setDimnames) dimnames(x) <- dimnames 447s + else dimnames(x) <- NULL 447s + tx <- t(x) 447s + # Check names attribute 447s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 447s + cat("rowMads():\n") 447s + center <- rowMedians(x, na.rm = TRUE, useNames = useNames) 447s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 447s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 447s + r1b <- rowMads_center(x, na.rm = TRUE, useNames = useNames) 447s + r1c <- rowMads(x, center = center, na.rm = TRUE, useNames = useNames) 447s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 447s + r2b <- colMads_center(tx, na.rm = TRUE, useNames = useNames) 447s + stopifnot(all.equal(r1, r2)) 447s + stopifnot(all.equal(r1, r0)) 447s + stopifnot(all.equal(r1b, r1)) 447s + stopifnot(all.equal(r1c, r1)) 447s + stopifnot(all.equal(r2, r0)) 447s + stopifnot(all.equal(r2b, r2)) 447s + 447s + cat("colMads():\n") 447s + center <- colMedians(x, na.rm = TRUE, useNames = useNames) 447s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 447s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 447s + r1b <- colMads_center(x, na.rm = TRUE, useNames = useNames) 447s + r1c <- colMads(x, center = center, na.rm = TRUE, useNames = useNames) 447s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 447s + r2b <- rowMads_center(tx, na.rm = TRUE, useNames = useNames) 447s + stopifnot(all.equal(r1, r2)) 447s + stopifnot(all.equal(r1, r0)) 447s + stopifnot(all.equal(r1b, r1)) 447s + stopifnot(all.equal(r1c, r1)) 447s + stopifnot(all.equal(r2, r0)) 447s + stopifnot(all.equal(r2b, r2)) 447s + } 447s + } 447s + } 447s mode: integer 447s int [1:3, 1:3] 1 2 3 2 3 4 3 4 5 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s mode: double 447s num [1:3, 1:3] 1.1 2.1 3.1 2.1 3.1 4.1 3.1 4.1 5.1 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s rowMads(): 447s colMads(): 447s > 447s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 447s > # Ties: a 4x4 matrix 447s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 447s > for (mode in c("integer", "double")) { 447s + x <- matrix(c(1:4, 2:5, 3:6, 4:7) + 0.1, nrow = 4, ncol = 4) 447s + cat("mode: ", mode, "\n", sep = "") 447s + storage.mode(x) <- mode 447s + str(x) 447s + tx <- t(x) 447s + 447s + # To check name attribute 447s + dimnames <- list(letters[1:4], LETTERS[1:4]) 447s + 447s + # Test with and without dimnames on x 447s + for (setDimnames in c(TRUE, FALSE)) { 447s + if (setDimnames) dimnames(x) <- dimnames 447s + else dimnames(x) <- NULL 447s + tx <- t(x) 447s + # Check names attribute 447s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 447s + cat("rowMads():\n") 447s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 447s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 447s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 447s + stopifnot(all.equal(r1, r2)) 447s + stopifnot(all.equal(r1, r0)) 447s + stopifnot(all.equal(r2, r0)) 447s + 447s + cat("colMads():\n") 447s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 447s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 447s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 447s + stopifnot(all.equal(r1, r2)) 447s + stopifnot(all.equal(r1, r0)) 447s + stopifnot(all.equal(r2, r0)) 447s + } 447s + } 447s + } 448s mode: integer 448s int [1:4, 1:4] 1 2 3 4 2 3 4 5 3 4 ... 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s mode: double 448s 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 ... 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s > tx <- NULL 448s > 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > # No ties: a 3x3 matrix with an NA value 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > for (mode in c("integer", "double")) { 448s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 448s + x[2, 2] <- NA_real_ 448s + 448s + cat("mode: ", mode, "\n", sep = "") 448s + storage.mode(x) <- mode 448s + str(x) 448s + tx <- t(x) 448s + 448s + # To check name attribute 448s + dimnames <- list(letters[1:3], LETTERS[1:3]) 448s + 448s + # Test with and without dimnames on x 448s + for (setDimnames in c(TRUE, FALSE)) { 448s + if (setDimnames) dimnames(x) <- dimnames 448s + else dimnames(x) <- NULL 448s + tx <- t(x) 448s + # Check names attribute 448s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 448s + cat("rowMads():\n") 448s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 448s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 448s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 448s + stopifnot(all.equal(r1, r2)) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + 448s + cat("colMads():\n") 448s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 448s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 448s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 448s + stopifnot(all.equal(r1, r2)) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + } 448s + } 448s + } 448s mode: integer 448s int [1:3, 1:3] 1 2 3 2 NA 4 3 4 5 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s mode: double 448s num [1:3, 1:3] 1.1 2.1 3.1 2.1 NA 4.1 3.1 4.1 5.1 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s rowMads(): 448s colMads(): 448s > tx <- NULL 448s > 448s > 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > # With and without some NAs 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > for (add_na in c(FALSE, TRUE)) { 448s + cat("add_na = ", add_na, "\n", sep = "") 448s + 448s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 448s + if (add_na) { 448s + x[3:7, c(2, 4)] <- NA_real_ 448s + } 448s + 448s + # To check name attribute 448s + dimnames <- list(letters[1:10], LETTERS[1:5]) 448s + 448s + # Test with and without dimnames on x 448s + for (setDimnames in c(TRUE, FALSE)) { 448s + if (setDimnames) dimnames(x) <- dimnames 448s + else dimnames(x) <- NULL 448s + tx <- t(x) 448s + # Row/column ranges 448s + for (na.rm in c(FALSE, TRUE)) { 448s + # Check names attribute 448s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 448s + cat("na.rm = ", na.rm, "\n", sep = "") 448s + cat("rowMads():\n") 448s + center <- rowMedians(x, na.rm = na.rm, useNames = useNames) 448s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 448s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 448s + r2 <- rowMads(x, center = center, na.rm = na.rm, useNames = useNames) 448s + r3 <- colMads(tx, na.rm = na.rm, useNames = useNames) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + stopifnot(all.equal(r2, r1)) 448s + stopifnot(all.equal(r3, r0)) 448s + stopifnot(all.equal(r3, r1)) 448s + stopifnot(all.equal(r3, r2)) 448s + 448s + cat("colMads():\n") 448s + center <- colMedians(x, na.rm = na.rm, useNames = useNames) 448s + r0 <- colMads_R(x, na.rm = na.rm, useNames = useNames) 448s + r1 <- colMads(x, na.rm = na.rm, useNames = useNames) 448s + r2 <- colMads(x, center = center, na.rm = na.rm, useNames = useNames) 448s + r3 <- rowMads(tx, na.rm = na.rm, useNames = useNames) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + stopifnot(all.equal(r2, r1)) 448s + stopifnot(all.equal(r3, r0)) 448s + stopifnot(all.equal(r3, r1)) 448s + stopifnot(all.equal(r3, r2)) 448s + } 448s + } 448s + } 448s + tx <- NULL 448s + } # for (add_na ...) 448s add_na = FALSE 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s add_na = TRUE 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = FALSE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s na.rm = TRUE 448s rowMads(): 448s colMads(): 448s > 448s > 448s > 448s > 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > # All NAs 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 448s > # Test with and without dimnames on x 448s > for (setDimnames in c(TRUE, FALSE)) { 448s + if (setDimnames) dimnames(x) <- dimnames 448s + else dimnames(x) <- NULL 448s + tx <- t(x) 448s + # Row/column ranges 448s + for (na.rm in c(FALSE, TRUE)) { 448s + # Check names attribute 448s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 448s + cat("na.rm = ", na.rm, "\n", sep = "") 448s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 448s + if (na.rm) r0[is.na(r0)] <- NaN 448s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 448s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + stopifnot(all.equal(r1, r2)) 448s + } 448s + } 448s + } 448s na.rm = FALSE 448s na.rm = FALSE 448s na.rm = TRUE 448s na.rm = TRUE 448s na.rm = FALSE 448s na.rm = FALSE 448s na.rm = TRUE 448s na.rm = TRUE 448s > tx <- NULL 448s > 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > # A 1x1 matrix 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > x <- matrix(0, nrow = 1L, ncol = 1L) 448s > dimnames <- list("a", "A") 448s > # Test with and without dimnames on x 448s > for (setDimnames in c(TRUE, FALSE)) { 448s + if (setDimnames) dimnames(x) <- dimnames 448s + else dimnames(x) <- NULL 448s + tx <- t(x) 448s + # Row/column ranges 448s + for (na.rm in c(FALSE, TRUE)) { 448s + # Check names attribute 448s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 448s + cat("na.rm = ", na.rm, "\n", sep = "") 448s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 448s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 448s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + stopifnot(all.equal(r1, r2)) 448s + } 448s + } 448s + } 448s na.rm = FALSE 448s na.rm = FALSE 448s na.rm = TRUE 448s na.rm = TRUE 448s na.rm = FALSE 448s na.rm = FALSE 448s na.rm = TRUE 448s na.rm = TRUE 448s > 448s > 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > # A 0x0 matrix 448s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 448s > x <- matrix(double(0), nrow = 0, ncol = 0) 448s > tx <- t(x) 448s > for (na.rm in c(FALSE, TRUE)) { 448s + cat("na.rm = ", na.rm, "\n", sep = "") 448s + r0 <- rowMads_R(x, na.rm = na.rm) 448s + r1 <- rowMads(x, na.rm = na.rm) 448s + r2 <- colMads(tx, na.rm = na.rm) 448s + stopifnot(all.equal(r1, r2)) 448s + stopifnot(all.equal(r1, r0)) 448s + stopifnot(all.equal(r2, r0)) 448s + } 448s na.rm = FALSE 448s na.rm = TRUE 448s > 448s 448s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 448s Copyright (C) 2024 The R Foundation for Statistical Computing 448s Platform: arm-unknown-linux-gnueabihf (32-bit) 448s 448s R is free software and comes with ABSOLUTELY NO WARRANTY. 448s You are welcome to redistribute it under certain conditions. 448s Type 'license()' or 'licence()' for distribution details. 448s 448s R is a collaborative project with many contributors. 448s Type 'contributors()' for more information and 448s 'citation()' on how to cite R or R packages in publications. 448s 448s Type 'demo()' for some demos, 'help()' for on-line help, or 448s 'help.start()' for an HTML browser interface to help. 448s Type 'q()' to quit R. 448s 449s > library("matrixStats") 449s > 449s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 449s > options(matrixStats.center.onUse = "ignore") 449s > 449s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 449s + suppressWarnings({ 449s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 449s + }) 449s + if (is.na(useNames) || !useNames) names(res) <- NULL 449s + res 449s + } 449s > 449s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 449s + suppressWarnings({ 449s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 449s + }) 449s + if (is.na(useNames) || !useNames) names(res) <- NULL 449s + res 449s + } 449s > 449s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 449s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 449s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 449s + } 449s > 449s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 449s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 449s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 449s + } 449s > 449s > 449s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 449s > # Subsetted tests 449s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 449s > source("utils/validateIndicesFramework.R") 449s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 449s > storage.mode(x) <- "integer" 449s > 449s > # To check names attribute 449s > dimnames <- list(letters[1:6], LETTERS[1:6]) 449s > 449s > # Test with and without dimnames on x 449s > for (setDimnames in c(TRUE, FALSE)) { 449s + if (setDimnames) dimnames(x) <- dimnames 449s + else dimnames(x) <- NULL 449s + 449s + count <- 0L 449s + for (rows in index_cases) { 449s + for (cols in index_cases) { 449s + count <- count + 1L 449s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 449s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 449s + useNames <- useNames[count %% length(useNames) + 1] 449s + 449s + validateIndicesTestMatrix(x, rows, cols, 449s + ftest = rowMads, fsure = rowMads_R, 449s + na.rm = na.rm, useNames = useNames) 449s + validateIndicesTestMatrix(x, rows, cols, 449s + ftest = rowMads_center, fsure = rowMads_R, 449s + na.rm = na.rm, useNames = useNames) 449s + 449s + validateIndicesTestMatrix(x, rows, cols, 449s + fcoltest = colMads, fsure = rowMads_R, 449s + na.rm = na.rm, useNames = useNames) 449s + validateIndicesTestMatrix(x, rows, cols, 449s + fcoltest = colMads_center, fsure = rowMads_R, 449s + na.rm = na.rm, useNames = useNames) 449s + } 449s + } 449s + } 452s > 452s 452s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 452s Copyright (C) 2024 The R Foundation for Statistical Computing 452s Platform: arm-unknown-linux-gnueabihf (32-bit) 452s 452s R is free software and comes with ABSOLUTELY NO WARRANTY. 452s You are welcome to redistribute it under certain conditions. 452s Type 'license()' or 'licence()' for distribution details. 452s 452s R is a collaborative project with many contributors. 452s Type 'contributors()' for more information and 452s 'citation()' on how to cite R or R packages in publications. 452s 452s Type 'demo()' for some demos, 'help()' for on-line help, or 452s 'help.start()' for an HTML browser interface to help. 452s Type 'q()' to quit R. 452s 453s > library("matrixStats") 453s > 453s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 453s + res <- rowMeans(x, na.rm = na.rm) 453s + if (is.na(useNames) || !useNames) names(res) <- NULL 453s + res 453s + } 453s > 453s > colMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 453s + res <- colMeans(x, na.rm = na.rm) 453s + if (is.na(useNames) || !useNames) names(res) <- NULL 453s + res 453s + } 453s > 453s > for (mode in c("integer", "logical", "double")) { 453s + x <- matrix(-4:4, nrow = 3, ncol = 3) 453s + storage.mode(x) <- mode 453s + if (mode == "double") x <- x + 0.1 453s + 453s + # To check names attribute 453s + dimnames <- list(letters[1:3], LETTERS[1:3]) 453s + 453s + # Test with and without dimnames on x 453s + for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s + } 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: Single-element matrix 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: Single-element matrix:\n") 453s Special case: Single-element matrix: 453s > for (mode in c("integer", "logical", "double")) { 453s + x <- matrix(1, nrow = 1, ncol = 1) 453s + storage.mode(x) <- mode 453s + 453s + # To check names attribute 453s + dimnames <- list("a", "A") 453s + 453s + # Test with and without dimnames on x 453s + for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: Empty matrix 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: Empty matrix:\n") 453s Special case: Empty matrix: 453s > for (mode in c("integer", "logical", "double")) { 453s + x <- matrix(integer(0), nrow = 0, ncol = 0) 453s + storage.mode(x) <- mode 453s + 453s + y0 <- rowMeans(x, na.rm = FALSE) 453s + y1 <- rowMeans2(x, na.rm = FALSE) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans(x, na.rm = FALSE) 453s + y1 <- colMeans2(x, na.rm = FALSE) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: All NAs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: All NAs:\n") 453s Special case: All NAs: 453s > for (mode in c("integer", "logical", "double")) { 453s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 453s + storage.mode(x) <- mode 453s + 453s + # To check names attribute 453s + dimnames <- list(letters[1:3], LETTERS[1:3]) 453s + 453s + # Test with and without dimnames on x 453s + for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: All NaNs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: All NaNs:\n") 453s Special case: All NaNs: 453s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: All Infs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: All Infs:\n") 453s Special case: All Infs: 453s > x <- matrix(Inf, nrow = 3, ncol = 3) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: All -Infs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: All -Infs:\n") 453s Special case: All -Infs: 453s > x <- matrix(-Inf, nrow = 3, ncol = 3) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: Infs and -Infs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: Infs and -Infs:\n") 453s Special case: Infs and -Infs: 453s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 453s > 453s > # To check names attribute 453s > dimnames <- list(letters[1:4], LETTERS[1:4]) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: NaNs and NAs 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: NaNs and NAs:\n") 453s Special case: NaNs and NAs: 453s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + str(y0) 453s + stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + str(y1) 453s + stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s Named num [1:4] NaN NA NaN NA 453s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 453s Named num [1:4] NaN NA NaN NA 453s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 453s num [1:4] NaN NA NaN NA 453s num [1:4] NaN NA NaN NA 453s num [1:4] NaN NA NaN NA 453s num [1:4] NaN NA NaN NA 453s num [1:4] NaN NA NaN NA 453s num [1:4] NaN NA NaN NA 453s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 453s > ## returned here (as one would expect). NaN might very well be returned, 453s > ## when both NA and NaN are involved. This is an accepted feature in R, 453s > ## which is documented in help("is.nan"). See also 453s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 453s > ## Thus, we cannot guarantee that y1 is identical to y0. 453s > 453s > 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Special case: Integer overflow with ties 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > cat("Special case: Integer overflow with ties:\n") 453s Special case: Integer overflow with ties: 453s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 453s > 453s > # Test with and without dimnames on x 453s > for (setDimnames in c(TRUE, FALSE)) { 453s + if (setDimnames) dimnames(x) <- dimnames 453s + else dimnames(x) <- NULL 453s + # Check names attribute 453s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 453s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + 453s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 453s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 453s + stopifnot(all.equal(y1, y0)) 453s + } 453s + } 453s > 453s > 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > # Consistency checks 453s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 453s > set.seed(1) 453s > 453s > cat("Consistency checks:\n") 453s Consistency checks: 453s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 453s > for (kk in seq_len(n_sims)) { 453s + cat("Random test #", kk, "\n", sep = "") 453s + 453s + # Simulate data in a matrix of any shape 453s + dim <- sample(50:200, size = 2) 453s + n <- prod(dim) 453s + x <- rnorm(n, sd = 100) 453s + dim(x) <- dim 453s + 453s + # Add NAs? 453s + if ((kk %% 4) %in% c(3, 0)) { 453s + cat("Adding NAs\n") 453s + nna <- sample(n, size = 1) 453s + na_values <- c(NA_real_, NaN) 453s + t <- sample(na_values, size = nna, replace = TRUE) 453s + x[sample(length(x), size = nna)] <- t 453s + } 453s + 453s + # Mode? 453s + modes <- "double" 453s + if ((kk %% 4) %in% c(2, 0)) { 453s + modes <- c("integer", "logical") 453s + } 453s + 453s + for (mode in modes) { 453s + if (mode != "double") { 453s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 453s + storage.mode(x) <- mode 453s + } 453s + 453s + na.rm <- sample(c(TRUE, FALSE), size = 1) 453s + 453s + # rowMeans2(): 453s + y0 <- rowMeans(x, na.rm = na.rm) 453s + y1 <- rowMeans2(x, na.rm = na.rm) 453s + stopifnot(all.equal(y1, y0)) 453s + y2 <- colMeans2(t(x), na.rm = na.rm) 453s + stopifnot(all.equal(y2, y0)) 453s + 453s + # colMeans2(): 453s + y0 <- colMeans(x, na.rm = na.rm) 453s + y1 <- colMeans2(x, na.rm = na.rm) 453s + stopifnot(all.equal(y1, y0)) 453s + y2 <- rowMeans2(t(x), na.rm = na.rm) 453s + stopifnot(all.equal(y2, y0)) 453s + } 453s + } # for (kk ...) 453s Random test #1 453s Random test #2 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #3 453s Adding NAs 453s Random test #4 453s Adding NAs 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #5 453s Random test #6 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #7 453s Adding NAs 453s Random test #8 453s Adding NAs 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #9 453s Random test #10 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #11 453s Adding NAs 453s Random test #12 453s Adding NAs 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #13 453s Random test #14 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #15 453s Adding NAs 453s Random test #16 453s Adding NAs 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #17 453s Random test #18 453s Coercing from double to integer 453s Coercing from integer to logical 453s Random test #19 453s Adding NAs 453s Random test #20 453s Adding NAs 453s Coercing from double to integer 453s Coercing from integer to logical 453s > 454s 454s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 454s Copyright (C) 2024 The R Foundation for Statistical Computing 454s Platform: arm-unknown-linux-gnueabihf (32-bit) 454s 454s R is free software and comes with ABSOLUTELY NO WARRANTY. 454s You are welcome to redistribute it under certain conditions. 454s Type 'license()' or 'licence()' for distribution details. 454s 454s R is a collaborative project with many contributors. 454s Type 'contributors()' for more information and 454s 'citation()' on how to cite R or R packages in publications. 454s 454s Type 'demo()' for some demos, 'help()' for on-line help, or 454s 'help.start()' for an HTML browser interface to help. 454s Type 'q()' to quit R. 454s 454s > library("matrixStats") 454s > 454s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 454s + res <- rowMeans(x, na.rm = na.rm) 454s + if (is.na(useNames) || !useNames) names(res) <- NULL 454s + res 454s + } 454s > 454s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 454s > # Subsetted tests 454s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 454s > source("utils/validateIndicesFramework.R") 454s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 454s > storage.mode(x) <- "integer" 454s > 454s > # To check names attribute 454s > dimnames <- list(letters[1:6], LETTERS[1:6]) 454s > 454s > # Test with and without dimnames on x 454s > for (setDimnames in c(TRUE, FALSE)) { 454s + if (setDimnames) dimnames(x) <- dimnames 454s + else dimnames(x) <- NULL 454s + 454s + count <- 0L 454s + for (rows in index_cases) { 454s + for (cols in index_cases) { 454s + count <- count + 1L 454s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 454s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 454s + useNames <- useNames[count %% length(useNames) + 1] 454s + 454s + validateIndicesTestMatrix(x, rows, cols, 454s + ftest = rowMeans2, fsure = rowMeans_R, 454s + na.rm = na.rm, useNames = useNames) 454s + validateIndicesTestMatrix(x, rows, cols, 454s + fcoltest = colMeans2, fsure = rowMeans_R, 454s + na.rm = na.rm, useNames = useNames) 454s + } 454s + } 454s + } 455s > 455s 455s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 455s Copyright (C) 2024 The R Foundation for Statistical Computing 455s Platform: arm-unknown-linux-gnueabihf (32-bit) 455s 455s R is free software and comes with ABSOLUTELY NO WARRANTY. 455s You are welcome to redistribute it under certain conditions. 455s Type 'license()' or 'licence()' for distribution details. 455s 455s R is a collaborative project with many contributors. 455s Type 'contributors()' for more information and 455s 'citation()' on how to cite R or R packages in publications. 455s 455s Type 'demo()' for some demos, 'help()' for on-line help, or 455s 'help.start()' for an HTML browser interface to help. 455s Type 'q()' to quit R. 455s 455s > library("matrixStats") 455s > 455s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 455s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 455s + if (is.na(useNames) || !useNames) names(res) <- NULL 455s + res 455s + } 455s > 455s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 455s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 455s + if (is.na(useNames) || !useNames) names(res) <- NULL 455s + res 455s + } 455s > 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > # Special case: Non-ties 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > cat("Special case: Non-ties:\n") 455s Special case: Non-ties: 455s > for (mode in c("integer", "double")) { 455s + x <- matrix(1:9 + 0.1, nrow = 3, ncol = 3) 455s + storage.mode(x) <- mode 455s + 455s + # To check names attribute 455s + dimnames <- list(letters[1:3], LETTERS[1:3]) 455s + 455s + # Test with and without dimnames on x 455s + for (setDimnames in c(TRUE, FALSE)) { 455s + if (setDimnames) dimnames(x) <- dimnames 455s + else dimnames(x) <- NULL 455s + # Check names attribute 455s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 455s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + 455s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + } 455s + } 455s + } 455s > 455s > 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > # Special case: Ties 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > cat("Special case: Ties:\n") 455s Special case: Ties: 455s > for (mode in c("integer", "double")) { 455s + x <- matrix(1:16 + 0.1, nrow = 4, ncol = 4) 455s + storage.mode(x) <- mode 455s + 455s + # To check names attribute 455s + dimnames <- list(letters[1:4], LETTERS[1:4]) 455s + 455s + # Test with and without dimnames on x 455s + for (setDimnames in c(TRUE, FALSE)) { 455s + if (setDimnames) dimnames(x) <- dimnames 455s + else dimnames(x) <- NULL 455s + # Check names attribute 455s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 455s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + 455s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + } 455s + } 455s + } 455s > 455s > 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > # Special case: Single-element matrix 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > cat("Special case: Single-element matrix:\n") 455s Special case: Single-element matrix: 455s > for (mode in c("integer", "double")) { 455s + x <- matrix(1, nrow = 1, ncol = 1) 455s + storage.mode(x) <- mode 455s + 455s + # To check names attribute 455s + dimnames <- list("a", "A") 455s + 455s + # Test with and without dimnames on x 455s + for (setDimnames in c(TRUE, FALSE)) { 455s + if (setDimnames) dimnames(x) <- dimnames 455s + else dimnames(x) <- NULL 455s + # Check names attribute 455s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 455s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + 455s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 455s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + } 455s + } 455s + } 455s > 455s > 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > # Special case: Empty matrix 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > cat("Special case: Empty matrix:\n") 455s Special case: Empty matrix: 455s > for (mode in c("integer", "double")) { 455s + x <- matrix(integer(0), nrow = 0, ncol = 0) 455s + storage.mode(x) <- mode 455s + 455s + y0 <- rowMedians_R(x, na.rm = FALSE) 455s + y1 <- rowMedians(x, na.rm = FALSE) 455s + stopifnot(all.equal(y1, y0)) 455s + 455s + y0 <- colMedians_R(x, na.rm = FALSE) 455s + y1 <- colMedians(x, na.rm = FALSE) 455s + stopifnot(all.equal(y1, y0)) 455s + } 455s > 455s > 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > # Special case: All NAs 455s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 455s > cat("Special case: All NAs:\n") 455s Special case: All NAs: 455s > for (mode in c("integer", "double")) { 455s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 455s + storage.mode(x) <- mode 455s + 455s + # To check names attribute 455s + dimnames <- list(letters[1:3], LETTERS[1:3]) 455s + 455s + # Test with and without dimnames on x 455s + for (setDimnames in c(TRUE, FALSE)) { 455s + if (setDimnames) dimnames(x) <- dimnames 455s + else dimnames(x) <- NULL 455s + # Check names attribute 455s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 455s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 455s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + 455s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 455s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 455s + stopifnot(all.equal(y1, y0)) 455s + } 455s + } 455s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Special case: All NaNs 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > cat("Special case: All NaNs:\n") 456s Special case: All NaNs: 456s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 456s > 456s > # Test with and without dimnames on x 456s > for (setDimnames in c(TRUE, FALSE)) { 456s + if (setDimnames) dimnames(x) <- dimnames 456s + else dimnames(x) <- NULL 456s + # Check names attribute 456s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 456s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 456s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + 456s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 456s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + } 456s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Special case: All Infs 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > cat("Special case: All Infs:\n") 456s Special case: All Infs: 456s > x <- matrix(Inf, nrow = 3, ncol = 3) 456s > 456s > # Test with and without dimnames on x 456s > for (setDimnames in c(TRUE, FALSE)) { 456s + if (setDimnames) dimnames(x) <- dimnames 456s + else dimnames(x) <- NULL 456s + # Check names attribute 456s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 456s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + 456s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + } 456s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Special case: All -Infs 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > cat("Special case: All -Infs:\n") 456s Special case: All -Infs: 456s > x <- matrix(-Inf, nrow = 3, ncol = 3) 456s > 456s > # Test with and without dimnames on x 456s > for (setDimnames in c(TRUE, FALSE)) { 456s + if (setDimnames) dimnames(x) <- dimnames 456s + else dimnames(x) <- NULL 456s + # Check names attribute 456s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 456s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + 456s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + } 456s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Special case: Infs and -Infs 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > cat("Special case: Infs and -Infs:\n") 456s Special case: Infs and -Infs: 456s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 456s > 456s > # To check names attribute 456s > dimnames <- list(letters[1:4], LETTERS[1:4]) 456s > 456s > # Test with and without dimnames on x 456s > for (setDimnames in c(TRUE, FALSE)) { 456s + if (setDimnames) dimnames(x) <- dimnames 456s + else dimnames(x) <- NULL 456s + # Check names attribute 456s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 456s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + 456s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + } 456s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Special case: Integer overflow with ties 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > cat("Special case: Integer overflow with ties:\n") 456s Special case: Integer overflow with ties: 456s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 456s > 456s > # Test with and without dimnames on x 456s > for (setDimnames in c(TRUE, FALSE)) { 456s + if (setDimnames) dimnames(x) <- dimnames 456s + else dimnames(x) <- NULL 456s + # Check names attribute 456s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 456s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + 456s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 456s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 456s + stopifnot(all.equal(y1, y0)) 456s + } 456s + } 456s > 456s > 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > # Consistency checks 456s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 456s > set.seed(1) 456s > 456s > cat("Consistency checks:\n") 456s Consistency checks: 456s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 456s > for (kk in seq_len(n_sims)) { 456s + cat("Random test #", kk, "\n", sep = "") 456s + 456s + # Simulate data in a matrix of any shape 456s + dim <- sample(50:200, size = 2) 456s + n <- prod(dim) 456s + x <- rnorm(n, sd = 100) 456s + dim(x) <- dim 456s + 456s + # Add NAs? 456s + if ((kk %% 4) %in% c(3, 0)) { 456s + cat("Adding NAs\n") 456s + nna <- sample(n, size = 1) 456s + na_values <- c(NA_real_, NaN) 456s + t <- sample(na_values, size = nna, replace = TRUE) 456s + x[sample(length(x), size = nna)] <- t 456s + } 456s + 456s + # Integer or double? 456s + if ((kk %% 4) %in% c(2, 0)) { 456s + cat("Coercing to integers\n") 456s + storage.mode(x) <- "integer" 456s + } 456s + 456s + na.rm <- sample(c(TRUE, FALSE), size = 1) 456s + 456s + # rowMedians(): 456s + y0 <- rowMedians_R(x, na.rm = na.rm) 456s + y1 <- rowMedians(x, na.rm = na.rm) 456s + stopifnot(all.equal(y1, y0)) 456s + y2 <- colMedians(t(x), na.rm = na.rm) 456s + stopifnot(all.equal(y2, y0)) 456s + 456s + # colMedians(): 456s + y0 <- colMedians_R(x, na.rm = na.rm) 456s + y1 <- colMedians(x, na.rm = na.rm) 456s + stopifnot(all.equal(y1, y0)) 456s + y2 <- rowMedians(t(x), na.rm = na.rm) 456s + stopifnot(all.equal(y2, y0)) 456s + } # for (kk ...) 456s Random test #1 456s Random test #2 456s Coercing to integers 456s Random test #3 456s Adding NAs 456s Random test #4 456s Adding NAs 456s Coercing to integers 456s Random test #5 456s Random test #6 456s Coercing to integers 456s Random test #7 456s Adding NAs 456s Random test #8 456s Adding NAs 456s Coercing to integers 456s Random test #9 456s Random test #10 456s Coercing to integers 456s Random test #11 456s Adding NAs 456s Random test #12 456s Adding NAs 456s Coercing to integers 456s Random test #13 456s Random test #14 456s Coercing to integers 456s Random test #15 456s Adding NAs 456s Random test #16 456s Adding NAs 456s Coercing to integers 456s Random test #17 456s Random test #18 456s Coercing to integers 457s Random test #19 457s Adding NAs 457s Random test #20 457s Adding NAs 457s Coercing to integers 457s > 457s 457s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 457s Copyright (C) 2024 The R Foundation for Statistical Computing 457s Platform: arm-unknown-linux-gnueabihf (32-bit) 457s 457s R is free software and comes with ABSOLUTELY NO WARRANTY. 457s You are welcome to redistribute it under certain conditions. 457s Type 'license()' or 'licence()' for distribution details. 457s 457s R is a collaborative project with many contributors. 457s Type 'contributors()' for more information and 457s 'citation()' on how to cite R or R packages in publications. 457s 457s Type 'demo()' for some demos, 'help()' for on-line help, or 457s 'help.start()' for an HTML browser interface to help. 457s Type 'q()' to quit R. 457s 457s > library("matrixStats") 457s > 457s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 457s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 457s + if (is.na(useNames) || !useNames) names(res) <- NULL 457s + res 457s + } 457s > 457s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 457s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 457s + if (is.na(useNames) || !useNames) names(res) <- NULL 457s + res 457s + } 457s > 457s > 457s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 457s > # Subsetted tests 457s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 457s > source("utils/validateIndicesFramework.R") 457s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 457s > storage.mode(x) <- "integer" 457s > 457s > # To check names attribute 457s > dimnames <- list(letters[1:6], LETTERS[1:6]) 457s > 457s > # Test with and without dimnames on x 457s > for (setDimnames in c(TRUE, FALSE)) { 457s + if (setDimnames) dimnames(x) <- dimnames 457s + else dimnames(x) <- NULL 457s + 457s + count <- 0L 457s + for (rows in index_cases) { 457s + for (cols in index_cases) { 457s + count <- count + 1L 457s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 457s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 457s + useNames <- useNames[count %% length(useNames) + 1] 457s + 457s + validateIndicesTestMatrix(x, rows, cols, 457s + ftest = rowMedians, fsure = rowMedians_R, 457s + na.rm = na.rm, useNames = useNames) 457s + validateIndicesTestMatrix(x, rows, cols, 457s + fcoltest = colMedians, fsure = rowMedians_R, 457s + na.rm = na.rm, useNames = useNames) 457s + } 457s + } 457s + } 458s > 458s 458s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 458s Copyright (C) 2024 The R Foundation for Statistical Computing 458s Platform: arm-unknown-linux-gnueabihf (32-bit) 458s 458s R is free software and comes with ABSOLUTELY NO WARRANTY. 458s You are welcome to redistribute it under certain conditions. 458s Type 'license()' or 'licence()' for distribution details. 458s 458s R is a collaborative project with many contributors. 458s Type 'contributors()' for more information and 458s 'citation()' on how to cite R or R packages in publications. 458s 458s Type 'demo()' for some demos, 'help()' for on-line help, or 458s 'help.start()' for an HTML browser interface to help. 458s Type 'q()' to quit R. 458s 459s > library("matrixStats") 459s > library("stats") 459s > 459s > asWhich <- function(probs, max) { 459s + idx <- as.integer(round(probs * max)) 459s + if (idx < 1L) { 459s + idx <- 1L 459s + } else if (idx > max) { 459s + idx <- max 459s + } 459s + idx 459s + } # asWhich() 459s > 459s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 459s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 459s + 459s + # Remove Attributes 459s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 459s + ans 459s + } # rowOrderStats_R() 459s > 459s > 459s > set.seed(1) 459s > 459s > 459s > # Simulate data in a matrix of any shape 459s > nrow <- 60L 459s > ncol <- 30L 459s > x <- rnorm(nrow * ncol) 459s > dim(x) <- c(nrow, ncol) 459s > probs <- 0.3 459s > which <- asWhich(probs, max = ncol) 459s > 459s > y0 <- rowOrderStats_R(x, probs = probs) 459s > y1 <- rowOrderStats(x, which = which) 459s > stopifnot(all.equal(y1, y0)) 459s > y2 <- colOrderStats(t(x), which = which) 459s > stopifnot(all.equal(y2, y0)) 459s > 459s > 459s > 459s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 459s > # Consistency checks 459s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 459s > for (mode in c("integer", "double")) { 459s + cat("Consistency checks without NAs:\n") 459s + for (kk in 1:3) { 459s + cat("Random test #", kk, "\n", sep = "") 459s + 459s + # Simulate data in a matrix of any shape 459s + nrow <- sample(20L, size = 1L) 459s + ncol <- sample(20L, size = 1L) 459s + x <- rnorm(nrow * ncol) 459s + dim(x) <- c(nrow, ncol) 459s + 459s + cat("mode: ", mode, "\n", sep = "") 459s + storage.mode(x) <- mode 459s + str(x) 459s + 459s + probs <- runif(1) 459s + which <- asWhich(probs, max = ncol) 459s + 459s + y0 <- rowOrderStats_R(x, probs = probs) 459s + y1 <- rowOrderStats(x, which = which) 459s + stopifnot(all.equal(y1, y0)) 459s + y2 <- colOrderStats(t(x), which = which) 459s + stopifnot(all.equal(y2, y0)) 459s + } # for (kk in ...) 459s + } # for (mode ...) 459s Consistency checks without NAs: 459s Random test #1 459s mode: integer 459s int [1:14, 1:6] 0 0 1 0 2 -1 1 0 0 0 ... 459s Random test #2 459s mode: integer 459s int [1:8, 1:13] 0 0 1 -2 0 0 0 0 1 0 ... 459s Random test #3 459s mode: integer 459s int [1:20, 1:17] 0 0 0 0 1 0 1 0 0 -1 ... 459s Consistency checks without NAs: 459s Random test #1 459s mode: double 459s num [1:9, 1:5] -1.4286 -0.00386 -0.70456 -0.29242 -0.49607 ... 459s Random test #2 459s mode: double 459s num [1:11, 1:20] -0.796 0.482 -0.952 0.5 1.242 ... 459s Random test #3 459s mode: double 459s num [1:7, 1:18] 1.553 -2.405 0.167 -0.403 -1.746 ... 459s > 459s > 459s > # Check names attribute 459s > x <- matrix(1:9 + 0.1, nrow = 3L, ncol = 3L) 459s > 459s > probs <- runif(1) 459s > which <- asWhich(probs, max = ncol(x)) 459s > 459s > dimnames <- list(letters[1:3], LETTERS[1:3]) 459s > 459s > # Test with and without dimnames on x 459s > for (setDimnames in c(TRUE, FALSE)) { 459s + if (setDimnames) dimnames(x) <- dimnames 459s + else dimnames(x) <- NULL 459s + # Check names attribute 459s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 459s + y0 <- rowOrderStats_R(x, probs = probs, useNames = useNames) 459s + y1 <- rowOrderStats(x, which = which, useNames = useNames) 459s + stopifnot(all.equal(y1, y0)) 459s + y2 <- colOrderStats(t(x), which = which, useNames = useNames) 459s + stopifnot(all.equal(y2, y0)) 459s + } 459s + } 459s > 459s 459s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 459s Copyright (C) 2024 The R Foundation for Statistical Computing 459s Platform: arm-unknown-linux-gnueabihf (32-bit) 459s 459s R is free software and comes with ABSOLUTELY NO WARRANTY. 459s You are welcome to redistribute it under certain conditions. 459s Type 'license()' or 'licence()' for distribution details. 459s 459s R is a collaborative project with many contributors. 459s Type 'contributors()' for more information and 459s 'citation()' on how to cite R or R packages in publications. 459s 459s Type 'demo()' for some demos, 'help()' for on-line help, or 459s 'help.start()' for an HTML browser interface to help. 459s Type 'q()' to quit R. 459s 459s > library("matrixStats") 459s > 459s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 459s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 459s + 459s + # Remove Attributes 459s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 459s + ans 459s + } # rowOrderStats_R() 459s > 459s > 459s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 459s > # Subsetted tests 459s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 459s > source("utils/validateIndicesFramework.R") 459s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 459s > storage.mode(x) <- "integer" 459s > 459s > # To check names attribute 459s > dimnames <- list(letters[1:6], LETTERS[1:6]) 459s > 459s > probs <- 0.3 459s > # Test with and without dimnames on x 459s > for (setDimnames in c(TRUE, FALSE)) { 459s + if (setDimnames) dimnames(x) <- dimnames 459s + else dimnames(x) <- NULL 459s + for (rows in index_cases) { 459s + for (cols in index_cases) { 459s + # Check names attribute 459s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 459s + if (is.null(cols)) which <- round(probs * ncol(x)) 459s + else { 459s + xxrows <- rows 459s + suppressWarnings({ 459s + xx <- tryCatch(x[, cols, drop = FALSE], error = function(c) "error") 459s + if (identical(xx, "error")) which <- 0L 459s + else which <- round(probs * ncol(xx)) 459s + }) 459s + } 459s + if (which == 0L) next 459s + 459s + validateIndicesTestMatrix(x, rows, cols, 459s + ftest = rowOrderStats, fsure = rowOrderStats_R, 459s + which = which, probs = probs, useNames = useNames) 459s + validateIndicesTestMatrix(x, rows, cols, 459s + fcoltest = colOrderStats, fsure = rowOrderStats_R, 459s + which = which, probs = probs, useNames = useNames) 459s + } 459s + } 459s + } 459s + } 462s > 463s 463s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 463s Copyright (C) 2024 The R Foundation for Statistical Computing 463s Platform: arm-unknown-linux-gnueabihf (32-bit) 463s 463s R is free software and comes with ABSOLUTELY NO WARRANTY. 463s You are welcome to redistribute it under certain conditions. 463s Type 'license()' or 'licence()' for distribution details. 463s 463s R is a collaborative project with many contributors. 463s Type 'contributors()' for more information and 463s 'citation()' on how to cite R or R packages in publications. 463s 463s Type 'demo()' for some demos, 'help()' for on-line help, or 463s 'help.start()' for an HTML browser interface to help. 463s Type 'q()' to quit R. 463s 463s > library("matrixStats") 463s > 463s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 463s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 463s + if (is.na(useNames) || !useNames) names(res) <- NULL 463s + res 463s + } 463s > 463s > all.equal.na <- function(target, current, ...) { 463s + # Computations involving NaN may return NaN or NA, cf. ?is.nan 463s + current[is.nan(current)] <- NA_real_ 463s + target[is.nan(target)] <- NA_real_ 463s + all.equal(target, current, ...) 463s + } 463s > 463s > for (mode in c("integer", "double")) { 463s + # Missing values 463s + x <- matrix(c(1, NA, NaN, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 463s + cat("mode: ", mode, "\n", sep = "") 463s + storage.mode(x) <- mode 463s + str(x) 463s + 463s + # To check names attribute 463s + dimnames <- list(letters[1:4], LETTERS[1:2]) 463s + 463s + # Test with and without dimnames on x 463s + for (setDimnames in c(TRUE, FALSE)) { 463s + if (setDimnames) dimnames(x) <- dimnames 463s + else dimnames(x) <- NULL 463s + # Check names attribute 463s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 463s + y0 <- rowProds_R(x, na.rm = TRUE, useNames = useNames) 463s + print(y0) 463s + y1 <- rowProds(x, na.rm = TRUE, useNames = useNames) 463s + print(y1) 463s + y2 <- colProds(t(x), na.rm = TRUE, useNames = useNames) 463s + print(y2) 463s + stopifnot(all.equal(y1, y0)) 463s + stopifnot(all.equal(y2, y1)) 463s + 463s + # Missing values 463s + y0 <- rowProds_R(x, na.rm = FALSE, useNames = useNames) 463s + print(y0) 463s + y1 <- rowProds(x, na.rm = FALSE, useNames = useNames) 463s + print(y1) 463s + y2 <- colProds(t(x), na.rm = FALSE, useNames = useNames) 463s + print(y2) 463s + stopifnot(all.equal(y1, y0)) 463s + stopifnot(all.equal(y2, y1)) 463s + 463s + # "Empty" rows 463s + y0 <- rowProds_R(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 463s + print(y0) 463s + y1 <- rowProds(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 463s + print(y1) 463s + y2 <- colProds(t(x[integer(0), , drop = FALSE]), na.rm = FALSE, useNames = useNames) 463s + print(y2) 463s + stopifnot(all.equal.na(y1, y0)) 463s + stopifnot(all.equal(y2, y1)) 463s + stopifnot(length(y1) == 0L) 463s + 463s + # Using product() 463s + y1 <- rowProds(x, method = "expSumLog", na.rm = FALSE, useNames = useNames) 463s + print(y1) 463s + y2 <- colProds(t(x), method = "expSumLog", na.rm = FALSE, useNames = useNames) 463s + print(y2) 463s + stopifnot(all.equal(y2, y1)) 463s + } 463s + } 463s + } # for (mode ...) 463s mode: integer 463s int [1:4, 1:2] 1 NA NA 1 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 NA NA 0 463s a b c d 463s 1 NA NA 0 463s a b c d 463s 1 NA NA 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s a b c d 463s 1 NA NA 0 463s a b c d 463s 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s mode: double 463s num [1:4, 1:2] 1 NA NaN 1 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 0 1 0 463s a b c d 463s 1 NA NaN 0 463s a b c d 463s 1 NA NaN 0 463s a b c d 463s 1 NA NaN 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s a b c d 463s 1 NA NA 0 463s a b c d 463s 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 0 1 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s [1] 1 NA NaN 0 463s numeric(0) 463s numeric(0) 463s numeric(0) 463s [1] 1 NA NA 0 463s [1] 1 NA NA 0 463s > 463s > 463s > # Bug report 2012-06-25 463s > x <- matrix(c(1, 1, 1, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 463s > y0 <- rowProds_R(x) 463s > print(y0) 463s [1] 1 0 1 0 463s > y1 <- rowProds(x) 463s > print(y1) 463s [1] 1 0 1 0 463s > y2 <- colProds(t(x)) 463s > print(y2) 463s [1] 1 0 1 0 463s > stopifnot(all.equal.na(y1, y0)) 463s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 463s > stopifnot(all.equal.na(y2, y1)) 463s > # Check names attribute 463s > dimnames(x) <- dimnames 463s > y0 <- rowProds_R(x, useNames = TRUE) 463s > print(y0) 463s a b c d 463s 1 0 1 0 463s > y1 <- rowProds(x, useNames = TRUE) 463s > print(y1) 463s a b c d 463s 1 0 1 0 463s > y2 <- colProds(t(x), useNames = TRUE) 463s > print(y2) 463s a b c d 463s 1 0 1 0 463s > stopifnot(all.equal.na(y1, y0)) 463s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 463s > stopifnot(all.equal.na(y2, y1)) 463s > 463s > # Bug report 2014-03-25 ("all rows contains a zero") 463s > x <- matrix(c(0, 1, 1, 0), nrow = 2, ncol = 2) 463s > # To check names attribute 463s > dimnames <- list(letters[1:2], LETTERS[1:2]) 463s > y0 <- rowProds_R(x) 463s > print(y0) 463s [1] 0 0 463s > y1 <- rowProds(x) 463s > print(y1) 463s [1] 0 0 463s > y2 <- colProds(t(x)) 463s > print(y2) 463s [1] 0 0 463s > stopifnot(all.equal.na(y1, y0)) 463s > stopifnot(all.equal.na(y1, c(0, 0))) 463s > stopifnot(all.equal.na(y2, y1)) 463s > # Check names attribute 463s > dimnames(x) <- dimnames 463s > y0 <- rowProds_R(x, useNames = TRUE) 463s > print(y0) 463s a b 463s 0 0 463s > y1 <- rowProds(x, useNames = TRUE) 463s > print(y1) 463s a b 463s 0 0 463s > y2 <- colProds(t(x), useNames = TRUE) 463s > print(y2) 463s a b 463s 0 0 463s > stopifnot(all.equal.na(y1, y0)) 463s > stopifnot(all.equal.na(y2, y1)) 463s > 463s 463s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 463s Copyright (C) 2024 The R Foundation for Statistical Computing 463s Platform: arm-unknown-linux-gnueabihf (32-bit) 463s 463s R is free software and comes with ABSOLUTELY NO WARRANTY. 463s You are welcome to redistribute it under certain conditions. 463s Type 'license()' or 'licence()' for distribution details. 463s 463s R is a collaborative project with many contributors. 463s Type 'contributors()' for more information and 463s 'citation()' on how to cite R or R packages in publications. 463s 463s Type 'demo()' for some demos, 'help()' for on-line help, or 463s 'help.start()' for an HTML browser interface to help. 463s Type 'q()' to quit R. 463s 464s > library("matrixStats") 464s > 464s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 464s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 464s + if (is.na(useNames) || !useNames) names(res) <- NULL 464s + res 464s + } 464s > 464s > 464s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 464s > # Subsetted tests 464s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 464s > source("utils/validateIndicesFramework.R") 464s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 464s > storage.mode(x) <- "integer" 464s > 464s > # To check names attribute 464s > dimnames <- list(letters[1:6], LETTERS[1:6]) 464s > 464s > # Test with and without dimnames on x 464s > for (setDimnames in c(TRUE, FALSE)) { 464s + if (setDimnames) dimnames(x) <- dimnames 464s + else dimnames(x) <- NULL 464s + for (rows in index_cases) { 464s + for (cols in index_cases) { 464s + for (na.rm in c(TRUE, FALSE)) { 464s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 464s + validateIndicesTestMatrix(x, rows, cols, 464s + ftest = rowProds, fsure = rowProds_R, 464s + method = "expSumLog", 464s + FUN = product, na.rm = na.rm, useNames = useNames) 464s + validateIndicesTestMatrix(x, rows, cols, 464s + fcoltest = colProds, fsure = rowProds_R, 464s + method = "expSumLog", 464s + FUN = product, na.rm = na.rm, useNames = useNames) 464s + } 464s + } 464s + } 464s + } 464s + } 467s > 467s 467s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 467s Copyright (C) 2024 The R Foundation for Statistical Computing 467s Platform: arm-unknown-linux-gnueabihf (32-bit) 467s 467s R is free software and comes with ABSOLUTELY NO WARRANTY. 467s You are welcome to redistribute it under certain conditions. 467s Type 'license()' or 'licence()' for distribution details. 467s 467s R is a collaborative project with many contributors. 467s Type 'contributors()' for more information and 467s 'citation()' on how to cite R or R packages in publications. 467s 467s Type 'demo()' for some demos, 'help()' for on-line help, or 467s 'help.start()' for an HTML browser interface to help. 467s Type 'q()' to quit R. 467s 468s > library("matrixStats") 468s > 468s > ## Create isFALSE() if running on an old version of R 468s > if (!exists("isFALSE", mode="function")) { 468s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 468s + } 468s > 468s > rowQuantiles_R <- function(x, probs = c(0, 0.25, 0.50, 0.75, 1), na.rm = FALSE, drop = TRUE, type = 7L, ..., useNames = NA) { 468s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 468s + if (!na.rm && any(is.na(x))) { 468s + na_value <- NA_real_ 468s + if (type != 7L) storage.mode(na_value) <- storage.mode(x) 468s + rep(na_value, times = length(probs)) 468s + } else { 468s + as.vector(quantile(x, probs = probs, na.rm = na.rm, type = type, names = FALSE, ...)) 468s + } 468s + }, probs = probs, na.rm = na.rm) 468s + 468s + if (!is.null(dim(q))) q <- t(q) 468s + else dim(q) <- c(nrow(x), length(probs)) 468s + 468s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 468s + rownames(q) <- rownames(x) 468s + if (isFALSE(useNames)) dimnames(q) <- NULL 468s + 468s + if (drop) q <- drop(q) 468s + q 468s + } 468s > 468s > 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > # Test with multiple quantiles 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > for (mode in c("logical", "integer", "double")) { 468s + cat("mode: ", mode, "\n", sep = "") 468s + x <- matrix(1:40 + 0.1, nrow = 8, ncol = 5) 468s + storage.mode(x) <- mode 468s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 468s + str(x) 468s + 468s + probs <- c(0, 0.5, 1) 468s + # Test with and without dimnames on x 468s + for (setDimnames in c(TRUE, FALSE)) { 468s + if (setDimnames) dimnames(x) <- dimnames 468s + else dimnames(x) <- NULL 468s + # Check names attribute 468s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 468s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 468s + print(q0) 468s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 468s + print(q1) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 468s + stopifnot(all.equal(q1, q0)) 468s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 468s + stopifnot(all.equal(q2, q0)) 468s + } 468s + } 468s + } # for (mode ...) 468s mode: logical 468s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 468s 0% 50% 100% 468s a 1 1 1 468s b 1 1 1 468s c 1 1 1 468s d 1 1 1 468s e 1 1 1 468s f 1 1 1 468s g 1 1 1 468s h 1 1 1 468s 0% 50% 100% 468s a 1 1 1 468s b 1 1 1 468s c 1 1 1 468s d 1 1 1 468s e 1 1 1 468s f 1 1 1 468s g 1 1 1 468s h 1 1 1 468s [,1] [,2] [,3] 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s [,1] [,2] [,3] 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s 0% 50% 100% 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s 0% 50% 100% 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s [,1] [,2] [,3] 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s [,1] [,2] [,3] 468s [1,] 1 1 1 468s [2,] 1 1 1 468s [3,] 1 1 1 468s [4,] 1 1 1 468s [5,] 1 1 1 468s [6,] 1 1 1 468s [7,] 1 1 1 468s [8,] 1 1 1 468s mode: integer 468s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 468s 0% 50% 100% 468s a 1 17 33 468s b 2 18 34 468s c 3 19 35 468s d 4 20 36 468s e 5 21 37 468s f 6 22 38 468s g 7 23 39 468s h 8 24 40 468s 0% 50% 100% 468s a 1 17 33 468s b 2 18 34 468s c 3 19 35 468s d 4 20 36 468s e 5 21 37 468s f 6 22 38 468s g 7 23 39 468s h 8 24 40 468s [,1] [,2] [,3] 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s [,1] [,2] [,3] 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s 0% 50% 100% 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s 0% 50% 100% 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s [,1] [,2] [,3] 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s [,1] [,2] [,3] 468s [1,] 1 17 33 468s [2,] 2 18 34 468s [3,] 3 19 35 468s [4,] 4 20 36 468s [5,] 5 21 37 468s [6,] 6 22 38 468s [7,] 7 23 39 468s [8,] 8 24 40 468s mode: double 468s 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 ... 468s 0% 50% 100% 468s a 1.1 17.1 33.1 468s b 2.1 18.1 34.1 468s c 3.1 19.1 35.1 468s d 4.1 20.1 36.1 468s e 5.1 21.1 37.1 468s f 6.1 22.1 38.1 468s g 7.1 23.1 39.1 468s h 8.1 24.1 40.1 468s 0% 50% 100% 468s a 1.1 17.1 33.1 468s b 2.1 18.1 34.1 468s c 3.1 19.1 35.1 468s d 4.1 20.1 36.1 468s e 5.1 21.1 37.1 468s f 6.1 22.1 38.1 468s g 7.1 23.1 39.1 468s h 8.1 24.1 40.1 468s [,1] [,2] [,3] 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s [,1] [,2] [,3] 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s 0% 50% 100% 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s 0% 50% 100% 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s [,1] [,2] [,3] 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s [,1] [,2] [,3] 468s [1,] 1.1 17.1 33.1 468s [2,] 2.1 18.1 34.1 468s [3,] 3.1 19.1 35.1 468s [4,] 4.1 20.1 36.1 468s [5,] 5.1 21.1 37.1 468s [6,] 6.1 22.1 38.1 468s [7,] 7.1 23.1 39.1 468s [8,] 8.1 24.1 40.1 468s > 468s > 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > # Test with a single quantile 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > for (mode in c("logical", "integer", "double")) { 468s + cat("mode: ", mode, "\n", sep = "") 468s + x <- matrix(1:40, nrow = 8, ncol = 5) 468s + storage.mode(x) <- mode 468s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 468s + str(x) 468s + 468s + probs <- c(0.5) 468s + # Test with and without dimnames on x 468s + for (setDimnames in c(TRUE, FALSE)) { 468s + if (setDimnames) dimnames(x) <- dimnames 468s + else dimnames(x) <- NULL 468s + # Check names attribute 468s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 468s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 468s + print(q0) 468s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 468s + print(q1) 468s + stopifnot(all.equal(q1, q0)) 468s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 468s + stopifnot(all.equal(q2, q0)) 468s + } 468s + } 468s + } # for (mode ...) 468s mode: logical 468s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 468s a b c d e f g h 468s 1 1 1 1 1 1 1 1 468s a b c d e f g h 468s 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s [1] 1 1 1 1 1 1 1 1 468s mode: integer 468s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 468s a b c d e f g h 468s 17 18 19 20 21 22 23 24 468s a b c d e f g h 468s 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s mode: double 468s num [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 468s a b c d e f g h 468s 17 18 19 20 21 22 23 24 468s a b c d e f g h 468s 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s [1] 17 18 19 20 21 22 23 24 468s > 468s > 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > # Consistency checks 468s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 468s > set.seed(1) 468s > 468s > probs <- seq(from = 0, to = 1, by = 0.25) 468s > 468s > cat("Consistency checks:\n") 468s Consistency checks: 468s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 6L else 24L 468s > for (kk in seq_len(n_sims)) { 468s + cat("Random test #", kk, "\n", sep = "") 468s + 468s + # Simulate data in a matrix of any shape 468s + dim <- sample(20:60, size = 2L) 468s + n <- prod(dim) 468s + x <- rnorm(n, sd = 100) 468s + dim(x) <- dim 468s + dimnames <- lapply(dim(x), FUN = function(n) rep(letters, length.out = n)) 468s + 468s + # Add NAs? 468s + has_na <- ((kk %% 2) == 0L) 468s + if (has_na) { 468s + cat("Adding NAs\n") 468s + nna <- sample(n, size = 1) 468s + na_values <- c(NA_real_, NaN) 468s + t <- sample(na_values, size = nna, replace = TRUE) 468s + x[sample(length(x), size = nna)] <- t 468s + } 468s + 468s + # Logical, integer, or double? 468s + mode <- "numeric" 468s + if ((kk %% 6) %in% 1:2) { 468s + cat("Coercing to logical\n") 468s + mode <- "logical" 468s + } else if ((kk %% 6) %in% 3:4) { 468s + cat("Coercing to integers\n") 468s + mode <- "integer" 468s + } 468s + storage.mode(x) <- mode 468s + 468s + str(x) 468s + 468s + # rowQuantiles(): 468s + for (type in 1:9) { 468s + cat(sprintf("type=%d, has_na=%s:\n", type, has_na)) 468s + # Test with and without dimnames on x 468s + for (setDimnames in c(TRUE, FALSE)) { 468s + if (setDimnames) dimnames(x) <- dimnames 468s + else dimnames(x) <- NULL 468s + # Check names attribute 468s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 468s + q0 <- rowQuantiles_R(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 468s + q1 <- rowQuantiles(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q1) <- storage.mode(q0) 468s + stopifnot(all.equal(q1, q0)) 468s + q2 <- colQuantiles(t(x), probs = probs, na.rm = has_na, type = type, useNames = useNames) 468s + ## FIXME: Workaround for R (< 3.0.0) 468s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q2) <- storage.mode(q0) 468s + stopifnot(all.equal(q2, q0)) 468s + } 468s + } 468s + } 468s + } # for (kk ...) 468s Random test #1 468s Coercing to logical 468s logi [1:23, 1:58] TRUE TRUE TRUE TRUE TRUE TRUE ... 468s type=1, has_na=FALSE: 468s type=2, has_na=FALSE: 468s type=3, has_na=FALSE: 469s type=4, has_na=FALSE: 469s type=5, has_na=FALSE: 469s type=6, has_na=FALSE: 469s type=7, has_na=FALSE: 469s type=8, has_na=FALSE: 469s type=9, has_na=FALSE: 469s Random test #2 469s Adding NAs 469s Coercing to logical 469s logi [1:58, 1:33] TRUE TRUE TRUE TRUE TRUE NA ... 469s type=1, has_na=TRUE: 469s type=2, has_na=TRUE: 469s type=3, has_na=TRUE: 470s type=4, has_na=TRUE: 470s type=5, has_na=TRUE: 470s type=6, has_na=TRUE: 470s type=7, has_na=TRUE: 471s type=8, has_na=TRUE: 471s type=9, has_na=TRUE: 471s Random test #3 471s Coercing to integers 471s int [1:28, 1:60] 119 -164 115 -129 209 -175 2 -32 120 -28 ... 471s type=1, has_na=FALSE: 471s type=2, has_na=FALSE: 471s type=3, has_na=FALSE: 471s type=4, has_na=FALSE: 471s type=5, has_na=FALSE: 472s type=6, has_na=FALSE: 472s type=7, has_na=FALSE: 472s type=8, has_na=FALSE: 472s type=9, has_na=FALSE: 472s Random test #4 472s Adding NAs 472s Coercing to integers 472s int [1:54, 1:35] 147 11 116 -50 NA -69 132 NA 114 NA ... 472s type=1, has_na=TRUE: 472s type=2, has_na=TRUE: 472s type=3, has_na=TRUE: 473s type=4, has_na=TRUE: 473s type=5, has_na=TRUE: 473s type=6, has_na=TRUE: 473s type=7, has_na=TRUE: 474s type=8, has_na=TRUE: 474s type=9, has_na=TRUE: 474s Random test #5 474s num [1:39, 1:53] 5.94 -27.16 -30.78 173 126.05 ... 474s type=1, has_na=FALSE: 474s type=2, has_na=FALSE: 474s type=3, has_na=FALSE: 474s type=4, has_na=FALSE: 475s type=5, has_na=FALSE: 475s type=6, has_na=FALSE: 475s type=7, has_na=FALSE: 475s type=8, has_na=FALSE: 475s type=9, has_na=FALSE: 475s Random test #6 475s Adding NAs 475s num [1:46, 1:22] 197 -107 15 148 -110 ... 475s type=1, has_na=TRUE: 475s type=2, has_na=TRUE: 476s type=3, has_na=TRUE: 476s type=4, has_na=TRUE: 476s type=5, has_na=TRUE: 476s type=6, has_na=TRUE: 476s type=7, has_na=TRUE: 477s type=8, has_na=TRUE: 477s type=9, has_na=TRUE: 477s Random test #7 477s Coercing to logical 477s logi [1:21, 1:51] TRUE TRUE TRUE TRUE TRUE TRUE ... 477s type=1, has_na=FALSE: 477s type=2, has_na=FALSE: 477s type=3, has_na=FALSE: 477s type=4, has_na=FALSE: 477s type=5, has_na=FALSE: 477s type=6, has_na=FALSE: 478s type=7, has_na=FALSE: 478s type=8, has_na=FALSE: 478s type=9, has_na=FALSE: 478s Random test #8 478s Adding NAs 478s Coercing to logical 478s logi [1:33, 1:53] NA NA TRUE TRUE TRUE TRUE ... 478s type=1, has_na=TRUE: 478s type=2, has_na=TRUE: 478s type=3, has_na=TRUE: 478s type=4, has_na=TRUE: 478s type=5, has_na=TRUE: 478s type=6, has_na=TRUE: 479s type=7, has_na=TRUE: 479s type=8, has_na=TRUE: 479s type=9, has_na=TRUE: 479s Random test #9 479s Coercing to integers 479s int [1:53, 1:24] -73 10 -73 -5 44 -107 -100 95 58 -50 ... 479s type=1, has_na=FALSE: 479s type=2, has_na=FALSE: 479s type=3, has_na=FALSE: 480s type=4, has_na=FALSE: 480s type=5, has_na=FALSE: 480s type=6, has_na=FALSE: 480s type=7, has_na=FALSE: 480s type=8, has_na=FALSE: 481s type=9, has_na=FALSE: 481s Random test #10 481s Adding NAs 481s Coercing to integers 481s int [1:44, 1:20] NA -140 NA -57 -252 NA NA 20 NA NA ... 481s type=1, has_na=TRUE: 481s type=2, has_na=TRUE: 481s type=3, has_na=TRUE: 481s type=4, has_na=TRUE: 482s type=5, has_na=TRUE: 482s type=6, has_na=TRUE: 482s type=7, has_na=TRUE: 482s type=8, has_na=TRUE: 482s type=9, has_na=TRUE: 482s Random test #11 482s num [1:54, 1:23] -160.87 74.13 196.08 7.27 4.92 ... 482s type=1, has_na=FALSE: 483s type=2, has_na=FALSE: 483s type=3, has_na=FALSE: 483s type=4, has_na=FALSE: 483s type=5, has_na=FALSE: 483s type=6, has_na=FALSE: 484s type=7, has_na=FALSE: 484s type=8, has_na=FALSE: 484s type=9, has_na=FALSE: 484s Random test #12 484s Adding NAs 484s num [1:59, 1:27] -139.2 -86.3 NA -40.7 NA ... 484s type=1, has_na=TRUE: 484s type=2, has_na=TRUE: 485s type=3, has_na=TRUE: 485s type=4, has_na=TRUE: 485s type=5, has_na=TRUE: 485s type=6, has_na=TRUE: 486s type=7, has_na=TRUE: 486s type=8, has_na=TRUE: 486s type=9, has_na=TRUE: 486s Random test #13 486s Coercing to logical 486s logi [1:53, 1:60] TRUE TRUE TRUE TRUE TRUE TRUE ... 486s type=1, has_na=FALSE: 487s type=2, has_na=FALSE: 487s type=3, has_na=FALSE: 487s type=4, has_na=FALSE: 487s type=5, has_na=FALSE: 487s type=6, has_na=FALSE: 488s type=7, has_na=FALSE: 488s type=8, has_na=FALSE: 488s type=9, has_na=FALSE: 488s Random test #14 488s Adding NAs 488s Coercing to logical 488s logi [1:22, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 488s type=1, has_na=TRUE: 488s type=2, has_na=TRUE: 488s type=3, has_na=TRUE: 488s type=4, has_na=TRUE: 488s type=5, has_na=TRUE: 489s type=6, has_na=TRUE: 489s type=7, has_na=TRUE: 489s type=8, has_na=TRUE: 489s type=9, has_na=TRUE: 489s Random test #15 489s Coercing to integers 489s int [1:20, 1:34] 78 -41 183 190 -71 37 0 -4 -86 27 ... 489s type=1, has_na=FALSE: 489s type=2, has_na=FALSE: 489s type=3, has_na=FALSE: 489s type=4, has_na=FALSE: 489s type=5, has_na=FALSE: 489s type=6, has_na=FALSE: 490s type=7, has_na=FALSE: 490s type=8, has_na=FALSE: 490s type=9, has_na=FALSE: 490s Random test #16 490s Adding NAs 490s Coercing to integers 490s int [1:42, 1:37] NA 12 -15 41 -28 17 NA -74 NA NA ... 490s type=1, has_na=TRUE: 490s type=2, has_na=TRUE: 490s type=3, has_na=TRUE: 490s type=4, has_na=TRUE: 491s type=5, has_na=TRUE: 491s type=6, has_na=TRUE: 491s type=7, has_na=TRUE: 491s type=8, has_na=TRUE: 491s type=9, has_na=TRUE: 491s Random test #17 491s num [1:42, 1:29] -50.51 -6.51 -117.59 135.58 226.87 ... 491s type=1, has_na=FALSE: 492s type=2, has_na=FALSE: 492s type=3, has_na=FALSE: 492s type=4, has_na=FALSE: 492s type=5, has_na=FALSE: 492s type=6, has_na=FALSE: 492s type=7, has_na=FALSE: 492s type=8, has_na=FALSE: 493s type=9, has_na=FALSE: 493s Random test #18 493s Adding NAs 493s num [1:57, 1:39] 223 156.8 -44.6 -127.5 -147.7 ... 493s type=1, has_na=TRUE: 493s type=2, has_na=TRUE: 493s type=3, has_na=TRUE: 494s type=4, has_na=TRUE: 494s type=5, has_na=TRUE: 494s type=6, has_na=TRUE: 494s type=7, has_na=TRUE: 494s type=8, has_na=TRUE: 495s type=9, has_na=TRUE: 495s Random test #19 495s Coercing to logical 495s logi [1:52, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 495s type=1, has_na=FALSE: 495s type=2, has_na=FALSE: 495s type=3, has_na=FALSE: 495s type=4, has_na=FALSE: 496s type=5, has_na=FALSE: 496s type=6, has_na=FALSE: 496s type=7, has_na=FALSE: 496s type=8, has_na=FALSE: 496s type=9, has_na=FALSE: 497s Random test #20 497s Adding NAs 497s Coercing to logical 497s logi [1:25, 1:48] NA TRUE NA NA NA NA ... 497s type=1, has_na=TRUE: 497s type=2, has_na=TRUE: 497s type=3, has_na=TRUE: 497s type=4, has_na=TRUE: 497s type=5, has_na=TRUE: 497s type=6, has_na=TRUE: 497s type=7, has_na=TRUE: 497s type=8, has_na=TRUE: 497s type=9, has_na=TRUE: 498s Random test #21 498s Coercing to integers 498s int [1:53, 1:27] 3 -30 203 -49 19 -45 -138 28 46 -44 ... 498s type=1, has_na=FALSE: 498s type=2, has_na=FALSE: 498s type=3, has_na=FALSE: 498s type=4, has_na=FALSE: 498s type=5, has_na=FALSE: 499s type=6, has_na=FALSE: 499s type=7, has_na=FALSE: 499s type=8, has_na=FALSE: 499s type=9, has_na=FALSE: 499s Random test #22 499s Adding NAs 499s Coercing to integers 499s int [1:48, 1:36] -131 NA NA -201 45 -17 NA 57 NA NA ... 499s type=1, has_na=TRUE: 500s type=2, has_na=TRUE: 500s type=3, has_na=TRUE: 500s type=4, has_na=TRUE: 500s type=5, has_na=TRUE: 500s type=6, has_na=TRUE: 500s type=7, has_na=TRUE: 501s type=8, has_na=TRUE: 501s type=9, has_na=TRUE: 501s Random test #23 501s num [1:23, 1:43] -99.2 -68.8 -86.7 -104.2 48 ... 501s type=1, has_na=FALSE: 501s type=2, has_na=FALSE: 501s type=3, has_na=FALSE: 501s type=4, has_na=FALSE: 502s type=5, has_na=FALSE: 502s type=6, has_na=FALSE: 502s type=7, has_na=FALSE: 502s type=8, has_na=FALSE: 502s type=9, has_na=FALSE: 502s Random test #24 502s Adding NAs 502s num [1:53, 1:29] NaN -67.6 10.8 -88.4 130.1 ... 502s type=1, has_na=TRUE: 502s type=2, has_na=TRUE: 502s type=3, has_na=TRUE: 503s type=4, has_na=TRUE: 503s type=5, has_na=TRUE: 503s type=6, has_na=TRUE: 503s type=7, has_na=TRUE: 504s type=8, has_na=TRUE: 504s type=9, has_na=TRUE: 504s > 504s > 504s > 504s > for (mode in c("logical", "integer", "double")) { 504s + naValue <- NA_real_ 504s + storage.mode(naValue) <- mode 504s + 504s + someValue <- 1 504s + storage.mode(someValue) <- mode 504s + 504s + for (type in 1:9) { 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + # All NA 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + x <- matrix(naValue, nrow = 3L, ncol = 4L) 504s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + # Test with and without dimnames on x 504s + for (setDimnames in c(TRUE, FALSE)) { 504s + if (setDimnames) dimnames(x) <- dimnames 504s + else dimnames(x) <- NULL 504s + # Check names attribute 504s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 504s + qr0 <- rowQuantiles_R(x, type = type, useNames = useNames) 504s + 504s + qr <- rowQuantiles(x, type = type, useNames = useNames) 504s + stopifnot(identical(qr, qr0)) 504s + 504s + # x <- matrix(naValue, nrow = 4L, ncol = 3L) 504s + qc <- colQuantiles(t(x), type = type, useNames = useNames) 504s + 504s + stopifnot(identical(qc, qr)) 504s + } 504s + } 504s + 504s + 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + # Empty matrices 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + probs <- c(0, 0.25, 0.75, 1) 504s + x <- matrix(naValue, nrow = 0L, ncol = 0L) 504s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 504s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 504s + 504s + x <- matrix(naValue, nrow = 2L, ncol = 0L) 504s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 504s + 504s + x <- matrix(naValue, nrow = 0L, ncol = 2L) 504s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 504s + 504s + 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + # Single column matrices 504s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 504s + probs <- c(0, 0.25, 0.75, 1) 504s + x <- matrix(someValue, nrow = 2L, ncol = 1L) 504s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + qr <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + print(qr) 504s + 504s + x <- matrix(someValue, nrow = 1L, ncol = 2L) 504s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 504s + qc <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 504s + print(qc) 504s + 504s + stopifnot(identical(qc, qr)) 504s + } 504s + } 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s 0% 25% 75% 100% 504s a 1 1 1 1 504s b 1 1 1 1 504s > 505s 505s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 505s Copyright (C) 2024 The R Foundation for Statistical Computing 505s Platform: arm-unknown-linux-gnueabihf (32-bit) 505s 505s R is free software and comes with ABSOLUTELY NO WARRANTY. 505s You are welcome to redistribute it under certain conditions. 505s Type 'license()' or 'licence()' for distribution details. 505s 505s R is a collaborative project with many contributors. 505s Type 'contributors()' for more information and 505s 'citation()' on how to cite R or R packages in publications. 505s 505s Type 'demo()' for some demos, 'help()' for on-line help, or 505s 'help.start()' for an HTML browser interface to help. 505s Type 'q()' to quit R. 505s 505s > library("matrixStats") 505s > 505s > ## Create isFALSE() if running on an old version of R 505s > if (!exists("isFALSE", mode="function")) { 505s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 505s + } 505s > 505s > rowQuantiles_R <- function(x, probs, na.rm = FALSE, drop = TRUE, ..., useNames = NA) { 505s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 505s + if (!na.rm && any(is.na(x))) { 505s + na_value <- NA_real_ 505s + storage.mode(na_value) <- storage.mode(x) 505s + rep(na_value, times = length(probs)) 505s + 505s + } else { 505s + as.vector(quantile(x, probs = probs, na.rm = na.rm, names = FALSE, ...)) 505s + } 505s + }, probs = probs, na.rm = na.rm) 505s + 505s + if (!is.null(dim(q))) q <- t(q) 505s + else dim(q) <- c(nrow(x), length(probs)) 505s + 505s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 505s + rownames(q) <- rownames(x) 505s + if (isFALSE(useNames)) dimnames(q) <- NULL 505s + 505s + if (drop) q <- drop(q) 505s + q 505s + } 505s > 505s > 505s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 505s > # Subsetted tests 505s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 505s > source("utils/validateIndicesFramework.R") 505s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 505s > dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 505s > probs <- c(0, 0.25, 0.75, 1) 505s > # Test with and without dimnames on x 505s > for (setDimnames in c(TRUE, FALSE)) { 505s + if (setDimnames) dimnames(x) <- dimnames 505s + else dimnames(x) <- NULL 505s + 505s + count <- 0L 505s + for (rows in index_cases) { 505s + for (cols in index_cases) { 505s + count <- count + 1L 505s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 505s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 505s + useNames <- useNames[count %% length(useNames) + 1] 505s + 505s + validateIndicesTestMatrix(x, rows, cols, 505s + ftest = rowQuantiles, fsure = rowQuantiles_R, 505s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 505s + validateIndicesTestMatrix(x, rows, cols, 505s + fcoltest = colQuantiles, fsure = rowQuantiles_R, 505s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 505s + } 505s + } 505s + } 509s > 509s > 509s 509s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 509s Copyright (C) 2024 The R Foundation for Statistical Computing 509s Platform: arm-unknown-linux-gnueabihf (32-bit) 509s 509s R is free software and comes with ABSOLUTELY NO WARRANTY. 509s You are welcome to redistribute it under certain conditions. 509s Type 'license()' or 'licence()' for distribution details. 509s 509s R is a collaborative project with many contributors. 509s Type 'contributors()' for more information and 509s 'citation()' on how to cite R or R packages in publications. 509s 509s Type 'demo()' for some demos, 'help()' for on-line help, or 509s 'help.start()' for an HTML browser interface to help. 509s Type 'q()' to quit R. 509s 509s > library("matrixStats") 509s > 509s > rowMins_R <- function(x, ..., useNames = NA) { 509s + suppressWarnings({ 509s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 509s + }) 509s + if (is.na(useNames) || !useNames) names(res) <- NULL 509s + res 509s + } # rowMins_R() 509s > 509s > rowMaxs_R <- function(x, ..., useNames = NA) { 509s + suppressWarnings({ 509s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 509s + }) 509s + if (is.na(useNames) || !useNames) names(res) <- NULL 509s + res 509s + } # rowMaxs_R() 509s > 509s > rowRanges_R <- function(x, ..., useNames = NA) { 509s + suppressWarnings({ 509s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 509s + }) 509s + 509s + # Preserve rownames attribute 509s + dim <- c(dim(x)[1], 2L) 509s + if (!isTRUE(all.equal(dim(ans), dim))) { 509s + dim(ans) <- dim 509s + rownames <- rownames(x) 509s + if (!is.null(dimnames)) rownames(ans) <- rownames 509s + } 509s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 509s + ans 509s + } # rowRanges_R() 509s > 509s > 509s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 509s > # With and without some NAs 509s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 509s > for (mode in c("integer", "double")) { 509s + cat("mode: ", mode, "\n", sep = "") 509s + 509s + for (add_na in c(FALSE, TRUE)) { 509s + cat("add_na = ", add_na, "\n", sep = "") 509s + 509s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 509s + if (add_na) { 509s + x[3:7, c(2, 4)] <- NA_real_ 509s + } 509s + storage.mode(x) <- mode 509s + str(x) 509s + 509s + # To check names attribute 509s + dimnames <- list(letters[1:10], LETTERS[1:5]) 509s + 509s + # Test with and without dimnames on x 509s + for (setDimnames in c(TRUE, FALSE)) { 509s + if (setDimnames) dimnames(x) <- dimnames 509s + else dimnames(x) <- NULL 509s + # Row/column extremes 509s + for (na.rm in c(FALSE, TRUE)) { 509s + # Check names attribute 509s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 509s + cat("na.rm = ", na.rm, "\n", sep = "") 509s + 509s + # Ranges 509s + cat("range:\n") 509s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 509s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 509s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 509s + stopifnot(all.equal(r1, r2)) 509s + stopifnot(all.equal(r1, r0)) 509s + 509s + # Min 509s + cat("min:\n") 509s + m0 <- rowMins_R(x, na.rm = na.rm, useNames = useNames) 509s + m1 <- rowMins(x, na.rm = na.rm, useNames = useNames) 509s + m2 <- colMins(t(x), na.rm = na.rm, useNames = useNames) 509s + stopifnot(all.equal(m1, m2)) 509s + stopifnot(all.equal(m1, m0)) 509s + 509s + # Max 509s + cat("max:\n") 509s + m0 <- rowMaxs_R(x, na.rm = na.rm, useNames = useNames) 509s + m1 <- rowMaxs(x, na.rm = na.rm, useNames = useNames) 509s + m2 <- colMaxs(t(x), na.rm = na.rm, useNames = useNames) 509s + stopifnot(all.equal(m1, m2)) 509s + stopifnot(all.equal(m1, m0)) 509s + } 509s + } 509s + } 509s + } # for (add_na ...) 509s + } # for (mode ...) 509s mode: integer 509s add_na = FALSE 509s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 509s na.rm = FALSE 509s range: 509s min: 509s max: 509s na.rm = FALSE 509s range: 509s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s add_na = TRUE 510s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s mode: double 510s add_na = FALSE 510s 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 ... 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s add_na = TRUE 510s 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 ... 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = FALSE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s na.rm = TRUE 510s range: 510s min: 510s max: 510s > 510s > 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > # All NAs 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > for (mode in c("integer", "double")) { 510s + cat("mode: ", mode, "\n", sep = "") 510s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 510s + storage.mode(x) <- mode 510s + str(x) 510s + 510s + # Test with and without dimnames on x 510s + for (setDimnames in c(TRUE, FALSE)) { 510s + if (setDimnames) dimnames(x) <- dimnames 510s + else dimnames(x) <- NULL 510s + for (na.rm in c(FALSE, TRUE)) { 510s + # Check names attribute 510s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 510s + cat("na.rm = ", na.rm, "\n", sep = "") 510s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 510s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 510s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 510s + stopifnot(all.equal(r1, r2)) 510s + stopifnot(all.equal(r1, r0)) 510s + } 510s + } 510s + } 510s + } # for (mode ...) 510s mode: integer 510s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 510s na.rm = FALSE 510s na.rm = FALSE 510s na.rm = TRUE 510s na.rm = TRUE 510s na.rm = FALSE 510s na.rm = FALSE 510s na.rm = TRUE 510s na.rm = TRUE 510s mode: double 510s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 510s na.rm = FALSE 510s na.rm = FALSE 510s na.rm = TRUE 510s na.rm = TRUE 510s na.rm = FALSE 510s na.rm = FALSE 510s na.rm = TRUE 510s na.rm = TRUE 510s > 510s > 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > # Special cases 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > # Nx0 matrix 510s > x <- matrix(double(0L), nrow = 5L, ncol = 0L) 510s > r0 <- rowRanges_R(x) 510s > #r1 <- rowRanges(x) 510s > #r_truth <- matrix(c(Inf, -Inf), nrow = nrow(x), ncol = 2L, byrow = TRUE) 510s > #stopifnot(all.equal(r1, r_truth)) 510s > 510s > # 0xN matrix 510s > x <- t(x) 510s > #r1 <- colRanges(x) 510s > #stopifnot(all.equal(r1, r_truth)) 510s > 510s > # Nx1 matrix 510s > x <- matrix(1:5, nrow = 5L, ncol = 1L) 510s > # To check names attribute 510s > dimnames <- list(letters[1:5], "A") 510s > r1 <- rowRanges(x) 510s > r_truth <- matrix(1:5, nrow = nrow(x), ncol = 2L, byrow = FALSE) 510s > stopifnot(all.equal(r1, r_truth)) 510s > # Check names attribute 510s > dimnames(x) <- dimnames 510s > r0 <- rowRanges_R(x, useNames = TRUE) 510s > r1 <- rowRanges(x, useNames = TRUE) 510s > stopifnot(all.equal(r1, r0)) 510s > dimnames(x) <- NULL 510s > 510s > # 1xN matrix 510s > x <- t(x) 510s > r1 <- colRanges(x) 510s > stopifnot(all.equal(r1, r_truth)) 510s > # Check names attribute 510s > dimnames(x) <- list("a", LETTERS[1:5]) 510s > r1 <- colRanges(x, useNames = TRUE) 510s > stopifnot(identical(rownames(r1), colnames(x))) 510s > 510s > 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > # Additional tests with NA_integer_, NA_real, NaN, -Inf, +Inf 510s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 510s > x <- matrix(1:12, nrow = 4L, ncol = 3L) 510s > 510s > na_list <- list( 510s + "integer" = matrix(1:12, nrow = 4L, ncol = 3L), 510s + "integer w/ NA" = matrix(NA_integer_, nrow = 4L, ncol = 3L), 510s + "real" = matrix(as.double(1:12), nrow = 4L, ncol = 3L), 510s + "real w/ NA" = matrix(NA_real_, nrow = 4L, ncol = 3L) 510s + ) 510s > 510s > na <- na_list[["real"]] 510s > na[2, 2] <- NA 510s > na_list[["real + NA cell"]] <- na 510s > 510s > na <- na_list[["real"]] 510s > na[2, ] <- NA 510s > na_list[["real + NA row"]] <- na 510s > 510s > na <- na_list[["real"]] 510s > na[2, ] <- NaN 510s > na_list[["real + NaN row"]] <- na 510s > 510s > na <- na_list[["real"]] 510s > na[2, 2] <- Inf 510s > na_list[["real + Inf cell"]] <- na 510s > 510s > na <- na_list[["real"]] 510s > na[2, ] <- Inf 510s > na_list[["real + Inf row"]] <- na 510s > 510s > na <- na_list[["real"]] 510s > na[2, 2] <- NaN 510s > na_list[["real + NaN cell"]] <- na 510s > 510s > na <- na_list[["real w/ NA"]] 510s > na[2, 2] <- NaN 510s > na_list[["real w/ NA + NaN cell"]] <- na 510s > 510s > na <- na_list[["real w/ NA"]] 510s > na[2, ] <- NaN 510s > na_list[["real w/ NA + NaN row"]] <- na 510s > 510s > # To check names attribute 510s > dimnames <- list(letters[1:4], LETTERS[1:3]) 510s > 510s > # Test with and without dimnames on x 510s > for (setDimnames in c(TRUE, FALSE)) { 510s + if (setDimnames) dimnames(x) <- dimnames 510s + else dimnames(x) <- NULL 510s + for (na.rm in c(FALSE, TRUE)) { 510s + for (name in names(na_list)) { 510s + # Check names attribute 510s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 510s + na <- na_list[[name]] 510s + cat(sprintf("%s (%s) w/ na.rm = %s:\n", name, typeof(na), na.rm)) 510s + print(na) 510s + 510s + cat(" min:\n") 510s + y0 <- rowMins_R(na, na.rm = na.rm, useNames = useNames) 510s + str(y0) 510s + y1 <- rowMins(na, na.rm = na.rm, useNames = useNames) 510s + str(y1) 510s + stopifnot(all.equal(y1, y0)) 510s + y1c <- colMins(t(na), na.rm = na.rm, useNames = useNames) 510s + str(y1c) 510s + stopifnot(all.equal(y1c, y1)) 510s + 510s + cat(" max:\n") 510s + y0 <- rowMaxs_R(na, na.rm = na.rm, useNames = useNames) 510s + str(y0) 510s + y1 <- rowMaxs(na, na.rm = na.rm, useNames = useNames) 510s + str(y1) 510s + stopifnot(all.equal(y1, y0)) 510s + y1c <- colMaxs(t(na), na.rm = na.rm, useNames = useNames) 510s + str(y1c) 510s + stopifnot(all.equal(y1c, y1)) 510s + 510s + cat(" range:\n") 510s + y0 <- rowRanges_R(na, na.rm = na.rm, useNames = useNames) 510s + str(y0) 510s + y1 <- rowRanges(na, na.rm = na.rm, useNames = useNames) 510s + str(y1) 510s + stopifnot(all.equal(y1, y0)) 510s + y1c <- colRanges(t(na), na.rm = na.rm, useNames = useNames) 510s + str(y1c) 510s + stopifnot(all.equal(y1c, y1)) 510s + } 510s + } # for (name ...) 510s + } # for (na.rm ...) 510s + } 510s integer (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer w/ NA (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s max: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s range: 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s integer w/ NA (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s max: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s range: 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real w/ NA (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s max: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s range: 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real w/ NA (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s max: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s range: 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real + NA cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NA 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s max: 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s range: 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s real + NA cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NA 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s max: 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s range: 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s real + NA row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NA NA NA 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s max: 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s range: 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s real + NA row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NA NA NA 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s num [1:4] 1 NA 3 4 510s max: 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s num [1:4] 9 NA 11 12 510s range: 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 510s real + NaN row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NaN NaN NaN 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s max: 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s range: 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s real + NaN row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NaN NaN NaN 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s max: 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s range: 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s real + Inf cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 Inf 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s real + Inf cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 Inf 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s real + Inf row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] Inf Inf Inf 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + Inf row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] Inf Inf Inf 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + NaN cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NaN 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s max: 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s range: 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s real + NaN cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NaN 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s num [1:4] 1 NaN 3 4 510s max: 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s num [1:4] 9 NaN 11 12 510s range: 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 510s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NaN NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s max: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s range: 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NaN NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s max: 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s num [1:4] NA NA NA NA 510s range: 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s num [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real w/ NA + NaN row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NaN NaN NaN 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s max: 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s range: 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s real w/ NA + NaN row (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NaN NaN NaN 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s max: 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s num [1:4] NA NaN NA NA 510s range: 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 510s integer (integer) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer (integer) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer w/ NA (integer) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s integer w/ NA (integer) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real w/ NA (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real w/ NA (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real + NA cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NA 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real + NA cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NA 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real + NA row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NA NA NA 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + NA row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NA NA NA 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + NaN row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NaN NaN NaN 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + NaN row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] NaN NaN NaN 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s num [1:4] 9 -Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + Inf cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 Inf 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s real + Inf cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 Inf 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s num [1:4, 1:2] 1 2 3 4 9 ... 510s real + Inf row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] Inf Inf Inf 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + Inf row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] Inf Inf Inf 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s num [1:4] 1 Inf 3 4 510s max: 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s num [1:4] 9 Inf 11 12 510s range: 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s num [1:4, 1:2] 1 Inf 3 4 9 ... 510s real + NaN cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NaN 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real + NaN cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 NaN 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NaN NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NaN NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real w/ NA + NaN row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NaN NaN NaN 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s real w/ NA + NaN row (double) w/ na.rm = TRUE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NaN NaN NaN 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s num [1:4] Inf Inf Inf Inf 510s max: 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s num [1:4] -Inf -Inf -Inf -Inf 510s range: 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 510s integer (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s int [1:4] 1 2 3 4 510s max: 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s int [1:4] 9 10 11 12 510s range: 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s int [1:4, 1:2] 1 2 3 4 9 10 11 12 510s integer w/ NA (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s max: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s range: 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s integer w/ NA (integer) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] NA NA NA 510s [2,] NA NA NA 510s [3,] NA NA NA 510s [4,] NA NA NA 510s min: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s max: 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s int [1:4] NA NA NA NA 510s range: 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s int [1:4, 1:2] NA NA NA NA NA NA NA NA 510s real (double) w/ na.rm = FALSE: 510s [,1] [,2] [,3] 510s [1,] 1 5 9 510s [2,] 2 6 10 510s [3,] 3 7 11 510s [4,] 4 8 12 510s min: 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s num [1:4] 1 2 3 4 510s max: 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s num [1:4] 9 10 11 12 510s range: 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 510s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 6 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real w/ NA (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s max: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s range: 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s real w/ NA (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s max: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s range: 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s real + NA cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NA 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s max: 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s range: 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s real + NA cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NA 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s max: 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s range: 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s real + NA row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NA NA NA 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s max: 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s range: 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s real + NA row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NA NA NA 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s num [1:4] 1 NA 3 4 511s max: 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s num [1:4] 9 NA 11 12 511s range: 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 511s real + NaN row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NaN NaN NaN 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s max: 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s range: 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s real + NaN row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NaN NaN NaN 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s max: 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s range: 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s real + Inf cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 Inf 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s real + Inf cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 Inf 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s real + Inf row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] Inf Inf Inf 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + Inf row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] Inf Inf Inf 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + NaN cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NaN 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s max: 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s range: 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s real + NaN cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NaN 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s num [1:4] 1 NaN 3 4 511s max: 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s num [1:4] 9 NaN 11 12 511s range: 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 511s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NaN NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s max: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s range: 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NaN NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s max: 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s num [1:4] NA NA NA NA 511s range: 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s num [1:4, 1:2] NA NA NA NA NA NA NA NA 511s real w/ NA + NaN row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NaN NaN NaN 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s max: 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s range: 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s real w/ NA + NaN row (double) w/ na.rm = FALSE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NaN NaN NaN 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s max: 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s num [1:4] NA NaN NA NA 511s range: 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 511s integer (integer) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 6 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s int [1:4] 1 2 3 4 511s int [1:4] 1 2 3 4 511s int [1:4] 1 2 3 4 511s max: 511s int [1:4] 9 10 11 12 511s int [1:4] 9 10 11 12 511s int [1:4] 9 10 11 12 511s range: 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s integer (integer) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 6 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s int [1:4] 1 2 3 4 511s int [1:4] 1 2 3 4 511s int [1:4] 1 2 3 4 511s max: 511s int [1:4] 9 10 11 12 511s int [1:4] 9 10 11 12 511s int [1:4] 9 10 11 12 511s range: 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s int [1:4, 1:2] 1 2 3 4 9 10 11 12 511s integer w/ NA (integer) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s integer w/ NA (integer) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 6 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 6 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real w/ NA (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real w/ NA (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NA NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real + NA cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NA 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real + NA cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NA 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real + NA row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NA NA NA 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + NA row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NA NA NA 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + NaN row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NaN NaN NaN 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + NaN row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] NaN NaN NaN 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s num [1:4] 9 -Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + Inf cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 Inf 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s real + Inf cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 Inf 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s num [1:4, 1:2] 1 2 3 4 9 ... 511s real + Inf row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] Inf Inf Inf 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + Inf row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] Inf Inf Inf 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s num [1:4] 1 Inf 3 4 511s max: 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s num [1:4] 9 Inf 11 12 511s range: 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s num [1:4, 1:2] 1 Inf 3 4 9 ... 511s real + NaN cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NaN 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real + NaN cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] 1 5 9 511s [2,] 2 NaN 10 511s [3,] 3 7 11 511s [4,] 4 8 12 511s min: 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s num [1:4] 1 2 3 4 511s max: 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s num [1:4] 9 10 11 12 511s range: 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s num [1:4, 1:2] 1 2 3 4 9 10 11 12 511s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NaN NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NA NaN NA 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real w/ NA + NaN row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NaN NaN NaN 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s real w/ NA + NaN row (double) w/ na.rm = TRUE: 511s [,1] [,2] [,3] 511s [1,] NA NA NA 511s [2,] NaN NaN NaN 511s [3,] NA NA NA 511s [4,] NA NA NA 511s min: 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s num [1:4] Inf Inf Inf Inf 511s max: 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s num [1:4] -Inf -Inf -Inf -Inf 511s range: 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 511s > 511s 511s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 511s Copyright (C) 2024 The R Foundation for Statistical Computing 511s Platform: arm-unknown-linux-gnueabihf (32-bit) 511s 511s R is free software and comes with ABSOLUTELY NO WARRANTY. 511s You are welcome to redistribute it under certain conditions. 511s Type 'license()' or 'licence()' for distribution details. 511s 511s R is a collaborative project with many contributors. 511s Type 'contributors()' for more information and 511s 'citation()' on how to cite R or R packages in publications. 511s 511s Type 'demo()' for some demos, 'help()' for on-line help, or 511s 'help.start()' for an HTML browser interface to help. 511s Type 'q()' to quit R. 511s 512s > library("matrixStats") 512s > 512s > rowMins_R <- function(x, ..., useNames = NA) { 512s + suppressWarnings({ 512s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 512s + }) 512s + if (is.na(useNames) || !useNames) names(res) <- NULL 512s + res 512s + } # rowMins_R() 512s > 512s > rowMaxs_R <- function(x, ..., useNames = NA) { 512s + suppressWarnings({ 512s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 512s + }) 512s + if (is.na(useNames) || !useNames) names(res) <- NULL 512s + res 512s + } # rowMaxs_R() 512s > 512s > rowRanges_R <- function(x, ..., useNames = NA) { 512s + suppressWarnings({ 512s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 512s + }) 512s + 512s + # Preserve rownames attribute 512s + dim <- c(dim(x)[1], 2L) 512s + if (!isTRUE(all.equal(dim(ans), dim))) { 512s + dim(ans) <- dim 512s + rownames <- rownames(x) 512s + if (!is.null(dimnames)) rownames(ans) <- rownames 512s + } 512s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 512s + ans 512s + } # rowRanges_R() 512s > 512s > 512s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 512s > # Subsetted tests 512s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 512s > source("utils/validateIndicesFramework.R") 512s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 512s > storage.mode(x) <- "integer" 512s > 512s > # To check rownames/names attributes 512s > dimnames <- list(letters[1:6], LETTERS[1:6]) 512s > 512s > # Test with and without dimnames on x 512s > for (setDimnames in c(TRUE, FALSE)) { 512s + if (setDimnames) dimnames(x) <- dimnames 512s + else dimnames(x) <- NULL 512s + 512s + count <- 0L 512s + for (rows in index_cases) { 512s + for (cols in index_cases) { 512s + count <- count + 1L 512s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 512s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 512s + useNames <- useNames[count %% length(useNames) + 1] 512s + 512s + validateIndicesTestMatrix(x, rows, cols, 512s + ftest = rowRanges, fsure = rowRanges_R, 512s + na.rm = na.rm, useNames = useNames) 512s + validateIndicesTestMatrix(x, rows, cols, 512s + ftest = rowMins, fsure = rowMins_R, 512s + na.rm = na.rm, useNames = useNames) 512s + validateIndicesTestMatrix(x, rows, cols, 512s + ftest = rowMaxs, fsure = rowMaxs_R, 512s + na.rm = na.rm, useNames = useNames) 512s + 512s + validateIndicesTestMatrix(x, rows, cols, 512s + fcoltest = colRanges, fsure = rowRanges_R, 512s + na.rm = na.rm, useNames = useNames) 512s + validateIndicesTestMatrix(x, rows, cols, 512s + fcoltest = colMins, fsure = rowMins_R, 512s + na.rm = na.rm, useNames = useNames) 512s + validateIndicesTestMatrix(x, rows, cols, 512s + fcoltest = colMaxs, fsure = rowMaxs_R, 512s + na.rm = na.rm, useNames = useNames) 512s + } 512s + } 512s + } 516s > 516s 516s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 516s Copyright (C) 2024 The R Foundation for Statistical Computing 516s Platform: arm-unknown-linux-gnueabihf (32-bit) 516s 516s R is free software and comes with ABSOLUTELY NO WARRANTY. 516s You are welcome to redistribute it under certain conditions. 516s Type 'license()' or 'licence()' for distribution details. 516s 516s R is a collaborative project with many contributors. 516s Type 'contributors()' for more information and 516s 'citation()' on how to cite R or R packages in publications. 516s 516s Type 'demo()' for some demos, 'help()' for on-line help, or 516s 'help.start()' for an HTML browser interface to help. 516s Type 'q()' to quit R. 516s 516s > library("matrixStats") 516s > 516s > dense_rank <- function(x) match(x, table = sort(unique(x))) 516s > 516s > rowRanks_R <- function(x, ties.method, ..., useNames = NA) { 516s + if (ties.method == "dense") { 516s + res <- t(apply(x, MARGIN = 1L, FUN = dense_rank)) 516s + } else { 516s + res <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", ties.method = ties.method)) 516s + } 516s + 516s + # Preserve dimnames attribute? 516s + dim(res) <- dim(x) 516s + dimnames(res) <- if (isTRUE(useNames)) dimnames(x) else NULL 516s + 516s + res 516s + } 516s > 516s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 516s + if (ties.method == "dense") { 516s + res <- t(apply(x, MARGIN = 2L, FUN = dense_rank)) 516s + } else { 516s + res <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 516s + } 516s + 516s + # Preserve dimnames attribute? 516s + tx <- t(x) 516s + dim(res) <- dim(tx) 516s + dimnames(res) <- if (isTRUE(useNames)) dimnames(tx) else NULL 516s + 516s + if (preserveShape) res <- t(res) 516s + res 516s + } 516s > 516s > set.seed(1) 516s > 516s > cat("Consistency checks:\n") 516s Consistency checks: 516s > xs <- vector("list", length = 4L) 516s > for (kk in 1:4) { 516s + 516s + # Simulate data in a matrix of any shape 516s + dim <- sample(40:80, size = 2L) 516s + n <- prod(dim) 516s + x <- rnorm(n, sd = 10) 516s + dim(x) <- dim 516s + 516s + # Add NAs? 516s + if ((kk %% 4) %in% c(3, 0)) { 516s + cat("Adding NAs\n") 516s + nna <- sample(n, size = 1L) 516s + x[sample(length(x), size = nna)] <- NA_real_ 516s + } 516s + 516s + # Integer or double? 516s + if ((kk %% 4) %in% c(2, 0)) { 516s + cat("Coercing to integers\n") 516s + storage.mode(x) <- "integer" 516s + } 516s + 516s + xs[[kk]] <- x 516s + } # for (kk ...) 517s Coercing to integers 517s Adding NAs 517s Adding NAs 517s Coercing to integers 517s > str(xs) 517s List of 4 517s $ : num [1:43, 1:78] 13.3 12.72 4.15 -15.4 -9.29 ... 517s $ : int [1:46, 1:61] 2 11 -16 -5 19 5 26 -13 1 -9 ... 517s $ : num [1:42, 1:47] NA -22.3 NA NA NA ... 517s $ : int [1:42, 1:78] NA NA NA NA NA NA NA NA NA NA ... 517s > 517s > for (kk in 1:4) { 517s + cat("Random test #", kk, "\n", sep = "") 517s + x <- xs[[kk]] 517s + tx <- t(x) 517s + 517s + for (ties in c("max", "min", "average", "first", "last", "dense")) { 517s + cat(sprintf("ties.method = %s\n", ties)) 517s + # rowRanks(): 517s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 517s + if (ties != "last" || getRversion() >= "3.3.0") { 517s + y2 <- rowRanks_R(x, ties.method = ties) 517s + stopifnot(identical(y1, y2)) 517s + } 517s + 517s + y3 <- matrixStats::colRanks(tx, ties.method = ties) 517s + stopifnot(identical(y1, y3)) 517s + 517s + # colRanks(): 517s + y1 <- matrixStats::colRanks(x, ties.method = ties) 517s + if (ties != "last" || getRversion() >= "3.3.0") { 517s + y2 <- colRanks_R(x, ties.method = ties) 517s + stopifnot(identical(y1, y2)) 517s + } 517s + 517s + y3 <- matrixStats::rowRanks(tx, ties.method = ties) 517s + stopifnot(identical(y1, y3)) 517s + } 517s + } # for (kk ...) 517s Random test #1 517s ties.method = max 517s ties.method = min 517s ties.method = average 517s ties.method = first 517s ties.method = last 517s ties.method = dense 517s Random test #2 517s ties.method = max 517s ties.method = min 517s ties.method = average 517s ties.method = first 517s ties.method = last 517s ties.method = dense 517s Random test #3 517s ties.method = max 517s ties.method = min 517s ties.method = average 517s ties.method = first 517s ties.method = last 517s ties.method = dense 517s Random test #4 517s ties.method = max 517s ties.method = min 517s ties.method = average 517s ties.method = first 517s ties.method = last 517s ties.method = dense 517s > 517s > # Note, below we know ties.method %in% c("min", "max", "average") is correct 517s > 517s > cat("Consistency checks for random:\n") 517s Consistency checks for random: 517s > tolerance <- 0.1 517s > nsamples <- 10000 517s > for (kk in 1:4) { 517s + cat("Random test #", kk, "\n", sep = "") 517s + x <- xs[[kk]] 517s + tx <- t(x) 517s + 517s + for (ties in c("random")) { 517s + cat(sprintf("ties.method = %s\n", ties)) 517s + 517s + ## rowRanks(): 517s + y0 <- rowRanks_R(x, ties.method = ties) 517s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 517s + 517s + ## Assert symmetric rank differences 517s + d <- y1 - y0 517s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 517s + 517s + ## Assert within [min, max] 517s + y2min <- matrixStats::rowRanks(x, ties.method = "min") 517s + y2max <- matrixStats::rowRanks(x, ties.method = "max") 517s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 517s + ## Assert near average 517s + y1list <- replicate(nsamples, matrixStats::rowRanks(x, ties.method = ties), simplify = FALSE) 517s + y1mean <- Reduce(`+`, y1list) / nsamples 517s + y2avg <- matrixStats::rowRanks(x, ties.method = "average") 517s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 517s + 517s + ## colRanks(): 517s + y0 <- colRanks_R(x, ties.method = ties) 517s + y1 <- matrixStats::colRanks(x, ties.method = ties) 517s + 517s + ## Assert symmetric rank differences 517s + d <- y1 - y0 517s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 517s + 517s + ## Assert within [min, max] 517s + y2min <- matrixStats::colRanks(x, ties.method = "min") 517s + y2max <- matrixStats::colRanks(x, ties.method = "max") 517s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 517s + y1list <- replicate(nsamples, matrixStats::colRanks(x, ties.method = ties), simplify = FALSE) 517s + y1mean <- Reduce(`+`, y1list) / nsamples 517s + ## Assert near average 517s + y2avg <- matrixStats::colRanks(x, ties.method = "average") 517s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 517s + } 517s + } # for (kk ...) 517s Random test #1 517s ties.method = random 525s Random test #2 525s ties.method = random 530s Random test #3 530s ties.method = random 533s Random test #4 533s ties.method = random 535s > 535s > 535s > ## Exception handling 535s > x <- matrix(1:12, nrow = 3L, ncol = 4L) 535s > y <- try(rowRanks(x, ties.method = "unknown"), silent = TRUE) 535s > stopifnot(inherits(y, "try-error")) 535s > 535s > y <- try(colRanks(x, ties.method = "unknown"), silent = TRUE) 535s > stopifnot(inherits(y, "try-error")) 535s > 535s > dimnames <- list(letters[1:3], LETTERS[1:4]) 535s > for (mode in c("integer", "double")){ 535s + storage.mode(x) <- mode 535s + # Test with and without dimnames on x 535s + for (setDimnames in c(TRUE, FALSE)) { 535s + if (setDimnames) dimnames(x) <- dimnames 535s + else dimnames(x) <- NULL 535s + # Check names attribute 535s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 535s + for (ties in c("max", "min", "average", "first", "last", "dense", "random")) { 535s + cat(sprintf("ties.method = %s\n", ties)) 535s + # rowRanks(): 535s + y1 <- matrixStats::rowRanks(x, ties.method = ties, useNames = useNames) 535s + if (ties != "last" || getRversion() >= "3.3.0") { 535s + y2 <- rowRanks_R(x, ties.method = ties, useNames = useNames) 535s + stopifnot(identical(y1, y2)) 535s + } 535s + 535s + y3 <- matrixStats::colRanks(t(x), ties.method = ties, useNames = useNames) 535s + stopifnot(identical(y1, y3)) 535s + 535s + # colRanks(): 535s + y1 <- matrixStats::colRanks(x, ties.method = ties, useNames = useNames) 535s + if (ties != "last" || getRversion() >= "3.3.0") { 535s + y2 <- colRanks_R(x, ties.method = ties, useNames = useNames) 535s + stopifnot(identical(y1, y2)) 535s + } 535s + 535s + y3 <- matrixStats::rowRanks(t(x), ties.method = ties, useNames = useNames) 535s + stopifnot(identical(y1, y3)) 535s + 535s + # Check preserveShape 535s + y1 <- matrixStats::colRanks(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 535s + if (ties != "last" || getRversion() >= "3.3.0") { 535s + y2 <- colRanks_R(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 535s + stopifnot(identical(y1, y2)) 535s + } 535s + } 535s + } 535s + } 535s + } 535s ties.method = max 535s ties.method = min 535s ties.method = average 535s ties.method = first 535s ties.method = last 535s ties.method = dense 535s ties.method = random 535s ties.method = max 535s ties.method = min 535s ties.method = average 535s ties.method = first 535s ties.method = last 535s ties.method = dense 535s ties.method = random 535s ties.method = max 535s ties.method = min 535s ties.method = average 535s ties.method = first 535s ties.method = last 535s ties.method = dense 535s ties.method = random 536s ties.method = max 536s ties.method = min 536s ties.method = average 536s ties.method = first 536s ties.method = last 536s ties.method = dense 536s ties.method = random 536s ties.method = max 536s ties.method = min 536s ties.method = average 536s ties.method = first 536s ties.method = last 536s ties.method = dense 536s ties.method = random 536s ties.method = max 536s ties.method = min 536s ties.method = average 536s ties.method = first 536s ties.method = last 536s ties.method = dense 536s ties.method = random 536s ties.method = max 536s ties.method = min 536s ties.method = average 536s ties.method = first 536s ties.method = last 536s ties.method = dense 536s ties.method = random 536s ties.method = max 536s ties.method = min 536s ties.method = average 536s ties.method = first 536s ties.method = last 536s ties.method = dense 536s ties.method = random 536s > 536s 536s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 536s Copyright (C) 2024 The R Foundation for Statistical Computing 536s Platform: arm-unknown-linux-gnueabihf (32-bit) 536s 536s R is free software and comes with ABSOLUTELY NO WARRANTY. 536s You are welcome to redistribute it under certain conditions. 536s Type 'license()' or 'licence()' for distribution details. 536s 536s R is a collaborative project with many contributors. 536s Type 'contributors()' for more information and 536s 'citation()' on how to cite R or R packages in publications. 536s 536s Type 'demo()' for some demos, 'help()' for on-line help, or 536s 'help.start()' for an HTML browser interface to help. 536s Type 'q()' to quit R. 536s 536s > library("matrixStats") 536s > 536s > rowRanks_R <- function(x, ties.method = "average", ..., useNames = NA) { 536s + ans <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", 536s + ties.method = ties.method)) 536s + 536s + # Preserve dimnames attribute? 536s + dim(ans) <- dim(x) 536s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(x) else NULL 536s + 536s + ans 536s + } 536s > 536s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 536s + ans <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 536s + 536s + # Preserve dimnames attribute? 536s + tx <- t(x) 536s + dim(ans) <- dim(tx) 536s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(tx) else NULL 536s + 536s + if (preserveShape) ans <- t(ans) 536s + ans 536s + } 536s > 536s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 536s > # Subsetted tests 536s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 536s > source("utils/validateIndicesFramework.R") 536s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 536s > storage.mode(x) <- "integer" 536s > 536s > # To check dimnames attribute 536s > dimnames <- list(letters[1:6], LETTERS[1:6]) 536s > 536s > colRanks_R_t <- function(x, rows, cols, ..., useNames = NA) { 536s + t(colRanks(t(x), rows = cols, cols = rows, preserveShape = TRUE, ..., useNames = useNames)) 536s + } 536s > 536s > # Test with and without dimnames on x 536s > for (setDimnames in c(TRUE, FALSE)) { 536s + if (setDimnames) dimnames(x) <- dimnames 536s + else dimnames(x) <- NULL 536s + 536s + count <- 0L 536s + for (rows in index_cases) { 536s + for (cols in index_cases) { 536s + count <- count + 1L 536s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 536s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 536s + useNames <- useNames[count %% length(useNames) + 1] 536s + 536s + validateIndicesTestMatrix(x, rows, cols, 536s + ftest = rowRanks, fsure = rowRanks_R, 536s + ties.method = "average", useNames = useNames) 536s + 536s + validateIndicesTestMatrix(x, rows, cols, 536s + ftest = colRanks_R_t, fsure = rowRanks_R, 536s + ties.method = "average", useNames = useNames) 536s + 536s + for (perserveShape in c(TRUE, FALSE)) { 536s + validateIndicesTestMatrix(x, rows, cols, 536s + ftest = colRanks, fsure = colRanks_R, 536s + ties.method = "average", perserveShape = perserveShape, 536s + useNames = useNames) 536s + } 536s + } 536s + } 536s + } 540s > 540s 540s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 540s Copyright (C) 2024 The R Foundation for Statistical Computing 540s Platform: arm-unknown-linux-gnueabihf (32-bit) 540s 540s R is free software and comes with ABSOLUTELY NO WARRANTY. 540s You are welcome to redistribute it under certain conditions. 540s Type 'license()' or 'licence()' for distribution details. 540s 540s R is a collaborative project with many contributors. 540s Type 'contributors()' for more information and 540s 'citation()' on how to cite R or R packages in publications. 540s 540s Type 'demo()' for some demos, 'help()' for on-line help, or 540s 'help.start()' for an HTML browser interface to help. 540s Type 'q()' to quit R. 540s 541s > library("matrixStats") 541s > 541s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 541s > options(matrixStats.center.onUse = "ignore") 541s > 541s > ## Create isFALSE() if running on an old version of R 541s > if (!exists("isFALSE", mode="function")) { 541s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 541s + } 541s > 541s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 541s + suppressWarnings({ 541s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 541s + }) 541s + stopifnot(!any(is.infinite(sigma))) 541s + 541s + # Keep naming support consistency same as rowSds() 541s + if (is.null(center) || ncol(x) <= 1L) { 541s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 541s + } 541s + else if (isFALSE(useNames)) names(sigma) <- NULL 541s + sigma 541s + } 541s > 541s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 541s + suppressWarnings({ 541s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 541s + }) 541s + stopifnot(!any(is.infinite(sigma))) 541s + 541s + # Keep naming support consistency same as colSds() 541s + if (is.null(center) || nrow(x) <= 1L) { 541s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 541s + } 541s + if (isFALSE(useNames)) names(sigma) <- NULL 541s + sigma 541s + } 541s > 541s > 541s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 541s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 541s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 541s + stopifnot(!any(is.infinite(sigma))) 541s + sigma 541s + } 541s > 541s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 541s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 541s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 541s + stopifnot(!any(is.infinite(sigma))) 541s + sigma 541s + } 541s > 541s > 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > # With and without some NAs 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > for (mode in c("integer", "double")) { 541s + for (add_na in c(FALSE, TRUE)) { 541s + cat("add_na = ", add_na, "\n", sep = "") 541s + 541s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 541s + if (add_na) { 541s + x[3:7, c(2, 4)] <- NA_real_ 541s + } 541s + cat("mode: ", mode, "\n", sep = "") 541s + storage.mode(x) <- mode 541s + str(x) 541s + 541s + # To check names attribute 541s + dimnames <- list(letters[1:10], LETTERS[1:5]) 541s + 541s + # Test with and without dimnames on x 541s + for (setDimnames in c(TRUE, FALSE)) { 541s + if (setDimnames) dimnames(x) <- dimnames 541s + else dimnames(x) <- NULL 541s + # Row/column ranges 541s + for (na.rm in c(FALSE, TRUE)) { 541s + # Check names attribute 541s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 541s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 541s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 541s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 541s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 541s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 541s + stopifnot(all.equal(r1, r2)) 541s + stopifnot(all.equal(r1, r0)) 541s + stopifnot(all.equal(r2, r0)) 541s + stopifnot(all.equal(r1b, r2b)) 541s + stopifnot( 541s + !any(is.infinite(r1)), 541s + !any(is.infinite(r2)), 541s + !any(is.infinite(r1b)), 541s + !any(is.infinite(r2b)) 541s + ) 541s + } 541s + } 541s + } 541s + } # for (add_na ...) 541s + } 541s add_na = FALSE 541s mode: integer 541s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 541s add_na = TRUE 541s mode: integer 541s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 541s add_na = FALSE 541s mode: double 541s 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 ... 541s add_na = TRUE 541s mode: double 541s 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 ... 541s > 541s > 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > # All NAs 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > for (mode in c("integer", "double")) { 541s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 541s + cat("mode: ", mode, "\n", sep = "") 541s + storage.mode(x) <- mode 541s + str(x) 541s + 541s + # Test with and without dimnames on x 541s + for (setDimnames in c(TRUE, FALSE)) { 541s + if (setDimnames) dimnames(x) <- dimnames 541s + else dimnames(x) <- NULL 541s + # Row/column ranges 541s + for (na.rm in c(FALSE, TRUE)) { 541s + # Check names attribute 541s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 541s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 541s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 541s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 541s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 541s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 541s + stopifnot(all.equal(r1, r2)) 541s + stopifnot(all.equal(r1, r0)) 541s + stopifnot(all.equal(r2, r0)) 541s + stopifnot(all.equal(r1b, r2b)) 541s + stopifnot( 541s + !any(is.infinite(r1)), 541s + !any(is.infinite(r2)), 541s + !any(is.infinite(r1b)), 541s + !any(is.infinite(r2b)) 541s + ) 541s + } 541s + } 541s + } 541s + } 541s mode: integer 541s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 541s mode: double 541s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 541s > 541s > 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > # A 1x1 matrix 541s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 541s > x <- matrix(0, nrow = 1L, ncol = 1L) 541s > dimnames <- list("a", "A") 541s > for (na.rm in c(FALSE, TRUE)) { 541s + cat("na.rm = ", na.rm, "\n", sep = "") 541s + 541s + # Test with and without dimnames on x 541s + for (setDimnames in c(TRUE, FALSE)) { 541s + if (setDimnames) dimnames(x) <- dimnames 541s + else dimnames(x) <- NULL 541s + # Row/column ranges 541s + for (na.rm in c(FALSE, TRUE)) { 541s + # Check names attribute 541s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 541s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 541s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 541s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 541s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 541s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 541s + stopifnot(all.equal(r1, r2)) 541s + stopifnot(all.equal(r1, r0)) 541s + stopifnot(all.equal(r2, r0)) 541s + stopifnot(all.equal(r1b, r2b)) 541s + stopifnot( 541s + !any(is.infinite(r1)), 541s + !any(is.infinite(r2)), 541s + !any(is.infinite(r1b)), 541s + !any(is.infinite(r2b)) 541s + ) 541s + } 541s + } 541s + } 541s + } 541s na.rm = FALSE 541s na.rm = TRUE 541s > 541s 541s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 541s Copyright (C) 2024 The R Foundation for Statistical Computing 541s Platform: arm-unknown-linux-gnueabihf (32-bit) 541s 541s R is free software and comes with ABSOLUTELY NO WARRANTY. 541s You are welcome to redistribute it under certain conditions. 541s Type 'license()' or 'licence()' for distribution details. 541s 541s R is a collaborative project with many contributors. 541s Type 'contributors()' for more information and 541s 'citation()' on how to cite R or R packages in publications. 541s 541s Type 'demo()' for some demos, 'help()' for on-line help, or 541s 'help.start()' for an HTML browser interface to help. 541s Type 'q()' to quit R. 541s 541s > library("matrixStats") 542s > 542s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 542s > options(matrixStats.center.onUse = "ignore") 542s > 542s > ## Create isFALSE() if running on an old version of R 542s > if (!exists("isFALSE", mode="function")) { 542s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 542s + } 542s > 542s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 542s + suppressWarnings({ 542s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 542s + }) 542s + stopifnot(!any(is.infinite(sigma))) 542s + 542s + # Keep naming support consistency same as rowSds() 542s + if (is.null(center) || ncol(x) <= 1L) { 542s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 542s + } 542s + else if (isFALSE(useNames)) names(sigma) <- NULL 542s + sigma 542s + } 542s > 542s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 542s + suppressWarnings({ 542s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 542s + }) 542s + stopifnot(!any(is.infinite(sigma))) 542s + 542s + # Keep naming support consistency same as colSds() 542s + if (is.null(center) || nrow(x) <= 1L) { 542s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 542s + } 542s + else if (isFALSE(useNames)) names(sigma) <- NULL 542s + sigma 542s + } 542s > 542s > 542s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 542s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 542s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 542s + stopifnot(!any(is.infinite(sigma))) 542s + sigma 542s + } 542s > 542s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 542s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 542s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 542s + stopifnot(!any(is.infinite(sigma))) 542s + sigma 542s + } 542s > 542s > 542s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 542s > # Subsetted tests 542s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 542s > source("utils/validateIndicesFramework.R") 542s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 542s > storage.mode(x) <- "integer" 542s > 542s > # To check names attribute 542s > dimnames <- list(letters[1:6], LETTERS[1:6]) 542s > 542s > # Test with and without dimnames on x 542s > for (setDimnames in c(TRUE, FALSE)) { 542s + if (setDimnames) dimnames(x) <- dimnames 542s + else dimnames(x) <- NULL 542s + 542s + count <- 0L 542s + for (rows in index_cases) { 542s + for (cols in index_cases) { 542s + count <- count + 1L 542s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 542s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 542s + useNames <- useNames[count %% length(useNames) + 1] 542s + 542s + validateIndicesTestMatrix(x, rows, cols, 542s + ftest = rowSds, fsure = rowSds_R, 542s + na.rm = na.rm, useNames = useNames) 542s + validateIndicesTestMatrix(x, rows, cols, 542s + ftest = rowSds_center, fsure = rowSds_R, 542s + na.rm = na.rm, center = TRUE, useNames = useNames) 542s + 542s + validateIndicesTestMatrix(x, rows, cols, 542s + fcoltest = colSds, fsure = rowSds_R, 542s + na.rm = na.rm, useNames = useNames) 542s + validateIndicesTestMatrix(x, rows, cols, 542s + fcoltest = colSds_center, fsure = rowSds_R, 542s + na.rm = na.rm, center = TRUE, useNames = useNames) 542s + } 542s + } 542s + } 544s > 544s 544s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 544s Copyright (C) 2024 The R Foundation for Statistical Computing 544s Platform: arm-unknown-linux-gnueabihf (32-bit) 544s 544s R is free software and comes with ABSOLUTELY NO WARRANTY. 544s You are welcome to redistribute it under certain conditions. 544s Type 'license()' or 'licence()' for distribution details. 544s 544s R is a collaborative project with many contributors. 544s Type 'contributors()' for more information and 544s 'citation()' on how to cite R or R packages in publications. 544s 544s Type 'demo()' for some demos, 'help()' for on-line help, or 544s 'help.start()' for an HTML browser interface to help. 544s Type 'q()' to quit R. 544s 545s > library("matrixStats") 545s > 545s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 545s + ## FIXME: sum() may overflow for integers, whereas 545s + ## base::rowSums() doesn't. What should rowSums2() do? 545s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 545s + res <- rowSums(x, na.rm = na.rm) 545s + if (is.na(useNames) || !useNames) names(res) <- NULL 545s + res 545s + } 545s > 545s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 545s + ## FIXME: sum() may overflow for integers, whereas 545s + ## base::colSums() doesn't. What should colSums2() do? 545s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 545s + res <- colSums(x, na.rm = na.rm) 545s + if (is.na(useNames) || !useNames) names(res) <- NULL 545s + res 545s + } 545s > 545s > for (mode in c("integer", "logical", "double")) { 545s + x <- matrix(-4:4, nrow = 3, ncol = 3) 545s + storage.mode(x) <- mode 545s + if (mode == "double") x <- x + 0.1 545s + 545s + # To check names attribute 545s + dimnames <- list(letters[1:3], LETTERS[1:3]) 545s + 545s + # Test with and without dimnames on x 545s + for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s + } 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: Single-element matrix 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: Single-element matrix:\n") 545s Special case: Single-element matrix: 545s > for (mode in c("integer", "logical", "double")) { 545s + x <- matrix(1, nrow = 1, ncol = 1) 545s + storage.mode(x) <- mode 545s + 545s + # To check names attribute 545s + dimnames <- list("a", "A") 545s + 545s + # Test with and without dimnames on x 545s + for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: Empty matrix 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: Empty matrix:\n") 545s Special case: Empty matrix: 545s > for (mode in c("integer", "logical", "double")) { 545s + x <- matrix(integer(0), nrow = 0, ncol = 0) 545s + storage.mode(x) <- mode 545s + 545s + y0 <- rowSums2_R(x, na.rm = FALSE) 545s + y1 <- rowSums2(x, na.rm = FALSE) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE) 545s + y1 <- colSums2(x, na.rm = FALSE) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: All NAs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: All NAs:\n") 545s Special case: All NAs: 545s > for (mode in c("integer", "logical", "double")) { 545s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 545s + storage.mode(x) <- mode 545s + 545s + # To check names attribute 545s + dimnames <- list(letters[1:3], LETTERS[1:3]) 545s + 545s + # Test with and without dimnames on x 545s + for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: All NaNs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: All NaNs:\n") 545s Special case: All NaNs: 545s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 545s > 545s > # Test with and without dimnames on x 545s > for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: All Infs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: All Infs:\n") 545s Special case: All Infs: 545s > x <- matrix(Inf, nrow = 3, ncol = 3) 545s > 545s > # Test with and without dimnames on x 545s > for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: All -Infs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: All -Infs:\n") 545s Special case: All -Infs: 545s > x <- matrix(-Inf, nrow = 3, ncol = 3) 545s > 545s > # Test with and without dimnames on x 545s > for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: Infs and -Infs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: Infs and -Infs:\n") 545s Special case: Infs and -Infs: 545s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 545s > 545s > # To check names attribute 545s > dimnames <- list(letters[1:4], LETTERS[1:4]) 545s > 545s > # Test with and without dimnames on x 545s > for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: NaNs and NAs 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: Infs and -Infs:\n") 545s Special case: Infs and -Infs: 545s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 545s > 545s > y0 <- rowSums(x, na.rm = FALSE) 545s > str(y0) 545s num [1:4] NaN NA NaN NA 545s > stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 545s > y1 <- rowSums2(x, na.rm = FALSE) 545s > str(y0) 545s num [1:4] NaN NA NaN NA 545s > stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 545s > stopifnot(all.equal(y1, y0)) 545s > 545s > y0 <- colSums(x, na.rm = FALSE) 545s > stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 545s > y1 <- colSums2(x, na.rm = FALSE) 545s > stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 545s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 545s > ## returned here (as one would expect). NaN might very well be returned, 545s > ## when both NA and NaN are involved. This is an accepted feature in R, 545s > ## which is documented in help("is.nan"). See also 545s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 545s > ## Thus, we cannot guarantee that y1 is identical to y0. 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Special case: Integer overflow with ties 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > cat("Special case: Integer overflow with ties:\n") 545s Special case: Integer overflow with ties: 545s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 545s > 545s > # Test with and without dimnames on x 545s > for (setDimnames in c(TRUE, FALSE)) { 545s + if (setDimnames) dimnames(x) <- dimnames 545s + else dimnames(x) <- NULL 545s + # Check names attribute 545s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 545s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + 545s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 545s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 545s + stopifnot(all.equal(y1, y0)) 545s + } 545s + } 545s > 545s > 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > # Consistency checks 545s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 545s > set.seed(1) 545s > 545s > cat("Consistency checks:\n") 545s Consistency checks: 545s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 545s > for (kk in seq_len(n_sims)) { 545s + cat("Random test #", kk, "\n", sep = "") 545s + 545s + # Simulate data in a matrix of any shape 545s + dim <- sample(50:200, size = 2) 545s + n <- prod(dim) 545s + x <- rnorm(n, sd = 100) 545s + dim(x) <- dim 545s + 545s + # Add NAs? 545s + if ((kk %% 4) %in% c(3, 0)) { 545s + cat("Adding NAs\n") 545s + nna <- sample(n, size = 1) 545s + na_values <- c(NA_real_, NaN) 545s + t <- sample(na_values, size = nna, replace = TRUE) 545s + x[sample(length(x), size = nna)] <- t 545s + } 545s + 545s + # Mode? 545s + modes <- "double" 545s + if ((kk %% 4) %in% c(2, 0)) { 545s + modes <- c("integer", "logical") 545s + } 545s + 545s + for (mode in modes) { 545s + if (mode != "double") { 545s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 545s + storage.mode(x) <- mode 545s + } 545s + 545s + na.rm <- sample(c(TRUE, FALSE), size = 1) 545s + 545s + # rowSums2(): 545s + y0 <- rowSums2_R(x, na.rm = na.rm) 545s + y1 <- rowSums2(x, na.rm = na.rm) 545s + stopifnot(all.equal(y1, y0)) 545s + y2 <- colSums2(t(x), na.rm = na.rm) 545s + stopifnot(all.equal(y2, y0)) 545s + 545s + # colSums2(): 545s + y0 <- colSums2_R(x, na.rm = na.rm) 545s + y1 <- colSums2(x, na.rm = na.rm) 545s + stopifnot(all.equal(y1, y0)) 545s + y2 <- rowSums2(t(x), na.rm = na.rm) 545s + stopifnot(all.equal(y2, y0)) 545s + } 545s + } # for (kk ...) 545s Random test #1 545s Random test #2 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #3 545s Adding NAs 545s Random test #4 545s Adding NAs 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #5 545s Random test #6 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #7 545s Adding NAs 545s Random test #8 545s Adding NAs 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #9 545s Random test #10 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #11 545s Adding NAs 545s Random test #12 545s Adding NAs 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #13 545s Random test #14 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #15 545s Adding NAs 545s Random test #16 545s Adding NAs 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #17 545s Random test #18 545s Coercing from double to integer 545s Coercing from integer to logical 545s Random test #19 545s Adding NAs 545s Random test #20 545s Adding NAs 545s Coercing from double to integer 545s Coercing from integer to logical 545s > 546s 546s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 546s Copyright (C) 2024 The R Foundation for Statistical Computing 546s Platform: arm-unknown-linux-gnueabihf (32-bit) 546s 546s R is free software and comes with ABSOLUTELY NO WARRANTY. 546s You are welcome to redistribute it under certain conditions. 546s Type 'license()' or 'licence()' for distribution details. 546s 546s R is a collaborative project with many contributors. 546s Type 'contributors()' for more information and 546s 'citation()' on how to cite R or R packages in publications. 546s 546s Type 'demo()' for some demos, 'help()' for on-line help, or 546s 'help.start()' for an HTML browser interface to help. 546s Type 'q()' to quit R. 546s 546s > library("matrixStats") 546s > 546s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 546s + ## FIXME: sum() may overflow for integers, whereas 546s + ## base::rowSums() doesn't. What should rowSums2() do? 546s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 546s + res <- rowSums(x, na.rm = na.rm) 546s + if (is.na(useNames) || !useNames) names(res) <- NULL 546s + res 546s + } 546s > 546s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 546s + ## FIXME: sum() may overflow for integers, whereas 546s + ## base::colSums() doesn't. What should colSums2() do? 546s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 546s + res <- colSums(x, na.rm = na.rm) 546s + if (is.na(useNames) || !useNames) names(res) <- NULL 546s + res 546s + } 546s > 546s > 546s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 546s > # Subsetted tests 546s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 546s > source("utils/validateIndicesFramework.R") 546s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 546s > storage.mode(x) <- "integer" 546s > 546s > # To check names attribute 546s > dimnames <- list(letters[1:6], LETTERS[1:6]) 546s > 546s > # Test with and without dimnames on x 546s > for (setDimnames in c(TRUE, FALSE)) { 546s + if (setDimnames) dimnames(x) <- dimnames 546s + else dimnames(x) <- NULL 546s + for (rows in index_cases) { 546s + for (cols in index_cases) { 546s + for (na.rm in c(TRUE, FALSE)) { 546s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 546s + validateIndicesTestMatrix(x, rows, cols, 546s + ftest = rowSums2, fsure = rowSums2_R, 546s + na.rm = na.rm, useNames = useNames) 546s + validateIndicesTestMatrix(x, rows, cols, 546s + fcoltest = colSums2, fsure = rowSums2_R, 546s + na.rm = na.rm, useNames = useNames) 546s + } 546s + } 546s + } 546s + } 546s + } 548s > 548s 548s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 548s Copyright (C) 2024 The R Foundation for Statistical Computing 548s Platform: arm-unknown-linux-gnueabihf (32-bit) 548s 548s R is free software and comes with ABSOLUTELY NO WARRANTY. 548s You are welcome to redistribute it under certain conditions. 548s Type 'license()' or 'licence()' for distribution details. 548s 548s R is a collaborative project with many contributors. 548s Type 'contributors()' for more information and 548s 'citation()' on how to cite R or R packages in publications. 548s 548s Type 'demo()' for some demos, 'help()' for on-line help, or 548s 'help.start()' for an HTML browser interface to help. 548s Type 'q()' to quit R. 548s 549s > library("matrixStats") 549s > 549s > nrow <- 6L 549s > ncol <- 5L 549s > data <- matrix(0:4, nrow = nrow, ncol = ncol) 549s > 549s > # To check names attribute 549s > dimnames <- list(letters[1:6], LETTERS[1:5]) 549s > 549s > modes <- c("integer", "logical", "raw") 549s > for (mode in modes) { 549s + cat(sprintf("Mode: %s...\n", mode)) 549s + 549s + x <- data 549s + if (mode == "logical") x <- x - 2L 549s + if (mode != "raw") x[c(2,5,7)] <- NA_integer_ 549s + storage.mode(x) <- mode 549s + print(x) 549s + 549s + unique_values <- unique(as.vector(x)) 549s + nbr_of_unique_values <- length(unique_values) 549s + 549s + y <- rowTabulates(x) 549s + print(y) 549s + stopifnot( 549s + identical(dim(y), c(nrow, nbr_of_unique_values)), 549s + all(y >= 0) 549s + ) 549s + if (mode != "raw") { 549s + y0 <- t(table(x, row(x), useNA = "always")[, seq_len(nrow(x))]) 549s + stopifnot(all(y == y0)) 549s + } 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- rowTabulates(x, useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- rowTabulates(x, useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y <- rowTabulates(x, useNames = TRUE) 549s + stopifnot(identical(rownames(y), rownames(x))) 549s + dimnames(x) <- NULL 549s + 549s + y <- colTabulates(x) 549s + print(y) 549s + stopifnot( 549s + identical(dim(y), c(ncol, nbr_of_unique_values)), 549s + all(y >= 0) 549s + ) 549s + if (mode != "raw") { 549s + y0 <- t(table(x, col(x), useNA = "always")[, seq_len(ncol(x))]) 549s + stopifnot(all(y == y0)) 549s + } 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- colTabulates(x, useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- colTabulates(x, useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y <- colTabulates(x, useNames = TRUE) 549s + stopifnot(identical(rownames(y), colnames(x))) 549s + dimnames(x) <- NULL 549s + 549s + # Count only certain values 549s + if (mode == "integer") { 549s + subset <- c(0:2, NA_integer_) 549s + } else if (mode == "logical") { 549s + subset <- c(TRUE, FALSE, NA) 549s + } else { 549s + subset <- c(0:2) 549s + } 549s + y <- rowTabulates(x, values = subset) 549s + print(y) 549s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- rowTabulates(x, values = subset, useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- rowTabulates(x, values = subset, useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y <- rowTabulates(x, values = subset, useNames = TRUE) 549s + stopifnot(identical(rownames(y), rownames(x))) 549s + dimnames(x) <- NULL 549s + 549s + y <- colTabulates(x, values = subset) 549s + print(y) 549s + stopifnot(identical(dim(y), c(ncol, length(subset)))) 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- colTabulates(x, values = subset, useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- colTabulates(x, values = subset, useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y <- colTabulates(x, values = subset, useNames = TRUE) 549s + stopifnot(identical(rownames(y), colnames(x))) 549s + dimnames(x) <- NULL 549s + 549s + # Raw 549s + if (mode %in% c("integer", "raw")) { 549s + subset <- c(0:2) 549s + 549s + y <- rowTabulates(x, values = as.raw(subset)) 549s + print(y) 549s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- rowTabulates(x, values = as.raw(subset), useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- rowTabulates(x, values = as.raw(subset), useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y3 <- rowTabulates(x, values = as.raw(subset), useNames = TRUE) 549s + stopifnot(identical(rownames(y3), rownames(x))) 549s + dimnames(x) <- NULL 549s + 549s + y2 <- colTabulates(t(x), values = as.raw(subset)) 549s + print(y2) 549s + stopifnot( 549s + identical(dim(y2), c(nrow, length(subset))), 549s + identical(y2, y) 549s + ) 549s + # Check names attribute 549s + dimnames(x) <- dimnames 549s + y1 <- colTabulates(t(x), values = as.raw(subset), useNames = FALSE) 549s + stopifnot(all.equal(y1, y)) 549s + if (!matrixStats:::isUseNamesNADefunct()) { 549s + y2 <- colTabulates(t(x), values = as.raw(subset), useNames = NA) 549s + stopifnot(all.equal(y2, y)) 549s + } 549s + y <- colTabulates(t(x), values = as.raw(subset), useNames = TRUE) 549s + stopifnot(identical(rownames(y), colnames(t(x)))) 549s + dimnames(x) <- NULL 549s + } 549s + 549s + cat(sprintf("Mode: %s...done\n", mode)) 549s + } # for (mode ...) 549s Mode: integer... 549s [,1] [,2] [,3] [,4] [,5] 549s [1,] 0 NA 2 3 4 549s [2,] NA 2 3 4 0 549s [3,] 2 3 4 0 1 549s [4,] 3 4 0 1 2 549s [5,] NA 0 1 2 3 549s [6,] 0 1 2 3 4 549s 0 1 2 3 4 549s [1,] 1 0 1 1 1 1 549s [2,] 1 0 1 1 1 1 549s [3,] 1 1 1 1 1 0 549s [4,] 1 1 1 1 1 0 549s [5,] 1 1 1 1 0 1 549s [6,] 1 1 1 1 1 0 549s 0 1 2 3 4 549s [1,] 2 0 1 1 0 2 549s [2,] 1 1 1 1 1 1 549s [3,] 1 1 2 1 1 0 549s [4,] 1 1 1 2 1 0 549s [5,] 1 1 1 1 2 0 549s 0 1 2 549s [1,] 1 0 1 1 549s [2,] 1 0 1 1 549s [3,] 1 1 1 0 549s [4,] 1 1 1 0 549s [5,] 1 1 1 1 549s [6,] 1 1 1 0 549s 0 1 2 549s [1,] 2 0 1 2 549s [2,] 1 1 1 1 549s [3,] 1 1 2 0 549s [4,] 1 1 1 0 549s [5,] 1 1 1 0 549s 0x0 0x1 0x2 549s [1,] 1 0 1 549s [2,] 1 0 1 549s [3,] 1 1 1 549s [4,] 1 1 1 549s [5,] 1 1 1 549s [6,] 1 1 1 549s 0x0 0x1 0x2 549s [1,] 1 0 1 549s [2,] 1 0 1 549s [3,] 1 1 1 549s [4,] 1 1 1 549s [5,] 1 1 1 549s [6,] 1 1 1 549s Mode: integer...done 549s Mode: logical... 549s [,1] [,2] [,3] [,4] [,5] 549s [1,] TRUE NA FALSE TRUE TRUE 549s [2,] NA FALSE TRUE TRUE TRUE 549s [3,] FALSE TRUE TRUE TRUE TRUE 549s [4,] TRUE TRUE TRUE TRUE FALSE 549s [5,] NA TRUE TRUE FALSE TRUE 549s [6,] TRUE TRUE FALSE TRUE TRUE 549s FALSE TRUE 549s [1,] 1 3 1 549s [2,] 1 3 1 549s [3,] 1 4 0 549s [4,] 1 4 0 549s [5,] 1 3 1 549s [6,] 1 4 0 549s FALSE TRUE 549s [1,] 1 3 2 549s [2,] 1 4 1 549s [3,] 2 4 0 549s [4,] 1 5 0 549s [5,] 1 5 0 549s TRUE FALSE 549s [1,] 3 1 1 549s [2,] 3 1 1 549s [3,] 4 1 0 549s [4,] 4 1 0 549s [5,] 3 1 1 549s [6,] 4 1 0 549s TRUE FALSE 549s [1,] 3 1 2 549s [2,] 4 1 1 549s [3,] 4 2 0 549s [4,] 5 1 0 549s [5,] 5 1 0 549s Mode: logical...done 549s Mode: raw... 549s [,1] [,2] [,3] [,4] [,5] 549s [1,] 00 01 02 03 04 549s [2,] 01 02 03 04 00 549s [3,] 02 03 04 00 01 549s [4,] 03 04 00 01 02 549s [5,] 04 00 01 02 03 549s [6,] 00 01 02 03 04 549s 0x0 0x1 0x2 0x3 0x4 549s [1,] 1 1 1 1 1 549s [2,] 1 1 1 1 1 549s [3,] 1 1 1 1 1 549s [4,] 1 1 1 1 1 549s [5,] 1 1 1 1 1 549s [6,] 1 1 1 1 1 549s 0x0 0x1 0x2 0x3 0x4 549s [1,] 2 1 1 1 1 549s [2,] 1 2 1 1 1 549s [3,] 1 1 2 1 1 549s [4,] 1 1 1 2 1 549s [5,] 1 1 1 1 2 549s 0 1 2 549s [1,] 1 1 1 549s [2,] 1 1 1 549s [3,] 1 1 1 549s [4,] 1 1 1 549s [5,] 1 1 1 549s [6,] 1 1 1 549s 0 1 2 549s [1,] 2 1 1 549s [2,] 1 2 1 549s [3,] 1 1 2 549s [4,] 1 1 1 549s [5,] 1 1 1 549s 0x0 0x1 0x2 549s [1,] 1 1 1 549s [2,] 1 1 1 549s [3,] 1 1 1 549s [4,] 1 1 1 549s [5,] 1 1 1 549s [6,] 1 1 1 549s 0x0 0x1 0x2 549s [1,] 1 1 1 549s [2,] 1 1 1 549s [3,] 1 1 1 549s [4,] 1 1 1 549s [5,] 1 1 1 549s [6,] 1 1 1 549s Mode: raw...done 549s > 549s 549s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 549s Copyright (C) 2024 The R Foundation for Statistical Computing 549s Platform: arm-unknown-linux-gnueabihf (32-bit) 549s 549s R is free software and comes with ABSOLUTELY NO WARRANTY. 549s You are welcome to redistribute it under certain conditions. 549s Type 'license()' or 'licence()' for distribution details. 549s 549s R is a collaborative project with many contributors. 549s Type 'contributors()' for more information and 549s 'citation()' on how to cite R or R packages in publications. 549s 549s Type 'demo()' for some demos, 'help()' for on-line help, or 549s 'help.start()' for an HTML browser interface to help. 549s Type 'q()' to quit R. 549s 550s > library("matrixStats") 550s > 550s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 550s > # Subsetted tests 550s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 550s > source("utils/validateIndicesFramework.R") 550s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 550s > storage.mode(x) <- "integer" 550s > 550s > # To check names attribute 550s > dimnames <- list(letters[1:6], LETTERS[1:6]) 550s > 550s > # Test with and without dimnames on x 550s > for (setDimnames in c(TRUE, FALSE)) { 550s + if (setDimnames) dimnames(x) <- dimnames 550s + else dimnames(x) <- NULL 550s + 550s + count <- 0L 550s + for (rows in index_cases) { 550s + for (cols in index_cases) { 550s + count <- count + 1L 550s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 550s + useNames <- useNames[count %% length(useNames) + 1] 550s + 550s + validateIndicesTestMatrix(x, rows, cols, 550s + ftest = rowTabulates, fsure = rowTabulates, useNames = useNames) 550s + validateIndicesTestMatrix(x, rows, cols, 550s + ftest = rowTabulates, fsure = rowTabulates, 550s + values = 1:3, useNames = useNames) 550s + 550s + validateIndicesTestMatrix(x, rows, cols, 550s + ftest = colTabulates, fsure = colTabulates, useNames = useNames) 550s + validateIndicesTestMatrix(x, rows, cols, 550s + ftest = colTabulates, fsure = colTabulates, 550s + values = 1:3, useNames = useNames) 550s + } 550s + } 550s + } 554s > 554s 554s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 554s Copyright (C) 2024 The R Foundation for Statistical Computing 554s Platform: arm-unknown-linux-gnueabihf (32-bit) 554s 554s R is free software and comes with ABSOLUTELY NO WARRANTY. 554s You are welcome to redistribute it under certain conditions. 554s Type 'license()' or 'licence()' for distribution details. 554s 554s R is a collaborative project with many contributors. 554s Type 'contributors()' for more information and 554s 'citation()' on how to cite R or R packages in publications. 554s 554s Type 'demo()' for some demos, 'help()' for on-line help, or 554s 'help.start()' for an HTML browser interface to help. 554s Type 'q()' to quit R. 554s 554s > library("matrixStats") 554s > 554s > fcns <- list( 554s + rowVarDiffs = list(rowVarDiffs, colVarDiffs), 554s + rowSdDiffs = list(rowSdDiffs, colSdDiffs), 554s + rowMadDiffs = list(rowMadDiffs, colMadDiffs), 554s + rowIQRDiffs = list(rowIQRDiffs, colIQRDiffs) 554s + ) 554s > 554s > for (fcn in names(fcns)) { 554s + cat(sprintf("%s()...\n", fcn)) 554s + row_fcn <- fcns[[fcn]][[1L]] 554s + col_fcn <- fcns[[fcn]][[2L]] 554s + 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + # With and without some NAs 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + for (mode in c("integer", "double")) { 554s + for (add_na in c(FALSE, TRUE)) { 554s + cat("add_na = ", add_na, "\n", sep = "") 554s + 554s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 554s + if (add_na) { 554s + x[3:7, c(2, 4)] <- NA_real_ 554s + } 554s + cat("mode: ", mode, "\n", sep = "") 554s + storage.mode(x) <- mode 554s + str(x) 554s + 554s + # To check names attribute 554s + dimnames <- list(letters[1:10], LETTERS[1:5]) 554s + 554s + # Test with and without dimnames on x 554s + for (setDimnames in c(TRUE, FALSE)) { 554s + if (setDimnames) dimnames(x) <- dimnames 554s + else dimnames(x) <- NULL 554s + # Row/column ranges 554s + for (na.rm in c(FALSE, TRUE)) { 554s + # Check names attribute 554s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 554s + cat("na.rm = ", na.rm, "\n", sep = "") 554s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 554s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 554s + stopifnot(all.equal(r1, r2)) 554s + } 554s + } 554s + } 554s + } # for (add_na ...) 554s + } 554s + 554s + 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + # All NAs 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + for (mode in c("integer", "double")) { 554s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 554s + cat("mode: ", mode, "\n", sep = "") 554s + storage.mode(x) <- mode 554s + str(x) 554s + 554s + # Test with and without dimnames on x 554s + for (setDimnames in c(TRUE, FALSE)) { 554s + if (setDimnames) dimnames(x) <- dimnames 554s + else dimnames(x) <- NULL 554s + # Row/column ranges 554s + for (na.rm in c(FALSE, TRUE)) { 554s + # Check names attribute 554s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 554s + cat("na.rm = ", na.rm, "\n", sep = "") 554s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 554s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 554s + stopifnot(all.equal(r1, r2)) 554s + } 554s + } 554s + } 554s + } 554s + 554s + 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + # A 1x1 matrix 554s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 554s + x <- matrix(0, nrow = 1L, ncol = 1L) 554s + dimnames <- list("a", "A") 554s + # Test with and without dimnames on x 554s + for (setDimnames in c(TRUE, FALSE)) { 554s + if (setDimnames) dimnames(x) <- dimnames 554s + else dimnames(x) <- NULL 554s + # Row/column ranges 554s + for (na.rm in c(FALSE, TRUE)) { 554s + # Check names attribute 554s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 554s + cat("na.rm = ", na.rm, "\n", sep = "") 554s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 554s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 554s + stopifnot(all.equal(r1, r2)) 554s + } 554s + } 554s + } 554s + 554s + cat(sprintf("%s()...DONE\n", fcn)) 554s + } # for (fcn ...) 555s rowVarDiffs()... 555s add_na = FALSE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = FALSE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: integer 555s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: double 555s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s rowVarDiffs()...DONE 555s rowSdDiffs()... 555s add_na = FALSE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = FALSE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: integer 555s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: double 555s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s rowSdDiffs()...DONE 555s rowMadDiffs()... 555s add_na = FALSE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = FALSE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: integer 555s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: double 555s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s rowMadDiffs()...DONE 555s rowIQRDiffs()... 555s add_na = FALSE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: integer 555s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = FALSE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s add_na = TRUE 555s mode: double 555s 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 ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: integer 555s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s mode: double 555s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s na.rm = FALSE 555s na.rm = FALSE 555s na.rm = TRUE 555s na.rm = TRUE 555s rowIQRDiffs()...DONE 555s > 555s 555s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 555s Copyright (C) 2024 The R Foundation for Statistical Computing 555s Platform: arm-unknown-linux-gnueabihf (32-bit) 555s 555s R is free software and comes with ABSOLUTELY NO WARRANTY. 555s You are welcome to redistribute it under certain conditions. 555s Type 'license()' or 'licence()' for distribution details. 555s 555s R is a collaborative project with many contributors. 555s Type 'contributors()' for more information and 555s 'citation()' on how to cite R or R packages in publications. 555s 555s Type 'demo()' for some demos, 'help()' for on-line help, or 555s 'help.start()' for an HTML browser interface to help. 555s Type 'q()' to quit R. 555s 556s > library("matrixStats") 556s > 556s > fcns <- list( 556s + madDiff = c(rowMadDiffs, colMadDiffs), 556s + iqrDiff = c(rowIQRDiffs, colIQRDiffs) 556s + ) 556s > 556s > 556s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 556s > # Subsetted tests 556s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 556s > source("utils/validateIndicesFramework.R") 556s > # To check names attribute 556s > dimnames <- list(letters[1:6], LETTERS[1:6]) 556s > trim <- runif(1, min = 0, max = 0.5) 556s > for (fcn in names(fcns)) { 556s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 556s + row_fcn <- fcns[[fcn]][[1L]] 556s + col_fcn <- fcns[[fcn]][[2L]] 556s + 556s + for (mode in c("numeric", "integer")) { 556s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 556s + storage.mode(x) <- mode 556s + if (mode == "numeric") x[1:2, 3:4] <- Inf 556s + 556s + # Test with and without dimnames on x 556s + for (setDimnames in c(TRUE, FALSE)) { 556s + if (setDimnames) dimnames(x) <- dimnames 556s + else dimnames(x) <- NULL 556s + 556s + count <- 0L 556s + for (diff in 1:2) { 556s + for (rows in index_cases) { 556s + for (cols in index_cases) { 556s + count <- count + 1L 556s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 556s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 556s + useNames <- useNames[count %% length(useNames) + 1] 556s + validateIndicesTestMatrix(x, rows, cols, 556s + ftest = row_fcn, fsure = row_fcn, 556s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 556s + validateIndicesTestMatrix(x, rows, cols, 556s + fcoltest = col_fcn, fsure = row_fcn, 556s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 556s + } 556s + } 556s + } 556s + } 556s + } 556s + cat(sprintf("%s()...DONE\n", fcn)) 556s + } 556s subsetted tests on madDiff()... 564s madDiff()...DONE 564s subsetted tests on iqrDiff()... 572s iqrDiff()...DONE 572s > 572s 572s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 572s Copyright (C) 2024 The R Foundation for Statistical Computing 572s Platform: arm-unknown-linux-gnueabihf (32-bit) 572s 572s R is free software and comes with ABSOLUTELY NO WARRANTY. 572s You are welcome to redistribute it under certain conditions. 572s Type 'license()' or 'licence()' for distribution details. 572s 572s R is a collaborative project with many contributors. 572s Type 'contributors()' for more information and 572s 'citation()' on how to cite R or R packages in publications. 572s 572s Type 'demo()' for some demos, 'help()' for on-line help, or 572s 'help.start()' for an HTML browser interface to help. 572s Type 'q()' to quit R. 572s 573s > library("matrixStats") 573s > 573s > fcns <- list( 573s + varDiff = c(rowVarDiffs, colVarDiffs), 573s + sdDiff = c(rowSdDiffs, colSdDiffs) 573s + ) 573s > 573s > 573s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 573s > # Subsetted tests 573s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 573s > source("utils/validateIndicesFramework.R") 573s > # To check names attribute 573s > dimnames <- list(letters[1:6], LETTERS[1:6]) 573s > trim <- runif(1, min = 0, max = 0.5) 573s > for (fcn in names(fcns)) { 573s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 573s + row_fcn <- fcns[[fcn]][[1L]] 573s + col_fcn <- fcns[[fcn]][[2L]] 573s + 573s + for (mode in c("numeric", "integer")) { 573s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 573s + storage.mode(x) <- mode 573s + if (mode == "numeric") x[1:2, 3:4] <- Inf 573s + 573s + # Test with and without dimnames on x 573s + for (setDimnames in c(TRUE, FALSE)) { 573s + if (setDimnames) dimnames(x) <- dimnames 573s + else dimnames(x) <- NULL 573s + 573s + count <- 0L 573s + for (diff in 1:2) { 573s + for (rows in index_cases) { 573s + for (cols in index_cases) { 573s + count <- count + 1L 573s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 573s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 573s + useNames <- useNames[count %% length(useNames) + 1] 573s + 573s + validateIndicesTestMatrix(x, rows, cols, 573s + ftest = row_fcn, fsure = row_fcn, 573s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 573s + validateIndicesTestMatrix(x, rows, cols, 573s + fcoltest = col_fcn, fsure = row_fcn, 573s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 573s + } 573s + } 573s + } 573s + } 573s + } 573s + cat(sprintf("%s()...DONE\n", fcn)) 573s + } 573s subsetted tests on varDiff()... 579s varDiff()...DONE 579s subsetted tests on sdDiff()... 585s sdDiff()...DONE 585s > 585s 585s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 585s Copyright (C) 2024 The R Foundation for Statistical Computing 585s Platform: arm-unknown-linux-gnueabihf (32-bit) 585s 585s R is free software and comes with ABSOLUTELY NO WARRANTY. 585s You are welcome to redistribute it under certain conditions. 585s Type 'license()' or 'licence()' for distribution details. 585s 585s R is a collaborative project with many contributors. 585s Type 'contributors()' for more information and 585s 'citation()' on how to cite R or R packages in publications. 585s 585s Type 'demo()' for some demos, 'help()' for on-line help, or 585s 'help.start()' for an HTML browser interface to help. 585s Type 'q()' to quit R. 585s 585s > library("matrixStats") 585s > 585s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 585s > options(matrixStats.center.onUse = "ignore") 585s > options(matrixStats.vars.formula.freq = Inf) 585s > 585s > ## Create isFALSE() if running on an old version of R 585s > if (!exists("isFALSE", mode="function")) { 585s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 585s + } 585s > 585s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 585s + suppressWarnings({ 585s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 585s + }) 585s + stopifnot(!any(is.infinite(res))) 585s + 585s + # Keep naming support consistency same as rowVars() 585s + if (is.null(center) || ncol(x) <= 1L) { 585s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 585s + } 585s + else if (isFALSE(useNames)) names(res) <- NULL 585s + res 585s + } 585s > 585s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 585s + suppressWarnings({ 585s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 585s + }) 585s + stopifnot(!any(is.infinite(res))) 585s + 585s + # Keep naming support consistency same as colVars() 585s + if (is.null(center) || ncol(x) <= 1L) { 585s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 585s + } 585s + else if (isFALSE(useNames)) names(res) <- NULL 585s + res 585s + } 585s > 585s > 585s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 585s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 585s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 585s + stopifnot(!any(is.infinite(res))) 585s + res 585s + } 585s > 585s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 585s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 585s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 585s + stopifnot(!any(is.infinite(res))) 585s + res 585s + } 585s > 585s > rowVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 585s + x <- sweep(x, MARGIN = 1, STATS = as.array(center), FUN = "-") 585s + x[is.infinite(center), ] <- NaN 585s + res <- rowVars(x, rows = rows, cols = cols, center = rep(0, times = nrow(x)), na.rm = na.rm, useNames = useNames) 585s + stopifnot(!any(is.infinite(res))) 585s + res 585s + } 585s > 585s > colVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 585s + x <- sweep(x, MARGIN = 2, STATS = as.array(center), FUN = "-") 585s + x[, is.infinite(center)] <- NaN 585s + res <- colVars(x, rows = rows, cols = cols, center = rep(0, times = ncol(x)), na.rm = na.rm, useNames = useNames) 585s + stopifnot(!any(is.infinite(res))) 585s + res 585s + } 585s > 585s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 585s > # With and without some NAs or Infs 585s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 585s > for (mode in c("integer", "double")) { 585s + if (mode == "integer") { 585s + specials <- c(0L, NA_integer_) 585s + delta <- 0L 585s + } else { 585s + specials <- c(0, NA_real_, Inf) 585s + delta <- 0.1 585s + } 585s + 585s + for (special in specials) { 585s + cat("special = ", special, "\n", sep = "") 585s + x <- matrix(1:50 + delta, nrow = 10L, ncol = 5L) 585s + x[3:7, c(2, 4)] <- special 585s + cat("mode: ", mode, "\n", sep = "") 585s + str(x) 585s + stopifnot(storage.mode(x) == mode) 585s + 585s + # To check names attribute 585s + dimnames <- list(letters[1:10], LETTERS[1:5]) 585s + 585s + # Test with and without dimnames on x 585s + for (setDimnames in c(TRUE, FALSE)) { 585s + if (setDimnames) dimnames(x) <- dimnames 585s + else dimnames(x) <- NULL 585s + # Row/column variance 585s + for (na.rm in c(FALSE, TRUE)) { 585s + # Check names attribute 585s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 585s + cat("na.rm = ", na.rm, "\n", sep = "") 585s + center <- rowMeans(x, na.rm = na.rm) 585s + 585s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 586s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 586s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 586s + r1c <- rowVars(x, center = center, na.rm = na.rm, useNames = useNames) 586s + 586s + tx <- t(x) 586s + r2 <- colVars(tx, na.rm = na.rm, useNames = useNames) 586s + r2b <- colVars_center(tx, na.rm = na.rm, useNames = useNames) 586s + r2c <- colVars(tx, center = center, na.rm = na.rm, useNames = useNames) 586s + tx <- NULL 586s + 586s + stopifnot(all.equal(r1, r2)) 586s + stopifnot(all.equal(r1, r0)) 586s + stopifnot(all.equal(r1b, r1c)) 586s + stopifnot(all.equal(r2, r0)) 586s + stopifnot(all.equal(r2b, r2c)) 586s + 586s + center <- colMeans(x, na.rm = na.rm) 586s + 586s + r3 <- colVars(x, center = center, na.rm = na.rm, useNames = useNames) 586s + r3b <- colVars_center_naive(x, center = center, na.rm = na.rm, useNames = useNames) 586s + r3c <- rowVars(t(x), center = center, na.rm = na.rm, useNames = useNames) 586s + r3d <- rowVars_center_naive(t(x), center = center, na.rm = na.rm, useNames = useNames) 586s + stopifnot(all.equal(r3b, r3)) 586s + stopifnot(all.equal(r3c, r3)) 586s + stopifnot(all.equal(r3d, r3)) 586s + 586s + stopifnot( 586s + !any(is.infinite(r0)), 586s + !any(is.infinite(r1)), 586s + !any(is.infinite(r2)), 586s + !any(is.infinite(r3)), 586s + !any(is.infinite(r1b)), 586s + !any(is.infinite(r1c)), 586s + !any(is.infinite(r2b)), 586s + !any(is.infinite(r2c)), 586s + !any(is.infinite(r3b)), 586s + !any(is.infinite(r3c)), 586s + !any(is.infinite(r3d)) 586s + ) 586s + } 586s + } 586s + } 586s + } # for (special ...) 586s + } 586s special = 0 586s mode: integer 586s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s special = NA 586s mode: integer 586s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s special = 0 586s mode: double 586s 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 ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s special = NA 586s mode: double 586s 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 ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s special = Inf 586s mode: double 586s 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 ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s > 586s > 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > # All NAs 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > for (mode in c("integer", "double")) { 586s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 586s + cat("mode: ", mode, "\n", sep = "") 586s + storage.mode(x) <- mode 586s + str(x) 586s + 586s + # Test with and without dimnames on x 586s + for (setDimnames in c(TRUE, FALSE)) { 586s + if (setDimnames) dimnames(x) <- dimnames 586s + else dimnames(x) <- NULL 586s + # Row/column variance 586s + for (na.rm in c(FALSE, TRUE)) { 586s + # Check names attribute 586s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 586s + cat("na.rm = ", na.rm, "\n", sep = "") 586s + 586s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 586s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 586s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 586s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 586s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 586s + stopifnot(all.equal(r1, r2)) 586s + stopifnot(all.equal(r1, r0)) 586s + stopifnot(all.equal(r2, r0)) 586s + stopifnot(all.equal(r1b, r2b)) 586s + stopifnot( 586s + !any(is.infinite(r0)), 586s + !any(is.infinite(r1)), 586s + !any(is.infinite(r2)), 586s + !any(is.infinite(r1b)), 586s + !any(is.infinite(r2b)) 586s + ) 586s + } 586s + } 586s + } 586s + } 586s mode: integer 586s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s mode: double 586s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s > 586s > 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > # A 1x1 matrix 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > x <- matrix(0, nrow = 1L, ncol = 1L) 586s > dimnames <- list("a", "A") 586s > # Test with and without dimnames on x 586s > for (setDimnames in c(TRUE, FALSE)) { 586s + if (setDimnames) dimnames(x) <- dimnames 586s + else dimnames(x) <- NULL 586s + # Row/column variance 586s + for (na.rm in c(FALSE, TRUE)) { 586s + # Check names attribute 586s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 586s + cat("na.rm = ", na.rm, "\n", sep = "") 586s + 586s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 586s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 586s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 586s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 586s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 586s + stopifnot(all.equal(r1, r2)) 586s + stopifnot(all.equal(r1, r0)) 586s + stopifnot(all.equal(r2, r0)) 586s + stopifnot(all.equal(r1b, r2b)) 586s + stopifnot( 586s + !any(is.infinite(r0)), 586s + !any(is.infinite(r1)), 586s + !any(is.infinite(r2)), 586s + !any(is.infinite(r1b)), 586s + !any(is.infinite(r2b)) 586s + ) 586s + } 586s + } 586s + } 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s na.rm = FALSE 586s na.rm = FALSE 586s na.rm = TRUE 586s na.rm = TRUE 586s > 586s > 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > # center and .dim 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > m <- matrix(1:12, nrow = 3L, ncol = 4L) 586s > a <- array(m, dim = c(3, 2, 2)) 586s > stopifnot(prod(dim(a)) == prod(dim(m))) 586s > 586s > y0 <- rowVars(m, dim. = dim(m)) 586s > print(y0) 586s [1] 15 15 15 586s > y1 <- rowVars(a, dim. = dim(m)) 586s > print(y1) 586s [1] 15 15 15 586s > stopifnot(identical(y1, y0)) 586s > stopifnot( 586s + !any(is.infinite(y0)), 586s + !any(is.infinite(y1)) 586s + ) 586s > 586s > mu <- rowMeans(m) 586s > y0 <- rowVars(m, center = mu, dim. = dim(m)) 586s > print(y0) 586s [1] 15 15 15 586s > y1 <- rowVars(a, center = mu, dim. = dim(m)) 586s > print(y1) 586s [1] 15 15 15 586s > stopifnot(identical(y1, y0)) 586s > stopifnot( 586s + !any(is.infinite(y0)), 586s + !any(is.infinite(y1)) 586s + ) 586s > 586s > 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > # Corner cases 586s > # https://github.com/HenrikBengtsson/matrixStats/issues/195 586s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 586s > x <- matrix(c(1,2,3,4), nrow = 2L, ncol = 2L) 586s > x[1,1] <- NA_real_ 586s > x[1,2] <- Inf 586s > 586s > center <- colMeans2(x, na.rm = TRUE) 586s > y <- colVars(x, center = center, na.rm = TRUE) 586s > stopifnot(!any(is.infinite(y))) 586s > 586s > x <- t(x) 586s > center <- rowMeans2(x, na.rm = TRUE) 586s > y <- rowVars(x, center = center, na.rm = TRUE) 586s > stopifnot(!any(is.infinite(y))) 586s > 586s 586s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 586s Copyright (C) 2024 The R Foundation for Statistical Computing 586s Platform: arm-unknown-linux-gnueabihf (32-bit) 586s 586s R is free software and comes with ABSOLUTELY NO WARRANTY. 586s You are welcome to redistribute it under certain conditions. 586s Type 'license()' or 'licence()' for distribution details. 586s 586s R is a collaborative project with many contributors. 586s Type 'contributors()' for more information and 586s 'citation()' on how to cite R or R packages in publications. 586s 586s Type 'demo()' for some demos, 'help()' for on-line help, or 586s 'help.start()' for an HTML browser interface to help. 586s Type 'q()' to quit R. 586s 587s > library("matrixStats") 587s > 587s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 587s > options(matrixStats.center.onUse = "ignore") 587s > 587s > ## Create isFALSE() if running on an old version of R 587s > if (!exists("isFALSE", mode="function")) { 587s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 587s + } 587s > 587s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 587s + suppressWarnings({ 587s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 587s + }) 587s + stopifnot(!any(is.infinite(res))) 587s + 587s + # Keep naming support consistency same as rowVars() 587s + if (is.null(center) || ncol(x) <= 1L) { 587s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 587s + } 587s + else if (isFALSE(useNames)) names(res) <- NULL 587s + res 587s + } 587s > 587s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 587s + suppressWarnings({ 587s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 587s + }) 587s + stopifnot(!any(is.infinite(res))) 587s + 587s + # Keep naming support consistency same as colVars() 587s + if (is.null(center) || nrow(x) <= 1L) { 587s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 587s + } 587s + else if (isFALSE(useNames)) names(res) <- NULL 587s + res 587s + } 587s > 587s > 587s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 587s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 587s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 587s + stopifnot(!any(is.infinite(res))) 587s + res 587s + } 587s > 587s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 587s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 587s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 587s + stopifnot(!any(is.infinite(res))) 587s + res 587s + } 587s > 587s > 587s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 587s > # Subsetted tests 587s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 587s > source("utils/validateIndicesFramework.R") 587s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 587s > storage.mode(x) <- "integer" 587s > 587s > # To check names attribute 587s > dimnames <- list(letters[1:6], LETTERS[1:6]) 587s > 587s > # Test with and without dimnames on x 587s > for (setDimnames in c(TRUE, FALSE)) { 587s + if (setDimnames) dimnames(x) <- dimnames 587s + else dimnames(x) <- NULL 587s + 587s + count <- 0L 587s + for (rows in index_cases) { 587s + for (cols in index_cases) { 587s + count <- count + 1L 587s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 587s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 587s + useNames <- useNames[count %% length(useNames) + 1] 587s + 587s + validateIndicesTestMatrix(x, rows, cols, 587s + ftest = rowVars, fsure = rowVars_R, 587s + na.rm = na.rm, useNames = useNames) 587s + validateIndicesTestMatrix(x, rows, cols, 587s + ftest = rowVars_center, fsure = rowVars_R, 587s + na.rm = na.rm, center = TRUE, useNames = useNames) 587s + 587s + validateIndicesTestMatrix(x, rows, cols, 587s + fcoltest = colVars, fsure = rowVars_R, 587s + na.rm = na.rm, useNames = useNames) 587s + validateIndicesTestMatrix(x, rows, cols, 587s + fcoltest = colVars_center, fsure = rowVars_R, 587s + na.rm = na.rm, center = TRUE, useNames = useNames) 587s + } 587s + } 587s + } 589s > 589s 589s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 589s Copyright (C) 2024 The R Foundation for Statistical Computing 589s Platform: arm-unknown-linux-gnueabihf (32-bit) 589s 589s R is free software and comes with ABSOLUTELY NO WARRANTY. 589s You are welcome to redistribute it under certain conditions. 589s Type 'license()' or 'licence()' for distribution details. 589s 589s R is a collaborative project with many contributors. 589s Type 'contributors()' for more information and 589s 'citation()' on how to cite R or R packages in publications. 589s 589s Type 'demo()' for some demos, 'help()' for on-line help, or 589s 'help.start()' for an HTML browser interface to help. 589s Type 'q()' to quit R. 589s 590s > library("matrixStats") 590s > 590s > ## Create isFALSE() if running on an old version of R 590s > if (!exists("isFALSE", mode="function")) { 590s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 590s + } 590s > 590s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 590s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 590s + 590s + # Keep naming support consistency same as rowWeightedMeans() 590s + idxs <- which(is.na(w) | w != 0) 590s + nw <- length(idxs) 590s + if (na.rm) na.rm <- anyMissing(x) 590s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 590s + if (is.na(useNames) || !useNames) names(res) <- NULL 590s + } 590s + else if (isFALSE(useNames)) names(res) <- NULL 590s + 590s + res 590s + } 590s > 590s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 590s + res <- apply(x, MARGIN = 2L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 590s + 590s + # Keep naming support consistency same as colWeightedMeans() 590s + idxs <- which(is.na(w) | w != 0) 590s + nw <- length(idxs) 590s + if (!is.null(w) && nw == 0L) { 590s + if (is.na(useNames) || !useNames) names(res) <- NULL 590s + } 590s + else if (isFALSE(useNames)) names(res) <- NULL 590s + 590s + res 590s + } 590s > 590s > set.seed(1) 590s > 590s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 590s > print(x) 590s [,1] [,2] [,3] [,4] 590s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 590s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 590s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 590s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 590s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 590s > 590s > # To check names attribute 590s > dimnames <- list(letters[1:5], LETTERS[1:4]) 590s > 590s > # Non-weighted row averages 590s > x_est0 <- rowMeans(x) 590s > x_est1 <- rowWeightedMeans(x) 590s > print(x_est1) 590s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x)) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Check names attribute 590s > dimnames(x) <- dimnames 590s > x_est1 <- rowWeightedMeans(x, useNames = FALSE) 590s > x_est2 <- colWeightedMeans(t(x), useNames = FALSE) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > x_est0 <- rowMeans(x) 590s > x_est1 <- rowWeightedMeans(x, useNames = TRUE) 590s > x_est2 <- colWeightedMeans(t(x), useNames = TRUE) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > dimnames(x) <- NULL 590s > 590s > 590s > # Weighted row averages (uniform weights) 590s > w <- rep(2.5, times = ncol(x)) 590s > x_est0 <- rowMeans(x) 590s > x_est1 <- rowWeightedMeans(x, w = w) 590s > print(x_est1) 590s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), w = w) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # Weighted row averages (excluding some columns) 590s > w <- c(1, 1, 0, 1) 590s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 590s > x_est1 <- rowWeightedMeans(x, w = w) 590s > print(x_est1) 590s [1] -0.4972853 0.2182940 0.2821774 0.9974278 0.2060069 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), w = w) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # Weighted row averages (excluding some columns) 590s > w <- c(0, 1, 0, 0) 590s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 590s > x_est1 <- rowWeightedMeans(x, w = w) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), w = w) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # Weighted row averages (all zero weights) 590s > w <- c(0, 0, 0, 0) 590s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 590s > x_est1 <- rowWeightedMeans(x, w = w) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), w = w) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # Weighted averages by rows and columns 590s > w <- 1:4 590s > x_est1 <- rowWeightedMeans(x, w = w) 590s > print(x_est1) 590s [1] 0.20882185 0.22632701 0.25526439 -0.06123714 0.54691290 590s > x_est2 <- colWeightedMeans(t(x), w = w) 590s > stopifnot(all.equal(x_est2, x_est1)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > x[sample(length(x), size = 0.3 * length(x))] <- NA 590s > print(x) 590s [,1] [,2] [,3] [,4] 590s [1,] -0.6264538 NA 1.5117812 -0.04493361 590s [2,] 0.1836433 NA NA -0.01619026 590s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 590s [4,] 1.5952808 NA -2.2146999 0.82122120 590s [5,] 0.3295078 NA NA 0.59390132 590s > 590s > # Non-weighted row averages with missing values 590s > x_est0 <- rowMeans(x, na.rm = TRUE) 590s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE) 590s > print(x_est1) 590s [1] 0.28013125 0.08372653 0.05632293 0.06726737 0.46170455 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Check names attribute 590s > dimnames(x) <- dimnames 590s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = FALSE) 590s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = FALSE) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > x_est0 <- rowMeans(x, na.rm = TRUE) 590s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = TRUE) 590s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = TRUE) 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > dimnames(x) <- NULL 590s > 590s > 590s > # Weighted row averages with missing values 590s > x_est0 <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = TRUE) 590s > print(x_est0) 590s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 590s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 590s > print(x_est1) 590s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 590s > stopifnot(all.equal(x_est1, x_est0)) 590s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 590s > stopifnot(all.equal(x_est2, x_est0)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # Weighted averages by rows and columns 590s > w <- 1:4 590s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 590s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 590s > stopifnot(all.equal(x_est2, x_est1)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > 590s > # w contains missing value 590s > w[1] <- NA_integer_ 590s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 590s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 590s > stopifnot(all.equal(x_est2, x_est1)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE) 590s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = FALSE) 590s > stopifnot(all.equal(x_est2, x_est1)) 590s > # Test with and without dimnames on x 590s > for (setDimnames in c(TRUE, FALSE)) { 590s + if (setDimnames) dimnames(x) <- dimnames 590s + else dimnames(x) <- NULL 590s + # Check names attribute 590s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 590s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = FALSE, useNames = useNames) 590s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = FALSE, useNames = useNames) 590s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = FALSE, useNames = useNames) 590s + stopifnot(all.equal(x_est1, x_est0)) 590s + } 590s + } 590s > 590s 590s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 590s Copyright (C) 2024 The R Foundation for Statistical Computing 590s Platform: arm-unknown-linux-gnueabihf (32-bit) 590s 590s R is free software and comes with ABSOLUTELY NO WARRANTY. 590s You are welcome to redistribute it under certain conditions. 590s Type 'license()' or 'licence()' for distribution details. 590s 590s R is a collaborative project with many contributors. 590s Type 'contributors()' for more information and 590s 'citation()' on how to cite R or R packages in publications. 590s 590s Type 'demo()' for some demos, 'help()' for on-line help, or 590s 'help.start()' for an HTML browser interface to help. 590s Type 'q()' to quit R. 590s 591s > library("matrixStats") 591s > 591s > ## Create isFALSE() if running on an old version of R 591s > if (!exists("isFALSE", mode="function")) { 591s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 591s + } 591s > 591s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 591s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 591s + 591s + # Keep naming support consistency same as rowWeightedMeans() 591s + idxs <- which(is.na(w) | w != 0) 591s + nw <- length(idxs) 591s + if (na.rm) na.rm <- anyMissing(x) 591s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 591s + if (is.na(useNames) || !useNames) names(res) <- NULL 591s + } 591s + else if (isFALSE(useNames)) names(res) <- NULL 591s + 591s + res 591s + } 591s > 591s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 591s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 591s + 591s + # Keep naming support consistency same as colWeightedMeans() 591s + idxs <- which(is.na(w) | w != 0) 591s + nw <- length(idxs) 591s + if (!is.null(w) && nw == 0L) { 591s + if (is.na(useNames) || !useNames) names(res) <- NULL 591s + } 591s + else if (isFALSE(useNames)) names(res) <- NULL 591s + 591s + res 591s + } 591s > 591s > 591s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 591s > # Subsetted tests 591s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 591s > source("utils/validateIndicesFramework.R") 591s > # To check names attribute 591s > dimnames <- list(letters[1:6], LETTERS[1:6]) 591s > for (mode in c("numeric", "integer", "logical")) { 591s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 591s + w <- runif(6, min = 0, max = 6) 591s + storage.mode(x) <- mode 591s + storage.mode(w) <- if (mode == "logical") "integer" else mode 591s + if (mode == "numeric") w[1] <- Inf 591s + 591s + # Test with and without dimnames on x 591s + for (setDimnames in c(TRUE, FALSE)) { 591s + if (setDimnames) dimnames(x) <- dimnames 591s + else dimnames(x) <- NULL 591s + 591s + count <- 0L 591s + for (rows in index_cases) { 591s + for (cols in index_cases) { 591s + count <- count + 1L 591s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 591s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 591s + useNames <- useNames[count %% length(useNames) + 1] 591s + 591s + validateIndicesTestMatrix_w(x, w, rows, cols, 591s + ftest = rowWeightedMeans, fsure = rowWeightedMeans_R, 591s + na.rm = na.rm, useNames = useNames) 591s + validateIndicesTestMatrix_w(x, w, rows, cols, 591s + fcoltest = colWeightedMeans, fsure = colWeightedMeans_R, 591s + na.rm = na.rm, useNames = useNames) 591s + } 591s + } 591s + } 591s + } 594s > 595s 595s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 595s Copyright (C) 2024 The R Foundation for Statistical Computing 595s Platform: arm-unknown-linux-gnueabihf (32-bit) 595s 595s R is free software and comes with ABSOLUTELY NO WARRANTY. 595s You are welcome to redistribute it under certain conditions. 595s Type 'license()' or 'licence()' for distribution details. 595s 595s R is a collaborative project with many contributors. 595s Type 'contributors()' for more information and 595s 'citation()' on how to cite R or R packages in publications. 595s 595s Type 'demo()' for some demos, 'help()' for on-line help, or 595s 'help.start()' for an HTML browser interface to help. 595s Type 'q()' to quit R. 595s 595s > library("matrixStats") 595s > 595s > ## Create isFALSE() if running on an old version of R 595s > if (!exists("isFALSE", mode="function")) { 595s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 595s + } 595s > 595s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 595s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 595s + 595s + # Keep naming support consistency same as rowWeightedMedians() 595s + if (!is.null(w)) { 595s + if (isFALSE(useNames)) names(res) <- NULL 595s + } 595s + else if (is.na(useNames) || !useNames) names(res) <- NULL 595s + 595s + res 595s + } 595s > 595s > colWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 595s + res <- apply(x, MARGIN = 2L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 595s + 595s + # Keep naming support consistency same as colWeightedMedians() 595s + if (!is.null(w)) { 595s + if (isFALSE(useNames)) names(res) <- NULL 595s + } 595s + else if (is.na(useNames) || !useNames) names(res) <- NULL 595s + 595s + res 595s + } 595s > 595s > set.seed(1) 595s > 595s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 595s > print(x) 595s [,1] [,2] [,3] [,4] 595s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 595s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 595s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 595s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 595s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 595s > 595s > # To check names attribute 595s > dimnames <- list(letters[1:5], LETTERS[1:4]) 595s > 595s > # Non-weighted row medians 595s > x_est0 <- rowMedians(x) 595s > x_est1 <- rowWeightedMedians(x) 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x)) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowMedians(x, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, useNames = useNames) 595s + x_est2 <- colWeightedMedians(t(x), useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + stopifnot(all.equal(x_est2, x_est0)) 595s + } 595s + } 595s > 595s > 595s > # Weighted row medians (uniform weights) 595s > w <- rep(2.5, times = ncol(x)) 595s > x_est0 <- rowMedians(x) 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > 595s > # Weighted row medians (excluding some columns) 595s > w <- c(1, 1, 0, 1) 595s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > # Weighted row medians (excluding some columns) 595s > w <- c(0, 1, 0, 0) 595s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > # Weighted row medians (all zero weights) 595s > w <- c(0, 0, 0, 0) 595s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > # Weighted medians by rows and columns 595s > w <- 1:4 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est1)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > 595s > # Weighted row medians with missing values 595s > x_est0 <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = TRUE) 595s > print(x_est0) 595s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 595s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 595s > print(x_est1) 595s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 595s > stopifnot(all.equal(x_est1, x_est0)) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(all.equal(x_est2, x_est0)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > # Weighted medians by rows and columns 595s > w <- 1:4 595s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 595s > x_est2 <- colWeightedMedians(t(x), w = w, na.rm = TRUE) 595s > stopifnot(all.equal(x_est2, x_est1)) 595s > # Test with and without dimnames on x 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 595s > 595s > # Inf weight 595s > x <- matrix(1:2, nrow = 1, ncol = 2) 595s > w <- c(7, Inf) 595s > x_est1 <- rowWeightedMedians(x, w = w) 595s > x_est2 <- colWeightedMedians(t(x), w = w) 595s > stopifnot(identical(2, x_est1)) 595s > stopifnot(identical(2, x_est2)) 595s > # Test with and without dimnames on x 595s > dimnames <- list("a", LETTERS[1:2]) 595s > for (setDimnames in c(TRUE, FALSE)) { 595s + if (setDimnames) dimnames(x) <- dimnames 595s + else dimnames(x) <- NULL 595s + # Check names attribute 595s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 595s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 595s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 595s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 595s + stopifnot(all.equal(x_est1, x_est0)) 595s + } 595s + } 595s > 596s 596s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 596s Copyright (C) 2024 The R Foundation for Statistical Computing 596s Platform: arm-unknown-linux-gnueabihf (32-bit) 596s 596s R is free software and comes with ABSOLUTELY NO WARRANTY. 596s You are welcome to redistribute it under certain conditions. 596s Type 'license()' or 'licence()' for distribution details. 596s 596s R is a collaborative project with many contributors. 596s Type 'contributors()' for more information and 596s 'citation()' on how to cite R or R packages in publications. 596s 596s Type 'demo()' for some demos, 'help()' for on-line help, or 596s 'help.start()' for an HTML browser interface to help. 596s Type 'q()' to quit R. 596s 596s > library("matrixStats") 596s > 596s > ## Create isFALSE() if running on an old version of R 596s > if (!exists("isFALSE", mode="function")) { 596s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 596s + } 596s > 596s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 596s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 596s + 596s + # Keep naming support consistency same as rowWeightedMedians() 596s + if (!is.null(w)) { 596s + if (isFALSE(useNames)) names(res) <- NULL 596s + } 596s + else if (is.na(useNames) || !useNames) names(res) <- NULL 596s + 596s + res 596s + } 596s > 596s > 596s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 596s > # Subsetted tests 596s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 596s > source("utils/validateIndicesFramework.R") 596s > # To check names attribute 596s > dimnames <- list(letters[1:6], LETTERS[1:6]) 596s > for (mode in c("numeric", "integer", "logical")) { 596s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 596s + w <- runif(6, min = 0, max = 6) 596s + storage.mode(x) <- mode 596s + storage.mode(w) <- if (mode == "logical") "integer" else mode 596s + if (mode == "numeric") w[1] <- Inf 596s + 596s + # Test with and without dimnames on x 596s + for (setDimnames in c(TRUE, FALSE)) { 596s + if (setDimnames) dimnames(x) <- dimnames 596s + else dimnames(x) <- NULL 596s + 596s + count <- 0L 596s + for (rows in index_cases) { 596s + for (cols in index_cases) { 596s + count <- count + 1L 596s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 596s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 596s + useNames <- useNames[count %% length(useNames) + 1] 596s + 596s + validateIndicesTestMatrix_w(x, w, rows, cols, 596s + ftest = rowWeightedMedians, 596s + fsure = rowWeightedMedians_R, 596s + na.rm = na.rm, useNames = useNames) 596s + validateIndicesTestMatrix_w(x, w, rows, cols, 596s + fcoltest = colWeightedMedians, 596s + fsure = rowWeightedMedians_R, 596s + na.rm = na.rm, useNames = useNames) 596s + } 596s + } 596s + } 596s + } 599s > 599s 599s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 599s Copyright (C) 2024 The R Foundation for Statistical Computing 599s Platform: arm-unknown-linux-gnueabihf (32-bit) 599s 599s R is free software and comes with ABSOLUTELY NO WARRANTY. 599s You are welcome to redistribute it under certain conditions. 599s Type 'license()' or 'licence()' for distribution details. 599s 599s R is a collaborative project with many contributors. 599s Type 'contributors()' for more information and 599s 'citation()' on how to cite R or R packages in publications. 599s 599s Type 'demo()' for some demos, 'help()' for on-line help, or 599s 'help.start()' for an HTML browser interface to help. 599s Type 'q()' to quit R. 599s 600s > library("matrixStats") 600s > 600s > set.seed(1) 600s > 600s > x <- matrix(rnorm(20), nrow = 5L, ncol = 4L) 600s > print(x) 600s [,1] [,2] [,3] [,4] 600s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 600s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 600s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 600s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 600s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 600s > 600s > # To check names attribute 600s > dimnames <- list(letters[1:5], LETTERS[1:4]) 600s > 600s > # Weighted row variances (uniform weights - all w = 1) 600s > # Non-weighted row variances 600s > x_est0 <- rowVars(x) 600s > w <- rep(1, times = ncol(x)) 600s > x_est1 <- rowWeightedVars(x, w = w) 600s > print(x_est1) 600s [1] 1.11767161 0.05022969 0.83582537 2.76819528 0.35351857 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowVars(x, useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row variances (uniform weights - all w = 3) 600s > x3 <- cbind(x, x, x) 600s > x_est0 <- rowVars(x3) 600s > w <- rep(3, times = ncol(x)) 600s > x_est1 <- rowWeightedVars(x, w = w) 600s > print(x_est1) 600s [1] 0.91445859 0.04109702 0.68385712 2.26488705 0.28924246 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x3 <- cbind(x, x, x) 600s > x_est0 <- rowVars(x3, useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row variances (excluding some columns) 600s > w <- c(1, 1, 0, 1) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 600s > x_est1 <- rowWeightedVars(x, w = w) 600s > print(x_est1) 600s [1] 0.16287693 0.06430861 0.94767651 0.28313135 0.21361984 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row variances (excluding some columns) 600s > w <- c(0, 1, 0, 0) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 600s > x_est1 <- rowWeightedVars(x, w = w) 600s > #stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est1)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row variances (all zero weights) 600s > w <- c(0, 0, 0, 0) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 600s > x_est1 <- rowWeightedVars(x, w = w) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > # Weighted variances by rows and columns 600s > w <- 1:4 600s > # Test with and without dimnames on x 600s > for (setDimnames in c(TRUE, FALSE)) { 600s + if (setDimnames) dimnames(x) <- dimnames 600s + else dimnames(x) <- NULL 600s + # Check names attribute 600s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 600s + x_est1 <- rowWeightedVars(x, w = w, useNames = useNames) 600s + print(x_est1) 600s + x_est2 <- colWeightedVars(t(x), w = w, useNames = useNames) 600s + stopifnot(all.equal(x_est2, x_est1)) 600s + } 600s + } 600s a b c d e 600s 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 600s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 600s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 600s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 600s > 600s > 600s > x[sample(length(x), size = 0.3 * length(x))] <- NA 600s > print(x) 600s [,1] [,2] [,3] [,4] 600s [1,] -0.6264538 NA 1.5117812 -0.04493361 600s [2,] 0.1836433 NA NA -0.01619026 600s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 600s [4,] 1.5952808 NA -2.2146999 0.82122120 600s [5,] 0.3295078 NA NA 0.59390132 600s > 600s > # Non-weighted row variances with missing values 600s > x_est0 <- rowVars(x, na.rm = TRUE) 600s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE) 600s > print(x_est1) 600s [1] 1.22226258 0.01996673 0.83582537 4.05532299 0.03495197 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 600s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowVars(x, na.rm = TRUE, useNames = TRUE) 600s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 600s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row variances with missing values 600s > # Test with and without dimnames on x 600s > for (setDimnames in c(TRUE, FALSE)) { 600s + if (setDimnames) dimnames(x) <- dimnames 600s + else dimnames(x) <- NULL 600s + # Check names attribute 600s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 600s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 600s + print(x_est1) 600s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 600s + stopifnot(all.equal(x_est2, x_est1)) 600s + } 600s + } 600s a b c d e 600s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s > 600s > 600s > # Weighted variances by rows and columns 600s > w <- 1:4 600s > # Test with and without dimnames on x 600s > for (setDimnames in c(TRUE, FALSE)) { 600s + if (setDimnames) dimnames(x) <- dimnames 600s + else dimnames(x) <- NULL 600s + # Check names attribute 600s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 600s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 600s + print(x_est1) 600s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 600s + stopifnot(all.equal(x_est2, x_est1)) 600s + } 600s + } 600s a b c d e 600s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 600s > 600s > 600s > # Weighted row standard deviation (excluding some columns) 600s > w <- c(1, 1, 0, 1) 600s > ## FIXME: rowVars()/rowSds() needs na.rm = FALSE (wrong default) 600s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE) 600s > x_est1 <- rowWeightedSds(x, w = w) 600s > print(x_est1) 600s [1] NA NA 0.9734868 NA NA 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = FALSE) 600s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE, useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = NA) 600s + x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = TRUE) 600s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s > 600s > # Weighted row MADs (excluding some columns) 600s > w <- c(1, 1, 0, 1) 600s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE]) 600s > x_est1 <- rowWeightedMads(x, w = w) 600s > print(x_est1) 600s [1] NA NA 0.3046914 NA NA 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > x_est2 <- colWeightedMads(t(x), w = w) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > # Check names attribute 600s > dimnames(x) <- dimnames 600s > x_est1 <- rowWeightedMads(x, w = w, useNames = FALSE) 600s > x_est2 <- colWeightedMads(t(x), w = w, useNames = FALSE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE], useNames = TRUE) 600s > if (!matrixStats:::isUseNamesNADefunct()) { 600s + x_est1 <- rowWeightedMads(x, w = w, useNames = NA) 600s + x_est2 <- colWeightedMads(t(x), w = w, useNames = NA) 600s + stopifnot(all.equal(x_est1, x_est0)) 600s + stopifnot(all.equal(x_est2, x_est0)) 600s + } 600s > x_est1 <- rowWeightedMads(x, w = w, useNames = TRUE) 600s > x_est2 <- colWeightedMads(t(x), w = w, useNames = TRUE) 600s > stopifnot(all.equal(x_est1, x_est0)) 600s > stopifnot(all.equal(x_est2, x_est0)) 600s > dimnames(x) <- NULL 600s > 600s 600s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 600s Copyright (C) 2024 The R Foundation for Statistical Computing 600s Platform: arm-unknown-linux-gnueabihf (32-bit) 600s 600s R is free software and comes with ABSOLUTELY NO WARRANTY. 600s You are welcome to redistribute it under certain conditions. 600s Type 'license()' or 'licence()' for distribution details. 600s 600s R is a collaborative project with many contributors. 600s Type 'contributors()' for more information and 600s 'citation()' on how to cite R or R packages in publications. 600s 600s Type 'demo()' for some demos, 'help()' for on-line help, or 600s 'help.start()' for an HTML browser interface to help. 600s Type 'q()' to quit R. 600s 600s > library("matrixStats") 600s > 600s > fcns <- list( 600s + weightedVar = c(rowWeightedVars, colWeightedVars), 600s + weightedSd = c(rowWeightedSds, colWeightedSds), 600s + weightedMad = c(rowWeightedMads, colWeightedMads) 600s + ) 600s > 600s > 600s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 600s > # Subsetted tests 600s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 600s > source("utils/validateIndicesFramework.R") 600s > # To check names attribute 600s > dimnames <- list(letters[1:6], LETTERS[1:6]) 600s > for (fcn in names(fcns)) { 600s + cat(sprintf("subsetted tests on matrix %s()...\n", fcn)) 600s + row_fcn <- fcns[[fcn]][[1]] 600s + col_fcn <- fcns[[fcn]][[2]] 600s + 600s + for (mode in c("numeric", "integer")) { 600s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 600s + w <- runif(6, min = 0, max = 6) 600s + storage.mode(x) <- mode 600s + storage.mode(w) <- mode 600s + if (mode == "numeric") w[1] <- Inf 600s + 600s + # Test with and without dimnames on x 600s + for (setDimnames in c(TRUE, FALSE)) { 600s + if (setDimnames) dimnames(x) <- dimnames 600s + else dimnames(x) <- NULL 600s + 600s + count <- 0L 600s + for (rows in index_cases) { 600s + for (cols in index_cases) { 600s + count <- count + 1L 600s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 600s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 600s + useNames <- useNames[count %% length(useNames) + 1] 600s + 600s + validateIndicesTestMatrix_w(x, w, rows, cols, 600s + ftest = row_fcn, fsure = row_fcn, 600s + na.rm = na.rm, useNames = useNames) 600s + validateIndicesTestMatrix_w(x, w, rows, cols, 600s + fcoltest = col_fcn, fsure = row_fcn, 600s + na.rm = na.rm, useNames = useNames) 600s + } 600s + } 600s + } 600s + } 600s + cat(sprintf("%s()...DONE\n", fcn)) 600s + } 600s subsetted tests on matrix weightedVar()... 603s weightedVar()...DONE 603s subsetted tests on matrix weightedSd()... 606s weightedSd()...DONE 606s subsetted tests on matrix weightedMad()... 608s weightedMad()...DONE 608s > 608s 608s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 608s Copyright (C) 2024 The R Foundation for Statistical Computing 608s Platform: arm-unknown-linux-gnueabihf (32-bit) 608s 608s R is free software and comes with ABSOLUTELY NO WARRANTY. 608s You are welcome to redistribute it under certain conditions. 608s Type 'license()' or 'licence()' for distribution details. 608s 608s R is a collaborative project with many contributors. 608s Type 'contributors()' for more information and 608s 'citation()' on how to cite R or R packages in publications. 608s 608s Type 'demo()' for some demos, 'help()' for on-line help, or 608s 'help.start()' for an HTML browser interface to help. 608s Type 'q()' to quit R. 608s 608s > library("matrixStats") 608s > 608s > signTabulate0 <- function(x, ...) { 608s + nneg <- sum(x < 0, na.rm = TRUE) 608s + nzero <- sum(x == 0, na.rm = TRUE) 608s + npos <- sum(x > 0, na.rm = TRUE) 608s + nna <- sum(is.na(x)) 608s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 608s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 608s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 608s + res <- as.double(res) 608s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 608s + if (is.integer(x)) res <- res[1:4] 608s + res 608s + } # signTabulate0() 608s > 608s > 608s > # Simulate data 608s > set.seed(0xBEEF) 608s > n <- 100L 608s Doubles: 608s > x <- runif(n) 608s > x[sample(n, size = 0.1 * n)] <- 0 608s > x[sample(n, size = 0.1 * n)] <- NA_real_ 608s > x[sample(n, size = 0.1 * n)] <- -Inf 608s > x[sample(n, size = 0.1 * n)] <- +Inf 608s > 608s > # Doubles 608s > message("Doubles:") 608s > counts0 <- signTabulate0(x) 608s > print(counts0) 608s -1 0 +1 NA -Inf +Inf 608s 9 7 77 7 9 10 608s > counts1 <- signTabulate(x) 608s > print(counts1) 608s -1 0 +1 NA -Inf +Inf 608s 9 7 77 7 9 10 608s > stopifnot(identical(counts1, counts0)) 608s > 608s > # Integers 608s > message("Integers:") 608s Integers: 608s > x <- suppressWarnings(as.integer(x)) 608s > counts0 <- signTabulate0(x) 608s > print(counts0) 608s -1 0 +1 NA 608s 0 74 0 26 608s > counts1 <- signTabulate(x) 608s > print(counts1) 608s -1 0 +1 NA 608s 0 74 0 26 608s > stopifnot(identical(counts1, counts0)) 608s > 608s 608s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 608s Copyright (C) 2024 The R Foundation for Statistical Computing 608s Platform: arm-unknown-linux-gnueabihf (32-bit) 608s 608s R is free software and comes with ABSOLUTELY NO WARRANTY. 608s You are welcome to redistribute it under certain conditions. 608s Type 'license()' or 'licence()' for distribution details. 608s 608s R is a collaborative project with many contributors. 608s Type 'contributors()' for more information and 608s 'citation()' on how to cite R or R packages in publications. 608s 608s Type 'demo()' for some demos, 'help()' for on-line help, or 608s 'help.start()' for an HTML browser interface to help. 608s Type 'q()' to quit R. 608s 609s > library("matrixStats") 609s > 609s > signTabulate0 <- function(x, ...) { 609s + nneg <- sum(x < 0, na.rm = TRUE) 609s + nzero <- sum(x == 0, na.rm = TRUE) 609s + npos <- sum(x > 0, na.rm = TRUE) 609s + nna <- sum(is.na(x)) 609s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 609s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 609s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 609s + res <- as.double(res) 609s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 609s + if (is.integer(x)) res <- res[1:4] 609s + res 609s + } # signTabulate0() 609s > 609s > 609s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 609s > # Subsetted tests 609s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 609s > source("utils/validateIndicesFramework.R") 609s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 609s > x[2:3, 4:5] <- +Inf 609s > x[4:5, 1:2] <- -Inf 609s > for (idxs in index_cases) { 609s + validateIndicesTestVector(x, idxs, 609s + ftest = signTabulate, fsure = signTabulate0) 609s + } 609s > 609s 609s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 609s Copyright (C) 2024 The R Foundation for Statistical Computing 609s Platform: arm-unknown-linux-gnueabihf (32-bit) 609s 609s R is free software and comes with ABSOLUTELY NO WARRANTY. 609s You are welcome to redistribute it under certain conditions. 609s Type 'license()' or 'licence()' for distribution details. 609s 609s R is a collaborative project with many contributors. 609s Type 'contributors()' for more information and 609s 'citation()' on how to cite R or R packages in publications. 609s 609s Type 'demo()' for some demos, 'help()' for on-line help, or 609s 'help.start()' for an HTML browser interface to help. 609s Type 'q()' to quit R. 609s 609s > library("matrixStats") 609s > options(warn = 1) 609s > 609s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 609s > # Consistency checks 609s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 609s > set.seed(1) 609s > 609s > sum2_R <- function(x, na.rm = FALSE, idxs = NULL) { 609s + if (is.null(idxs)) { 609s + sum(x, na.rm = na.rm) 609s + } else { 609s + sum(x[idxs], na.rm = na.rm) 609s + } 609s + } # sum2_R() 609s > 609s > 609s > cat("Consistency checks:\n") 609s Consistency checks: 609s > for (kk in 1:20) { 609s + cat("Random test #", kk, "\n", sep = "") 609s + 609s + # Simulate data in a matrix of any shape 609s + n <- sample(1e3, size = 1L) 609s + x <- rnorm(n, sd = 100) 609s + 609s + # Add NAs? 609s + if ((kk %% 4) %in% c(3, 0)) { 609s + cat("Adding NAs\n") 609s + nna <- sample(n, size = 1L) 609s + na_values <- c(NA_real_, NaN) 609s + t <- sample(na_values, size = nna, replace = TRUE) 609s + x[sample(length(x), size = nna)] <- t 609s + } 609s + 609s + # Integer or double? 609s + if ((kk %% 4) %in% c(2, 0)) { 609s + cat("Coercing to integers\n") 609s + storage.mode(x) <- "integer" 609s + } 609s + 609s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 609s + 609s + # Sum over all 609s + y0 <- sum2_R(x, na.rm = na.rm) 609s + y1 <- sum2(x, na.rm = na.rm) 609s + stopifnot(all.equal(y1, y0)) 609s + 609s + # Sum over subset 609s + nidxs <- sample(n, size = 1L) 609s + idxs <- sample(n, size = nidxs) 609s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 609s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 609s + stopifnot(all.equal(y1, y0)) 609s + 609s + if (storage.mode(x) == "integer") { 609s + storage.mode(x) <- "logical" 609s + 609s + y0 <- sum2_R(x, na.rm = na.rm) 609s + y1 <- sum2(x, na.rm = na.rm) 609s + stopifnot(all.equal(y1, y0)) 609s + 609s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 609s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 609s + stopifnot(all.equal(y1, y0)) 609s + } 609s + } # for (kk ...) 609s Random test #1 609s Random test #2 609s Coercing to integers 609s Random test #3 609s Adding NAs 609s Random test #4 609s Adding NAs 609s Coercing to integers 609s Random test #5 609s Random test #6 609s Coercing to integers 609s Random test #7 609s Adding NAs 609s Random test #8 609s Adding NAs 609s Coercing to integers 609s Random test #9 609s Random test #10 609s Coercing to integers 609s Random test #11 609s Adding NAs 609s Random test #12 609s Adding NAs 609s Coercing to integers 609s Random test #13 609s Random test #14 609s Coercing to integers 609s Random test #15 609s Adding NAs 609s Random test #16 610s Adding NAs 610s Coercing to integers 610s Random test #17 610s Random test #18 610s Coercing to integers 610s Random test #19 610s Adding NAs 610s Random test #20 610s Adding NAs 610s Coercing to integers 610s > 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # All missing values 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > for (n in 0:2) { 610s + for (na.rm in c(FALSE, TRUE)) { 610s + x <- rep(NA_real_, times = n) 610s + y0 <- sum(x, na.rm = na.rm) 610s + y <- sum2(x, na.rm = na.rm) 610s + stopifnot(all.equal(y, y0)) 610s + 610s + x <- rep(NA_integer_, times = n) 610s + y0 <- sum(x, na.rm = na.rm) 610s + y <- sum2(x, na.rm = na.rm) 610s + stopifnot(all.equal(y, y0)) 610s + 610s + x <- rep(NA, times = n) 610s + y0 <- sum(x, na.rm = na.rm) 610s + y <- sum2(x, na.rm = na.rm) 610s + stopifnot(all.equal(y, y0)) 610s + } 610s + } 610s > 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # Special cases 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > for (na.rm in c(FALSE, TRUE)) { 610s + # Summing over zero elements (integers) 610s + x <- integer(0) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot(identical(s1, s2)) 610s + 610s + x <- 1:10 610s + idxs <- integer(0) 610s + s1 <- sum(x[idxs], na.rm = na.rm) 610s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 610s + stopifnot(identical(s1, s2)) 610s + 610s + # Summing over NA_integer_:s 610s + x <- rep(NA_integer_, times = 10L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot(identical(s1, s2)) 610s + 610s + x <- rep(NA_integer_, times = 10L) 610s + idxs <- 1:5 610s + s1 <- sum(x[idxs], na.rm = na.rm) 610s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 610s + stopifnot(identical(s1, s2)) 610s + 610s + 610s + # Summing over zero elements (doubles) 610s + x <- double(0) 610s + s1 <- sum(x) 610s + s2 <- sum2(x) 610s + stopifnot( 610s + identical(s1, 0), 610s + identical(s1, s2) 610s + ) 610s + 610s + x <- as.double(1:10) 610s + idxs <- integer(0) 610s + s1 <- sum(x[idxs]) 610s + s2 <- sum2(x, idxs = idxs) 610s + stopifnot( 610s + identical(s1, 0), 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over NA_real_:s 610s + x <- rep(NA_real_, times = 10L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot( 610s + !na.rm || s1 == 0, 610s + identical(s1, s2) 610s + ) 610s + 610s + x <- rep(NA_real_, times = 10L) 610s + idxs <- 1:5 610s + s1 <- sum(x[idxs], na.rm = na.rm) 610s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 610s + stopifnot( 610s + !na.rm || s1 == 0, 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over -Inf:s 610s + x <- rep(-Inf, times = 3L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot( 610s + is.infinite(s1) && s1 < 0, 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over +Inf:s 610s + x <- rep(+Inf, times = 3L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot(identical(s1, s2)) 610s + stopifnot( 610s + is.infinite(s1) && s1 > 0, 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over mix of -Inf:s and +Inf:s 610s + x <- rep(c(-Inf, +Inf), times = 3L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot( 610s + is.nan(s1), 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over mix of -Inf:s and +Inf:s and numerics 610s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + stopifnot( 610s + is.nan(s1), 610s + identical(s1, s2) 610s + ) 610s + 610s + # Summing over mix of NaN, NA, +Inf, and numerics 610s + x <- c(NaN, NA, +Inf, 3.14) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + if (na.rm) { 610s + stopifnot( 610s + is.infinite(s1) && s1 > 0, 610s + identical(s2, s1) 610s + ) 610s + } else { 610s + stopifnot(is.na(s1), is.na(s2)) 610s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 610s + ## returned here (as one would expect). NaN might very well be returned, 610s + ## when both NA and NaN are involved. This is an accepted feature in R, 610s + ## which is documented in help("is.nan"). See also 610s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 610s + ## Thus, we cannot guarantee that s1 is identical to s0. 610s + } 610s + 610s + # Summing over mix of NaN, NA, +Inf, and numerics 610s + x <- c(NA, NaN, +Inf, 3.14) 610s + s1 <- sum(x, na.rm = na.rm) 610s + s2 <- sum2(x, na.rm = na.rm) 610s + if (na.rm) { 610s + stopifnot( 610s + is.infinite(s1) && s1 > 0, 610s + identical(s2, s1) 610s + ) 610s + } else { 610s + stopifnot(is.na(s1), is.na(s2)) 610s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 610s + ## returned here (as one would expect). NaN might very well be returned, 610s + ## when both NA and NaN are involved. This is an accepted feature in R, 610s + ## which is documented in help("is.nan"). See also 610s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 610s + ## Thus, we cannot guarantee that s1 is identical to s0. 610s + } 610s + } 610s > 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # Summing of large integers 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > x <- c(.Machine$integer.max, 1L, -.Machine$integer.max) 610s > 610s > # Total gives integer overflow 610s > s1 <- sum(x[1:2]) # NA_integer_ w/ warning 610s > s2 <- sum2(x[1:2]) # NA_integer_ w/ warning 610s > stopifnot( 610s + getRversion() >= "3.5.0" || identical(s1, NA_integer_), 610s + identical(s2, NA_integer_) 610s + ) 610s Warning in sum2(x[1:2]) : 610s Integer overflow. Use sum2(..., mode = "double") to avoid this. 610s > 610s > ## Assert above warning 610s > res <- tryCatch({ 610s + s2 <- sum2(x[1:2]) 610s + }, warning = identity) 610s > stopifnot(inherits(res, "warning")) 610s > 610s > 610s > # Total gives integer overflow (coerce to numeric) 610s > s1 <- sum(as.numeric(x[1:2])) # 2147483648 610s > s2 <- sum2(as.numeric(x[1:2])) # 2147483648 610s > s3 <- sum2(x[1:2], mode = "double") # 2147483648 610s > stopifnot( 610s + identical(s1, 2147483648), 610s + identical(s1, s2), 610s + identical(s1, s3) 610s + ) 610s > 610s > # Cumulative sum would give integer overflow but not the total 610s > s1 <- sum(x) # 1L 610s > s2 <- sum2(x) # 1L 610s > stopifnot( 610s + identical(s1, 1L), 610s + identical(s1, s2) 610s + ) 610s > 610s > # Input is double but coersing result to integer 610s > x <- c(1, 2, 3.1) 610s > s1 <- sum2(x) 610s > s2 <- sum2(x, mode = "integer") 610s Warning in sum2(x, mode = "integer") : 610s sum2(x, mode = "integer") called with typeof(x) == "double"; did you mean to use as.integer(sum2(x))? 610s > stopifnot( 610s + identical(as.integer(s1), s2) 610s + ) 610s > 610s > ## Assert above warning 610s > res <- tryCatch({ 610s + s2 <- sum2(x, mode = "integer") 610s + }, warning = identity) 610s > stopifnot(inherits(res, "warning")) 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # Summing of large doubles 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > ## Double overflow 610s > x <- rep(.Machine$double.xmax, times = 2L) 610s > y0 <- sum(x) 610s > print(y0) 610s [1] Inf 610s > y <- sum2(x) 610s > print(y) 610s [1] Inf 610s > stopifnot( 610s + is.infinite(y) && y > 0, 610s + identical(y, y0) 610s + ) 610s > 610s > x <- rep(-.Machine$double.xmax, times = 2L) 610s > y0 <- sum(x) 610s > print(y0) 610s [1] -Inf 610s > y <- sum2(x) 610s > print(y) 610s [1] -Inf 610s > stopifnot( 610s + is.infinite(y) && y < 0, 610s + identical(y, y0) 610s + ) 610s > 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # Argument 'idxs' 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > x <- 1:10 610s > idxs_list <- list( 610s + integer = 1:5, 610s + double = as.double(1:5), 610s + logical = (x <= 5) 610s + ) 610s > 610s > for (idxs in idxs_list) { 610s + cat("idxs:\n") 610s + str(idxs) 610s + s1 <- sum(x[idxs], na.rm = TRUE) 610s + s2 <- sum2(x, idxs = idxs, na.rm = TRUE) 610s + stopifnot(identical(s1, s2)) 610s + } 610s idxs: 610s int [1:5] 1 2 3 4 5 610s idxs: 610s num [1:5] 1 2 3 4 5 610s idxs: 610s logi [1:10] TRUE TRUE TRUE TRUE TRUE FALSE ... 610s > 610s 610s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 610s Copyright (C) 2024 The R Foundation for Statistical Computing 610s Platform: arm-unknown-linux-gnueabihf (32-bit) 610s 610s R is free software and comes with ABSOLUTELY NO WARRANTY. 610s You are welcome to redistribute it under certain conditions. 610s Type 'license()' or 'licence()' for distribution details. 610s 610s R is a collaborative project with many contributors. 610s Type 'contributors()' for more information and 610s 'citation()' on how to cite R or R packages in publications. 610s 610s Type 'demo()' for some demos, 'help()' for on-line help, or 610s 'help.start()' for an HTML browser interface to help. 610s Type 'q()' to quit R. 610s 610s > library("matrixStats") 610s > 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > # Subsetted tests 610s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 610s > source("utils/validateIndicesFramework.R") 610s > x <- runif(6, min = -6, max = 6) 610s > storage.mode(x) <- "integer" 610s > for (idxs in index_cases) { 610s + validateIndicesTestVector(x, idxs, 610s + ftest = sum2, fsure = sum, 610s + na.rm = FALSE) 610s + validateIndicesTestVector(x, idxs, 610s + ftest = sum2, fsure = sum, 610s + na.rm = TRUE) 610s + } 610s > 611s 611s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 611s Copyright (C) 2024 The R Foundation for Statistical Computing 611s Platform: arm-unknown-linux-gnueabihf (32-bit) 611s 611s R is free software and comes with ABSOLUTELY NO WARRANTY. 611s You are welcome to redistribute it under certain conditions. 611s Type 'license()' or 'licence()' for distribution details. 611s 611s R is a collaborative project with many contributors. 611s Type 'contributors()' for more information and 611s 'citation()' on how to cite R or R packages in publications. 611s 611s Type 'demo()' for some demos, 'help()' for on-line help, or 611s 'help.start()' for an HTML browser interface to help. 611s Type 'q()' to quit R. 611s 611s > library(matrixStats) 611s > source("utils/validateIndicesFramework.R") 611s > 611s > oopts <- options(matrixStats.validateIndices = "ignore") 611s > 611s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 611s > 611s > x <- 1:6 611s > for (idxs in index_cases) { 611s + for (mode in c("integer", "numeric", "logical")) { 611s + if (!is.null(idxs)) { 611s + suppressWarnings({storage.mode(idxs) <- mode}) 611s + } 611s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 611s + } 611s + } 611s > 611s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 611s > 611s > for (idxs in index_error_cases) { 611s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 611s + } 611s > 611s > 611s > ftest <- function(x, rows, cols) { 611s + vr <- validateIndices(rows, dim(x)[1], FALSE) 611s + vc <- validateIndices(cols, dim(x)[2], FALSE) 611s + 611s + stopifnot(all((vr > 0 & vr <= dim(x)[1]) | is.na(vr))) 611s + stopifnot(all((vc > 0 & vc <= dim(x)[2]) | is.na(vc))) 611s + suppressWarnings(x <- x[vr, vc, drop = FALSE]) 611s + x 611s + } 611s > 611s > x <- matrix(1:36, nrow = 6, ncol = 6) 611s > for (rows in index_cases) { 611s + for (cols in index_cases) { 611s + validateIndicesTestMatrix(x, rows, cols, ftest = ftest, fsure = identity) 611s + } 611s + } 611s > 611s > # Testing for 64-bit builds (64 bits = 8 bytes) 611s > if (.Machine$sizeof.pointer == 8L) { 611s + validateIndices(c(1.25*2^40, 3, 1*2^38, 1, 1.4*2^39), maxIdx = 1*2^41) 611s + } 611s > 611s > options(oopts) 611s > 612s 612s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 612s Copyright (C) 2024 The R Foundation for Statistical Computing 612s Platform: arm-unknown-linux-gnueabihf (32-bit) 612s 612s R is free software and comes with ABSOLUTELY NO WARRANTY. 612s You are welcome to redistribute it under certain conditions. 612s Type 'license()' or 'licence()' for distribution details. 612s 612s R is a collaborative project with many contributors. 612s Type 'contributors()' for more information and 612s 'citation()' on how to cite R or R packages in publications. 612s 612s Type 'demo()' for some demos, 'help()' for on-line help, or 612s 'help.start()' for an HTML browser interface to help. 612s Type 'q()' to quit R. 612s 612s > library("matrixStats") 612s > 612s > set.seed(1) 612s > x <- rnorm(1e4) 612s > 612s > 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > # Variance estimators 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > sigma2_a <- var(x) 612s > cat(sprintf("var(x) = %g\n", sigma2_a)) 612s var(x) = 1.02487 612s > 612s > sigma2_b <- varDiff(x) 612s > cat(sprintf("varDiff(x) = %g\n", sigma2_b)) 612s varDiff(x) = 1.01224 612s > 612s > d <- abs(sigma2_b - sigma2_a) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 0.0126268 612s > stopifnot(d < 0.02) 612s > 612s > 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > # Standard deviation estimators 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > sigma_a <- sd(x) 612s > cat(sprintf("sd(x) = %g\n", sigma_a)) 612s sd(x) = 1.01236 612s > 612s > sigma_b <- sdDiff(x) 612s > cat(sprintf("sdDiff(x) = %g\n", sigma_b)) 612s sdDiff(x) = 1.0061 612s > 612s > d <- abs(sigma_b - sigma_a) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 0.00625567 612s > stopifnot(d < 0.01) 612s > 612s > # Sanity checks 612s > stopifnot(abs(sigma2_a - sigma_a ^ 2) < 1e-9) 612s > stopifnot(abs(sigma2_b - sigma_b ^ 2) < 1e-9) 612s > 612s > 612s > sigma_a2 <- mad(x) 612s > cat(sprintf("mad(x) = %g\n", sigma_a2)) 612s mad(x) = 0.998376 612s > 612s > sigma_b2 <- madDiff(x) 612s > cat(sprintf("madDiff(x) = %g\n", sigma_b2)) 612s madDiff(x) = 1.02513 612s > 612s > d <- abs(sigma_b2 - sigma_a2) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 0.0267497 612s > stopifnot(d < 0.05) 612s > 612s > 612s > sigma_a3 <- IQR(x) 612s > cat(sprintf("IQR(x) = %g\n", sigma_a3)) 612s IQR(x) = 1.35105 612s > 612s > sigma_b3 <- iqrDiff(x) 612s > cat(sprintf("iqrDiff(x) = %g\n", sigma_b3)) 612s iqrDiff(x) = 1.37797 612s > 612s > d <- abs(sigma_b3 - sigma_a3) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 0.0269152 612s > stopifnot(d < 0.05) 612s > 612s > 612s > 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > # Trimmed estimators 612s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 612s > y <- x 612s > outliers <- sample(length(x), size = 0.1 * length(x)) 612s > y[outliers] <- 100 * y[outliers] 612s > 612s > sigma_ao <- sd(y[-outliers]) 612s > cat(sprintf("sd(y) = %g\n", sigma_ao)) 612s sd(y) = 1.01166 612s > 612s > sigma_bo <- sdDiff(y[-outliers]) 612s > cat(sprintf("sdDiff(y) = %g\n", sigma_bo)) 612s sdDiff(y) = 1.00743 612s > 612s > d <- abs(sigma_b - sigma_a) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 0.00625567 612s > stopifnot(d < 0.01) 612s > 612s > sigma_bot <- sdDiff(y, trim = 0.05) 612s > cat(sprintf("sdDiff(y, trim = 0.05) = %g\n", sigma_bot)) 612s sdDiff(y, trim = 0.05) = 7.74327 612s > 612s > d <- abs(sigma_bot - sigma_a) 612s > cat(sprintf("Absolute difference = %g\n", d)) 612s Absolute difference = 6.73091 612s > #stopifnot(d < 1e-3) 612s > 612s > sigma_cot <- madDiff(y, trim = 0.05) 612s > cat(sprintf("madDiff(y, trim = 0.05) = %g\n", sigma_cot)) 612s madDiff(y, trim = 0.05) = 1.15278 612s > 612s > sigma_dot <- iqrDiff(y, trim = 0.05) 612s > cat(sprintf("iqrDiff(y, trim = 0.05) = %g\n", sigma_dot)) 612s iqrDiff(y, trim = 0.05) = 1.55762 612s > 612s > 612s > fcns <- list( 612s + varDiff = varDiff, 612s + sdDiff = sdDiff, 612s + madDiff = madDiff, 612s + iqrDiff = iqrDiff 612s + ) 612s > 612s > for (name in names(fcns)) { 612s + cat(sprintf("%s()...\n", name)) 612s + fcn <- fcns[[name]] 612s + 612s + for (mode in c("integer", "double")) { 612s + cat("mode: ", mode, "", sep = "") 612s + for (n in 0:3) { 612s + x <- runif(n, min = -5, max = 5) 612s + storage.mode(x) <- mode 612s + str(x) 612s + 612s + y <- fcn(x) 612s + yt <- fcn(x, trim = 0.1) 612s + str(list("non-trimmed" = y, trimmed = yt)) 612s + } # for (mode ...) 612s + } 612s + 612s + cat(sprintf("%s()...DONE\n", name)) 612s + } # for (name ...) 612s varDiff()... 612s mode: integer int(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int -4 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:2] 3 2 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:3] 1 4 -1 612s List of 2 612s $ non-trimmed: num 16 612s $ trimmed : num 16 612s mode: double num(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num -0.794 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:2] 0.897 -3.728 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:3] 2.07 -1.13 1.94 612s List of 2 612s $ non-trimmed: num 9.83 612s $ trimmed : num 9.83 612s varDiff()...DONE 612s sdDiff()... 612s mode: integer int(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int 2 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:2] -4 1 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:3] -2 1 -1 612s List of 2 612s $ non-trimmed: num 2.5 612s $ trimmed : num 2.5 612s mode: double num(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num -3.78 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:2] -2.04 2.38 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:3] 1.42 -2.14 1.14 612s List of 2 612s $ non-trimmed: num 3.42 612s $ trimmed : num 3.42 612s sdDiff()...DONE 612s madDiff()... 612s mode: integer int(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int -1 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:2] -1 4 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int [1:3] -1 0 -3 612s List of 2 612s $ non-trimmed: num 2.1 612s $ trimmed : num 2.1 612s mode: double num(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num -1.13 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:2] -1.7 -1.21 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num [1:3] -2.39 -0.464 3.086 612s List of 2 612s $ non-trimmed: num 0.851 612s $ trimmed : num 0.851 612s madDiff()...DONE 612s iqrDiff()... 612s mode: integer int(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s int 3 612s List of 2 612s $ non-trimmed: num 0 612s $ trimmed : num 0 612s int [1:2] -3 4 612s List of 2 612s $ non-trimmed: num 0 612s $ trimmed : num 0 612s int [1:3] 0 -2 -2 612s List of 2 612s $ non-trimmed: num 0.707 612s $ trimmed : num 0.707 612s mode: double num(0) 612s List of 2 612s $ non-trimmed: num NA 612s $ trimmed : num NA 612s num -4.46 612s List of 2 612s $ non-trimmed: num 0 612s $ trimmed : num 0 612s num [1:2] 3.67 1.02 612s List of 2 612s $ non-trimmed: num 0 612s $ trimmed : num 0 612s num [1:3] -0.537 -2.733 2.857 612s List of 2 612s $ non-trimmed: num 2.75 612s $ trimmed : num 2.75 612s iqrDiff()...DONE 612s > 612s 612s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 612s Copyright (C) 2024 The R Foundation for Statistical Computing 612s Platform: arm-unknown-linux-gnueabihf (32-bit) 612s 612s R is free software and comes with ABSOLUTELY NO WARRANTY. 612s You are welcome to redistribute it under certain conditions. 612s Type 'license()' or 'licence()' for distribution details. 612s 612s R is a collaborative project with many contributors. 612s Type 'contributors()' for more information and 612s 'citation()' on how to cite R or R packages in publications. 612s 612s Type 'demo()' for some demos, 'help()' for on-line help, or 612s 'help.start()' for an HTML browser interface to help. 612s Type 'q()' to quit R. 612s 613s > library("matrixStats") 613s > 613s > fcns <- list( 613s + varDiff = varDiff, 613s + sdDiff = sdDiff, 613s + madDiff = madDiff, 613s + iqrDiff = iqrDiff 613s + ) 613s > 613s > 613s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 613s > # Subsetted tests 613s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 613s > source("utils/validateIndicesFramework.R") 613s > for (name in names(fcns)) { 613s + cat(sprintf("subsetted tests on %s()...\n", name)) 613s + fcn <- fcns[[name]] 613s + 613s + for (mode in c("numeric", "integer")) { 613s + x <- runif(6, min = -6, max = 6) 613s + storage.mode(x) <- mode 613s + trim <- runif(1, min = 0, max = 0.5) 613s + if (mode == "numeric") x[1] <- Inf 613s + 613s + for (diff in 1:2) { 613s + for (idxs in index_cases) { 613s + validateIndicesTestVector(x, idxs, 613s + ftest = fcn, fsure = fcn, 613s + na.rm = TRUE, diff = diff, trim = trim) 613s + validateIndicesTestVector(x, idxs, 613s + ftest = fcn, fsure = fcn, 613s + na.rm = FALSE, diff = diff, trim = trim) 613s + } 613s + } 613s + } 613s + cat(sprintf("%s()...DONE\n", name)) 613s + } 613s subsetted tests on varDiff()... 613s varDiff()...DONE 613s subsetted tests on sdDiff()... 613s sdDiff()...DONE 613s subsetted tests on madDiff()... 613s madDiff()...DONE 613s subsetted tests on iqrDiff()... 613s iqrDiff()...DONE 613s > 613s 613s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 613s Copyright (C) 2024 The R Foundation for Statistical Computing 613s Platform: arm-unknown-linux-gnueabihf (32-bit) 613s 613s R is free software and comes with ABSOLUTELY NO WARRANTY. 613s You are welcome to redistribute it under certain conditions. 613s Type 'license()' or 'licence()' for distribution details. 613s 613s R is a collaborative project with many contributors. 613s Type 'contributors()' for more information and 613s 'citation()' on how to cite R or R packages in publications. 613s 613s Type 'demo()' for some demos, 'help()' for on-line help, or 613s 'help.start()' for an HTML browser interface to help. 613s Type 'q()' to quit R. 613s 613s > library("matrixStats") 614s > 614s > for (mode in c("logical", "integer", "double")) { 614s + cat("mode: ", mode, "", sep = "") 614s + n <- 2L 614s + x <- runif(n, min = -5, max = 5) 614s + if (mode == "logical") { 614s + x <- x > 0 614s + } 614s + storage.mode(x) <- mode 614s + str(x) 614s + 614s + cat("All weights are 1\n") 614s + w <- rep(1, times = n) 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + 614s + cat("First weight is 5\n") 614s + # Pull the mean towards zero 614s + w[1] <- 5 614s + str(w) 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + 614s + cat("All weights are 0\n") 614s + # All weights set to zero 614s + w <- rep(0, times = n) 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + 614s + cat("First weight is 8.5\n") 614s + # Put even more weight on the zero 614s + w[1] <- 8.5 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + 614s + cat("First weight is Inf\n") 614s + # All weight on the first value 614s + w[1] <- Inf 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + 614s + cat("Last weight is Inf\n") 614s + # All weight on the last value 614s + w[1] <- 1 614s + w[n] <- Inf 614s + m0 <- weighted.mean(x, w) 614s + m1 <- weightedMean(x, w) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(identical(m1, m0)) 614s + } # for (mode ...) 614s mode: logical logi [1:2] TRUE TRUE 614s All weights are 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s First weight is 5 614s num [1:2] 5 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s All weights are 0 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s First weight is 8.5 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s First weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s Last weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s mode: integer int [1:2] -3 0 614s All weights are 1 614s List of 2 614s $ m0: num -1.5 614s $ m1: num -1.5 614s First weight is 5 614s num [1:2] 5 1 614s List of 2 614s $ m0: num -2.5 614s $ m1: num -2.5 614s All weights are 0 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s First weight is 8.5 614s List of 2 614s $ m0: num -3 614s $ m1: num -3 614s First weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s Last weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s mode: double num [1:2] -3.8 3.02 614s All weights are 1 614s List of 2 614s $ m0: num -0.389 614s $ m1: num -0.389 614s First weight is 5 614s num [1:2] 5 1 614s List of 2 614s $ m0: num -2.66 614s $ m1: num -2.66 614s All weights are 0 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s First weight is 8.5 614s List of 2 614s $ m0: num -3.8 614s $ m1: num -3.8 614s First weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s Last weight is Inf 614s List of 2 614s $ m0: num NaN 614s $ m1: num NaN 614s > 614s > 614s > message("*** Testing for missing values") 614s *** Testing for missing values 614s > # NA tests 614s > xs <- list(A = c(1, 2, 3), B = c(NA, 2, 3), C = c(NA, 2, 3)) 614s > ws <- list(A = c(1, 1, 1), B = c(NA, 1, 1), C = c(1, NA, 1)) 614s > ## NOTE: The (B, B) case with na.rm = TRUE is interesting because 614s > ## even if NAs in 'w' are not dropped by na.rm = TRUE, this one 614s > ## is because 'x' is dropped and therefore that first element 614s > ## is skipped in the computation. It basically does 614s > ## keep <- !is.na(x); x <- x[keep]; w <- w[keep] 614s > ## without looking at 'w'. 614s > for (x in xs) { 614s + for (mode in c("logical", "integer", "double")) { 614s + storage.mode(x) <- mode 614s + for (w in ws) { 614s + for (na.rm in c(FALSE, TRUE)) { 614s + cat(sprintf("mode: %s, na.rm = %s\n", mode, na.rm)) 614s + str(list(x = x, w = w)) 614s + m0 <- weighted.mean(x, w, na.rm = na.rm) 614s + m1 <- weightedMean(x, w, na.rm = na.rm) 614s + str(list(m0 = m0, m1 = m1)) 614s + stopifnot(all.equal(m1, m0)) 614s + } 614s + } 614s + } 614s + } 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] TRUE TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] 1 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] 1 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: logical, na.rm = FALSE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: logical, na.rm = TRUE 614s List of 2 614s $ x: logi [1:3] NA TRUE TRUE 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: integer, na.rm = FALSE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: integer, na.rm = TRUE 614s List of 2 614s $ x: int [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] NA 1 1 614s List of 2 614s $ m0: num 1 614s $ m1: num 1 614s mode: double, na.rm = FALSE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s mode: double, na.rm = TRUE 614s List of 2 614s $ x: num [1:3] NA 1 1 614s $ w: num [1:3] 1 NA 1 614s List of 2 614s $ m0: num NA 614s $ m1: num NA 614s > 614s 614s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 614s Copyright (C) 2024 The R Foundation for Statistical Computing 614s Platform: arm-unknown-linux-gnueabihf (32-bit) 614s 614s R is free software and comes with ABSOLUTELY NO WARRANTY. 614s You are welcome to redistribute it under certain conditions. 614s Type 'license()' or 'licence()' for distribution details. 614s 614s R is a collaborative project with many contributors. 614s Type 'contributors()' for more information and 614s 'citation()' on how to cite R or R packages in publications. 614s 614s Type 'demo()' for some demos, 'help()' for on-line help, or 614s 'help.start()' for an HTML browser interface to help. 614s Type 'q()' to quit R. 614s 615s > library("matrixStats") 615s > 615s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 615s > # Subsetted tests 615s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 615s > source("utils/validateIndicesFramework.R") 615s > for (mode in c("numeric", "integer")) { 615s + x <- runif(6, min = -6, max = 6) 615s + w <- runif(6, min = 0, max = 6) 615s + storage.mode(x) <- mode 615s + storage.mode(w) <- mode 615s + if (mode == "numeric") w[1] <- Inf 615s + 615s + for (idxs in index_cases) { 615s + validateIndicesTestVector_w(x, w, idxs, 615s + ftest = weightedMean, fsure = weighted.mean, 615s + na.rm = TRUE, refine = TRUE) 615s + validateIndicesTestVector_w(x, w, idxs, 615s + ftest = weightedMean, fsure = weighted.mean, 615s + na.rm = FALSE, refine = TRUE) 615s + } 615s + } 615s > 615s 615s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 615s Copyright (C) 2024 The R Foundation for Statistical Computing 615s Platform: arm-unknown-linux-gnueabihf (32-bit) 615s 615s R is free software and comes with ABSOLUTELY NO WARRANTY. 615s You are welcome to redistribute it under certain conditions. 615s Type 'license()' or 'licence()' for distribution details. 615s 615s R is a collaborative project with many contributors. 615s Type 'contributors()' for more information and 615s 'citation()' on how to cite R or R packages in publications. 615s 615s Type 'demo()' for some demos, 'help()' for on-line help, or 615s 'help.start()' for an HTML browser interface to help. 615s Type 'q()' to quit R. 615s 615s > library("matrixStats") 615s > 615s > x <- 1:5 615s > y <- weightedMedian(x) 615s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = TRUE) 615s > print(y) 615s [1] 3 615s > 615s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = FALSE) 615s > print(y) 615s [1] NA 615s > stopifnot(is.na(y)) 615s > 615s > x <- 1:10 615s > n <- length(x) 615s > 615s > y1 <- median(x) # 5.5 615s > y2 <- weightedMedian(x) # 5.5 615s > stopifnot(all.equal(y1, y2)) 615s > 615s > 615s > w <- rep(1, times = n) 615s > y1 <- weightedMedian(x, w) # 5.5 (default) 615s > y2a <- weightedMedian(x, ties = "weighted") # 5.5 (default) 615s > y2b <- weightedMedian(x, ties = "min") # 5 615s > y2c <- weightedMedian(x, ties = "max") # 6 615s > stopifnot(all.equal(y2a, y1)) 615s > 615s > y3 <- weightedMedian(x, w) # 5.5 (default) 615s > 615s > 615s > # Pull the median towards zero 615s > w[1] <- 5 615s > y1 <- weightedMedian(x, w) # 3.5 615s > y <- c(rep(0, times = w[1]), x[-1]) # Only possible for integer weights 615s > y2 <- median(y) # 3.5 615s > stopifnot(all.equal(y1, y2)) 615s > 615s > # Put even more weight on the zero 615s > w[1] <- 8.5 615s > y <- weightedMedian(x, w) # 2 615s > 615s > # All weight on the first value 615s > w[1] <- Inf 615s > y <- weightedMedian(x, w) # 1 615s > 615s > # All weight on the last value 615s > w[1] <- 1 615s > w[n] <- Inf 615s > y <- weightedMedian(x, w) # 10 615s > 615s > # All weights set to zero 615s > w <- rep(0, times = n) 615s > y <- weightedMedian(x, w) # NA 615s > 615s > x <- 1:4 615s > w <- rep(1, times = 4) 615s > for (mode in c("integer", "double")) { 615s + storage.mode(x) <- mode 615s + for (ties in c("weighted", "mean", "min", "max")) { 615s + cat(sprintf("ties = %s\n", ties)) 615s + y <- weightedMedian(x, w, ties = ties) 615s + } 615s + } 615s ties = weighted 615s ties = mean 615s ties = min 615s ties = max 615s ties = weighted 615s ties = mean 615s ties = min 615s ties = max 615s > 615s > set.seed(0x42) 615s > 615s > y <- weightedMedian(x = double(0L)) 615s > print(y) 615s [1] NA 615s > stopifnot(length(y) == 1L) 615s > stopifnot(is.na(y)) 615s > 615s > y <- weightedMedian(x = x[1]) 615s > print(y) 615s [1] 1 615s > stopifnot(length(y) == 1L) 615s > stopifnot(all.equal(y, x[1])) 615s > 615s > 615s > n <- 1e3 615s > x <- runif(n) 615s > w <- runif(n, min = 0, max = 1) 615s > for (mode in c("integer", "double")) { 615s + storage.mode(x) <- mode 615s + for (ties in c("weighted", "mean", "min", "max")) { 615s + y <- weightedMedian(x, w, ties = ties) 615s + cat(sprintf("mode = %s, ties = %s, result = %g\n", mode, ties, y)) 615s + } 615s + } 615s mode = integer, ties = weighted, result = 0 615s mode = integer, ties = mean, result = 0 615s mode = integer, ties = min, result = 0 615s mode = integer, ties = max, result = 0 615s mode = double, ties = weighted, result = 0 615s mode = double, ties = mean, result = 0 615s mode = double, ties = min, result = 0 615s mode = double, ties = max, result = 0 615s > 615s > 615s > # A large vector 615s > n <- 1e5 615s > x <- runif(n) 615s > w <- runif(n, min = 0, max = 1) 615s > y <- weightedMedian(x, w) 615s > 615s > y <- weightedMedian(x, w, ties = "min") 615s > 615s > 615s > # Single Number 615s > xs <- c(1, NA_integer_) 615s > ws <- c(1, NA_integer_) 615s > for (x in xs) { 615s + for (w in ws) { 615s + y <- weightedMedian(x = x, w = w) 615s + if (is.na(w)) z <- NA_real_ 615s + else z <- x[1] 615s + stopifnot(all.equal(y, z)) 615s + } 615s + } 615s > 615s > ## Logical 615s > x1 <- c(TRUE, FALSE, TRUE) 615s > w0 <- c(0, 0, 0) 615s > stopifnot(!is.finite(weightedMedian(x1, w0)), 615s + !is.infinite(weightedMedian(x1, w0))) 615s > 615s > w1 <- c(1, 1, 1) 615s > stopifnot(weightedMedian(x1, w1) == 1) 615s > 615s > w2 <- c(1, 2, 3) 615s > stopifnot(weightedMedian(x1, w2) == 1) 615s > 615s > ### NA 615s > stopifnot(is.na(weightedMedian(c(TRUE, FALSE, NA), 615s + c(1, 2, 3))), 615s + all.equal(weightedMedian(c(TRUE, FALSE, NA), 615s + c(1, 2, 3), 615s + na.rm = TRUE), 615s + weightedMedian(c(TRUE, FALSE), 615s + c(1, 2)))) 615s > ### Identical to as.integer() 615s > x <- rcauchy(100) 615s > w <- abs(rcauchy(100)) 615s > stopifnot(all.equal(weightedMedian(x > 0, w), 615s + weightedMedian(as.integer(x > 0), w))) 615s > 615s > 615s > 616s 616s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 616s Copyright (C) 2024 The R Foundation for Statistical Computing 616s Platform: arm-unknown-linux-gnueabihf (32-bit) 616s 616s R is free software and comes with ABSOLUTELY NO WARRANTY. 616s You are welcome to redistribute it under certain conditions. 616s Type 'license()' or 'licence()' for distribution details. 616s 616s R is a collaborative project with many contributors. 616s Type 'contributors()' for more information and 616s 'citation()' on how to cite R or R packages in publications. 616s 616s Type 'demo()' for some demos, 'help()' for on-line help, or 616s 'help.start()' for an HTML browser interface to help. 616s Type 'q()' to quit R. 616s 616s > library("matrixStats") 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Subsetted tests 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > source("utils/validateIndicesFramework.R") 616s > for (mode in c("numeric", "integer")) { 616s + x <- runif(6, min = -6, max = 6) 616s + w <- runif(6, min = 0, max = 6) 616s + storage.mode(x) <- mode 616s + storage.mode(w) <- mode 616s + if (mode == "numeric") w[1] <- Inf 616s + 616s + for (idxs in index_cases) { 616s + validateIndicesTestVector_w(x, w, idxs, 616s + ftest = weightedMedian, 616s + fsure = weightedMedian, 616s + na.rm = TRUE) 616s + validateIndicesTestVector_w(x, w, idxs, 616s + ftest = weightedMedian, 616s + fsure = weightedMedian, 616s + na.rm = FALSE) 616s + 616s + for (ties in c("weighted", "mean", "min", "max")) { 616s + validateIndicesTestVector_w(x, w, idxs, 616s + ftest = weightedMedian, 616s + fsure = weightedMedian, 616s + na.rm = TRUE, ties = ties) 616s + validateIndicesTestVector_w(x, w, idxs, 616s + ftest = weightedMedian, 616s + fsure = weightedMedian, 616s + na.rm = FALSE, ties = ties) 616s + } 616s + } 616s + } 616s > 616s 616s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 616s Copyright (C) 2024 The R Foundation for Statistical Computing 616s Platform: arm-unknown-linux-gnueabihf (32-bit) 616s 616s R is free software and comes with ABSOLUTELY NO WARRANTY. 616s You are welcome to redistribute it under certain conditions. 616s Type 'license()' or 'licence()' for distribution details. 616s 616s R is a collaborative project with many contributors. 616s Type 'contributors()' for more information and 616s 'citation()' on how to cite R or R packages in publications. 616s 616s Type 'demo()' for some demos, 'help()' for on-line help, or 616s 'help.start()' for an HTML browser interface to help. 616s Type 'q()' to quit R. 616s 617s > library("matrixStats") 617s > 617s > weightedVar_R <- function(x, w) { 617s + mu <- weighted.mean(x, w = w) 617s + sum(w * (x - mu) ^ 2) / (sum(w) - 1) 617s + } 617s > 617s > 617s > n <- 10 617s > x <- as.double(1:n) 617s > 617s > message("*** weightedVar() ...") 617s > 617s > message("- Zero elements") 617s *** weightedVar() ... 617s > m0 <- var(integer(0)) 617s > m1 <- weightedVar(integer(0), w = integer(0)) 617s > str(list(m0 = m0, m1 = m1)) 617s - Zero elements 617s List of 2 617s $ m0: num NA 617s $ m1: int NA 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- One elements") 617s > m0 <- var(1) 617s > m1 <- weightedVar(1) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0:- One elements 617s num NA 617s $ m1:- Uniform weights (all w = 1) 617s num NA 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- Uniform weights (all w = 1)") 617s > m0 <- var(x) 617s > w <- rep(1, times = n) 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s - Uniform weights (all w = 3) 617s - Uniform weights on the first five elements 617s - Uniform weights on every second elements 617s $ m0: num 9.17 617s $ m1: num 9.17 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- Uniform weights (all w = 3)") 617s > m0 <- var(rep(x, each = 3)) 617s > w <- rep(3, times = n) 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0: num 8.53 617s $ m1: num 8.53 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- Uniform weights on the first five elements") 617s > idxs <- 1:5 617s > m0 <- var(x[1:5]) 617s > w <- rep(0, times = n) 617s > w[idxs] <- 1 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0: num 2.5 617s $ m1: num 2.5 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- Uniform weights on every second elements") 617s > idxs <- seq(from = 1, to = n, by = 2) 617s > m0 <- var(x[idxs]) 617s > w <- rep(0, times = n) 617s > w[idxs] <- 1 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0:- All weights are zero 617s num 10 617s $ m1: num 10 617s - Infinite weight on first element 617s - Missing-value weight on first element 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > 617s > message("- All weights are zero") 617s > idxs <- integer(0L) 617s > m0 <- var(x[idxs]) 617s > w <- rep(0, times = n) 617s > w[idxs] <- 1 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0: num NA 617s $ m1: num NA 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > message("- Infinite weight on first element") 617s > idxs <- 1L 617s > m0 <- var(x[idxs]) 617s > w <- rep(0, times = n) 617s > w[idxs] <- Inf 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0: num NA 617s $ m1: num NA 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > message("- Missing-value weight on first element") 617s > idxs <- 1L 617s > w <- rep(1, times = n) 617s > w[idxs] <- NA_real_ 617s > m1 <- weightedVar(x, w = w) 617s > str(list(m1 = m1)) 617s List of 1 617s $ m1: num NA 617s > stopifnot(identical(m1, NA_real_)) 617s > 617s > 617s > message("- Frequency weights") 617s > 617s > ## From https://en.wikipedia.org/wiki/Weighted_arithmetic_mean 617s > y <- c(2, 2, 4, 5, 5, 5) 617s > x <- unique(y) 617s > w <- table(y) 617s > stopifnot(names(w) == x) 617s > 617s > m0 <- weightedVar(x, w = w) 617s > m1 <- var(y) 617s > stopifnot(all.equal(m1, m0)) 617s > m2 <- weightedVar(x, w = w) 617s > str(list(m0 = m0, m1 = m1, m2 = m2)) 617s List of 3 617s $ m0: num 2.17 617s $ m1:- Frequency weights 617s num 2.17 617s $ m2: num 2.17 617s > stopifnot(all.equal(m2, m0)) 617s > 617s > ## From https://github.com/HenrikBengtsson/matrixStats/issues/72 617s > large <- c(21, 8, 26, 1, 15, 33, 12, 25, 0, 84) 617s > years <- c(41706, 9301, 33678, 3082, 27040, 44188, 10049, 30591, 2275, 109831) 617s > 617s > m0 <- weightedVar(large, w = years) 617s > m1 <- weightedVar(large, w = years) 617s > str(list(m0 = m0, m1 = m1)) 617s List of 2 617s $ m0: num 899 617s *** weightedVar() ... DONE 617s $ m1: num 899 617s > stopifnot(all.equal(m1, m0)) 617s > 617s > message("*** weightedVar() ... DONE") 617s > 617s 617s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 617s Copyright (C) 2024 The R Foundation for Statistical Computing 617s Platform: arm-unknown-linux-gnueabihf (32-bit) 617s 617s R is free software and comes with ABSOLUTELY NO WARRANTY. 617s You are welcome to redistribute it under certain conditions. 617s Type 'license()' or 'licence()' for distribution details. 617s 617s R is a collaborative project with many contributors. 617s Type 'contributors()' for more information and 617s 'citation()' on how to cite R or R packages in publications. 617s 617s Type 'demo()' for some demos, 'help()' for on-line help, or 617s 'help.start()' for an HTML browser interface to help. 617s Type 'q()' to quit R. 617s 617s > library("matrixStats") 617s > 617s > fcns <- list( 617s + weightedVar = weightedVar, 617s + weightedSd = weightedSd, 617s + weightedMad = weightedMad 617s + ) 617s > 617s > for (name in names(fcns)) { 617s + cat(sprintf("%s()...\n", name)) 617s + fcn <- fcns[[name]] 617s + 617s + for (mode in c("integer", "double")) { 617s + cat("mode: ", mode, "\n", sep = "") 617s + n <- 15L 617s + x <- runif(n, min = -5, max = 5) 617s + storage.mode(x) <- mode 617s + str(x) 617s + 617s + for (add_na in c(FALSE, TRUE)) { 617s + cat("add_na: ", add_na, "\n", sep = "") 617s + if (add_na) { 617s + x[c(5, 7)] <- NA 617s + } 617s + str(x) 617s + 617s + for (na.rm in c(FALSE, TRUE)) { 617s + cat("na.rm: ", na.rm, "\n", sep = "") 617s + 617s + cat("Weights are not specified (all are 1)\n") 617s + m1 <- fcn(x, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("All weights are 1\n") 617s + w <- rep(1, times = n) 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("First weight is 5\n") 617s + # Pull the mean towards zero 617s + w[1] <- 5 617s + str(w) 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("All weights are 0\n") 617s + # All weights set to zero 617s + w <- rep(0, times = n) 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("First weight is 8.5\n") 617s + # Put even more weight on the zero 617s + w[1] <- 8.5 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("First weight is Inf\n") 617s + # All weight on the first value 617s + w[1] <- Inf 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("Last weight is Inf\n") 617s + # All weight on the last value 617s + w[1] <- 1 617s + w[n] <- Inf 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + 617s + cat("Last weight is NA\n") 617s + # All weight on the last value 617s + w[1] <- 1 617s + w[n] <- NA_real_ 617s + m1 <- fcn(x, w, na.rm = na.rm) 617s + str(list(m1 = m1)) 617s + } # for (na.rm ...) 617s + } # for (add_na ...) 617s + } # for (mode ...) 617s + 617s + cat(sprintf("%s()...DONE\n", name)) 617s + } # for (name ...) 617s weightedVar()... 617s mode: integer 617s int [1:15] 0 0 2 -4 -3 -4 2 0 -3 0 ... 617s add_na: FALSE 617s int [1:15] 0 0 2 -4 -3 -4 2 0 -3 0 ... 617s na.rm: FALSE 617s Weights are not specified (all are 1) 617s List of 1 617s $ m1: num 7.24 617s All weights are 1 617s List of 1 617s $ m1: num 7.24 617s First weight is 5 617s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 617s List of 1 617s $ m1: num 5.71 617s All weights are 0 617s List of 1 617s $ m1: int NA 617s First weight is 8.5 617s List of 1 617s $ m1: int NA 617s First weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is NA 617s List of 1 617s $ m1: int NA 617s na.rm: TRUE 617s Weights are not specified (all are 1) 617s List of 1 617s $ m1: num 7.24 617s All weights are 1 617s List of 1 617s $ m1: num 7.24 617s First weight is 5 617s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 617s List of 1 617s $ m1: num 5.71 617s All weights are 0 617s List of 1 617s $ m1: int NA 617s First weight is 8.5 617s List of 1 617s $ m1: int NA 617s First weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is NA 617s List of 1 617s $ m1: int NA 617s add_na: TRUE 617s int [1:15] 0 0 2 -4 NA -4 NA 0 -3 0 ... 617s na.rm: FALSE 617s Weights are not specified (all are 1) 617s List of 1 617s $ m1: int NA 617s All weights are 1 617s List of 1 617s $ m1: int NA 617s First weight is 5 617s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 617s List of 1 617s $ m1: int NA 617s All weights are 0 617s List of 1 617s $ m1: int NA 617s First weight is 8.5 617s List of 1 617s $ m1: int NA 617s First weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is NA 617s List of 1 617s $ m1: int NA 617s na.rm: TRUE 617s Weights are not specified (all are 1) 617s List of 1 617s $ m1: num 7.4 617s All weights are 1 617s List of 1 617s $ m1: num 7.4 617s First weight is 5 617s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 617s List of 1 617s $ m1: num 5.64 617s All weights are 0 617s List of 1 617s $ m1: int NA 617s First weight is 8.5 617s List of 1 617s $ m1: int NA 617s First weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is Inf 617s List of 1 617s $ m1: int NA 617s Last weight is NA 617s List of 1 617s $ m1: int NA 617s mode: double 617s num [1:15] -0.259 3.368 2.272 -2.357 1.886 ... 617s add_na: FALSE 617s num [1:15] -0.259 3.368 2.272 -2.357 1.886 ... 617s na.rm: FALSE 617s Weights are not specified (all are 1) 617s List of 1 617s $ m1: num 8.96 617s All weights are 1 617s List of 1 617s $ m1: num 8.96 617s First weight is 5 617s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 617s List of 1 617s $ m1: num 6.97 617s All weights are 0 617s List of 1 617s $ m1: num NA 617s First weight is 8.5 617s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 8.96 618s All weights are 1 618s List of 1 618s $ m1: num 8.96 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 6.97 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s add_na: TRUE 618s num [1:15] -0.259 3.368 2.272 -2.357 NA ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num NA 618s All weights are 1 618s List of 1 618s $ m1: num NA 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num NA 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 8.89 618s All weights are 1 618s List of 1 618s $ m1: num 8.89 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 6.69 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s weightedVar()...DONE 618s weightedSd()... 618s mode: integer 618s int [1:15] -3 -2 4 -4 2 -2 -1 -2 3 -4 ... 618s add_na: FALSE 618s int [1:15] -3 -2 4 -4 2 -2 -1 -2 3 -4 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 2.61 618s All weights are 1 618s List of 1 618s $ m1: num 2.61 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 2.4 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 2.61 618s All weights are 1 618s List of 1 618s $ m1: num 2.61 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 2.4 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s add_na: TRUE 618s int [1:15] -3 -2 4 -4 NA -2 NA -2 3 -4 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num NA 618s All weights are 1 618s List of 1 618s $ m1: num NA 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num NA 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 2.63 618s All weights are 1 618s List of 1 618s $ m1: num 2.63 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 2.36 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s mode: double 618s num [1:15] -4.18 4.28 -2.42 1 2.87 ... 618s add_na: FALSE 618s num [1:15] -4.18 4.28 -2.42 1 2.87 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 3.12 618s All weights are 1 618s List of 1 618s $ m1: num 3.12 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.18 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 3.12 618s All weights are 1 618s List of 1 618s $ m1: num 3.12 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.18 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s add_na: TRUE 618s num [1:15] -4.18 4.28 -2.42 1 NA ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num NA 618s All weights are 1 618s List of 1 618s $ m1: num NA 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num NA 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 3.2 618s All weights are 1 618s List of 1 618s $ m1: num 3.2 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.17 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num NA 618s First weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is Inf 618s List of 1 618s $ m1: num NA 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s weightedSd()...DONE 618s weightedMad()... 618s mode: integer 618s int [1:15] -1 0 -3 -1 2 -3 4 1 3 4 ... 618s add_na: FALSE 618s int [1:15] -1 0 -3 -1 2 -3 4 1 3 4 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 1.48 618s All weights are 1 618s List of 1 618s $ m1: num 1.48 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 1.48 618s All weights are 0 618s List of 1 618s $ m1: int NA 618s First weight is 8.5 618s List of 1 618s $ m1: int 0 618s First weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is NA 618s List of 1 618s $ m1: int NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 1.48 618s All weights are 1 618s List of 1 618s $ m1: num 1.48 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 1.48 618s All weights are 0 618s List of 1 618s $ m1: int NA 618s First weight is 8.5 618s List of 1 618s $ m1: int 0 618s First weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is NA 618s List of 1 618s $ m1: int NA 618s add_na: TRUE 618s int [1:15] -1 0 -3 -1 NA -3 NA 1 3 4 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num NA 618s All weights are 1 618s List of 1 618s $ m1: int NA 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: int NA 618s All weights are 0 618s List of 1 618s $ m1: int NA 618s First weight is 8.5 618s List of 1 618s $ m1: int 0 618s First weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is NA 618s List of 1 618s $ m1: int NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 1.48 618s All weights are 1 618s List of 1 618s $ m1: num 1.48 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 1.48 618s All weights are 0 618s List of 1 618s $ m1: int NA 618s First weight is 8.5 618s List of 1 618s $ m1: int 0 618s First weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is Inf 618s List of 1 618s $ m1: int 0 618s Last weight is NA 618s List of 1 618s $ m1: int NA 618s mode: double 618s num [1:15] -2.29 2.99 3.58 2.94 -1.72 ... 618s add_na: FALSE 618s num [1:15] -2.29 2.99 3.58 2.94 -1.72 ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 2.69 618s All weights are 1 618s List of 1 618s $ m1: num 2.69 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.85 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num 0 618s First weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 2.69 618s All weights are 1 618s List of 1 618s $ m1: num 2.69 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.85 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num 0 618s First weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s add_na: TRUE 618s num [1:15] -2.29 2.99 3.58 2.94 NA ... 618s na.rm: FALSE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num NA 618s All weights are 1 618s List of 1 618s $ m1: num NA 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num NA 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num 0 618s First weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s na.rm: TRUE 618s Weights are not specified (all are 1) 618s List of 1 618s $ m1: num 1.8 618s All weights are 1 618s List of 1 618s $ m1: num 1.8 618s First weight is 5 618s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 618s List of 1 618s $ m1: num 3.98 618s All weights are 0 618s List of 1 618s $ m1: num NA 618s First weight is 8.5 618s List of 1 618s $ m1: num 0 618s First weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is Inf 618s List of 1 618s $ m1: num 0 618s Last weight is NA 618s List of 1 618s $ m1: num NA 618s weightedMad()...DONE 618s > 618s 618s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 618s Copyright (C) 2024 The R Foundation for Statistical Computing 618s Platform: arm-unknown-linux-gnueabihf (32-bit) 618s 618s R is free software and comes with ABSOLUTELY NO WARRANTY. 618s You are welcome to redistribute it under certain conditions. 618s Type 'license()' or 'licence()' for distribution details. 618s 618s R is a collaborative project with many contributors. 618s Type 'contributors()' for more information and 618s 'citation()' on how to cite R or R packages in publications. 618s 618s Type 'demo()' for some demos, 'help()' for on-line help, or 618s 'help.start()' for an HTML browser interface to help. 618s Type 'q()' to quit R. 618s 618s > library("matrixStats") 618s > 618s > fcns <- list( 618s + weightedVar = weightedVar, 618s + weightedSd = weightedSd, 618s + weightedMad = weightedMad 618s + ) 618s > 618s > 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > # Subsetted tests 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > source("utils/validateIndicesFramework.R") 618s > for (name in names(fcns)) { 618s + cat(sprintf("subsetted tests on %s()...\n", name)) 618s + fcn <- fcns[[name]] 618s + 618s + for (mode in c("numeric", "integer")) { 618s + x <- runif(6, min = -6, max = 6) 618s + w <- runif(6, min = 0, max = 6) 618s + storage.mode(x) <- mode 618s + storage.mode(w) <- mode 618s + if (mode == "numeric") w[1] <- Inf 618s + 618s + for (idxs in index_cases) { 618s + validateIndicesTestVector_w(x, w, idxs, 618s + ftest = fcn, fsure = fcn, 618s + na.rm = TRUE) 618s + validateIndicesTestVector_w(x, w, idxs, 618s + ftest = fcn, fsure = fcn, 618s + na.rm = FALSE) 618s + } 618s + } 618s + cat(sprintf("%s()...DONE\n", name)) 618s + } 618s subsetted tests on weightedVar()... 618s weightedVar()...DONE 618s subsetted tests on weightedSd()... 619s weightedSd()...DONE 619s subsetted tests on weightedMad()... 619s weightedMad()...DONE 619s > 619s 619s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 619s Copyright (C) 2024 The R Foundation for Statistical Computing 619s Platform: arm-unknown-linux-gnueabihf (32-bit) 619s 619s R is free software and comes with ABSOLUTELY NO WARRANTY. 619s You are welcome to redistribute it under certain conditions. 619s Type 'license()' or 'licence()' for distribution details. 619s 619s R is a collaborative project with many contributors. 619s Type 'contributors()' for more information and 619s 'citation()' on how to cite R or R packages in publications. 619s 619s Type 'demo()' for some demos, 'help()' for on-line help, or 619s 'help.start()' for an HTML browser interface to help. 619s Type 'q()' to quit R. 619s 619s > library("matrixStats") 619s > 619s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 619s + if (na.rm) { 619s + xnok <- is.na(x) 619s + ynok <- is.na(y) 619s + anok <- xnok & ynok 619s + unit <- switch(OP, 619s + "+" = 0, 619s + "-" = NA_real_, 619s + "*" = 1, 619s + "/" = NA_real_, 619s + stop("Unknown 'OP' operator: ", OP) 619s + ) 619s + x[xnok] <- unit 619s + y[ynok] <- unit 619s + } 619s + 619s + ans <- switch(OP, 619s + "+" = x + y, 619s + "-" = x - y, 619s + "*" = x * y, 619s + "/" = x / y, 619s + stop("Unknown 'OP' operator: ", OP) 619s + ) 619s + 619s + if (na.rm) { 619s + ans[anok] <- NA_real_ 619s + } 619s + 619s + ans 619s + } # x_OP_y_R() 619s > 619s > 619s > 619s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 619s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 619s + } 619s > 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # No missing values 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > x <- matrix(1:16, nrow = 4, ncol = 4) 619s > y <- 1:nrow(x) 619s > storage.mode(y) <- storage.mode(x) 619s > 619s > for (OP in c("+", "-", "*", "/")) { 619s + for (na.rm in c(FALSE, TRUE)) { 619s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 619s + 619s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 619s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 619s + str(a1) 619s + stopifnot(all.equal(a1, a0)) 619s + 619s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 619s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 619s + str(b1) 619s + stopifnot(all.equal(b1, b0)) 619s + } 619s + } 619s OP = '+', na.rm = FALSE 619s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 619s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 619s OP = '+', na.rm = TRUE 619s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 619s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 619s OP = '-', na.rm = FALSE 619s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 619s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 619s OP = '-', na.rm = TRUE 619s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 619s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 619s OP = '*', na.rm = FALSE 619s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 619s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 619s OP = '*', na.rm = TRUE 619s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 619s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 619s OP = '/', na.rm = FALSE 619s num [1:4, 1:4] 1 1 1 1 5 ... 619s num [1:4, 1:4] 1 2 3 4 2.5 ... 619s OP = '/', na.rm = TRUE 619s num [1:4, 1:4] 1 1 1 1 5 ... 619s num [1:4, 1:4] 1 2 3 4 2.5 ... 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Missing values in x, y, or both. 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > for (which in c("x", "y", "both")) { 619s + x <- matrix(1:16, nrow = 4, ncol = 4) 619s + y <- 1:nrow(x) 619s + storage.mode(y) <- storage.mode(x) 619s + 619s + if (which == "x") { 619s + x[3:6] <- NA_real_ 619s + } else if (which == "y") { 619s + y[c(1, 3)] <- NA_real_ 619s + } else if (which == "both") { 619s + x[3:6] <- NA_real_ 619s + y[c(1, 3)] <- NA_real_ 619s + } 619s + 619s + for (OP in c("+", "-", "*", "/")) { 619s + for (na.rm in c(FALSE, TRUE)) { 619s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 619s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 619s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 619s + str(a1) 619s + stopifnot(all.equal(a1, a0)) 619s + 619s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 619s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 619s + str(b1) 619s + stopifnot(all.equal(b1, b0)) 619s + } 619s + } 619s + } 619s OP = '+', na.rm = FALSE 619s num [1:4, 1:4] 2 4 NA NA NA NA 10 12 10 12 ... 619s num [1:4, 1:4] 2 3 NA NA NA NA 9 10 12 13 ... 619s OP = '+', na.rm = TRUE 619s num [1:4, 1:4] 2 4 3 4 1 2 10 12 10 12 ... 619s num [1:4, 1:4] 2 3 1 1 2 2 9 10 12 13 ... 619s OP = '-', na.rm = FALSE 619s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 619s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 619s OP = '-', na.rm = TRUE 619s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 619s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 619s OP = '*', na.rm = FALSE 619s num [1:4, 1:4] 1 4 NA NA NA NA 21 32 9 20 ... 619s num [1:4, 1:4] 1 2 NA NA NA NA 14 16 27 30 ... 619s OP = '*', na.rm = TRUE 619s num [1:4, 1:4] 1 4 3 4 1 2 21 32 9 20 ... 619s num [1:4, 1:4] 1 2 1 1 2 2 14 16 27 30 ... 619s OP = '/', na.rm = FALSE 619s num [1:4, 1:4] 1 1 NA NA NA ... 619s num [1:4, 1:4] 1 2 NA NA NA ... 619s OP = '/', na.rm = TRUE 619s num [1:4, 1:4] 1 1 NA NA NA ... 619s num [1:4, 1:4] 1 2 NA NA NA ... 619s OP = '+', na.rm = FALSE 619s num [1:4, 1:4] NA 4 NA 8 NA 8 NA 12 NA 12 ... 619s num [1:4, 1:4] NA NA NA NA 7 8 9 10 NA NA ... 619s OP = '+', na.rm = TRUE 619s num [1:4, 1:4] 1 4 3 8 5 8 7 12 9 12 ... 619s num [1:4, 1:4] 1 2 3 4 7 8 9 10 9 10 ... 619s OP = '-', na.rm = FALSE 619s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 619s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 619s OP = '-', na.rm = TRUE 619s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 619s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 619s OP = '*', na.rm = FALSE 619s num [1:4, 1:4] NA 4 NA 16 NA 12 NA 32 NA 20 ... 619s num [1:4, 1:4] NA NA NA NA 10 12 14 16 NA NA ... 619s OP = '*', na.rm = TRUE 619s num [1:4, 1:4] 1 4 3 16 5 12 7 32 9 20 ... 619s num [1:4, 1:4] 1 2 3 4 10 12 14 16 9 10 ... 619s OP = '/', na.rm = FALSE 619s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 619s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 619s OP = '/', na.rm = TRUE 619s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 619s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 619s OP = '+', na.rm = FALSE 619s num [1:4, 1:4] NA 4 NA NA NA NA NA 12 NA 12 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 9 10 NA NA ... 619s OP = '+', na.rm = TRUE 619s num [1:4, 1:4] 1 4 NA 4 NA 2 7 12 9 12 ... 619s num [1:4, 1:4] 1 2 NA NA 2 2 9 10 9 10 ... 619s OP = '-', na.rm = FALSE 619s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 619s OP = '-', na.rm = TRUE 619s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 619s OP = '*', na.rm = FALSE 619s num [1:4, 1:4] NA 4 NA NA NA NA NA 32 NA 20 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 14 16 NA NA ... 619s OP = '*', na.rm = TRUE 619s num [1:4, 1:4] 1 4 NA 4 NA 2 7 32 9 20 ... 619s num [1:4, 1:4] 1 2 NA NA 2 2 14 16 9 10 ... 619s OP = '/', na.rm = FALSE 619s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 619s OP = '/', na.rm = TRUE 619s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 619s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 619s > 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Length differences 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > x <- matrix(1:8, nrow = 2, ncol = 4) 619s > y <- 1:ncol(x) 619s > storage.mode(y) <- storage.mode(x) 619s > 619s > for (OP in c("+", "-", "*", "/")) { 619s + for (na.rm in c(FALSE, TRUE)) { 619s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 619s + 619s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 619s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 619s + str(a1) 619s + stopifnot(all.equal(a1, a0)) 619s + 619s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 619s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 619s + str(b1) 619s + stopifnot(all.equal(b1, b0)) 619s + } 619s + } 619s OP = '+', na.rm = FALSE 619s int [1:2, 1:4] 2 4 6 8 6 8 10 12 619s int [1:2, 1:4] 2 3 5 6 8 9 11 12 619s OP = '+', na.rm = TRUE 619s int [1:2, 1:4] 2 4 6 8 6 8 10 12 619s int [1:2, 1:4] 2 3 5 6 8 9 11 12 619s OP = '-', na.rm = FALSE 619s int [1:2, 1:4] 0 0 0 0 4 4 4 4 619s int [1:2, 1:4] 0 1 1 2 2 3 3 4 619s OP = '-', na.rm = TRUE 619s int [1:2, 1:4] 0 0 0 0 4 4 4 4 619s int [1:2, 1:4] 0 1 1 2 2 3 3 4 619s OP = '*', na.rm = FALSE 619s int [1:2, 1:4] 1 4 9 16 5 12 21 32 619s int [1:2, 1:4] 1 2 6 8 15 18 28 32 619s OP = '*', na.rm = TRUE 619s int [1:2, 1:4] 1 4 9 16 5 12 21 32 619s int [1:2, 1:4] 1 2 6 8 15 18 28 32 619s OP = '/', na.rm = FALSE 619s num [1:2, 1:4] 1 1 1 1 5 ... 619s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 619s OP = '/', na.rm = TRUE 619s num [1:2, 1:4] 1 1 1 1 5 ... 619s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # All missing values 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > xs <- list( 619s + A = matrix(1:2, nrow = 2, ncol = 2), 619s + B = matrix(NA_integer_, nrow = 2, ncol = 2) 619s + ) 619s > ys <- list( 619s + A = 1L, 619s + B = NA_integer_ 619s + ) 619s > 619s > for (x in xs) { 619s + for (y in ys) { 619s + for (mode in c("logical", "integer", "double")) { 619s + storage.mode(x) <- mode 619s + storage.mode(y) <- mode 619s + str(list(x = x, y = y)) 619s + 619s + for (OP in c("+", "-", "*", "/")) { 619s + for (na.rm in c(FALSE, TRUE)) { 619s + cat(sprintf("mode = '%s', OP = '%s', na.rm = %s\n", mode, OP, na.rm)) 619s + suppressWarnings({ 619s + z0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 619s + z <- x_OP_y(x, y, OP, na.rm = na.rm) 619s + }) 619s + str(z) 619s + stopifnot(all.equal(z, z0)) 619s + } 619s + } 619s + } # for (mode ...) 619s + } # for (y ...) 619s + } # for (x ...) 619s List of 2 619s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 619s $ y: logi TRUE 619s mode = 'logical', OP = '+', na.rm = FALSE 619s int [1:2, 1:2] 2 2 2 2 619s mode = 'logical', OP = '+', na.rm = TRUE 619s int [1:2, 1:2] 2 2 2 2 619s mode = 'logical', OP = '-', na.rm = FALSE 619s int [1:2, 1:2] 0 0 0 0 619s mode = 'logical', OP = '-', na.rm = TRUE 619s int [1:2, 1:2] 0 0 0 0 619s mode = 'logical', OP = '*', na.rm = FALSE 619s int [1:2, 1:2] 1 1 1 1 619s mode = 'logical', OP = '*', na.rm = TRUE 619s int [1:2, 1:2] 1 1 1 1 619s mode = 'logical', OP = '/', na.rm = FALSE 619s num [1:2, 1:2] 1 1 1 1 619s mode = 'logical', OP = '/', na.rm = TRUE 619s num [1:2, 1:2] 1 1 1 1 619s List of 2 619s $ x: int [1:2, 1:2] 1 1 1 1 619s $ y: int 1 619s mode = 'integer', OP = '+', na.rm = FALSE 619s int [1:2, 1:2] 2 2 2 2 619s mode = 'integer', OP = '+', na.rm = TRUE 619s int [1:2, 1:2] 2 2 2 2 619s mode = 'integer', OP = '-', na.rm = FALSE 619s int [1:2, 1:2] 0 0 0 0 619s mode = 'integer', OP = '-', na.rm = TRUE 619s int [1:2, 1:2] 0 0 0 0 619s mode = 'integer', OP = '*', na.rm = FALSE 619s int [1:2, 1:2] 1 1 1 1 619s mode = 'integer', OP = '*', na.rm = TRUE 619s int [1:2, 1:2] 1 1 1 1 619s mode = 'integer', OP = '/', na.rm = FALSE 619s num [1:2, 1:2] 1 1 1 1 619s mode = 'integer', OP = '/', na.rm = TRUE 619s num [1:2, 1:2] 1 1 1 1 619s List of 2 619s $ x: num [1:2, 1:2] 1 1 1 1 620s $ y: num 1 620s mode = 'double', OP = '+', na.rm = FALSE 620s num [1:2, 1:2] 2 2 2 2 620s mode = 'double', OP = '+', na.rm = TRUE 620s num [1:2, 1:2] 2 2 2 2 620s mode = 'double', OP = '-', na.rm = FALSE 620s num [1:2, 1:2] 0 0 0 0 620s mode = 'double', OP = '-', na.rm = TRUE 620s num [1:2, 1:2] 0 0 0 0 620s mode = 'double', OP = '*', na.rm = FALSE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '*', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s List of 2 620s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 620s $ y: logi NA 620s mode = 'logical', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'logical', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'logical', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: int [1:2, 1:2] 1 1 1 1 620s $ y: int NA 620s mode = 'integer', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'integer', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'integer', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: num [1:2, 1:2] 1 1 1 1 620s $ y: num NA 620s mode = 'double', OP = '+', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '+', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '-', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '-', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: logi [1:2, 1:2] NA NA NA NA 620s $ y: logi TRUE 620s mode = 'logical', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'logical', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'logical', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: int [1:2, 1:2] NA NA NA NA 620s $ y: int 1 620s mode = 'integer', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'integer', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] 1 1 1 1 620s mode = 'integer', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: num [1:2, 1:2] NA NA NA NA 620s $ y: num 1 620s mode = 'double', OP = '+', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '+', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '-', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '-', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = TRUE 620s num [1:2, 1:2] 1 1 1 1 620s mode = 'double', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: logi [1:2, 1:2] NA NA NA NA 620s $ y: logi NA 620s mode = 'logical', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'logical', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: int [1:2, 1:2] NA NA NA NA 620s $ y: int NA 620s mode = 'integer', OP = '+', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '+', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '-', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '-', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = FALSE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '*', na.rm = TRUE 620s int [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'integer', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s List of 2 620s $ x: num [1:2, 1:2] NA NA NA NA 620s $ y: num NA 620s mode = 'double', OP = '+', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '+', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '-', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '-', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '*', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '/', na.rm = FALSE 620s num [1:2, 1:2] NA NA NA NA 620s mode = 'double', OP = '/', na.rm = TRUE 620s num [1:2, 1:2] NA NA NA NA 620s > 620s 620s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 620s Copyright (C) 2024 The R Foundation for Statistical Computing 620s Platform: arm-unknown-linux-gnueabihf (32-bit) 620s 620s R is free software and comes with ABSOLUTELY NO WARRANTY. 620s You are welcome to redistribute it under certain conditions. 620s Type 'license()' or 'licence()' for distribution details. 620s 620s R is a collaborative project with many contributors. 620s Type 'contributors()' for more information and 620s 'citation()' on how to cite R or R packages in publications. 620s 620s Type 'demo()' for some demos, 'help()' for on-line help, or 620s 'help.start()' for an HTML browser interface to help. 620s Type 'q()' to quit R. 620s 620s > library("matrixStats") 620s > 620s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 620s + if (na.rm) { 620s + xnok <- is.na(x) 620s + ynok <- is.na(y) 620s + anok <- xnok & ynok 620s + unit <- switch(OP, 620s + "+" = 0, 620s + "-" = NA_real_, 620s + "*" = 1, 620s + "/" = NA_real_, 620s + stop("Unknown 'OP' operator: ", OP) 620s + ) 620s + x[xnok] <- unit 620s + y[ynok] <- unit 620s + } 620s + 620s + ans <- switch(OP, 620s + "+" = x + y, 620s + "-" = x - y, 620s + "*" = x * y, 620s + "/" = x / y, 620s + stop("Unknown 'OP' operator: ", OP) 620s + ) 620s + 620s + if (na.rm) { 620s + ans[anok] <- NA_real_ 620s + } 620s + 620s + ans 620s + } # x_OP_y_R() 620s > 620s > 620s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 620s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 620s + } 620s > 620s > 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > # Subsetted tests 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > source("utils/validateIndicesFramework.R") 620s > for (OP in c("+", "-", "*", "/")) { 620s + for (mode in c("numeric", "integer", "logical")) { 620s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 620s + y <- runif(6, min = 0, max = 6) 620s + storage.mode(x) <- mode 620s + storage.mode(y) <- mode 620s + if (mode == "numeric") y[1] <- Inf 620s + 620s + for (xrows in index_cases) { 620s + for (xcols in index_cases) { 620s + if (is.null(xrows)) xrows <- seq_len(nrow(x)) 620s + if (is.null(xcols)) xcols <- seq_len(ncol(x)) 620s + 620s + for (yidxs in list(xrows, xcols)) { 620s + for (na.rm in c(TRUE, FALSE)) { 620s + 620s + suppressWarnings({ 620s + actual <- tryCatch( 620s + x_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 620s + na.rm = na.rm), 620s + error = function(c) "error" 620s + ) 620s + 620s + expect <- tryCatch( 620s + x_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 620s + na.rm = na.rm), 620s + error = function(c) "error" 620s + ) 620s + }) 620s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 620s + 620s + suppressWarnings({ 620s + actual <- tryCatch( 620s + t_tx_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 620s + na.rm = na.rm), 620s + error = function(c) "error" 620s + ) 620s + 620s + expect <- tryCatch( 620s + t_tx_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 620s + na.rm = na.rm), 620s + error = function(c) "error" 620s + ) 620s + }) 620s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 620s + } 620s + } 620s + } 620s + } 620s + } 620s + } 634s > 634s 634s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 634s Copyright (C) 2024 The R Foundation for Statistical Computing 634s Platform: arm-unknown-linux-gnueabihf (32-bit) 634s 634s R is free software and comes with ABSOLUTELY NO WARRANTY. 634s You are welcome to redistribute it under certain conditions. 634s Type 'license()' or 'licence()' for distribution details. 634s 634s R is a collaborative project with many contributors. 634s Type 'contributors()' for more information and 634s 'citation()' on how to cite R or R packages in publications. 634s 634s Type 'demo()' for some demos, 'help()' for on-line help, or 634s 'help.start()' for an HTML browser interface to help. 634s Type 'q()' to quit R. 634s 634s > ## These tests need to be last of all tests, otherwise 634s > ## covr::package_coverage() gives an error. 634s > cat("1. Loading package\n") 634s 1. Loading package 634s > loadNamespace("matrixStats") 634s 634s > stopifnot("matrixStats" %in% loadedNamespaces()) 634s > 634s > cat("2. Unloading package\n") 634s 2. Unloading package 634s > unloadNamespace("matrixStats") 634s > stopifnot(!"matrixStats" %in% loadedNamespaces()) 634s > 634s > if (FALSE) { 634s + ## 'covr' gives "Error in library("matrixStats") : 634s + ## there is no package called 'matrixStats'" here, cf. 634s + ## https://travis-ci.org/HenrikBengtsson/matrixStats/builds/48015577 634s + 634s + cat("3. Attaching package\n") 634s + library("matrixStats") 634s + stopifnot("package:matrixStats" %in% search()) 634s + 634s + cat("4. Detaching package\n") 634s + detach("package:matrixStats") 634s + stopifnot(!"package:matrixStats" %in% search()) 634s + stopifnot("matrixStats" %in% loadedNamespaces()) 634s + 634s + cat("5. Unloading package\n") 634s + unloadNamespace("matrixStats") 634s + stopifnot(!"matrixStats" %in% loadedNamespaces()) 634s + 634s + cat("6. Attaching package (again)\n") 634s + library("matrixStats") 634s + stopifnot("package:matrixStats" %in% search()) 634s + 634s + cat("7. Detaching package (again)\n") 634s + detach("package:matrixStats") 634s + stopifnot(!"package:matrixStats" %in% search()) 634s + stopifnot("matrixStats" %in% loadedNamespaces()) 634s + } 634s > 634s > cat("7. DONE\n") 634s 7. DONE 634s > 635s autopkgtest [08:32:27]: test run-unit-test: -----------------------] 640s run-unit-test PASS 640s autopkgtest [08:32:32]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 645s autopkgtest [08:32:37]: test pkg-r-autopkgtest: preparing testbed 698s autopkgtest [08:33:30]: testbed dpkg architecture: armhf 700s autopkgtest [08:33:32]: testbed apt version: 2.7.14build2 700s autopkgtest [08:33:32]: @@@@@@@@@@@@@@@@@@@@ test bed setup 702s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 703s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 703s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [53.5 kB] 703s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 703s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [497 kB] 703s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main armhf Packages [112 kB] 703s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf Packages [432 kB] 703s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse armhf Packages [1968 B] 703s Fetched 1176 kB in 1s (1040 kB/s) 703s Reading package lists... 722s tee: /proc/self/fd/2: Permission denied 746s Hit:1 http://ftpmaster.internal/ubuntu oracular InRelease 746s Hit:2 http://ftpmaster.internal/ubuntu oracular-updates InRelease 746s Hit:3 http://ftpmaster.internal/ubuntu oracular-security InRelease 747s Hit:4 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 749s Reading package lists... 749s Reading package lists... 750s Building dependency tree... 750s Reading state information... 751s Calculating upgrade... 752s The following package was automatically installed and is no longer required: 752s libatm1t64 752s Use 'apt autoremove' to remove it. 752s The following NEW packages will be installed: 752s python3-jaraco.context python3-jaraco.functools 752s The following packages will be upgraded: 752s apparmor apport apport-core-dump-handler apt apt-utils bash-completion curl 752s dhcpcd-base dpkg dpkg-dev dracut-install eatmydata fwupd gcc-14-base 752s gir1.2-girepository-2.0 gir1.2-glib-2.0 groff-base initramfs-tools 752s initramfs-tools-bin initramfs-tools-core iproute2 klibc-utils less libacl1 752s libapparmor1 libapt-pkg6.0t64 libbpf1 libbsd0 libc-bin libc6 libcap-ng0 752s libcurl3t64-gnutls libcurl4t64 libdpkg-perl libeatmydata1 libelf1t64 752s libevent-core-2.1-7t64 libexpat1 libfwupd2 libgcc-s1 libgcrypt20 752s libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-data libgnutls30t64 752s libgpg-error-l10n libgpg-error0 libklibc liblocale-gettext-perl liblz4-1 752s libnss3 libnvme1t64 libpam-modules libpam-modules-bin libpam-runtime 752s libpam0g libperl5.38t64 libslang2 libsqlite3-0 libstdc++6 libtirpc-common 752s libtirpc3t64 libuv1t64 libxcb1 locales man-db pastebinit perl perl-base 752s perl-modules-5.38 python-apt-common python-babel-localedata python3-apport 752s python3-apt python3-babel python3-blinker python3-httplib2 python3-jinja2 752s python3-keyring python3-problem-report python3-pyparsing python3-six rsync 752s tzdata ubuntu-pro-client ubuntu-pro-client-l10n vim-common vim-tiny xxd 753s 89 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 753s Need to get 48.8 MB of archives. 753s After this operation, 267 kB of additional disk space will be used. 753s Get:1 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-14-base armhf 14.1.0-1ubuntu1 [48.4 kB] 753s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf libgcc-s1 armhf 14.1.0-1ubuntu1 [41.5 kB] 753s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf libstdc++6 armhf 14.1.0-1ubuntu1 [714 kB] 753s Get:4 http://ftpmaster.internal/ubuntu oracular/main armhf libc6 armhf 2.39-0ubuntu8.1 [2828 kB] 753s Get:5 http://ftpmaster.internal/ubuntu oracular/main armhf libgpg-error-l10n all 1.49-2 [8228 B] 753s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf libgpg-error0 armhf 1.49-2 [62.7 kB] 753s Get:7 http://ftpmaster.internal/ubuntu oracular/main armhf libgcrypt20 armhf 1.10.3-3 [454 kB] 753s Get:8 http://ftpmaster.internal/ubuntu oracular/main armhf liblz4-1 armhf 1.9.4-2 [58.0 kB] 753s Get:9 http://ftpmaster.internal/ubuntu oracular/main armhf libapt-pkg6.0t64 armhf 2.9.3 [1013 kB] 753s Get:10 http://ftpmaster.internal/ubuntu oracular/main armhf dpkg armhf 1.22.6ubuntu10 [1230 kB] 753s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf libperl5.38t64 armhf 5.38.2-4 [4102 kB] 754s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf perl armhf 5.38.2-4 [231 kB] 754s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf perl-base armhf 5.38.2-4 [1671 kB] 754s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf perl-modules-5.38 all 5.38.2-4 [3110 kB] 754s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf libc-bin armhf 2.39-0ubuntu8.1 [530 kB] 754s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf apt armhf 2.9.3 [1397 kB] 754s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf apt-utils armhf 2.9.3 [217 kB] 754s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf libgnutls30t64 armhf 3.8.5-2ubuntu1 [958 kB] 754s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf libpam0g armhf 1.5.3-7ubuntu1 [62.3 kB] 754s Get:20 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-modules-bin armhf 1.5.3-7ubuntu1 [47.0 kB] 754s Get:21 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-modules armhf 1.5.3-7ubuntu1 [266 kB] 754s Get:22 http://ftpmaster.internal/ubuntu oracular/main armhf liblocale-gettext-perl armhf 1.07-7 [14.8 kB] 754s Get:23 http://ftpmaster.internal/ubuntu oracular/main armhf libacl1 armhf 2.3.2-2 [15.1 kB] 754s Get:24 http://ftpmaster.internal/ubuntu oracular/main armhf rsync armhf 3.3.0-1 [414 kB] 754s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf python-apt-common all 2.9.0 [20.1 kB] 754s Get:26 http://ftpmaster.internal/ubuntu oracular/main armhf python3-apt armhf 2.9.0 [162 kB] 754s Get:27 http://ftpmaster.internal/ubuntu oracular/main armhf python3-pyparsing all 3.1.2-1 [86.4 kB] 754s Get:28 http://ftpmaster.internal/ubuntu oracular/main armhf python3-httplib2 all 0.22.0-1 [30.4 kB] 754s Get:29 http://ftpmaster.internal/ubuntu oracular/main armhf python3-problem-report all 2.28.1-0ubuntu4 [23.9 kB] 754s Get:30 http://ftpmaster.internal/ubuntu oracular/main armhf python3-apport all 2.28.1-0ubuntu4 [92.1 kB] 754s Get:31 http://ftpmaster.internal/ubuntu oracular/main armhf gir1.2-girepository-2.0 armhf 1.80.1-3 [24.7 kB] 754s Get:32 http://ftpmaster.internal/ubuntu oracular/main armhf gir1.2-glib-2.0 armhf 2.80.2-1ubuntu1 [182 kB] 754s Get:33 http://ftpmaster.internal/ubuntu oracular/main armhf libglib2.0-0t64 armhf 2.80.2-1ubuntu1 [1421 kB] 754s Get:34 http://ftpmaster.internal/ubuntu oracular/main armhf libgirepository-1.0-1 armhf 1.80.1-3 [107 kB] 754s Get:35 http://ftpmaster.internal/ubuntu oracular/main armhf apport-core-dump-handler all 2.28.1-0ubuntu4 [16.9 kB] 754s Get:36 http://ftpmaster.internal/ubuntu oracular/main armhf apport all 2.28.1-0ubuntu4 [83.4 kB] 754s Get:37 http://ftpmaster.internal/ubuntu oracular/main armhf libcap-ng0 armhf 0.8.5-1 [13.6 kB] 754s Get:38 http://ftpmaster.internal/ubuntu oracular/main armhf libpam-runtime all 1.5.3-7ubuntu1 [40.8 kB] 754s Get:39 http://ftpmaster.internal/ubuntu oracular/main armhf dhcpcd-base armhf 1:10.0.6-5 [186 kB] 754s Get:40 http://ftpmaster.internal/ubuntu oracular/main armhf libelf1t64 armhf 0.191-1 [49.8 kB] 754s Get:41 http://ftpmaster.internal/ubuntu oracular/main armhf libbpf1 armhf 1:1.4.1-1 [151 kB] 754s Get:42 http://ftpmaster.internal/ubuntu oracular/main armhf libtirpc-common all 1.3.4+ds-1.3 [8106 B] 754s Get:43 http://ftpmaster.internal/ubuntu oracular/main armhf libtirpc3t64 armhf 1.3.4+ds-1.3 [73.3 kB] 754s Get:44 http://ftpmaster.internal/ubuntu oracular/main armhf iproute2 armhf 6.9.0-1 [1083 kB] 754s Get:45 http://ftpmaster.internal/ubuntu oracular/main armhf less armhf 590-2ubuntu2.1 [131 kB] 754s Get:46 http://ftpmaster.internal/ubuntu oracular/main armhf libapparmor1 armhf 4.0.1-0ubuntu1 [45.5 kB] 754s Get:47 http://ftpmaster.internal/ubuntu oracular/main armhf libbsd0 armhf 0.12.2-1 [36.5 kB] 754s Get:48 http://ftpmaster.internal/ubuntu oracular/main armhf libexpat1 armhf 2.6.2-1 [65.9 kB] 754s Get:49 http://ftpmaster.internal/ubuntu oracular/main armhf libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 754s Get:50 http://ftpmaster.internal/ubuntu oracular/main armhf libslang2 armhf 2.3.3-5 [478 kB] 757s Get:51 http://ftpmaster.internal/ubuntu oracular/main armhf libsqlite3-0 armhf 3.45.3-1 [601 kB] 757s Get:52 http://ftpmaster.internal/ubuntu oracular/main armhf locales all 2.39-0ubuntu8.1 [4234 kB] 757s Get:53 http://ftpmaster.internal/ubuntu oracular/main armhf tzdata all 2024a-4ubuntu1 [274 kB] 757s Get:54 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client-l10n armhf 32.1 [19.4 kB] 757s Get:55 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client armhf 32.1 [230 kB] 757s Get:56 http://ftpmaster.internal/ubuntu oracular/main armhf vim-tiny armhf 2:9.1.0377-1ubuntu1 [670 kB] 757s Get:57 http://ftpmaster.internal/ubuntu oracular/main armhf vim-common all 2:9.1.0377-1ubuntu1 [385 kB] 757s Get:58 http://ftpmaster.internal/ubuntu oracular/main armhf xxd armhf 2:9.1.0377-1ubuntu1 [63.0 kB] 757s Get:59 http://ftpmaster.internal/ubuntu oracular/main armhf apparmor armhf 4.0.1-0ubuntu1 [565 kB] 757s Get:60 http://ftpmaster.internal/ubuntu oracular/main armhf bash-completion all 1:2.14.0-1 [206 kB] 757s Get:61 http://ftpmaster.internal/ubuntu oracular/main armhf groff-base armhf 1.23.0-4 [946 kB] 757s Get:62 http://ftpmaster.internal/ubuntu oracular/main armhf libuv1t64 armhf 1.48.0-4 [83.2 kB] 757s Get:63 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb1 armhf 1.17.0-2 [46.3 kB] 757s Get:64 http://ftpmaster.internal/ubuntu oracular/main armhf man-db armhf 2.12.1-1 [1201 kB] 757s Get:65 http://ftpmaster.internal/ubuntu oracular/main armhf curl armhf 8.5.0-2ubuntu10.1 [219 kB] 757s Get:66 http://ftpmaster.internal/ubuntu oracular/main armhf libcurl4t64 armhf 8.5.0-2ubuntu10.1 [296 kB] 757s Get:67 http://ftpmaster.internal/ubuntu oracular/main armhf dpkg-dev all 1.22.6ubuntu10 [1074 kB] 757s Get:68 http://ftpmaster.internal/ubuntu oracular/main armhf libdpkg-perl all 1.22.6ubuntu10 [269 kB] 757s Get:69 http://ftpmaster.internal/ubuntu oracular/main armhf dracut-install armhf 060+5-8ubuntu1 [34.3 kB] 757s Get:70 http://ftpmaster.internal/ubuntu oracular/main armhf libeatmydata1 armhf 131-2 [7106 B] 757s Get:71 http://ftpmaster.internal/ubuntu oracular/main armhf eatmydata all 131-2 [5576 B] 757s Get:72 http://ftpmaster.internal/ubuntu oracular/main armhf libcurl3t64-gnutls armhf 8.5.0-2ubuntu10.1 [290 kB] 757s Get:73 http://ftpmaster.internal/ubuntu oracular/main armhf libfwupd2 armhf 1.9.20-1 [126 kB] 757s Get:74 http://ftpmaster.internal/ubuntu oracular/main armhf fwupd armhf 1.9.20-1 [4368 kB] 757s Get:75 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools all 0.142ubuntu27 [7898 B] 757s Get:76 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools-core all 0.142ubuntu27 [49.5 kB] 757s Get:77 http://ftpmaster.internal/ubuntu oracular/main armhf initramfs-tools-bin armhf 0.142ubuntu27 [20.9 kB] 757s Get:78 http://ftpmaster.internal/ubuntu oracular/main armhf klibc-utils armhf 2.0.13-4ubuntu1 [93.8 kB] 757s Get:79 http://ftpmaster.internal/ubuntu oracular/main armhf libklibc armhf 2.0.13-4ubuntu1 [45.0 kB] 757s Get:80 http://ftpmaster.internal/ubuntu oracular/main armhf libevent-core-2.1-7t64 armhf 2.1.12-stable-10 [82.5 kB] 757s Get:81 http://ftpmaster.internal/ubuntu oracular/main armhf libnss3 armhf 2:3.100-1 [1331 kB] 757s Get:82 http://ftpmaster.internal/ubuntu oracular/main armhf libnvme1t64 armhf 1.9-1 [69.9 kB] 757s Get:83 http://ftpmaster.internal/ubuntu oracular/main armhf pastebinit all 1.7.0-1 [14.9 kB] 757s Get:84 http://ftpmaster.internal/ubuntu oracular/main armhf python3-babel all 2.14.0-1 [96.4 kB] 757s Get:85 http://ftpmaster.internal/ubuntu oracular/main armhf python-babel-localedata all 2.14.0-1 [6385 kB] 757s Get:86 http://ftpmaster.internal/ubuntu oracular/main armhf python3-blinker all 1.8.2-1 [11.4 kB] 757s Get:87 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jaraco.context all 4.3.0-1 [6994 B] 757s Get:88 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jaraco.functools all 4.0.0-1 [10.7 kB] 757s Get:89 http://ftpmaster.internal/ubuntu oracular/main armhf python3-jinja2 all 3.1.3-1 [107 kB] 757s Get:90 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-keyring all 25.2.1-1 [39.9 kB] 757s Get:91 http://ftpmaster.internal/ubuntu oracular/main armhf python3-six all 1.16.0-6 [13.0 kB] 757s Preconfiguring packages ... 757s Fetched 48.8 MB in 3s (17.0 MB/s) 757s (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 ... 58082 files and directories currently installed.) 757s Preparing to unpack .../gcc-14-base_14.1.0-1ubuntu1_armhf.deb ... 757s Unpacking gcc-14-base:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 757s Setting up gcc-14-base:armhf (14.1.0-1ubuntu1) ... 757s (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 ... 58082 files and directories currently installed.) 757s Preparing to unpack .../libgcc-s1_14.1.0-1ubuntu1_armhf.deb ... 757s Unpacking libgcc-s1:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 757s Setting up libgcc-s1:armhf (14.1.0-1ubuntu1) ... 758s (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 ... 58082 files and directories currently installed.) 758s Preparing to unpack .../libstdc++6_14.1.0-1ubuntu1_armhf.deb ... 758s Unpacking libstdc++6:armhf (14.1.0-1ubuntu1) over (14-20240412-0ubuntu1) ... 758s Setting up libstdc++6:armhf (14.1.0-1ubuntu1) ... 758s (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 ... 58082 files and directories currently installed.) 758s Preparing to unpack .../libc6_2.39-0ubuntu8.1_armhf.deb ... 758s Unpacking libc6:armhf (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 759s Setting up libc6:armhf (2.39-0ubuntu8.1) ... 760s (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 ... 58082 files and directories currently installed.) 760s Preparing to unpack .../libgpg-error-l10n_1.49-2_all.deb ... 760s Unpacking libgpg-error-l10n (1.49-2) over (1.47-3build2) ... 760s Preparing to unpack .../libgpg-error0_1.49-2_armhf.deb ... 760s Unpacking libgpg-error0:armhf (1.49-2) over (1.47-3build2) ... 760s Setting up libgpg-error0:armhf (1.49-2) ... 760s (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 ... 58082 files and directories currently installed.) 760s Preparing to unpack .../libgcrypt20_1.10.3-3_armhf.deb ... 760s Unpacking libgcrypt20:armhf (1.10.3-3) over (1.10.3-2build1) ... 760s Setting up libgcrypt20:armhf (1.10.3-3) ... 760s (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 ... 58082 files and directories currently installed.) 760s Preparing to unpack .../liblz4-1_1.9.4-2_armhf.deb ... 760s Unpacking liblz4-1:armhf (1.9.4-2) over (1.9.4-1build1) ... 760s Setting up liblz4-1:armhf (1.9.4-2) ... 760s (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 ... 58082 files and directories currently installed.) 760s Preparing to unpack .../libapt-pkg6.0t64_2.9.3_armhf.deb ... 760s Unpacking libapt-pkg6.0t64:armhf (2.9.3) over (2.7.14build2) ... 760s Setting up libapt-pkg6.0t64:armhf (2.9.3) ... 760s (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 ... 58082 files and directories currently installed.) 760s Preparing to unpack .../dpkg_1.22.6ubuntu10_armhf.deb ... 760s Unpacking dpkg (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 761s Setting up dpkg (1.22.6ubuntu10) ... 762s (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 ... 58082 files and directories currently installed.) 762s Preparing to unpack .../libperl5.38t64_5.38.2-4_armhf.deb ... 762s Unpacking libperl5.38t64:armhf (5.38.2-4) over (5.38.2-3.2build2) ... 762s Preparing to unpack .../perl_5.38.2-4_armhf.deb ... 762s Unpacking perl (5.38.2-4) over (5.38.2-3.2build2) ... 763s Preparing to unpack .../perl-base_5.38.2-4_armhf.deb ... 763s Unpacking perl-base (5.38.2-4) over (5.38.2-3.2build2) ... 763s Setting up perl-base (5.38.2-4) ... 763s (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 ... 58082 files and directories currently installed.) 763s Preparing to unpack .../perl-modules-5.38_5.38.2-4_all.deb ... 763s Unpacking perl-modules-5.38 (5.38.2-4) over (5.38.2-3.2build2) ... 764s Preparing to unpack .../libc-bin_2.39-0ubuntu8.1_armhf.deb ... 764s Unpacking libc-bin (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 764s Setting up libc-bin (2.39-0ubuntu8.1) ... 765s (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 ... 58082 files and directories currently installed.) 765s Preparing to unpack .../archives/apt_2.9.3_armhf.deb ... 765s Unpacking apt (2.9.3) over (2.7.14build2) ... 765s Setting up apt (2.9.3) ... 767s (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 ... 58082 files and directories currently installed.) 767s Preparing to unpack .../apt-utils_2.9.3_armhf.deb ... 767s Unpacking apt-utils (2.9.3) over (2.7.14build2) ... 767s Preparing to unpack .../libgnutls30t64_3.8.5-2ubuntu1_armhf.deb ... 767s Unpacking libgnutls30t64:armhf (3.8.5-2ubuntu1) over (3.8.3-1.1ubuntu3) ... 767s Setting up libgnutls30t64:armhf (3.8.5-2ubuntu1) ... 767s (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 ... 58083 files and directories currently installed.) 767s Preparing to unpack .../libpam0g_1.5.3-7ubuntu1_armhf.deb ... 767s Unpacking libpam0g:armhf (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 767s Setting up libpam0g:armhf (1.5.3-7ubuntu1) ... 767s (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 ... 58083 files and directories currently installed.) 767s Preparing to unpack .../libpam-modules-bin_1.5.3-7ubuntu1_armhf.deb ... 767s Unpacking libpam-modules-bin (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 768s Setting up libpam-modules-bin (1.5.3-7ubuntu1) ... 768s pam_namespace.service is a disabled or a static unit not running, not starting it. 768s (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 ... 58083 files and directories currently installed.) 768s Preparing to unpack .../libpam-modules_1.5.3-7ubuntu1_armhf.deb ... 769s Unpacking libpam-modules:armhf (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 769s Setting up libpam-modules:armhf (1.5.3-7ubuntu1) ... 769s (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 ... 58086 files and directories currently installed.) 769s Preparing to unpack .../liblocale-gettext-perl_1.07-7_armhf.deb ... 769s Unpacking liblocale-gettext-perl (1.07-7) over (1.07-6ubuntu5) ... 769s Preparing to unpack .../libacl1_2.3.2-2_armhf.deb ... 769s Unpacking libacl1:armhf (2.3.2-2) over (2.3.2-1build1) ... 769s Setting up libacl1:armhf (2.3.2-2) ... 769s (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 ... 58086 files and directories currently installed.) 769s Preparing to unpack .../00-rsync_3.3.0-1_armhf.deb ... 769s Unpacking rsync (3.3.0-1) over (3.2.7-1ubuntu1) ... 769s Preparing to unpack .../01-python-apt-common_2.9.0_all.deb ... 769s Unpacking python-apt-common (2.9.0) over (2.7.7ubuntu1) ... 769s Preparing to unpack .../02-python3-apt_2.9.0_armhf.deb ... 769s Unpacking python3-apt (2.9.0) over (2.7.7ubuntu1) ... 770s Preparing to unpack .../03-python3-pyparsing_3.1.2-1_all.deb ... 770s Unpacking python3-pyparsing (3.1.2-1) over (3.1.1-1) ... 770s Preparing to unpack .../04-python3-httplib2_0.22.0-1_all.deb ... 770s Unpacking python3-httplib2 (0.22.0-1) over (0.20.4-3) ... 770s Preparing to unpack .../05-python3-problem-report_2.28.1-0ubuntu4_all.deb ... 770s Unpacking python3-problem-report (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 770s Preparing to unpack .../06-python3-apport_2.28.1-0ubuntu4_all.deb ... 770s Unpacking python3-apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 770s Preparing to unpack .../07-gir1.2-girepository-2.0_1.80.1-3_armhf.deb ... 771s Unpacking gir1.2-girepository-2.0:armhf (1.80.1-3) over (1.80.1-1) ... 771s Preparing to unpack .../08-gir1.2-glib-2.0_2.80.2-1ubuntu1_armhf.deb ... 771s Unpacking gir1.2-glib-2.0:armhf (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 771s Preparing to unpack .../09-libglib2.0-0t64_2.80.2-1ubuntu1_armhf.deb ... 771s Unpacking libglib2.0-0t64:armhf (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 771s Preparing to unpack .../10-libgirepository-1.0-1_1.80.1-3_armhf.deb ... 771s Unpacking libgirepository-1.0-1:armhf (1.80.1-3) over (1.80.1-1) ... 771s Preparing to unpack .../11-apport-core-dump-handler_2.28.1-0ubuntu4_all.deb ... 771s Unpacking apport-core-dump-handler (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 771s Preparing to unpack .../12-apport_2.28.1-0ubuntu4_all.deb ... 771s Unpacking apport (2.28.1-0ubuntu4) over (2.28.1-0ubuntu2) ... 771s Preparing to unpack .../13-libcap-ng0_0.8.5-1_armhf.deb ... 771s Unpacking libcap-ng0:armhf (0.8.5-1) over (0.8.4-2build2) ... 771s Setting up libcap-ng0:armhf (0.8.5-1) ... 771s (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 ... 58088 files and directories currently installed.) 771s Preparing to unpack .../libpam-runtime_1.5.3-7ubuntu1_all.deb ... 771s Unpacking libpam-runtime (1.5.3-7ubuntu1) over (1.5.3-5ubuntu5) ... 771s Setting up libpam-runtime (1.5.3-7ubuntu1) ... 772s (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 ... 58088 files and directories currently installed.) 772s Preparing to unpack .../00-dhcpcd-base_1%3a10.0.6-5_armhf.deb ... 772s Unpacking dhcpcd-base (1:10.0.6-5) over (1:10.0.6-1ubuntu3) ... 772s Preparing to unpack .../01-libelf1t64_0.191-1_armhf.deb ... 772s Unpacking libelf1t64:armhf (0.191-1) over (0.190-1.1build4) ... 772s Preparing to unpack .../02-libbpf1_1%3a1.4.1-1_armhf.deb ... 772s Unpacking libbpf1:armhf (1:1.4.1-1) over (1:1.3.0-2build2) ... 772s Preparing to unpack .../03-libtirpc-common_1.3.4+ds-1.3_all.deb ... 772s Unpacking libtirpc-common (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 772s Preparing to unpack .../04-libtirpc3t64_1.3.4+ds-1.3_armhf.deb ... 772s Unpacking libtirpc3t64:armhf (1.3.4+ds-1.3) over (1.3.4+ds-1.1build1) ... 772s Preparing to unpack .../05-iproute2_6.9.0-1_armhf.deb ... 773s Unpacking iproute2 (6.9.0-1) over (6.1.0-1ubuntu6) ... 773s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_tables.d': Directory not empty 773s dpkg: warning: unable to delete old directory '/etc/iproute2/rt_protos.d': Directory not empty 773s dpkg: warning: unable to delete old directory '/etc/iproute2': Directory not empty 773s Preparing to unpack .../06-less_590-2ubuntu2.1_armhf.deb ... 773s Unpacking less (590-2ubuntu2.1) over (590-2ubuntu2) ... 773s Preparing to unpack .../07-libapparmor1_4.0.1-0ubuntu1_armhf.deb ... 773s Unpacking libapparmor1:armhf (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 774s Preparing to unpack .../08-libbsd0_0.12.2-1_armhf.deb ... 774s Unpacking libbsd0:armhf (0.12.2-1) over (0.12.1-1build1) ... 774s Preparing to unpack .../09-libexpat1_2.6.2-1_armhf.deb ... 774s Unpacking libexpat1:armhf (2.6.2-1) over (2.6.1-2build1) ... 774s Preparing to unpack .../10-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 774s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.0-6ubuntu1) ... 774s Preparing to unpack .../11-libslang2_2.3.3-5_armhf.deb ... 774s Unpacking libslang2:armhf (2.3.3-5) over (2.3.3-3build2) ... 774s Preparing to unpack .../12-libsqlite3-0_3.45.3-1_armhf.deb ... 774s Unpacking libsqlite3-0:armhf (3.45.3-1) over (3.45.1-1ubuntu2) ... 774s Preparing to unpack .../13-locales_2.39-0ubuntu8.1_all.deb ... 774s Unpacking locales (2.39-0ubuntu8.1) over (2.39-0ubuntu8) ... 775s Preparing to unpack .../14-tzdata_2024a-4ubuntu1_all.deb ... 775s Unpacking tzdata (2024a-4ubuntu1) over (2024a-2ubuntu1) ... 775s Preparing to unpack .../15-ubuntu-pro-client-l10n_32.1_armhf.deb ... 775s Unpacking ubuntu-pro-client-l10n (32.1) over (31.2.3) ... 775s Preparing to unpack .../16-ubuntu-pro-client_32.1_armhf.deb ... 775s Unpacking ubuntu-pro-client (32.1) over (31.2.3) ... 776s Preparing to unpack .../17-vim-tiny_2%3a9.1.0377-1ubuntu1_armhf.deb ... 776s Unpacking vim-tiny (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 776s Preparing to unpack .../18-vim-common_2%3a9.1.0377-1ubuntu1_all.deb ... 776s Unpacking vim-common (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 776s Preparing to unpack .../19-xxd_2%3a9.1.0377-1ubuntu1_armhf.deb ... 776s Unpacking xxd (2:9.1.0377-1ubuntu1) over (2:9.1.0016-1ubuntu7) ... 776s Preparing to unpack .../20-apparmor_4.0.1-0ubuntu1_armhf.deb ... 778s Unpacking apparmor (4.0.1-0ubuntu1) over (4.0.0-beta3-0ubuntu3) ... 778s Preparing to unpack .../21-bash-completion_1%3a2.14.0-1_all.deb ... 778s Unpacking bash-completion (1:2.14.0-1) over (1:2.11-8) ... 779s Preparing to unpack .../22-groff-base_1.23.0-4_armhf.deb ... 779s Unpacking groff-base (1.23.0-4) over (1.23.0-3build2) ... 779s Preparing to unpack .../23-libuv1t64_1.48.0-4_armhf.deb ... 779s Unpacking libuv1t64:armhf (1.48.0-4) over (1.48.0-1.1build1) ... 779s Preparing to unpack .../24-libxcb1_1.17.0-2_armhf.deb ... 779s Unpacking libxcb1:armhf (1.17.0-2) over (1.15-1ubuntu2) ... 780s Preparing to unpack .../25-man-db_2.12.1-1_armhf.deb ... 780s Unpacking man-db (2.12.1-1) over (2.12.0-4build2) ... 780s Preparing to unpack .../26-curl_8.5.0-2ubuntu10.1_armhf.deb ... 780s Unpacking curl (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 780s Preparing to unpack .../27-libcurl4t64_8.5.0-2ubuntu10.1_armhf.deb ... 780s Unpacking libcurl4t64:armhf (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 780s Preparing to unpack .../28-dpkg-dev_1.22.6ubuntu10_all.deb ... 780s Unpacking dpkg-dev (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 781s Preparing to unpack .../29-libdpkg-perl_1.22.6ubuntu10_all.deb ... 781s Unpacking libdpkg-perl (1.22.6ubuntu10) over (1.22.6ubuntu6) ... 781s Preparing to unpack .../30-dracut-install_060+5-8ubuntu1_armhf.deb ... 781s Unpacking dracut-install (060+5-8ubuntu1) over (060+5-1ubuntu3) ... 781s Preparing to unpack .../31-libeatmydata1_131-2_armhf.deb ... 781s Unpacking libeatmydata1:armhf (131-2) over (131-1ubuntu1) ... 781s Preparing to unpack .../32-eatmydata_131-2_all.deb ... 781s Unpacking eatmydata (131-2) over (131-1ubuntu1) ... 781s Preparing to unpack .../33-libcurl3t64-gnutls_8.5.0-2ubuntu10.1_armhf.deb ... 781s Unpacking libcurl3t64-gnutls:armhf (8.5.0-2ubuntu10.1) over (8.5.0-2ubuntu10) ... 781s Preparing to unpack .../34-libfwupd2_1.9.20-1_armhf.deb ... 781s Unpacking libfwupd2:armhf (1.9.20-1) over (1.9.16-1) ... 781s Preparing to unpack .../35-fwupd_1.9.20-1_armhf.deb ... 782s Unpacking fwupd (1.9.20-1) over (1.9.16-1) ... 782s Preparing to unpack .../36-initramfs-tools_0.142ubuntu27_all.deb ... 782s Unpacking initramfs-tools (0.142ubuntu27) over (0.142ubuntu25) ... 782s Preparing to unpack .../37-initramfs-tools-core_0.142ubuntu27_all.deb ... 782s Unpacking initramfs-tools-core (0.142ubuntu27) over (0.142ubuntu25) ... 782s Preparing to unpack .../38-initramfs-tools-bin_0.142ubuntu27_armhf.deb ... 782s Unpacking initramfs-tools-bin (0.142ubuntu27) over (0.142ubuntu25) ... 782s Preparing to unpack .../39-klibc-utils_2.0.13-4ubuntu1_armhf.deb ... 782s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 782s Preparing to unpack .../40-libklibc_2.0.13-4ubuntu1_armhf.deb ... 782s Unpacking libklibc:armhf (2.0.13-4ubuntu1) over (2.0.13-4) ... 782s Preparing to unpack .../41-libevent-core-2.1-7t64_2.1.12-stable-10_armhf.deb ... 782s Unpacking libevent-core-2.1-7t64:armhf (2.1.12-stable-10) over (2.1.12-stable-9ubuntu2) ... 782s Preparing to unpack .../42-libnss3_2%3a3.100-1_armhf.deb ... 782s Unpacking libnss3:armhf (2:3.100-1) over (2:3.98-1build1) ... 783s Preparing to unpack .../43-libnvme1t64_1.9-1_armhf.deb ... 783s Unpacking libnvme1t64 (1.9-1) over (1.8-3build1) ... 783s Preparing to unpack .../44-pastebinit_1.7.0-1_all.deb ... 783s Unpacking pastebinit (1.7.0-1) over (1.6.2-1) ... 783s Preparing to unpack .../45-python3-babel_2.14.0-1_all.deb ... 783s Unpacking python3-babel (2.14.0-1) over (2.10.3-3build1) ... 783s Preparing to unpack .../46-python-babel-localedata_2.14.0-1_all.deb ... 783s Unpacking python-babel-localedata (2.14.0-1) over (2.10.3-3build1) ... 784s Preparing to unpack .../47-python3-blinker_1.8.2-1_all.deb ... 784s Unpacking python3-blinker (1.8.2-1) over (1.8.1-1) ... 784s Selecting previously unselected package python3-jaraco.context. 784s Preparing to unpack .../48-python3-jaraco.context_4.3.0-1_all.deb ... 784s Unpacking python3-jaraco.context (4.3.0-1) ... 784s Selecting previously unselected package python3-jaraco.functools. 784s Preparing to unpack .../49-python3-jaraco.functools_4.0.0-1_all.deb ... 784s Unpacking python3-jaraco.functools (4.0.0-1) ... 784s Preparing to unpack .../50-python3-jinja2_3.1.3-1_all.deb ... 785s Unpacking python3-jinja2 (3.1.3-1) over (3.1.2-1ubuntu1) ... 785s Preparing to unpack .../51-python3-keyring_25.2.1-1_all.deb ... 785s Unpacking python3-keyring (25.2.1-1) over (24.3.1-1) ... 785s Preparing to unpack .../52-python3-six_1.16.0-6_all.deb ... 785s Unpacking python3-six (1.16.0-6) over (1.16.0-4) ... 785s Setting up libexpat1:armhf (2.6.2-1) ... 785s Setting up libapparmor1:armhf (4.0.1-0ubuntu1) ... 785s Setting up libxcb1:armhf (1.17.0-2) ... 785s Setting up apt-utils (2.9.3) ... 785s Setting up python3-jaraco.functools (4.0.0-1) ... 786s Setting up python3-jaraco.context (4.3.0-1) ... 786s Setting up libcurl4t64:armhf (8.5.0-2ubuntu10.1) ... 786s Setting up python3-problem-report (2.28.1-0ubuntu4) ... 786s Setting up libtirpc-common (1.3.4+ds-1.3) ... 786s Setting up libsqlite3-0:armhf (3.45.3-1) ... 786s Setting up libuv1t64:armhf (1.48.0-4) ... 786s Setting up libcurl3t64-gnutls:armhf (8.5.0-2ubuntu10.1) ... 786s Setting up less (590-2ubuntu2.1) ... 786s Setting up pastebinit (1.7.0-1) ... 786s Setting up libnss3:armhf (2:3.100-1) ... 786s Setting up locales (2.39-0ubuntu8.1) ... 788s Generating locales (this might take a while)... 793s en_US.UTF-8... done 793s Generation complete. 793s Setting up xxd (2:9.1.0377-1ubuntu1) ... 793s Setting up libelf1t64:armhf (0.191-1) ... 793s Setting up python-babel-localedata (2.14.0-1) ... 793s Setting up tzdata (2024a-4ubuntu1) ... 794s 794s Current default time zone: 'Etc/UTC' 794s Local time is now: Fri May 24 08:35:06 UTC 2024. 794s Universal Time is now: Fri May 24 08:35:06 UTC 2024. 794s Run 'dpkg-reconfigure tzdata' if you wish to change it. 794s 794s Setting up python3-six (1.16.0-6) ... 794s Setting up apparmor (4.0.1-0ubuntu1) ... 794s Installing new version of config file /etc/apparmor.d/abstractions/authentication ... 794s Installing new version of config file /etc/apparmor.d/abstractions/samba ... 794s Installing new version of config file /etc/apparmor.d/firefox ... 795s apparmor_parser: Unable to replace "lsb_release". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 795s 795s apparmor_parser: Unable to replace "kmod". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 795s 795s apparmor_parser: Unable to replace "nvidia_modprobe". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 795s 797s Reloading AppArmor profiles 797s /sbin/apparmor_parser: Unable to replace "1password". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "Discord". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "MongoDB Compass". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "balena-etcher". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "brave". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "buildah". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "busybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "cam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "ch-checkns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "ch-run". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "chrome". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "element-desktop". /sbin/apparmor_parser: Unable to replace "crun". /sbin/apparmor_parser: Unable to replace "devhelp". /sbin/apparmor_parser: Unable to replace "bwrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "vscode". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "epiphany". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "evolution". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "firefox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "flatpak". /sbin/apparmor_parser: Unable to replace "foliate". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "geary". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "github-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "goldendict". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "ipa_verify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "keybase". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "kchmviewer". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lc-compliance". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "libcamerify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "linux-sandbox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "loupe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-attach". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-create". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-destroy". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-execute". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-stop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-usernsexec". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lxc-unshare". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "msedge". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "mmdebstrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "nautilus". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "notepadqq". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "obsidian". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "opam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "opera". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "podman". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "polypane". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "privacybrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "qmapshack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "qutebrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "rpm". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "rootlesskit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "qcam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "runc". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "pageedit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "rssguard". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild". /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "plasmashell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-abort". /sbin/apparmor_parser: Unable to replace "sbuild-adduser". /sbin/apparmor_parser: Unable to replace "sbuild-apt". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-distupgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-createchroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-checkpackages". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-destroychroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-clean". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-shell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-update". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-hold". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-unhold". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "scide". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "signal-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "slack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "sbuild-upgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "steam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "lsb_release". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "surfshark". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "stress-ng". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "slirp4netns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "thunderbird". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "trinity". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "systemd-coredump". /sbin/apparmor_parser: Unable to replace "tup". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "toybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "tuxedo-control-center". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "userbindmount". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "unprivileged_userns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "kmod". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "nvidia_modprobe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "uwsgi-core". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "vdens". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "virtiofsd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "vivaldi-bin". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "vpnns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "wike". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "unix-chkpwd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "wpcom". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "/usr/bin/man". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "rsyslogd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "ubuntu_pro_apt_news". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "/usr/lib/NetworkManager/nm-dhcp-client.action". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 797s /sbin/apparmor_parser: Unable to replace "tcpdump". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 797s 798s /sbin/apparmor_parser: Unable to replace "transmission-cli". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 798s 798s Error: At least one profile failed to load 798s Setting up libklibc:armhf (2.0.13-4ubuntu1) ... 798s Setting up python3-jinja2 (3.1.3-1) ... 798s Setting up libglib2.0-0t64:armhf (2.80.2-1ubuntu1) ... 798s No schema files found: doing nothing. 798s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 798s Setting up vim-common (2:9.1.0377-1ubuntu1) ... 798s Setting up libslang2:armhf (2.3.3-5) ... 798s Setting up python3-pyparsing (3.1.2-1) ... 799s Setting up libnvme1t64 (1.9-1) ... 799s Setting up bash-completion (1:2.14.0-1) ... 799s Installing new version of config file /etc/profile.d/bash_completion.sh ... 799s Setting up perl-modules-5.38 (5.38.2-4) ... 799s Setting up dhcpcd-base (1:10.0.6-5) ... 799s Setting up gir1.2-glib-2.0:armhf (2.80.2-1ubuntu1) ... 799s Setting up python-apt-common (2.9.0) ... 799s Setting up dracut-install (060+5-8ubuntu1) ... 799s Setting up groff-base (1.23.0-4) ... 799s Setting up libeatmydata1:armhf (131-2) ... 799s Setting up python3-keyring (25.2.1-1) ... 799s Setting up python3-httplib2 (0.22.0-1) ... 800s Setting up libgirepository-1.0-1:armhf (1.80.1-3) ... 800s Setting up libevent-core-2.1-7t64:armhf (2.1.12-stable-10) ... 800s Setting up curl (8.5.0-2ubuntu10.1) ... 800s Setting up libperl5.38t64:armhf (5.38.2-4) ... 800s Setting up klibc-utils (2.0.13-4ubuntu1) ... 800s Setting up libbsd0:armhf (0.12.2-1) ... 800s Setting up libgpg-error-l10n (1.49-2) ... 800s Setting up liblocale-gettext-perl (1.07-7) ... 800s Setting up libbpf1:armhf (1:1.4.1-1) ... 800s Setting up rsync (3.3.0-1) ... 801s rsync.service is a disabled or a static unit not running, not starting it. 801s Setting up initramfs-tools-bin (0.142ubuntu27) ... 801s Setting up python3-blinker (1.8.2-1) ... 802s Setting up eatmydata (131-2) ... 802s Setting up libtirpc3t64:armhf (1.3.4+ds-1.3) ... 802s Setting up python3-babel (2.14.0-1) ... 802s Setting up python3-apt (2.9.0) ... 803s Setting up iproute2 (6.9.0-1) ... 803s Removing obsolete conffile /etc/iproute2/group ... 803s Removing obsolete conffile /etc/iproute2/rt_realms ... 803s Removing obsolete conffile /etc/iproute2/rt_scopes ... 803s Removing obsolete conffile /etc/iproute2/rt_tables ... 803s Removing obsolete conffile /etc/iproute2/rt_tables.d/README ... 803s Removing obsolete conffile /etc/iproute2/rt_protos.d/README ... 803s Removing obsolete conffile /etc/iproute2/rt_protos ... 803s Removing obsolete conffile /etc/iproute2/rt_dsfield ... 803s Removing obsolete conffile /etc/iproute2/nl_protos ... 803s Removing obsolete conffile /etc/iproute2/ematch_map ... 803s Removing obsolete conffile /etc/iproute2/bpf_pinning ... 803s Setting up libfwupd2:armhf (1.9.20-1) ... 803s Setting up vim-tiny (2:9.1.0377-1ubuntu1) ... 803s Setting up man-db (2.12.1-1) ... 803s Updating database of manual pages ... 806s apparmor_parser: Unable to replace "/usr/bin/man". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 806s 807s man-db.service is a disabled or a static unit not running, not starting it. 807s Setting up python3-apport (2.28.1-0ubuntu4) ... 808s Setting up perl (5.38.2-4) ... 808s Setting up gir1.2-girepository-2.0:armhf (1.80.1-3) ... 808s Setting up libdpkg-perl (1.22.6ubuntu10) ... 808s Setting up initramfs-tools-core (0.142ubuntu27) ... 808s Setting up ubuntu-pro-client (32.1) ... 808s Installing new version of config file /etc/apparmor.d/ubuntu_pro_apt_news ... 808s apparmor_parser: Unable to replace "ubuntu_pro_apt_news". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 808s 809s apparmor_parser: Unable to replace "apt_methods". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 809s 809s apparmor_parser: Unable to replace "ubuntu_pro_esm_cache". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 809s 812s Setting up fwupd (1.9.20-1) ... 813s fwupd-offline-update.service is a disabled or a static unit not running, not starting it. 813s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 813s fwupd.service is a disabled or a static unit not running, not starting it. 813s Setting up ubuntu-pro-client-l10n (32.1) ... 813s Setting up initramfs-tools (0.142ubuntu27) ... 813s update-initramfs: deferring update (trigger activated) 813s Setting up dpkg-dev (1.22.6ubuntu10) ... 813s Setting up apport-core-dump-handler (2.28.1-0ubuntu4) ... 815s Setting up apport (2.28.1-0ubuntu4) ... 815s Installing new version of config file /etc/apport/crashdb.conf ... 817s apport-autoreport.service is a disabled or a static unit not running, not starting it. 817s Processing triggers for dbus (1.14.10-4ubuntu4) ... 817s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 817s Processing triggers for initramfs-tools (0.142ubuntu27) ... 820s Reading package lists... 820s Building dependency tree... 820s Reading state information... 822s The following packages will be REMOVED: 822s libatm1t64* 822s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 822s After this operation, 94.2 kB disk space will be freed. 823s (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 ... 58570 files and directories currently installed.) 823s Removing libatm1t64:armhf (1:2.5.1-5.1build1) ... 823s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 825s autopkgtest [08:35:37]: rebooting testbed after setup commands that affected boot 910s Reading package lists... 911s Building dependency tree... 911s Reading state information... 912s Starting pkgProblemResolver with broken count: 0 912s Starting 2 pkgProblemResolver with broken count: 0 912s Done 913s The following additional packages will be installed: 913s build-essential cpp cpp-13 cpp-13-arm-linux-gnueabihf 913s cpp-arm-linux-gnueabihf dctrl-tools fontconfig fontconfig-config 913s fonts-dejavu-core fonts-dejavu-mono fonts-glyphicons-halflings fonts-mathjax 913s g++ g++-13 g++-13-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc gcc-13 913s gcc-13-arm-linux-gnueabihf gcc-13-base gcc-arm-linux-gnueabihf gfortran 913s gfortran-13 gfortran-13-arm-linux-gnueabihf gfortran-arm-linux-gnueabihf 913s icu-devtools libasan8 libatomic1 libblas-dev libblas3 libbz2-dev 913s libc-dev-bin libc6-dev libcairo2 libcc1-0 libcrypt-dev libdatrie1 913s libdeflate-dev libdeflate0 libfontconfig1 libfreetype6 libgcc-13-dev 913s libgfortran-13-dev libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b 913s libice6 libicu-dev libisl23 libjbig0 libjpeg-dev libjpeg-turbo8 913s libjpeg-turbo8-dev libjpeg8 libjpeg8-dev libjs-bootstrap libjs-highlight.js 913s libjs-jquery libjs-jquery-datatables libjs-mathjax liblapack-dev liblapack3 913s liblerc4 liblzma-dev libmpc3 libncurses-dev libpango-1.0-0 913s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpcre2-16-0 913s libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpixman-1-0 libpkgconf3 913s libpng-dev libreadline-dev libsharpyuv0 libsm6 libstdc++-13-dev libtcl8.6 913s libthai-data libthai0 libtiff6 libtirpc-dev libtk8.6 libubsan1 libwebp7 913s libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 913s linux-libc-dev node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin 913s r-base-core r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace 913s r-cran-commonmark r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 913s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 913s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 913s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 913s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r6 913s r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble r-cran-utf8 913s r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun r-cran-yaml 913s rpcsvc-proto unzip x11-common xdg-utils zip zlib1g-dev 914s Suggested packages: 914s cpp-doc gcc-13-locales cpp-13-doc debtags gcc-13-doc gcc-multilib 914s manpages-dev autoconf automake libtool flex bison gdb gcc-doc 914s gdb-arm-linux-gnueabihf gfortran-doc gfortran-13-doc libcoarrays-dev 914s liblapack-doc glibc-doc icu-doc fonts-mathjax-extras fonts-stix 914s libjs-mathjax-doc liblzma-doc ncurses-doc readline-doc libstdc++-13-doc 914s tcl8.6 tk8.6 libjs-html5shiv elpa-ess r-doc-info | r-doc-pdf r-mathlib 914s r-base-html texlive-base texlive-latex-base texlive-plain-generic 914s texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils 914s texlive-latex-recommended texlive-latex-extra texinfo r-cran-kernsmooth 914s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 914s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 914s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 914s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 914s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-bench 914s r-cran-blob r-cran-brio r-cran-callr r-cran-crayon r-cran-here r-cran-hms 914s r-cran-htmltools r-cran-pkgbuild r-cran-pkgload r-cran-purrr r-cran-tidyr 914s Recommended packages: 914s bzip2-doc manpages manpages-dev libc-devtools javascript-common libpng-tools 914s r-recommended r-doc-html r-cran-callr r-cran-covr r-cran-crayon 914s r-cran-digest r-cran-htmltools r-cran-htmlwidgets r-cran-mockery 914s r-cran-processx r-cran-ps r-cran-rmarkdown r-cran-rprojroot 914s r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl r-cran-xml2 914s r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc r-cran-mapproj 914s r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg r-cran-ragg 914s r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 914s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 914s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 914s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 914s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 914s r-cran-r.devices r-cran-r.rsp r-cran-lubridate r-cran-fs r-cran-usethis 914s r-cran-bit64 r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table 914s r-cran-mockr r-cran-formattable r-cran-generics r-cran-pkgdown 914s r-cran-zeallot r-cran-mime r-cran-remotes r-cran-renv r-cran-jsonlite 914s r-cran-runit libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl 914s x11-utils x11-xserver-utils 914s The following NEW packages will be installed: 914s autopkgtest-satdep build-essential cpp cpp-13 cpp-13-arm-linux-gnueabihf 914s cpp-arm-linux-gnueabihf dctrl-tools fontconfig fontconfig-config 914s fonts-dejavu-core fonts-dejavu-mono fonts-glyphicons-halflings fonts-mathjax 914s g++ g++-13 g++-13-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc gcc-13 914s gcc-13-arm-linux-gnueabihf gcc-13-base gcc-arm-linux-gnueabihf gfortran 914s gfortran-13 gfortran-13-arm-linux-gnueabihf gfortran-arm-linux-gnueabihf 914s icu-devtools libasan8 libatomic1 libblas-dev libblas3 libbz2-dev 914s libc-dev-bin libc6-dev libcairo2 libcc1-0 libcrypt-dev libdatrie1 914s libdeflate-dev libdeflate0 libfontconfig1 libfreetype6 libgcc-13-dev 914s libgfortran-13-dev libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b 914s libice6 libicu-dev libisl23 libjbig0 libjpeg-dev libjpeg-turbo8 914s libjpeg-turbo8-dev libjpeg8 libjpeg8-dev libjs-bootstrap libjs-highlight.js 914s libjs-jquery libjs-jquery-datatables libjs-mathjax liblapack-dev liblapack3 914s liblerc4 liblzma-dev libmpc3 libncurses-dev libpango-1.0-0 914s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpcre2-16-0 914s libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpixman-1-0 libpkgconf3 914s libpng-dev libreadline-dev libsharpyuv0 libsm6 libstdc++-13-dev libtcl8.6 914s libthai-data libthai0 libtiff6 libtirpc-dev libtk8.6 libubsan1 libwebp7 914s libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 914s linux-libc-dev node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin 914s r-base-core r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace 914s r-cran-commonmark r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 914s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 914s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 914s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 914s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r6 914s r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble r-cran-utf8 914s r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun r-cran-yaml 914s rpcsvc-proto unzip x11-common xdg-utils zip zlib1g-dev 914s 0 upgraded, 148 newly installed, 0 to remove and 0 not upgraded. 914s Need to get 152 MB/152 MB of archives. 914s After this operation, 402 MB of additional disk space will be used. 914s Get:1 /tmp/autopkgtest.nMUE6C/2-autopkgtest-satdep.deb autopkgtest-satdep armhf 0 [752 B] 914s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf libc-dev-bin armhf 2.39-0ubuntu8.1 [19.1 kB] 914s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf linux-libc-dev armhf 6.8.0-31.31 [1557 kB] 915s Get:4 http://ftpmaster.internal/ubuntu oracular/main armhf libcrypt-dev armhf 1:4.4.36-4build1 [120 kB] 915s Get:5 http://ftpmaster.internal/ubuntu oracular/main armhf rpcsvc-proto armhf 1.4.2-0ubuntu7 [62.2 kB] 915s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf libc6-dev armhf 2.39-0ubuntu8.1 [1351 kB] 915s Get:7 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-13-base armhf 13.2.0-23ubuntu4 [48.9 kB] 915s Get:8 http://ftpmaster.internal/ubuntu oracular/main armhf libisl23 armhf 0.26-3build1 [544 kB] 915s Get:9 http://ftpmaster.internal/ubuntu oracular/main armhf libmpc3 armhf 1.3.1-1build1 [46.7 kB] 915s Get:10 http://ftpmaster.internal/ubuntu oracular/main armhf cpp-13-arm-linux-gnueabihf armhf 13.2.0-23ubuntu4 [8759 kB] 916s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf cpp-13 armhf 13.2.0-23ubuntu4 [1034 B] 916s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf cpp-arm-linux-gnueabihf armhf 4:13.2.0-7ubuntu1 [5320 B] 916s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf cpp armhf 4:13.2.0-7ubuntu1 [22.4 kB] 916s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf libcc1-0 armhf 14.1.0-1ubuntu1 [43.3 kB] 916s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf libgomp1 armhf 14.1.0-1ubuntu1 [125 kB] 916s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf libatomic1 armhf 14.1.0-1ubuntu1 [7816 B] 916s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf libasan8 armhf 14.1.0-1ubuntu1 [2913 kB] 916s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf libubsan1 armhf 14.1.0-1ubuntu1 [1154 kB] 916s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf libgcc-13-dev armhf 13.2.0-23ubuntu4 [899 kB] 916s Get:20 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-13-arm-linux-gnueabihf armhf 13.2.0-23ubuntu4 [16.9 MB] 917s Get:21 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-13 armhf 13.2.0-23ubuntu4 [453 kB] 917s Get:22 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-arm-linux-gnueabihf armhf 4:13.2.0-7ubuntu1 [1220 B] 917s Get:23 http://ftpmaster.internal/ubuntu oracular/main armhf gcc armhf 4:13.2.0-7ubuntu1 [5022 B] 917s Get:24 http://ftpmaster.internal/ubuntu oracular/main armhf libstdc++-13-dev armhf 13.2.0-23ubuntu4 [2456 kB] 917s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf g++-13-arm-linux-gnueabihf armhf 13.2.0-23ubuntu4 [9941 kB] 918s Get:26 http://ftpmaster.internal/ubuntu oracular/main armhf g++-13 armhf 13.2.0-23ubuntu4 [14.5 kB] 918s Get:27 http://ftpmaster.internal/ubuntu oracular/main armhf g++-arm-linux-gnueabihf armhf 4:13.2.0-7ubuntu1 [966 B] 918s Get:28 http://ftpmaster.internal/ubuntu oracular/main armhf g++ armhf 4:13.2.0-7ubuntu1 [1090 B] 918s Get:29 http://ftpmaster.internal/ubuntu oracular/main armhf build-essential armhf 12.10ubuntu1 [4928 B] 918s Get:30 http://ftpmaster.internal/ubuntu oracular/main armhf dctrl-tools armhf 2.24-3build3 [94.7 kB] 918s Get:31 http://ftpmaster.internal/ubuntu oracular/main armhf libfreetype6 armhf 2.13.2+dfsg-1build3 [331 kB] 918s Get:32 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-dejavu-mono all 2.37-8 [502 kB] 918s Get:33 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-dejavu-core all 2.37-8 [835 kB] 918s Get:34 http://ftpmaster.internal/ubuntu oracular/main armhf fontconfig-config armhf 2.15.0-1.1ubuntu2 [37.4 kB] 918s Get:35 http://ftpmaster.internal/ubuntu oracular/main armhf libfontconfig1 armhf 2.15.0-1.1ubuntu2 [113 kB] 918s Get:36 http://ftpmaster.internal/ubuntu oracular/main armhf fontconfig armhf 2.15.0-1.1ubuntu2 [189 kB] 918s Get:37 http://ftpmaster.internal/ubuntu oracular/universe armhf fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 918s Get:38 http://ftpmaster.internal/ubuntu oracular/main armhf fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 918s Get:39 http://ftpmaster.internal/ubuntu oracular/main armhf libgfortran5 armhf 14.1.0-1ubuntu1 [311 kB] 918s Get:40 http://ftpmaster.internal/ubuntu oracular/main armhf libgfortran-13-dev armhf 13.2.0-23ubuntu4 [359 kB] 918s Get:41 http://ftpmaster.internal/ubuntu oracular/main armhf gfortran-13-arm-linux-gnueabihf armhf 13.2.0-23ubuntu4 [9182 kB] 918s Get:42 http://ftpmaster.internal/ubuntu oracular/main armhf gfortran-13 armhf 13.2.0-23ubuntu4 [11.7 kB] 918s Get:43 http://ftpmaster.internal/ubuntu oracular/main armhf gfortran-arm-linux-gnueabihf armhf 4:13.2.0-7ubuntu1 [1024 B] 918s Get:44 http://ftpmaster.internal/ubuntu oracular/main armhf gfortran armhf 4:13.2.0-7ubuntu1 [1166 B] 918s Get:45 http://ftpmaster.internal/ubuntu oracular/main armhf icu-devtools armhf 74.2-1ubuntu3 [201 kB] 918s Get:46 http://ftpmaster.internal/ubuntu oracular/main armhf libblas3 armhf 3.12.0-3build1 [123 kB] 918s Get:47 http://ftpmaster.internal/ubuntu oracular/main armhf libblas-dev armhf 3.12.0-3build1 [132 kB] 918s Get:48 http://ftpmaster.internal/ubuntu oracular/main armhf libbz2-dev armhf 1.0.8-5.1 [30.5 kB] 918s Get:49 http://ftpmaster.internal/ubuntu oracular/main armhf libpixman-1-0 armhf 0.42.2-1build1 [193 kB] 918s Get:50 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb-render0 armhf 1.17.0-2 [15.3 kB] 918s Get:51 http://ftpmaster.internal/ubuntu oracular/main armhf libxcb-shm0 armhf 1.17.0-2 [5774 B] 918s Get:52 http://ftpmaster.internal/ubuntu oracular/main armhf libxrender1 armhf 1:0.9.10-1.1build1 [16.0 kB] 918s Get:53 http://ftpmaster.internal/ubuntu oracular/main armhf libcairo2 armhf 1.18.0-3build1 [482 kB] 918s Get:54 http://ftpmaster.internal/ubuntu oracular/main armhf libdatrie1 armhf 0.2.13-3build1 [15.7 kB] 918s Get:55 http://ftpmaster.internal/ubuntu oracular/main armhf libdeflate0 armhf 1.20-1 [38.3 kB] 918s Get:56 http://ftpmaster.internal/ubuntu oracular/main armhf libdeflate-dev armhf 1.20-1 [44.6 kB] 918s Get:57 http://ftpmaster.internal/ubuntu oracular/main armhf libgraphite2-3 armhf 1.3.14-2build1 [64.6 kB] 918s Get:58 http://ftpmaster.internal/ubuntu oracular/main armhf libharfbuzz0b armhf 8.3.0-2build2 [446 kB] 918s Get:59 http://ftpmaster.internal/ubuntu oracular/main armhf x11-common all 1:7.7+23ubuntu3 [21.7 kB] 918s Get:60 http://ftpmaster.internal/ubuntu oracular/main armhf libice6 armhf 2:1.0.10-1build3 [35.4 kB] 918s Get:61 http://ftpmaster.internal/ubuntu oracular/main armhf libicu-dev armhf 74.2-1ubuntu3 [11.6 MB] 919s Get:62 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg-turbo8 armhf 2.1.5-2ubuntu2 [125 kB] 919s Get:63 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg-turbo8-dev armhf 2.1.5-2ubuntu2 [262 kB] 919s Get:64 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg8 armhf 8c-2ubuntu11 [2148 B] 919s Get:65 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg8-dev armhf 8c-2ubuntu11 [1484 B] 919s Get:66 http://ftpmaster.internal/ubuntu oracular/main armhf libjpeg-dev armhf 8c-2ubuntu11 [1482 B] 919s Get:67 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 919s Get:68 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 919s Get:69 http://ftpmaster.internal/ubuntu oracular/main armhf libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 919s Get:70 http://ftpmaster.internal/ubuntu oracular/universe armhf libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 919s Get:71 http://ftpmaster.internal/ubuntu oracular/main armhf liblapack3 armhf 3.12.0-3build1 [2085 kB] 919s Get:72 http://ftpmaster.internal/ubuntu oracular/main armhf liblapack-dev armhf 3.12.0-3build1 [2177 kB] 919s Get:73 http://ftpmaster.internal/ubuntu oracular/main armhf liblerc4 armhf 4.0.0+ds-4ubuntu2 [151 kB] 919s Get:74 http://ftpmaster.internal/ubuntu oracular/main armhf libncurses-dev armhf 6.4+20240113-1ubuntu2 [501 kB] 919s Get:75 http://ftpmaster.internal/ubuntu oracular/main armhf libthai-data all 0.1.29-2build1 [158 kB] 919s Get:76 http://ftpmaster.internal/ubuntu oracular/main armhf libthai0 armhf 0.1.29-2build1 [15.2 kB] 919s Get:77 http://ftpmaster.internal/ubuntu oracular/main armhf libpango-1.0-0 armhf 1.52.2+ds-1 [209 kB] 919s Get:78 http://ftpmaster.internal/ubuntu oracular/main armhf libpangoft2-1.0-0 armhf 1.52.2+ds-1 [36.4 kB] 919s Get:79 http://ftpmaster.internal/ubuntu oracular/main armhf libpangocairo-1.0-0 armhf 1.52.2+ds-1 [24.9 kB] 919s Get:80 http://ftpmaster.internal/ubuntu oracular/main armhf libpaper1 armhf 1.1.29build1 [12.6 kB] 919s Get:81 http://ftpmaster.internal/ubuntu oracular/main armhf libpaper-utils armhf 1.1.29build1 [8184 B] 919s Get:82 http://ftpmaster.internal/ubuntu oracular/main armhf libpcre2-16-0 armhf 10.42-4ubuntu2 [180 kB] 919s Get:83 http://ftpmaster.internal/ubuntu oracular/main armhf libpcre2-32-0 armhf 10.42-4ubuntu2 [171 kB] 919s Get:84 http://ftpmaster.internal/ubuntu oracular/main armhf libpcre2-posix3 armhf 10.42-4ubuntu2 [6088 B] 919s Get:85 http://ftpmaster.internal/ubuntu oracular/main armhf libpcre2-dev armhf 10.42-4ubuntu2 [664 kB] 919s Get:86 http://ftpmaster.internal/ubuntu oracular/main armhf libpkgconf3 armhf 1.8.1-2build1 [26.3 kB] 919s Get:87 http://ftpmaster.internal/ubuntu oracular/main armhf zlib1g-dev armhf 1:1.3.dfsg-3.1ubuntu2 [880 kB] 919s Get:88 http://ftpmaster.internal/ubuntu oracular/main armhf libpng-dev armhf 1.6.43-5build1 [248 kB] 919s Get:89 http://ftpmaster.internal/ubuntu oracular/main armhf libreadline-dev armhf 8.2-4build1 [153 kB] 919s Get:90 http://ftpmaster.internal/ubuntu oracular/main armhf libsharpyuv0 armhf 1.4.0-0.1 [16.3 kB] 919s Get:91 http://ftpmaster.internal/ubuntu oracular/main armhf libsm6 armhf 2:1.2.3-1build3 [14.1 kB] 919s Get:92 http://ftpmaster.internal/ubuntu oracular/main armhf libtcl8.6 armhf 8.6.14+dfsg-1build1 [903 kB] 919s Get:93 http://ftpmaster.internal/ubuntu oracular/main armhf libjbig0 armhf 2.1-6.1ubuntu2 [24.9 kB] 919s Get:94 http://ftpmaster.internal/ubuntu oracular/main armhf libwebp7 armhf 1.4.0-0.1 [184 kB] 919s Get:95 http://ftpmaster.internal/ubuntu oracular/main armhf libtiff6 armhf 4.5.1+git230720-4ubuntu2 [178 kB] 919s Get:96 http://ftpmaster.internal/ubuntu oracular/main armhf libxft2 armhf 2.3.6-1build1 [37.4 kB] 919s Get:97 http://ftpmaster.internal/ubuntu oracular/main armhf libxss1 armhf 1:1.2.3-1build3 [6500 B] 919s Get:98 http://ftpmaster.internal/ubuntu oracular/main armhf libtk8.6 armhf 8.6.14-1build1 [681 kB] 919s Get:99 http://ftpmaster.internal/ubuntu oracular/main armhf libxt6t64 armhf 1:1.2.1-1.2build1 [145 kB] 919s Get:100 http://ftpmaster.internal/ubuntu oracular/universe armhf node-normalize.css all 8.0.1-5 [10.8 kB] 919s Get:101 http://ftpmaster.internal/ubuntu oracular/main armhf zip armhf 3.0-13build1 [163 kB] 919s Get:102 http://ftpmaster.internal/ubuntu oracular/main armhf unzip armhf 6.0-28ubuntu4 [163 kB] 919s Get:103 http://ftpmaster.internal/ubuntu oracular/main armhf xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 920s Get:104 http://ftpmaster.internal/ubuntu oracular/universe armhf r-base-core armhf 4.4.0-2 [28.1 MB] 921s Get:105 http://ftpmaster.internal/ubuntu oracular/main armhf liblzma-dev armhf 5.6.1+really5.4.5-1 [165 kB] 921s Get:106 http://ftpmaster.internal/ubuntu oracular/main armhf pkgconf-bin armhf 1.8.1-2build1 [20.7 kB] 921s Get:107 http://ftpmaster.internal/ubuntu oracular/main armhf pkgconf armhf 1.8.1-2build1 [16.8 kB] 921s Get:108 http://ftpmaster.internal/ubuntu oracular/main armhf libtirpc-dev armhf 1.3.4+ds-1.3 [184 kB] 921s Get:109 http://ftpmaster.internal/ubuntu oracular/universe armhf r-base-dev all 4.4.0-2 [4340 B] 921s Get:110 http://ftpmaster.internal/ubuntu oracular/universe armhf pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 921s Get:111 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-base64enc armhf 0.1-3-3 [27.3 kB] 921s Get:112 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-cli armhf 3.6.2-1 [1363 kB] 921s Get:113 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-colorspace armhf 2.1-0+dfsg-1 [1538 kB] 921s Get:114 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-commonmark armhf 1.9.1-1 [110 kB] 921s Get:115 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-evaluate all 0.23-1 [90.2 kB] 921s Get:116 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-fansi armhf 1.0.5-1 [611 kB] 921s Get:117 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-farver armhf 2.1.1-2 [1353 kB] 921s Get:118 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-glue armhf 1.7.0-1 [153 kB] 921s Get:119 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-rlang armhf 1.1.3-1 [1658 kB] 921s Get:120 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 921s Get:121 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 921s Get:122 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-isoband armhf 0.2.7-1 [1477 kB] 921s Get:123 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-mass armhf 7.3-60.0.1-1 [1118 kB] 921s Get:124 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-lattice armhf 0.22-6-1 [1363 kB] 921s Get:125 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-nlme armhf 3.1.164-1build1 [2248 kB] 921s Get:126 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-matrix armhf 1.6-5-1 [3762 kB] 921s Get:127 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-mgcv armhf 1.9-1-1 [3205 kB] 921s Get:128 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-labeling all 0.4.3-1 [62.1 kB] 921s Get:129 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-munsell all 0.5.0-2build1 [208 kB] 921s Get:130 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-r6 all 2.5.1-1 [99.0 kB] 921s Get:131 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 921s Get:132 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-viridislite all 0.4.2-2 [1088 kB] 921s Get:133 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-scales all 1.3.0-1 [603 kB] 921s Get:134 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-magrittr armhf 2.0.3-1 [154 kB] 921s Get:135 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-utf8 armhf 1.2.4-1 [136 kB] 921s Get:136 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-vctrs armhf 0.6.5-1 [1310 kB] 922s Get:137 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 922s Get:138 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 922s Get:139 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-tibble armhf 3.2.1+dfsg-2 [415 kB] 922s Get:140 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-withr all 2.5.0-1 [225 kB] 922s Get:141 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 922s Get:142 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-xfun armhf 0.44+dfsg-1 [517 kB] 922s Get:143 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-highr all 0.10+dfsg-2 [38.5 kB] 922s Get:144 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-yaml armhf 2.3.8-2 [100 kB] 922s Get:145 http://ftpmaster.internal/ubuntu oracular/main armhf libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 922s Get:146 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-knitr all 1.46+dfsg-1 [911 kB] 922s Get:147 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-markdown all 1.12+dfsg-2 [179 kB] 922s Get:148 http://ftpmaster.internal/ubuntu oracular/universe armhf r-cran-matrixstats armhf 1.2.0-1 [478 kB] 923s Preconfiguring packages ... 924s Fetched 152 MB in 8s (18.8 MB/s) 924s Selecting previously unselected package libc-dev-bin. 924s (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 ... 58565 files and directories currently installed.) 924s Preparing to unpack .../000-libc-dev-bin_2.39-0ubuntu8.1_armhf.deb ... 924s Unpacking libc-dev-bin (2.39-0ubuntu8.1) ... 924s Selecting previously unselected package linux-libc-dev:armhf. 924s Preparing to unpack .../001-linux-libc-dev_6.8.0-31.31_armhf.deb ... 924s Unpacking linux-libc-dev:armhf (6.8.0-31.31) ... 924s Selecting previously unselected package libcrypt-dev:armhf. 924s Preparing to unpack .../002-libcrypt-dev_1%3a4.4.36-4build1_armhf.deb ... 924s Unpacking libcrypt-dev:armhf (1:4.4.36-4build1) ... 924s Selecting previously unselected package rpcsvc-proto. 924s Preparing to unpack .../003-rpcsvc-proto_1.4.2-0ubuntu7_armhf.deb ... 924s Unpacking rpcsvc-proto (1.4.2-0ubuntu7) ... 924s Selecting previously unselected package libc6-dev:armhf. 924s Preparing to unpack .../004-libc6-dev_2.39-0ubuntu8.1_armhf.deb ... 924s Unpacking libc6-dev:armhf (2.39-0ubuntu8.1) ... 925s Selecting previously unselected package gcc-13-base:armhf. 925s Preparing to unpack .../005-gcc-13-base_13.2.0-23ubuntu4_armhf.deb ... 925s Unpacking gcc-13-base:armhf (13.2.0-23ubuntu4) ... 925s Selecting previously unselected package libisl23:armhf. 925s Preparing to unpack .../006-libisl23_0.26-3build1_armhf.deb ... 925s Unpacking libisl23:armhf (0.26-3build1) ... 925s Selecting previously unselected package libmpc3:armhf. 925s Preparing to unpack .../007-libmpc3_1.3.1-1build1_armhf.deb ... 925s Unpacking libmpc3:armhf (1.3.1-1build1) ... 925s Selecting previously unselected package cpp-13-arm-linux-gnueabihf. 925s Preparing to unpack .../008-cpp-13-arm-linux-gnueabihf_13.2.0-23ubuntu4_armhf.deb ... 925s Unpacking cpp-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 925s Selecting previously unselected package cpp-13. 925s Preparing to unpack .../009-cpp-13_13.2.0-23ubuntu4_armhf.deb ... 925s Unpacking cpp-13 (13.2.0-23ubuntu4) ... 925s Selecting previously unselected package cpp-arm-linux-gnueabihf. 925s Preparing to unpack .../010-cpp-arm-linux-gnueabihf_4%3a13.2.0-7ubuntu1_armhf.deb ... 925s Unpacking cpp-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 925s Selecting previously unselected package cpp. 925s Preparing to unpack .../011-cpp_4%3a13.2.0-7ubuntu1_armhf.deb ... 925s Unpacking cpp (4:13.2.0-7ubuntu1) ... 925s Selecting previously unselected package libcc1-0:armhf. 925s Preparing to unpack .../012-libcc1-0_14.1.0-1ubuntu1_armhf.deb ... 925s Unpacking libcc1-0:armhf (14.1.0-1ubuntu1) ... 925s Selecting previously unselected package libgomp1:armhf. 925s Preparing to unpack .../013-libgomp1_14.1.0-1ubuntu1_armhf.deb ... 925s Unpacking libgomp1:armhf (14.1.0-1ubuntu1) ... 926s Selecting previously unselected package libatomic1:armhf. 926s Preparing to unpack .../014-libatomic1_14.1.0-1ubuntu1_armhf.deb ... 926s Unpacking libatomic1:armhf (14.1.0-1ubuntu1) ... 926s Selecting previously unselected package libasan8:armhf. 926s Preparing to unpack .../015-libasan8_14.1.0-1ubuntu1_armhf.deb ... 926s Unpacking libasan8:armhf (14.1.0-1ubuntu1) ... 926s Selecting previously unselected package libubsan1:armhf. 926s Preparing to unpack .../016-libubsan1_14.1.0-1ubuntu1_armhf.deb ... 926s Unpacking libubsan1:armhf (14.1.0-1ubuntu1) ... 926s Selecting previously unselected package libgcc-13-dev:armhf. 926s Preparing to unpack .../017-libgcc-13-dev_13.2.0-23ubuntu4_armhf.deb ... 926s Unpacking libgcc-13-dev:armhf (13.2.0-23ubuntu4) ... 926s Selecting previously unselected package gcc-13-arm-linux-gnueabihf. 926s Preparing to unpack .../018-gcc-13-arm-linux-gnueabihf_13.2.0-23ubuntu4_armhf.deb ... 926s Unpacking gcc-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 927s Selecting previously unselected package gcc-13. 927s Preparing to unpack .../019-gcc-13_13.2.0-23ubuntu4_armhf.deb ... 927s Unpacking gcc-13 (13.2.0-23ubuntu4) ... 927s Selecting previously unselected package gcc-arm-linux-gnueabihf. 927s Preparing to unpack .../020-gcc-arm-linux-gnueabihf_4%3a13.2.0-7ubuntu1_armhf.deb ... 927s Unpacking gcc-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 927s Selecting previously unselected package gcc. 927s Preparing to unpack .../021-gcc_4%3a13.2.0-7ubuntu1_armhf.deb ... 927s Unpacking gcc (4:13.2.0-7ubuntu1) ... 927s Selecting previously unselected package libstdc++-13-dev:armhf. 927s Preparing to unpack .../022-libstdc++-13-dev_13.2.0-23ubuntu4_armhf.deb ... 927s Unpacking libstdc++-13-dev:armhf (13.2.0-23ubuntu4) ... 927s Selecting previously unselected package g++-13-arm-linux-gnueabihf. 927s Preparing to unpack .../023-g++-13-arm-linux-gnueabihf_13.2.0-23ubuntu4_armhf.deb ... 927s Unpacking g++-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 928s Selecting previously unselected package g++-13. 928s Preparing to unpack .../024-g++-13_13.2.0-23ubuntu4_armhf.deb ... 928s Unpacking g++-13 (13.2.0-23ubuntu4) ... 928s Selecting previously unselected package g++-arm-linux-gnueabihf. 928s Preparing to unpack .../025-g++-arm-linux-gnueabihf_4%3a13.2.0-7ubuntu1_armhf.deb ... 928s Unpacking g++-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 928s Selecting previously unselected package g++. 928s Preparing to unpack .../026-g++_4%3a13.2.0-7ubuntu1_armhf.deb ... 928s Unpacking g++ (4:13.2.0-7ubuntu1) ... 928s Selecting previously unselected package build-essential. 928s Preparing to unpack .../027-build-essential_12.10ubuntu1_armhf.deb ... 928s Unpacking build-essential (12.10ubuntu1) ... 928s Selecting previously unselected package dctrl-tools. 928s Preparing to unpack .../028-dctrl-tools_2.24-3build3_armhf.deb ... 928s Unpacking dctrl-tools (2.24-3build3) ... 928s Selecting previously unselected package libfreetype6:armhf. 928s Preparing to unpack .../029-libfreetype6_2.13.2+dfsg-1build3_armhf.deb ... 928s Unpacking libfreetype6:armhf (2.13.2+dfsg-1build3) ... 928s Selecting previously unselected package fonts-dejavu-mono. 928s Preparing to unpack .../030-fonts-dejavu-mono_2.37-8_all.deb ... 928s Unpacking fonts-dejavu-mono (2.37-8) ... 928s Selecting previously unselected package fonts-dejavu-core. 928s Preparing to unpack .../031-fonts-dejavu-core_2.37-8_all.deb ... 928s Unpacking fonts-dejavu-core (2.37-8) ... 928s Selecting previously unselected package fontconfig-config. 928s Preparing to unpack .../032-fontconfig-config_2.15.0-1.1ubuntu2_armhf.deb ... 929s Unpacking fontconfig-config (2.15.0-1.1ubuntu2) ... 929s Selecting previously unselected package libfontconfig1:armhf. 929s Preparing to unpack .../033-libfontconfig1_2.15.0-1.1ubuntu2_armhf.deb ... 929s Unpacking libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 929s Selecting previously unselected package fontconfig. 929s Preparing to unpack .../034-fontconfig_2.15.0-1.1ubuntu2_armhf.deb ... 929s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 929s Selecting previously unselected package fonts-glyphicons-halflings. 929s Preparing to unpack .../035-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 929s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 929s Selecting previously unselected package fonts-mathjax. 929s Preparing to unpack .../036-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 929s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 929s Selecting previously unselected package libgfortran5:armhf. 929s Preparing to unpack .../037-libgfortran5_14.1.0-1ubuntu1_armhf.deb ... 929s Unpacking libgfortran5:armhf (14.1.0-1ubuntu1) ... 929s Selecting previously unselected package libgfortran-13-dev:armhf. 929s Preparing to unpack .../038-libgfortran-13-dev_13.2.0-23ubuntu4_armhf.deb ... 929s Unpacking libgfortran-13-dev:armhf (13.2.0-23ubuntu4) ... 930s Selecting previously unselected package gfortran-13-arm-linux-gnueabihf. 930s Preparing to unpack .../039-gfortran-13-arm-linux-gnueabihf_13.2.0-23ubuntu4_armhf.deb ... 930s Unpacking gfortran-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 930s Selecting previously unselected package gfortran-13. 930s Preparing to unpack .../040-gfortran-13_13.2.0-23ubuntu4_armhf.deb ... 930s Unpacking gfortran-13 (13.2.0-23ubuntu4) ... 930s Selecting previously unselected package gfortran-arm-linux-gnueabihf. 930s Preparing to unpack .../041-gfortran-arm-linux-gnueabihf_4%3a13.2.0-7ubuntu1_armhf.deb ... 930s Unpacking gfortran-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 930s Selecting previously unselected package gfortran. 930s Preparing to unpack .../042-gfortran_4%3a13.2.0-7ubuntu1_armhf.deb ... 930s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 930s Selecting previously unselected package icu-devtools. 930s Preparing to unpack .../043-icu-devtools_74.2-1ubuntu3_armhf.deb ... 930s Unpacking icu-devtools (74.2-1ubuntu3) ... 930s Selecting previously unselected package libblas3:armhf. 930s Preparing to unpack .../044-libblas3_3.12.0-3build1_armhf.deb ... 930s Unpacking libblas3:armhf (3.12.0-3build1) ... 930s Selecting previously unselected package libblas-dev:armhf. 930s Preparing to unpack .../045-libblas-dev_3.12.0-3build1_armhf.deb ... 930s Unpacking libblas-dev:armhf (3.12.0-3build1) ... 930s Selecting previously unselected package libbz2-dev:armhf. 930s Preparing to unpack .../046-libbz2-dev_1.0.8-5.1_armhf.deb ... 930s Unpacking libbz2-dev:armhf (1.0.8-5.1) ... 930s Selecting previously unselected package libpixman-1-0:armhf. 930s Preparing to unpack .../047-libpixman-1-0_0.42.2-1build1_armhf.deb ... 930s Unpacking libpixman-1-0:armhf (0.42.2-1build1) ... 930s Selecting previously unselected package libxcb-render0:armhf. 931s Preparing to unpack .../048-libxcb-render0_1.17.0-2_armhf.deb ... 931s Unpacking libxcb-render0:armhf (1.17.0-2) ... 931s Selecting previously unselected package libxcb-shm0:armhf. 931s Preparing to unpack .../049-libxcb-shm0_1.17.0-2_armhf.deb ... 931s Unpacking libxcb-shm0:armhf (1.17.0-2) ... 931s Selecting previously unselected package libxrender1:armhf. 931s Preparing to unpack .../050-libxrender1_1%3a0.9.10-1.1build1_armhf.deb ... 931s Unpacking libxrender1:armhf (1:0.9.10-1.1build1) ... 931s Selecting previously unselected package libcairo2:armhf. 931s Preparing to unpack .../051-libcairo2_1.18.0-3build1_armhf.deb ... 931s Unpacking libcairo2:armhf (1.18.0-3build1) ... 931s Selecting previously unselected package libdatrie1:armhf. 931s Preparing to unpack .../052-libdatrie1_0.2.13-3build1_armhf.deb ... 931s Unpacking libdatrie1:armhf (0.2.13-3build1) ... 931s Selecting previously unselected package libdeflate0:armhf. 931s Preparing to unpack .../053-libdeflate0_1.20-1_armhf.deb ... 931s Unpacking libdeflate0:armhf (1.20-1) ... 931s Selecting previously unselected package libdeflate-dev:armhf. 931s Preparing to unpack .../054-libdeflate-dev_1.20-1_armhf.deb ... 931s Unpacking libdeflate-dev:armhf (1.20-1) ... 931s Selecting previously unselected package libgraphite2-3:armhf. 931s Preparing to unpack .../055-libgraphite2-3_1.3.14-2build1_armhf.deb ... 931s Unpacking libgraphite2-3:armhf (1.3.14-2build1) ... 931s Selecting previously unselected package libharfbuzz0b:armhf. 931s Preparing to unpack .../056-libharfbuzz0b_8.3.0-2build2_armhf.deb ... 931s Unpacking libharfbuzz0b:armhf (8.3.0-2build2) ... 931s Selecting previously unselected package x11-common. 931s Preparing to unpack .../057-x11-common_1%3a7.7+23ubuntu3_all.deb ... 931s Unpacking x11-common (1:7.7+23ubuntu3) ... 931s Selecting previously unselected package libice6:armhf. 931s Preparing to unpack .../058-libice6_2%3a1.0.10-1build3_armhf.deb ... 931s Unpacking libice6:armhf (2:1.0.10-1build3) ... 931s Selecting previously unselected package libicu-dev:armhf. 931s Preparing to unpack .../059-libicu-dev_74.2-1ubuntu3_armhf.deb ... 931s Unpacking libicu-dev:armhf (74.2-1ubuntu3) ... 932s Selecting previously unselected package libjpeg-turbo8:armhf. 932s Preparing to unpack .../060-libjpeg-turbo8_2.1.5-2ubuntu2_armhf.deb ... 932s Unpacking libjpeg-turbo8:armhf (2.1.5-2ubuntu2) ... 932s Selecting previously unselected package libjpeg-turbo8-dev:armhf. 932s Preparing to unpack .../061-libjpeg-turbo8-dev_2.1.5-2ubuntu2_armhf.deb ... 932s Unpacking libjpeg-turbo8-dev:armhf (2.1.5-2ubuntu2) ... 932s Selecting previously unselected package libjpeg8:armhf. 932s Preparing to unpack .../062-libjpeg8_8c-2ubuntu11_armhf.deb ... 932s Unpacking libjpeg8:armhf (8c-2ubuntu11) ... 932s Selecting previously unselected package libjpeg8-dev:armhf. 932s Preparing to unpack .../063-libjpeg8-dev_8c-2ubuntu11_armhf.deb ... 932s Unpacking libjpeg8-dev:armhf (8c-2ubuntu11) ... 932s Selecting previously unselected package libjpeg-dev:armhf. 932s Preparing to unpack .../064-libjpeg-dev_8c-2ubuntu11_armhf.deb ... 932s Unpacking libjpeg-dev:armhf (8c-2ubuntu11) ... 932s Selecting previously unselected package libjs-bootstrap. 932s Preparing to unpack .../065-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 932s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 932s Selecting previously unselected package libjs-highlight.js. 932s Preparing to unpack .../066-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 932s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 932s Selecting previously unselected package libjs-jquery. 932s Preparing to unpack .../067-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 932s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 932s Selecting previously unselected package libjs-jquery-datatables. 933s Preparing to unpack .../068-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 933s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 933s Selecting previously unselected package liblapack3:armhf. 933s Preparing to unpack .../069-liblapack3_3.12.0-3build1_armhf.deb ... 933s Unpacking liblapack3:armhf (3.12.0-3build1) ... 933s Selecting previously unselected package liblapack-dev:armhf. 933s Preparing to unpack .../070-liblapack-dev_3.12.0-3build1_armhf.deb ... 933s Unpacking liblapack-dev:armhf (3.12.0-3build1) ... 933s Selecting previously unselected package liblerc4:armhf. 933s Preparing to unpack .../071-liblerc4_4.0.0+ds-4ubuntu2_armhf.deb ... 933s Unpacking liblerc4:armhf (4.0.0+ds-4ubuntu2) ... 933s Selecting previously unselected package libncurses-dev:armhf. 933s Preparing to unpack .../072-libncurses-dev_6.4+20240113-1ubuntu2_armhf.deb ... 933s Unpacking libncurses-dev:armhf (6.4+20240113-1ubuntu2) ... 933s Selecting previously unselected package libthai-data. 933s Preparing to unpack .../073-libthai-data_0.1.29-2build1_all.deb ... 933s Unpacking libthai-data (0.1.29-2build1) ... 933s Selecting previously unselected package libthai0:armhf. 933s Preparing to unpack .../074-libthai0_0.1.29-2build1_armhf.deb ... 933s Unpacking libthai0:armhf (0.1.29-2build1) ... 933s Selecting previously unselected package libpango-1.0-0:armhf. 933s Preparing to unpack .../075-libpango-1.0-0_1.52.2+ds-1_armhf.deb ... 933s Unpacking libpango-1.0-0:armhf (1.52.2+ds-1) ... 933s Selecting previously unselected package libpangoft2-1.0-0:armhf. 933s Preparing to unpack .../076-libpangoft2-1.0-0_1.52.2+ds-1_armhf.deb ... 933s Unpacking libpangoft2-1.0-0:armhf (1.52.2+ds-1) ... 933s Selecting previously unselected package libpangocairo-1.0-0:armhf. 933s Preparing to unpack .../077-libpangocairo-1.0-0_1.52.2+ds-1_armhf.deb ... 933s Unpacking libpangocairo-1.0-0:armhf (1.52.2+ds-1) ... 933s Selecting previously unselected package libpaper1:armhf. 933s Preparing to unpack .../078-libpaper1_1.1.29build1_armhf.deb ... 933s Unpacking libpaper1:armhf (1.1.29build1) ... 934s Selecting previously unselected package libpaper-utils. 934s Preparing to unpack .../079-libpaper-utils_1.1.29build1_armhf.deb ... 934s Unpacking libpaper-utils (1.1.29build1) ... 934s Selecting previously unselected package libpcre2-16-0:armhf. 934s Preparing to unpack .../080-libpcre2-16-0_10.42-4ubuntu2_armhf.deb ... 934s Unpacking libpcre2-16-0:armhf (10.42-4ubuntu2) ... 934s Selecting previously unselected package libpcre2-32-0:armhf. 934s Preparing to unpack .../081-libpcre2-32-0_10.42-4ubuntu2_armhf.deb ... 934s Unpacking libpcre2-32-0:armhf (10.42-4ubuntu2) ... 934s Selecting previously unselected package libpcre2-posix3:armhf. 934s Preparing to unpack .../082-libpcre2-posix3_10.42-4ubuntu2_armhf.deb ... 934s Unpacking libpcre2-posix3:armhf (10.42-4ubuntu2) ... 934s Selecting previously unselected package libpcre2-dev:armhf. 934s Preparing to unpack .../083-libpcre2-dev_10.42-4ubuntu2_armhf.deb ... 934s Unpacking libpcre2-dev:armhf (10.42-4ubuntu2) ... 934s Selecting previously unselected package libpkgconf3:armhf. 934s Preparing to unpack .../084-libpkgconf3_1.8.1-2build1_armhf.deb ... 934s Unpacking libpkgconf3:armhf (1.8.1-2build1) ... 934s Selecting previously unselected package zlib1g-dev:armhf. 934s Preparing to unpack .../085-zlib1g-dev_1%3a1.3.dfsg-3.1ubuntu2_armhf.deb ... 934s Unpacking zlib1g-dev:armhf (1:1.3.dfsg-3.1ubuntu2) ... 934s Selecting previously unselected package libpng-dev:armhf. 934s Preparing to unpack .../086-libpng-dev_1.6.43-5build1_armhf.deb ... 934s Unpacking libpng-dev:armhf (1.6.43-5build1) ... 934s Selecting previously unselected package libreadline-dev:armhf. 934s Preparing to unpack .../087-libreadline-dev_8.2-4build1_armhf.deb ... 934s Unpacking libreadline-dev:armhf (8.2-4build1) ... 934s Selecting previously unselected package libsharpyuv0:armhf. 934s Preparing to unpack .../088-libsharpyuv0_1.4.0-0.1_armhf.deb ... 934s Unpacking libsharpyuv0:armhf (1.4.0-0.1) ... 934s Selecting previously unselected package libsm6:armhf. 934s Preparing to unpack .../089-libsm6_2%3a1.2.3-1build3_armhf.deb ... 934s Unpacking libsm6:armhf (2:1.2.3-1build3) ... 934s Selecting previously unselected package libtcl8.6:armhf. 934s Preparing to unpack .../090-libtcl8.6_8.6.14+dfsg-1build1_armhf.deb ... 934s Unpacking libtcl8.6:armhf (8.6.14+dfsg-1build1) ... 935s Selecting previously unselected package libjbig0:armhf. 935s Preparing to unpack .../091-libjbig0_2.1-6.1ubuntu2_armhf.deb ... 935s Unpacking libjbig0:armhf (2.1-6.1ubuntu2) ... 935s Selecting previously unselected package libwebp7:armhf. 935s Preparing to unpack .../092-libwebp7_1.4.0-0.1_armhf.deb ... 935s Unpacking libwebp7:armhf (1.4.0-0.1) ... 935s Selecting previously unselected package libtiff6:armhf. 935s Preparing to unpack .../093-libtiff6_4.5.1+git230720-4ubuntu2_armhf.deb ... 935s Unpacking libtiff6:armhf (4.5.1+git230720-4ubuntu2) ... 935s Selecting previously unselected package libxft2:armhf. 935s Preparing to unpack .../094-libxft2_2.3.6-1build1_armhf.deb ... 935s Unpacking libxft2:armhf (2.3.6-1build1) ... 935s Selecting previously unselected package libxss1:armhf. 935s Preparing to unpack .../095-libxss1_1%3a1.2.3-1build3_armhf.deb ... 935s Unpacking libxss1:armhf (1:1.2.3-1build3) ... 935s Selecting previously unselected package libtk8.6:armhf. 935s Preparing to unpack .../096-libtk8.6_8.6.14-1build1_armhf.deb ... 935s Unpacking libtk8.6:armhf (8.6.14-1build1) ... 935s Selecting previously unselected package libxt6t64:armhf. 935s Preparing to unpack .../097-libxt6t64_1%3a1.2.1-1.2build1_armhf.deb ... 935s Unpacking libxt6t64:armhf (1:1.2.1-1.2build1) ... 935s Selecting previously unselected package node-normalize.css. 935s Preparing to unpack .../098-node-normalize.css_8.0.1-5_all.deb ... 935s Unpacking node-normalize.css (8.0.1-5) ... 935s Selecting previously unselected package zip. 935s Preparing to unpack .../099-zip_3.0-13build1_armhf.deb ... 935s Unpacking zip (3.0-13build1) ... 935s Selecting previously unselected package unzip. 935s Preparing to unpack .../100-unzip_6.0-28ubuntu4_armhf.deb ... 935s Unpacking unzip (6.0-28ubuntu4) ... 935s Selecting previously unselected package xdg-utils. 935s Preparing to unpack .../101-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 935s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 936s Selecting previously unselected package r-base-core. 936s Preparing to unpack .../102-r-base-core_4.4.0-2_armhf.deb ... 936s Unpacking r-base-core (4.4.0-2) ... 937s Selecting previously unselected package liblzma-dev:armhf. 937s Preparing to unpack .../103-liblzma-dev_5.6.1+really5.4.5-1_armhf.deb ... 937s Unpacking liblzma-dev:armhf (5.6.1+really5.4.5-1) ... 937s Selecting previously unselected package pkgconf-bin. 937s Preparing to unpack .../104-pkgconf-bin_1.8.1-2build1_armhf.deb ... 937s Unpacking pkgconf-bin (1.8.1-2build1) ... 937s Selecting previously unselected package pkgconf:armhf. 937s Preparing to unpack .../105-pkgconf_1.8.1-2build1_armhf.deb ... 937s Unpacking pkgconf:armhf (1.8.1-2build1) ... 937s Selecting previously unselected package libtirpc-dev:armhf. 937s Preparing to unpack .../106-libtirpc-dev_1.3.4+ds-1.3_armhf.deb ... 937s Unpacking libtirpc-dev:armhf (1.3.4+ds-1.3) ... 937s Selecting previously unselected package r-base-dev. 937s Preparing to unpack .../107-r-base-dev_4.4.0-2_all.deb ... 937s Unpacking r-base-dev (4.4.0-2) ... 937s Selecting previously unselected package pkg-r-autopkgtest. 937s Preparing to unpack .../108-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 937s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 937s Selecting previously unselected package r-cran-base64enc. 937s Preparing to unpack .../109-r-cran-base64enc_0.1-3-3_armhf.deb ... 937s Unpacking r-cran-base64enc (0.1-3-3) ... 937s Selecting previously unselected package r-cran-cli. 937s Preparing to unpack .../110-r-cran-cli_3.6.2-1_armhf.deb ... 937s Unpacking r-cran-cli (3.6.2-1) ... 937s Selecting previously unselected package r-cran-colorspace. 937s Preparing to unpack .../111-r-cran-colorspace_2.1-0+dfsg-1_armhf.deb ... 937s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 937s Selecting previously unselected package r-cran-commonmark. 937s Preparing to unpack .../112-r-cran-commonmark_1.9.1-1_armhf.deb ... 937s Unpacking r-cran-commonmark (1.9.1-1) ... 938s Selecting previously unselected package r-cran-evaluate. 938s Preparing to unpack .../113-r-cran-evaluate_0.23-1_all.deb ... 938s Unpacking r-cran-evaluate (0.23-1) ... 938s Selecting previously unselected package r-cran-fansi. 938s Preparing to unpack .../114-r-cran-fansi_1.0.5-1_armhf.deb ... 938s Unpacking r-cran-fansi (1.0.5-1) ... 938s Selecting previously unselected package r-cran-farver. 938s Preparing to unpack .../115-r-cran-farver_2.1.1-2_armhf.deb ... 938s Unpacking r-cran-farver (2.1.1-2) ... 938s Selecting previously unselected package r-cran-glue. 938s Preparing to unpack .../116-r-cran-glue_1.7.0-1_armhf.deb ... 938s Unpacking r-cran-glue (1.7.0-1) ... 938s Selecting previously unselected package r-cran-rlang. 938s Preparing to unpack .../117-r-cran-rlang_1.1.3-1_armhf.deb ... 938s Unpacking r-cran-rlang (1.1.3-1) ... 938s Selecting previously unselected package r-cran-lifecycle. 938s Preparing to unpack .../118-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 938s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 938s Selecting previously unselected package r-cran-gtable. 938s Preparing to unpack .../119-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 938s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 938s Selecting previously unselected package r-cran-isoband. 938s Preparing to unpack .../120-r-cran-isoband_0.2.7-1_armhf.deb ... 938s Unpacking r-cran-isoband (0.2.7-1) ... 938s Selecting previously unselected package r-cran-mass. 938s Preparing to unpack .../121-r-cran-mass_7.3-60.0.1-1_armhf.deb ... 938s Unpacking r-cran-mass (7.3-60.0.1-1) ... 938s Selecting previously unselected package r-cran-lattice. 938s Preparing to unpack .../122-r-cran-lattice_0.22-6-1_armhf.deb ... 938s Unpacking r-cran-lattice (0.22-6-1) ... 939s Selecting previously unselected package r-cran-nlme. 939s Preparing to unpack .../123-r-cran-nlme_3.1.164-1build1_armhf.deb ... 939s Unpacking r-cran-nlme (3.1.164-1build1) ... 939s Selecting previously unselected package r-cran-matrix. 939s Preparing to unpack .../124-r-cran-matrix_1.6-5-1_armhf.deb ... 939s Unpacking r-cran-matrix (1.6-5-1) ... 939s Selecting previously unselected package r-cran-mgcv. 939s Preparing to unpack .../125-r-cran-mgcv_1.9-1-1_armhf.deb ... 939s Unpacking r-cran-mgcv (1.9-1-1) ... 939s Selecting previously unselected package r-cran-labeling. 939s Preparing to unpack .../126-r-cran-labeling_0.4.3-1_all.deb ... 939s Unpacking r-cran-labeling (0.4.3-1) ... 939s Selecting previously unselected package r-cran-munsell. 939s Preparing to unpack .../127-r-cran-munsell_0.5.0-2build1_all.deb ... 939s Unpacking r-cran-munsell (0.5.0-2build1) ... 939s Selecting previously unselected package r-cran-r6. 939s Preparing to unpack .../128-r-cran-r6_2.5.1-1_all.deb ... 939s Unpacking r-cran-r6 (2.5.1-1) ... 939s Selecting previously unselected package r-cran-rcolorbrewer. 939s Preparing to unpack .../129-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 939s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 939s Selecting previously unselected package r-cran-viridislite. 939s Preparing to unpack .../130-r-cran-viridislite_0.4.2-2_all.deb ... 939s Unpacking r-cran-viridislite (0.4.2-2) ... 939s Selecting previously unselected package r-cran-scales. 939s Preparing to unpack .../131-r-cran-scales_1.3.0-1_all.deb ... 939s Unpacking r-cran-scales (1.3.0-1) ... 939s Selecting previously unselected package r-cran-magrittr. 940s Preparing to unpack .../132-r-cran-magrittr_2.0.3-1_armhf.deb ... 940s Unpacking r-cran-magrittr (2.0.3-1) ... 940s Selecting previously unselected package r-cran-utf8. 940s Preparing to unpack .../133-r-cran-utf8_1.2.4-1_armhf.deb ... 940s Unpacking r-cran-utf8 (1.2.4-1) ... 940s Selecting previously unselected package r-cran-vctrs. 940s Preparing to unpack .../134-r-cran-vctrs_0.6.5-1_armhf.deb ... 940s Unpacking r-cran-vctrs (0.6.5-1) ... 940s Selecting previously unselected package r-cran-pillar. 940s Preparing to unpack .../135-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 940s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 940s Selecting previously unselected package r-cran-pkgconfig. 940s Preparing to unpack .../136-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 940s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 940s Selecting previously unselected package r-cran-tibble. 940s Preparing to unpack .../137-r-cran-tibble_3.2.1+dfsg-2_armhf.deb ... 940s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 940s Selecting previously unselected package r-cran-withr. 940s Preparing to unpack .../138-r-cran-withr_2.5.0-1_all.deb ... 940s Unpacking r-cran-withr (2.5.0-1) ... 940s Selecting previously unselected package r-cran-ggplot2. 940s Preparing to unpack .../139-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 940s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 941s Selecting previously unselected package r-cran-xfun. 941s Preparing to unpack .../140-r-cran-xfun_0.44+dfsg-1_armhf.deb ... 941s Unpacking r-cran-xfun (0.44+dfsg-1) ... 941s Selecting previously unselected package r-cran-highr. 941s Preparing to unpack .../141-r-cran-highr_0.10+dfsg-2_all.deb ... 941s Unpacking r-cran-highr (0.10+dfsg-2) ... 941s Selecting previously unselected package r-cran-yaml. 941s Preparing to unpack .../142-r-cran-yaml_2.3.8-2_armhf.deb ... 941s Unpacking r-cran-yaml (2.3.8-2) ... 941s Selecting previously unselected package libjs-mathjax. 941s Preparing to unpack .../143-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 941s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 943s Selecting previously unselected package r-cran-knitr. 943s Preparing to unpack .../144-r-cran-knitr_1.46+dfsg-1_all.deb ... 943s Unpacking r-cran-knitr (1.46+dfsg-1) ... 943s Selecting previously unselected package r-cran-markdown. 943s Preparing to unpack .../145-r-cran-markdown_1.12+dfsg-2_all.deb ... 943s Unpacking r-cran-markdown (1.12+dfsg-2) ... 943s Selecting previously unselected package r-cran-matrixstats. 943s Preparing to unpack .../146-r-cran-matrixstats_1.2.0-1_armhf.deb ... 943s Unpacking r-cran-matrixstats (1.2.0-1) ... 943s Selecting previously unselected package autopkgtest-satdep. 943s Preparing to unpack .../147-2-autopkgtest-satdep.deb ... 943s Unpacking autopkgtest-satdep (0) ... 943s Setting up libgraphite2-3:armhf (1.3.14-2build1) ... 943s Setting up libpixman-1-0:armhf (0.42.2-1build1) ... 943s Setting up libsharpyuv0:armhf (1.4.0-0.1) ... 943s Setting up libpaper1:armhf (1.1.29build1) ... 944s 944s Creating config file /etc/papersize with new version 944s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 944s Setting up liblerc4:armhf (4.0.0+ds-4ubuntu2) ... 944s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 944s Setting up libxrender1:armhf (1:0.9.10-1.1build1) ... 944s Setting up libdatrie1:armhf (0.2.13-3build1) ... 944s Setting up libxcb-render0:armhf (1.17.0-2) ... 944s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 944s Setting up unzip (6.0-28ubuntu4) ... 944s Setting up x11-common (1:7.7+23ubuntu3) ... 945s Setting up libdeflate0:armhf (1.20-1) ... 945s Setting up linux-libc-dev:armhf (6.8.0-31.31) ... 945s Setting up libxcb-shm0:armhf (1.17.0-2) ... 945s Setting up libpaper-utils (1.1.29build1) ... 945s Setting up libgomp1:armhf (14.1.0-1ubuntu1) ... 945s Setting up libjbig0:armhf (2.1-6.1ubuntu2) ... 945s Setting up libpcre2-16-0:armhf (10.42-4ubuntu2) ... 945s Setting up zip (3.0-13build1) ... 945s Setting up libpcre2-32-0:armhf (10.42-4ubuntu2) ... 945s Setting up libblas3:armhf (3.12.0-3build1) ... 945s update-alternatives: using /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3 to provide /usr/lib/arm-linux-gnueabihf/libblas.so.3 (libblas.so.3-arm-linux-gnueabihf) in auto mode 945s Setting up libtirpc-dev:armhf (1.3.4+ds-1.3) ... 945s Setting up libpkgconf3:armhf (1.8.1-2build1) ... 945s Setting up rpcsvc-proto (1.4.2-0ubuntu7) ... 945s Setting up gcc-13-base:armhf (13.2.0-23ubuntu4) ... 945s Setting up libfreetype6:armhf (2.13.2+dfsg-1build3) ... 945s Setting up fonts-dejavu-mono (2.37-8) ... 945s Setting up libmpc3:armhf (1.3.1-1build1) ... 945s Setting up libatomic1:armhf (14.1.0-1ubuntu1) ... 945s Setting up libtcl8.6:armhf (8.6.14+dfsg-1build1) ... 945s Setting up icu-devtools (74.2-1ubuntu3) ... 945s Setting up fonts-dejavu-core (2.37-8) ... 945s Setting up pkgconf-bin (1.8.1-2build1) ... 945s Setting up libjpeg-turbo8:armhf (2.1.5-2ubuntu2) ... 945s Setting up libgfortran5:armhf (14.1.0-1ubuntu1) ... 945s Setting up libwebp7:armhf (1.4.0-0.1) ... 945s Setting up liblzma-dev:armhf (5.6.1+really5.4.5-1) ... 945s Setting up libubsan1:armhf (14.1.0-1ubuntu1) ... 945s Setting up libpcre2-posix3:armhf (10.42-4ubuntu2) ... 945s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 945s Setting up libcrypt-dev:armhf (1:4.4.36-4build1) ... 945s Setting up libasan8:armhf (14.1.0-1ubuntu1) ... 945s Setting up libharfbuzz0b:armhf (8.3.0-2build2) ... 945s Setting up libthai-data (0.1.29-2build1) ... 945s Setting up libxss1:armhf (1:1.2.3-1build3) ... 945s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 945s Setting up libisl23:armhf (0.26-3build1) ... 945s Setting up libc-dev-bin (2.39-0ubuntu8.1) ... 945s Setting up libdeflate-dev:armhf (1.20-1) ... 945s Setting up node-normalize.css (8.0.1-5) ... 945s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 945s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 945s Setting up libcc1-0:armhf (14.1.0-1ubuntu1) ... 945s Setting up libblas-dev:armhf (3.12.0-3build1) ... 945s update-alternatives: using /usr/lib/arm-linux-gnueabihf/blas/libblas.so to provide /usr/lib/arm-linux-gnueabihf/libblas.so (libblas.so-arm-linux-gnueabihf) in auto mode 945s Setting up dctrl-tools (2.24-3build3) ... 945s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 945s Setting up libjpeg8:armhf (8c-2ubuntu11) ... 945s Setting up libice6:armhf (2:1.0.10-1build3) ... 945s Setting up liblapack3:armhf (3.12.0-3build1) ... 945s update-alternatives: using /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3 to provide /usr/lib/arm-linux-gnueabihf/liblapack.so.3 (liblapack.so.3-arm-linux-gnueabihf) in auto mode 945s Setting up cpp-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 945s Setting up fontconfig-config (2.15.0-1.1ubuntu2) ... 945s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 945s Setting up pkgconf:armhf (1.8.1-2build1) ... 945s Setting up libthai0:armhf (0.1.29-2build1) ... 945s Setting up liblapack-dev:armhf (3.12.0-3build1) ... 945s update-alternatives: using /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so to provide /usr/lib/arm-linux-gnueabihf/liblapack.so (liblapack.so-arm-linux-gnueabihf) in auto mode 945s Setting up libgcc-13-dev:armhf (13.2.0-23ubuntu4) ... 945s Setting up libtiff6:armhf (4.5.1+git230720-4ubuntu2) ... 945s Setting up libc6-dev:armhf (2.39-0ubuntu8.1) ... 945s Setting up libfontconfig1:armhf (2.15.0-1.1ubuntu2) ... 945s Setting up libgfortran-13-dev:armhf (13.2.0-23ubuntu4) ... 945s Setting up libsm6:armhf (2:1.2.3-1build3) ... 945s Setting up libicu-dev:armhf (74.2-1ubuntu3) ... 945s Setting up cpp-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 945s Setting up libstdc++-13-dev:armhf (13.2.0-23ubuntu4) ... 945s Setting up libbz2-dev:armhf (1.0.8-5.1) ... 945s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 947s Regenerating fonts cache... done. 948s Setting up libjpeg-turbo8-dev:armhf (2.1.5-2ubuntu2) ... 948s Setting up libxft2:armhf (2.3.6-1build1) ... 948s Setting up libncurses-dev:armhf (6.4+20240113-1ubuntu2) ... 948s Setting up libpcre2-dev:armhf (10.42-4ubuntu2) ... 948s Setting up cpp-13 (13.2.0-23ubuntu4) ... 948s Setting up libtk8.6:armhf (8.6.14-1build1) ... 948s Setting up libpango-1.0-0:armhf (1.52.2+ds-1) ... 948s Setting up libreadline-dev:armhf (8.2-4build1) ... 948s Setting up libcairo2:armhf (1.18.0-3build1) ... 948s Setting up gcc-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 948s Setting up libxt6t64:armhf (1:1.2.1-1.2build1) ... 948s Setting up gcc-13 (13.2.0-23ubuntu4) ... 948s Setting up zlib1g-dev:armhf (1:1.3.dfsg-3.1ubuntu2) ... 948s Setting up cpp (4:13.2.0-7ubuntu1) ... 948s Setting up libpangoft2-1.0-0:armhf (1.52.2+ds-1) ... 948s Setting up libjpeg8-dev:armhf (8c-2ubuntu11) ... 948s Setting up libpangocairo-1.0-0:armhf (1.52.2+ds-1) ... 948s Setting up gcc-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 948s Setting up g++-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 948s Setting up gfortran-13-arm-linux-gnueabihf (13.2.0-23ubuntu4) ... 948s Setting up g++-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 948s Setting up g++-13 (13.2.0-23ubuntu4) ... 948s Setting up libpng-dev:armhf (1.6.43-5build1) ... 948s Setting up libjpeg-dev:armhf (8c-2ubuntu11) ... 948s Setting up gcc (4:13.2.0-7ubuntu1) ... 948s Setting up gfortran-arm-linux-gnueabihf (4:13.2.0-7ubuntu1) ... 948s Setting up gfortran-13 (13.2.0-23ubuntu4) ... 948s Setting up r-base-core (4.4.0-2) ... 948s 948s Creating config file /etc/R/Renviron with new version 948s Setting up r-cran-labeling (0.4.3-1) ... 948s Setting up r-cran-lattice (0.22-6-1) ... 948s Setting up r-cran-nlme (3.1.164-1build1) ... 948s Setting up r-cran-farver (2.1.1-2) ... 948s Setting up g++ (4:13.2.0-7ubuntu1) ... 948s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 948s Setting up r-cran-viridislite (0.4.2-2) ... 948s Setting up build-essential (12.10ubuntu1) ... 948s Setting up r-cran-commonmark (1.9.1-1) ... 948s Setting up r-cran-r6 (2.5.1-1) ... 948s Setting up r-cran-magrittr (2.0.3-1) ... 948s Setting up r-cran-rlang (1.1.3-1) ... 948s Setting up r-cran-matrixstats (1.2.0-1) ... 948s Setting up r-cran-xfun (0.44+dfsg-1) ... 948s Setting up r-cran-withr (2.5.0-1) ... 948s Setting up r-cran-base64enc (0.1-3-3) ... 948s Setting up r-cran-yaml (2.3.8-2) ... 948s Setting up r-cran-evaluate (0.23-1) ... 948s Setting up r-cran-highr (0.10+dfsg-2) ... 948s Setting up r-cran-fansi (1.0.5-1) ... 948s Setting up r-cran-mass (7.3-60.0.1-1) ... 948s Setting up r-cran-glue (1.7.0-1) ... 948s Setting up r-cran-cli (3.6.2-1) ... 948s Setting up gfortran (4:13.2.0-7ubuntu1) ... 948s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 948s 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 948s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 948s 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 948s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 948s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 948s Setting up r-cran-utf8 (1.2.4-1) ... 948s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 948s Setting up r-cran-markdown (1.12+dfsg-2) ... 948s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 948s Setting up r-cran-isoband (0.2.7-1) ... 948s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 948s Setting up r-cran-matrix (1.6-5-1) ... 948s Setting up r-cran-knitr (1.46+dfsg-1) ... 948s Setting up r-cran-mgcv (1.9-1-1) ... 948s Setting up r-cran-vctrs (0.6.5-1) ... 948s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 948s Setting up r-base-dev (4.4.0-2) ... 948s Setting up r-cran-munsell (0.5.0-2build1) ... 948s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 948s Setting up r-cran-scales (1.3.0-1) ... 948s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 948s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 948s Setting up autopkgtest-satdep (0) ... 948s Processing triggers for man-db (2.12.1-1) ... 950s Processing triggers for install-info (7.1-3build2) ... 950s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 985s (Reading database ... 72695 files and directories currently installed.) 985s Removing autopkgtest-satdep (0) ... 998s autopkgtest [08:38:30]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 998s autopkgtest [08:38:30]: test pkg-r-autopkgtest: [----------------------- 1001s Test: Try to load the R library matrixStats 1001s 1001s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1001s Copyright (C) 2024 The R Foundation for Statistical Computing 1001s Platform: arm-unknown-linux-gnueabihf (32-bit) 1001s 1001s R is free software and comes with ABSOLUTELY NO WARRANTY. 1001s You are welcome to redistribute it under certain conditions. 1001s Type 'license()' or 'licence()' for distribution details. 1001s 1001s R is a collaborative project with many contributors. 1001s Type 'contributors()' for more information and 1001s 'citation()' on how to cite R or R packages in publications. 1001s 1001s Type 'demo()' for some demos, 'help()' for on-line help, or 1001s 'help.start()' for an HTML browser interface to help. 1001s Type 'q()' to quit R. 1001s 1001s > library('matrixStats') 1001s > 1001s > 1001s Other tests are currently unsupported! 1001s They will be progressively added. 1002s autopkgtest [08:38:34]: test pkg-r-autopkgtest: -----------------------] 1006s autopkgtest [08:38:38]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 1006s pkg-r-autopkgtest PASS 1010s autopkgtest [08:38:42]: @@@@@@@@@@@@@@@@@@@@ summary 1010s run-unit-test PASS 1010s pkg-r-autopkgtest PASS