0s autopkgtest [09:43:54]: starting date and time: 2024-05-24 09:43:54+0000 0s autopkgtest [09:43:54]: git checkout: 699e7f9f ssh-setup/nova: explicitely set 'fqdn' in cloud-init 0s autopkgtest [09:43:54]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.b1zusors/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:r-cran-ggplot2 --apt-upgrade r-cran-matrixstats --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=r-cran-ggplot2/3.5.1+dfsg-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-8.secgroup --name adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 --image adt/ubuntu-oracular-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-3 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 489s flock: timeout while waiting to get lock 489s Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 489s nova boot failed (attempt #1): 489s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 489s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 489s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 489s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 489s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 489s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 489s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 489s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:45:25 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-b2052d10-8f4c-4b83-bc3f-684021c8f16d 489s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 489s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-b2052d10-8f4c-4b83-bc3f-684021c8f16d 489s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 489s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 489s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["JgtbUdwuSRSfTtolzbklTw"], "expires_at": "2024-05-25T09:45:25.000000Z", "issued_at": "2024-05-24T09:45:25.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin", "region_id": "prodstack6", "url": "https://glance-admin.ps6.canonical.com:9292", "region": "prodstack6"}], "id": "49de724549524bd78e9cd46a4477226f", "type": "image", "name": "glance"}, {"endpoints": [{"id": "a1a41e9a1e2d42e5b6cd5380cd1e21bf", "interface": "admin", "region_id": "prodstack6", "url": "https://cinder-admin.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "d2309a99724b4111827482c68a832c0c", "interface": "public", "region_id": "prodstack6", "url": "https://cinder.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "f8a02e3949ff42afa772eb5e74dbef9f", "interface": "internal", "region_id": "prodstack6", "url": "https://cinder-internal.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "5bf6578a631349e3af4bf36d7adb18e1", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "01d84128f36444e9b01549b86bd69116", "interface": "admin", "region_id": "prodstack6", "url": "https://barbican-admin.ps6.canonical.com:9312", "region": "prodstack6"}, {"id": "0ce4a8777e0b40a88f7fc0f77e34a605", "interface": "public", "region_id": "prodstack6", "url": "https://barbican.ps6.canonical.com:9311", "region": "prodstack6"}, {"id": "f507ba49e4a7435cb330234217c92449", "interface": "internal", "region_id": "prodstack6", "url": "https://barbican-internal.ps6.canonical.com:9311", "region": "prodstack6"}], "id": "62cb1c3d9f6c45979c13516a6b3ff114", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "3cb6121bd8f14da8aa2fba7be823a2b4", "interface": "internal", "region_id": "prodstack6", "url": "https://neutron-internal.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "46ba11d133fe4e8f9e8f9097ba737682", "interface": "admin", "region_id": "prodstack6", "url": "https://neutron-admin.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "d872eb6aa23d40009165aa3dcdce3948", "interface": "public", "region_id": "prodstack6", "url": "https://neutron.ps6.canonical.com:9696", "region": "prodstack6"}], "id": "759cb6fdfbc146dd8b9d1ba444c4b9db", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "4349d565f72446da9699269f85df5e8b", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "a483dcc58f5e415e9ec739c94474e609", "interface": "public", "region_id": "prodstack6", "url": "https://manila.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "c1f14236723e42878562d8dd63d5a6a0", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "93fc4008035946deb1f433c2dd905a5d", "type": "sharev2", "name": "manilav2"}, {"endpoints": [{"id": "0fa148793c7249c8b187b6b4ff425731", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "555ade266a6b4bcc81b6e5abf607aec5", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "7dad1a7b1552465686424fc014463173", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/swift/simplestreams/data", "region": "prodstack6"}], "id": "977dd359af1a4fcc91a9daf4dc33b0f3", "type": "product-streams", "name": "image-stream"}, {"endpoints": [{"id": "12d30eabcdec4831bd15273d55b1cbab", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "29d35b2b483346479f1ff1a13604d50e", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "4aa1422b8f5945d8aed9ba6a8d670e5c", "interface": "public", "region_id": "prodstack6", "url": "https://manila.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "ac5e4f28fa794cde99f1d7ffc1b664e5", "type": "share", "name": "manila"}, {"endpoints": [{"id": "c7db93d54a684d8caeae1d9e18a59118", "interface": "admin", "region_id": "prodstack6", "url": "https://nova-admin.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}, {"id": "dd7a796f401b477f9f1b5bbc05747d8d", "interface": "public", "region_id": "prodstack6", "url": "https://nova.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}, {"id": "e7ecb038d830462ea67b0b463af5e013", "interface": "internal", "region_id": "prodstack6", "url": "https://nova-internal.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}], "id": "b4519af08e174d4a8333a2d14ac3ba3b", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "02ef5b6154934ffd97d8b5b8e4d70d2a", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/swift/v1/AUTH_bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "2741abe526e94842a4fa801423ba1ef0", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/swift/v1/AUTH_bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "3742f9406c604516933d6fd8c29e0880", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/swift", "region": "prodstack6"}], "id": "c7f07a7b3b3c408c96200dfd1d1a0f6f", "type": "object-store", "name": "swift"}, {"endpoints": [{"id": "06d4ed6c160a43f2b7fa7f80ad1dc709", "interface": "internal", "region_id": "prodstack6", "url": "https://designate-internal.ps6.canonical.com:9001", "region": "prodstack6"}, {"id": "1e240624a50c4ca0aaa6ef63cbc94f1b", "interface": "admin", "region_id": "prodstack6", "url": "https://designate-admin.ps6.canonical.com:9001", "region": "prodstack6"}, {"id": "f94d7d17997a43fd9c63b34c43301c6e", "interface": "public", "region_id": "prodstack6", "url": "https://designate.ps6.canonical.com:9001", "region": "prodstack6"}], "id": "cf82013d63844fedbe96bcacb6bd1fef", "type": "dns", "name": "designate"}, {"endpoints": [{"id": "4a688340be464710bfa60bf3f88f41c4", "interface": "admin", "region_id": "prodstack6", "url": "https://gnocchi-admin.ps6.canonical.com:8041", "region": "prodstack6"}, {"id": "a5a95506c96d4716adb4efc3ac9051be", "interface": "public", "region_id": "prodstack6", "url": "https://gnocchi.ps6.canonical.com:8041", "region": "prodstack6"}, {"id": "eebc17a086834f8fa8bb6b35c8061a8c", "interface": "internal", "region_id": "prodstack6", "url": "https://gnocchi-internal.ps6.canonical.com:8041", "region": "prodstack6"}], "id": "d10589e854a446a5b852593f33f170a7", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "08f66df28d0f47f3bec12f29e06d85ac", "interface": "admin", "region_id": "prodstack6", "url": "https://keystone-admin.ps6.canonical.com:35357/v3", "region": "prodstack6"}, {"id": "46d270b45ceb42db902f4d241afa6a70", "interface": "public", "region_id": "prodstack6", "url": "https://keystone.ps6.canonical.com:5000/v3", "region": "prodstack6"}, {"id": "a4addee11d9349cfa46ec6660dbad947", "interface": "internal", "region_id": "prodstack6", "url": "https://keystone-internal.ps6.canonical.com:5000/v3", "region": "prodstack6"}], "id": "deb38a775a9b4e87a8de9e3eed779882", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "18b4af5f40664babb94e884c6a53ccf3", "interface": "admin", "region_id": "prodstack6", "url": "https://octavia-admin.ps6.canonical.com:9876", "region": "prodstack6"}, {"id": "2b6f7ba7f9944ee1aebd6dccc5223b2d", "interface": "internal", "region_id": "prodstack6", "url": "https://octavia-internal.ps6.canonical.com:9876", "region": "prodstack6"}, {"id": "5e3012e9c79e4890be4d964b6208f5c6", "interface": "public", "region_id": "prodstack6", "url": "https://octavia.ps6.canonical.com:9876", "region": "prodstack6"}], "id": "e00337be20d54948b66a1c3109b885c6", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id": "2d2942b35f3041389ad810f679d02f22", "interface": "public", "region_id": "prodstack6", "url": "https://placement.ps6.canonical.com:8778", "region": "prodstack6"}, {"id": "2e3beaac7ac14284b72e2592820ad725", "interface": "admin", "region_id": "prodstack6", "url": "https://placement-admin.ps6.canonical.com:8778", "region": "prodstack6"}, {"id": "91060f6df9ae444f81808adf40540d94", "interface": "internal", "region_id": "prodstack6", "url": "https://placement-internal.ps6.canonical.com:8778", "region": "prodstack6"}], "id": "edc6e37f154f4c0ab3dd4d52b82bf873", "type": "placement", "name": "placement"}]}} 489s REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1 -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" 489s DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1 -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" 489s DEBUG (connectionpool:962) Starting new HTTPS connection (1): nova.ps6.canonical.com:8774 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1 HTTP/1.1" 302 0 489s RESP: [302] Connection: Keep-Alive Content-Length: 0 Content-Type: text/plain; charset=utf8 Date: Fri, 24 May 2024 09:45:25 GMT Keep-Alive: timeout=75, max=1000 Location: https://nova.ps6.canonical.com:8774/v2.1/ Server: Apache/2.4.52 (Ubuntu) x-compute-request-id: req-363c42df-eb5c-46f9-afb7-6c732a972e61 x-openstack-request-id: req-363c42df-eb5c-46f9-afb7-6c732a972e61 489s DEBUG (session:548) RESP: [302] Connection: Keep-Alive Content-Length: 0 Content-Type: text/plain; charset=utf8 Date: Fri, 24 May 2024 09:45:25 GMT Keep-Alive: timeout=75, max=1000 Location: https://nova.ps6.canonical.com:8774/v2.1/ Server: Apache/2.4.52 (Ubuntu) x-compute-request-id: req-363c42df-eb5c-46f9-afb7-6c732a972e61 x-openstack-request-id: req-363c42df-eb5c-46f9-afb7-6c732a972e61 489s RESP BODY: Omitted, Content-Type is set to text/plain; charset=utf8. Only application/json responses have their bodies logged. 489s DEBUG (session:580) RESP BODY: Omitted, Content-Type is set to text/plain; charset=utf8. Only application/json responses have their bodies logged. 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/ HTTP/1.1" 200 397 489s RESP: [200] Connection: Keep-Alive Content-Length: 397 Content-Type: application/json Date: Fri, 24 May 2024 09:45:25 GMT Keep-Alive: timeout=75, max=999 OpenStack-API-Version: compute 2.1 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.1 x-compute-request-id: req-b56ab9f6-1590-4d4d-84ef-06196685767c x-openstack-request-id: req-b56ab9f6-1590-4d4d-84ef-06196685767c 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 397 Content-Type: application/json Date: Fri, 24 May 2024 09:45:25 GMT Keep-Alive: timeout=75, max=999 OpenStack-API-Version: compute 2.1 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.1 x-compute-request-id: req-b56ab9f6-1590-4d4d-84ef-06196685767c x-openstack-request-id: req-b56ab9f6-1590-4d4d-84ef-06196685767c 489s RESP BODY: {"version": {"id": "v2.1", "status": "CURRENT", "version": "2.90", "min_version": "2.1", "updated": "2013-07-23T11:33:21Z", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/"}, {"rel": "describedby", "type": "text/html", "href": "http://docs.openstack.org/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}]}} 489s DEBUG (session:580) RESP BODY: {"version": {"id": "v2.1", "status": "CURRENT", "version": "2.90", "min_version": "2.1", "updated": "2013-07-23T11:33:21Z", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/"}, {"rel": "describedby", "type": "text/html", "href": "http://docs.openstack.org/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}]}} 489s GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/ used request id req-b56ab9f6-1590-4d4d-84ef-06196685767c 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/ used request id req-b56ab9f6-1590-4d4d-84ef-06196685767c 489s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 489s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 489s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 489s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 489s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 489s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 489s DEBUG (session:517) REQ: curl -g -i -X GET https://glance.ps6.canonical.com:9292/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:962) Starting new HTTPS connection (1): glance.ps6.canonical.com:9292 489s DEBUG (connectionpool:429) https://glance.ps6.canonical.com:9292 "GET /v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf HTTP/1.1" 200 1938 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 1938 Content-Type: application/json Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) X-Openstack-Request-Id: req-6072de1c-f60b-4de9-9c18-84deb07779d9 489s DEBUG (session:580) RESP BODY: {"base_image_ref": "09c3944a-cd0d-425d-b22f-cde7ec51d155", "boot_roles": "reader,member", "hw_cdrom_bus": "scsi", "hw_disk_bus": "virtio", "hw_machine_type": "virt", "hw_video_model": "virtio", "hw_vif_model": "virtio", "image_location": "snapshot", "image_state": "available", "image_type": "snapshot", "instance_uuid": "fece0e0e-581f-48e7-84f0-8090b1d5f9d7", "owner_id": "bd8b3df3f03d43a0a9303b7c0434fdab", "owner_project_name": "prod-proposed-migration-arm64_project", "owner_specified.openstack.md5": "087a26f2222dab8516c553374a9d1b4d", "owner_specified.openstack.object": "images/adt/ubuntu-noble-arm64-server-20240201.img", "owner_specified.openstack.sha256": "095b278df09de76f01843de514daf3f8eb0a0cc67fee4b3491161913153619db", "owner_user_name": "prod-proposed-migration-arm64", "user_id": "369f50a481564a2c9433776a4ebd224d", "name": "adt/ubuntu-oracular-arm64-server-20240523.img", "disk_format": "qcow2", "container_format": "bare", "visibility": "private", "size": 2682585088, "virtual_size": 21474836480, "status": "active", "checksum": "bb454db02263bc3101379e65f4e525fe", "protected": false, "min_ram": 0, "min_disk": 20, "owner": "bd8b3df3f03d43a0a9303b7c0434fdab", "os_hidden": false, "os_hash_algo": "sha512", "os_hash_value": "7db50932a12eb973a8890242dc4350d0dcf4eda2096082c17ea47fc9a77da85acb522af483802cd6d6e805906efcba83bdc4530f7419173ecbc508a606563188", "id": "ff48658f-96e6-43b8-b68b-32e64925c2cf", "created_at": "2024-05-23T14:39:50Z", "updated_at": "2024-05-23T14:40:25Z", "locations": [{"url": "rbd://eea9d068-c18c-11ed-8dc0-013aacb71b80/glance/ff48658f-96e6-43b8-b68b-32e64925c2cf/snap", "metadata": {"store": "ceph"}}], "direct_url": "rbd://eea9d068-c18c-11ed-8dc0-013aacb71b80/glance/ff48658f-96e6-43b8-b68b-32e64925c2cf/snap", "tags": [], "self": "/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf", "file": "/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf/file", "schema": "/v2/schemas/image", "stores": "ceph"} 489s DEBUG (session:936) GET call to image for https://glance.ps6.canonical.com:9292/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf used request id req-6072de1c-f60b-4de9-9c18-84deb07779d9 489s DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1/flavors/autopkgtest -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/flavors/autopkgtest HTTP/1.1" 404 84 489s DEBUG (session:548) RESP: [404] Connection: Keep-Alive Content-Length: 84 Content-Type: application/json; charset=UTF-8 Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=998 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 x-compute-request-id: req-ec9c2d19-41f4-459b-ad2f-7601ccae2949 x-openstack-request-id: req-ec9c2d19-41f4-459b-ad2f-7601ccae2949 489s DEBUG (session:580) RESP BODY: {"itemNotFound": {"code": 404, "message": "Flavor autopkgtest could not be found."}} 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/flavors/autopkgtest used request id req-ec9c2d19-41f4-459b-ad2f-7601ccae2949 489s DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1/flavors?is_public=None -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/flavors?is_public=None HTTP/1.1" 200 1739 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 1739 Content-Type: application/json Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=997 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 x-compute-request-id: req-8299f7fd-bb22-4ba6-91c0-bf70f272beec x-openstack-request-id: req-8299f7fd-bb22-4ba6-91c0-bf70f272beec 489s DEBUG (session:580) RESP BODY: {"flavors": [{"id": "062428d9-35a1-461f-a33a-38436ed516b4", "name": "autopkgtest-cpu8-ram16-disk160-arm64", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/062428d9-35a1-461f-a33a-38436ed516b4"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/062428d9-35a1-461f-a33a-38436ed516b4"}], "description": null}, {"id": "8d27c5f0-65c7-4018-b3f7-50463875ab09", "name": "autopkgtest", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09"}], "description": null}, {"id": "8ebe34fb-1390-4cc7-bbe5-0d38c80f2fb4", "name": "autopkgtest-cpu2-ram4-disk20-arm64", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/8ebe34fb-1390-4cc7-bbe5-0d38c80f2fb4"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/8ebe34fb-1390-4cc7-bbe5-0d38c80f2fb4"}], "description": null}, {"id": "a8256f9e-53ee-4584-ad7f-60e088825b83", "name": "autopkgtest-big", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/a8256f9e-53ee-4584-ad7f-60e088825b83"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/a8256f9e-53ee-4584-ad7f-60e088825b83"}], "description": null}, {"id": "cfc564ac-9f6e-4477-91c4-a89ccb4b744e", "name": "autopkgtest-cpu4-ram8-disk100-arm64", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/cfc564ac-9f6e-4477-91c4-a89ccb4b744e"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/cfc564ac-9f6e-4477-91c4-a89ccb4b744e"}], "description": null}]} 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/flavors?is_public=None used request id req-8299f7fd-bb22-4ba6-91c0-bf70f272beec 489s DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09 -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09 HTTP/1.1" 200 613 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 613 Content-Type: application/json Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=996 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 x-compute-request-id: req-87003810-1add-4b84-b003-05328c8a8b98 x-openstack-request-id: req-87003810-1add-4b84-b003-05328c8a8b98 489s DEBUG (session:580) RESP BODY: {"flavor": {"id": "8d27c5f0-65c7-4018-b3f7-50463875ab09", "name": "autopkgtest", "ram": 4096, "disk": 20, "swap": 0, "OS-FLV-EXT-DATA:ephemeral": 0, "OS-FLV-DISABLED:disabled": false, "vcpus": 2, "os-flavor-access:is_public": false, "rxtx_factor": 1.0, "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09"}], "description": null, "extra_specs": {"aggregate_instance_extra_specs:commit": "builder-arm64", "hw_rng:allowed": "True"}}} 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/flavors/8d27c5f0-65c7-4018-b3f7-50463875ab09 used request id req-87003810-1add-4b84-b003-05328c8a8b98 489s DEBUG (session:517) REQ: curl -g -i -X POST https://nova.ps6.canonical.com:8774/v2.1/servers -H "Accept: application/json" -H "Content-Type: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" -d '{"server": {"name": "adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789", "imageRef": "ff48658f-96e6-43b8-b68b-32e64925c2cf", "flavorRef": "8d27c5f0-65c7-4018-b3f7-50463875ab09", "user_data": "I2Nsb3VkLWNvbmZpZwpob3N0bmFtZTogYXV0b3BrZ3Rlc3QKZnFkbjogYXV0b3BrZ3Rlc3QubG9jYWwKbWFuYWdlX2V0Y19ob3N0czogdHJ1ZQphcHRfdXBkYXRlOiB0cnVlCmFwdF91cGdyYWRlOiBmYWxzZQphcHRfbWlycm9yOiBodHRwOi8vZnRwbWFzdGVyLmludGVybmFsL3VidW50dS8KCnJ1bmNtZDoKIC0gZWNobyAnQWNxdWlyZTo6TGFuZ3VhZ2VzICJub25lIjsnID4gL2V0Yy9hcHQvYXB0LmNvbmYuZC85MG5vbGFuZ3VhZ2VzCiAtIGVjaG8gJ2ZvcmNlLXVuc2FmZS1pbycgPiAvZXRjL2Rwa2cvZHBrZy5jZmcuZC9hdXRvcGtndGVzdAogLSBwcmludGYgJ1xuVEVSTT1saW51eFxuJ2h0dHBfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4naHR0cHNfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4nbm9fcHJveHk9MTI3LjAuMC4xLDEyNy4wLjEuMSxsb2dpbi51YnVudHUuY29tLGxvY2FsaG9zdCxsb2NhbGRvbWFpbixub3ZhbG9jYWwsaW50ZXJuYWwsYXJjaGl2ZS51YnVudHUuY29tLHBvcnRzLnVidW50dS5jb20sc2VjdXJpdHkudWJ1bnR1LmNvbSxkZGVicy51YnVudHUuY29tLGNoYW5nZWxvZ3MudWJ1bnR1LmNvbSxrZXlzZXJ2ZXIudWJ1bnR1LmNvbSxsYXVuY2hwYWRsaWJyYXJpYW4ubmV0LGxhdW5jaHBhZGNvbnRlbnQubmV0LGxhdW5jaHBhZC5uZXQsMTAuMjQuMC4wLzI0LGtleXN0b25lLnBzNS5jYW5vbmljYWwuY29tLG9iamVjdHN0b3JhZ2UucHJvZHN0YWNrNS5jYW5vbmljYWwuY29tJ1xuJyA+PiAvZXRjL2Vudmlyb25tZW50CiAtIHNlZCAtaSAtciAnL14xMjcuMC4xLjEvIHMvYXV0b3BrZ3Rlc3QtW14gXStcLi9hdXRvcGtndGVzdFwuLycgL2V0Yy9ob3N0cwo=", "key_name": "testbed-juju-7f2275-prod-proposed-migration-environment-3", "min_count": 1, "max_count": 1, "security_groups": [{"name": "autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-8.secgroup"}], "networks": [{"uuid": "6ea4839c-9760-4b54-ab7d-70a6312667d1"}]}}' 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "POST /v2.1/servers HTTP/1.1" 202 475 489s DEBUG (session:548) RESP: [202] Connection: Keep-Alive Content-Length: 475 Content-Type: application/json Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=995 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 location: https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe x-compute-request-id: req-876b9728-9f32-4b67-8405-0bd68b4639c8 x-openstack-request-id: req-876b9728-9f32-4b67-8405-0bd68b4639c8 489s DEBUG (session:580) RESP BODY: {"server": {"id": "bdce8c2f-4369-4ef7-a81c-5b447a4062fe", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}], "OS-DCF:diskConfig": "MANUAL", "security_groups": [{"name": "autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-8.secgroup"}], "adminPass": "MoM6kEH24QQa"}} 489s DEBUG (session:936) POST call to compute for https://nova.ps6.canonical.com:8774/v2.1/servers used request id req-876b9728-9f32-4b67-8405-0bd68b4639c8 489s DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe HTTP/1.1" 200 3198 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 3198 Content-Type: application/json Date: Fri, 24 May 2024 09:45:26 GMT Keep-Alive: timeout=75, max=994 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 x-compute-request-id: req-99bc53c9-c429-4cd7-9f96-b9e55ac81a6c x-openstack-request-id: req-99bc53c9-c429-4cd7-9f96-b9e55ac81a6c 489s DEBUG (session:580) RESP BODY: {"server": {"id": "bdce8c2f-4369-4ef7-a81c-5b447a4062fe", "name": "adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789", "status": "BUILD", "tenant_id": "bd8b3df3f03d43a0a9303b7c0434fdab", "user_id": "369f50a481564a2c9433776a4ebd224d", "metadata": {}, "hostId": "", "image": {"id": "ff48658f-96e6-43b8-b68b-32e64925c2cf", "links": [{"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/images/ff48658f-96e6-43b8-b68b-32e64925c2cf"}]}, "flavor": {"vcpus": 2, "ram": 4096, "disk": 20, "ephemeral": 0, "swap": 0, "original_name": "autopkgtest", "extra_specs": {"aggregate_instance_extra_specs:commit": "builder-arm64", "hw_rng:allowed": "True"}}, "created": "2024-05-24T09:45:27Z", "updated": "2024-05-24T09:45:26Z", "addresses": {}, "accessIPv4": "", "accessIPv6": "", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}], "OS-DCF:diskConfig": "MANUAL", "progress": 0, "OS-EXT-AZ:availability_zone": "", "config_drive": "", "key_name": "testbed-juju-7f2275-prod-proposed-migration-environment-3", "OS-SRV-USG:launched_at": null, "OS-SRV-USG:terminated_at": null, "OS-EXT-SRV-ATTR:host": null, "OS-EXT-SRV-ATTR:instance_name": "", "OS-EXT-SRV-ATTR:hypervisor_hostname": null, "OS-EXT-SRV-ATTR:reservation_id": "r-caji5sdg", "OS-EXT-SRV-ATTR:launch_index": 0, "OS-EXT-SRV-ATTR:hostname": "adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f22", "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:ramdisk_id": "", "OS-EXT-SRV-ATTR:root_device_name": null, "OS-EXT-SRV-ATTR:user_data": "I2Nsb3VkLWNvbmZpZwpob3N0bmFtZTogYXV0b3BrZ3Rlc3QKZnFkbjogYXV0b3BrZ3Rlc3QubG9jYWwKbWFuYWdlX2V0Y19ob3N0czogdHJ1ZQphcHRfdXBkYXRlOiB0cnVlCmFwdF91cGdyYWRlOiBmYWxzZQphcHRfbWlycm9yOiBodHRwOi8vZnRwbWFzdGVyLmludGVybmFsL3VidW50dS8KCnJ1bmNtZDoKIC0gZWNobyAnQWNxdWlyZTo6TGFuZ3VhZ2VzICJub25lIjsnID4gL2V0Yy9hcHQvYXB0LmNvbmYuZC85MG5vbGFuZ3VhZ2VzCiAtIGVjaG8gJ2ZvcmNlLXVuc2FmZS1pbycgPiAvZXRjL2Rwa2cvZHBrZy5jZmcuZC9hdXRvcGtndGVzdAogLSBwcmludGYgJ1xuVEVSTT1saW51eFxuJ2h0dHBfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4naHR0cHNfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4nbm9fcHJveHk9MTI3LjAuMC4xLDEyNy4wLjEuMSxsb2dpbi51YnVudHUuY29tLGxvY2FsaG9zdCxsb2NhbGRvbWFpbixub3ZhbG9jYWwsaW50ZXJuYWwsYXJjaGl2ZS51YnVudHUuY29tLHBvcnRzLnVidW50dS5jb20sc2VjdXJpdHkudWJ1bnR1LmNvbSxkZGVicy51YnVudHUuY29tLGNoYW5nZWxvZ3MudWJ1bnR1LmNvbSxrZXlzZXJ2ZXIudWJ1bnR1LmNvbSxsYXVuY2hwYWRsaWJyYXJpYW4ubmV0LGxhdW5jaHBhZGNvbnRlbnQubmV0LGxhdW5jaHBhZC5uZXQsMTAuMjQuMC4wLzI0LGtleXN0b25lLnBzNS5jYW5vbmljYWwuY29tLG9iamVjdHN0b3JhZ2UucHJvZHN0YWNrNS5jYW5vbmljYWwuY29tJ1xuJyA+PiAvZXRjL2Vudmlyb25tZW50CiAtIHNlZCAtaSAtciAnL14xMjcuMC4xLjEvIHMvYXV0b3BrZ3Rlc3QtW14gXStcLi9hdXRvcGtndGVzdFwuLycgL2V0Yy9ob3N0cwo=", "OS-EXT-STS:task_state": "scheduling", "OS-EXT-STS:vm_state": "building", "OS-EXT-STS:power_state": 0, "os-extended-volumes:volumes_attached": [], "locked": false, "locked_reason": null, "description": null, "tags": [], "trusted_image_certificates": null, "server_groups": []}} 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe used request id req-99bc53c9-c429-4cd7-9f96-b9e55ac81a6c 489s DEBUG (session:517) REQ: curl -g -i -X GET https://glance.ps6.canonical.com:9292/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://glance.ps6.canonical.com:9292 "GET /v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf HTTP/1.1" 200 1938 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 1938 Content-Type: application/json Date: Fri, 24 May 2024 09:45:27 GMT Keep-Alive: timeout=75, max=999 Server: Apache/2.4.52 (Ubuntu) X-Openstack-Request-Id: req-e48ec039-33e8-4294-92ab-55a4d4e74f1a 489s DEBUG (session:580) RESP BODY: {"base_image_ref": "09c3944a-cd0d-425d-b22f-cde7ec51d155", "boot_roles": "reader,member", "hw_cdrom_bus": "scsi", "hw_disk_bus": "virtio", "hw_machine_type": "virt", "hw_video_model": "virtio", "hw_vif_model": "virtio", "image_location": "snapshot", "image_state": "available", "image_type": "snapshot", "instance_uuid": "fece0e0e-581f-48e7-84f0-8090b1d5f9d7", "owner_id": "bd8b3df3f03d43a0a9303b7c0434fdab", "owner_project_name": "prod-proposed-migration-arm64_project", "owner_specified.openstack.md5": "087a26f2222dab8516c553374a9d1b4d", "owner_specified.openstack.object": "images/adt/ubuntu-noble-arm64-server-20240201.img", "owner_specified.openstack.sha256": "095b278df09de76f01843de514daf3f8eb0a0cc67fee4b3491161913153619db", "owner_user_name": "prod-proposed-migration-arm64", "user_id": "369f50a481564a2c9433776a4ebd224d", "name": "adt/ubuntu-oracular-arm64-server-20240523.img", "disk_format": "qcow2", "container_format": "bare", "visibility": "private", "size": 2682585088, "virtual_size": 21474836480, "status": "active", "checksum": "bb454db02263bc3101379e65f4e525fe", "protected": false, "min_ram": 0, "min_disk": 20, "owner": "bd8b3df3f03d43a0a9303b7c0434fdab", "os_hidden": false, "os_hash_algo": "sha512", "os_hash_value": "7db50932a12eb973a8890242dc4350d0dcf4eda2096082c17ea47fc9a77da85acb522af483802cd6d6e805906efcba83bdc4530f7419173ecbc508a606563188", "id": "ff48658f-96e6-43b8-b68b-32e64925c2cf", "created_at": "2024-05-23T14:39:50Z", "updated_at": "2024-05-23T14:40:25Z", "locations": [{"url": "rbd://eea9d068-c18c-11ed-8dc0-013aacb71b80/glance/ff48658f-96e6-43b8-b68b-32e64925c2cf/snap", "metadata": {"store": "ceph"}}], "direct_url": "rbd://eea9d068-c18c-11ed-8dc0-013aacb71b80/glance/ff48658f-96e6-43b8-b68b-32e64925c2cf/snap", "tags": [], "self": "/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf", "file": "/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf/file", "schema": "/v2/schemas/image", "stores": "ceph"} 489s DEBUG (session:936) GET call to image for https://glance.ps6.canonical.com:9292/v2/images/ff48658f-96e6-43b8-b68b-32e64925c2cf used request id req-e48ec039-33e8-4294-92ab-55a4d4e74f1a 489s +--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ 489s | Property | Value | 489s +--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ 489s | OS-DCF:diskConfig | MANUAL | 489s | OS-EXT-AZ:availability_zone | | 489s | OS-EXT-SRV-ATTR:host | - | 489s | OS-EXT-SRV-ATTR:hostname | adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f22 | 489s | OS-EXT-SRV-ATTR:hypervisor_hostname | - | 489s | OS-EXT-SRV-ATTR:instance_name | | 489s | OS-EXT-SRV-ATTR:kernel_id | | 489s | OS-EXT-SRV-ATTR:launch_index | 0 | 489s | OS-EXT-SRV-ATTR:ramdisk_id | | 489s | OS-EXT-SRV-ATTR:reservation_id | r-caji5sdg | 489s | OS-EXT-SRV-ATTR:root_device_name | - | 489s | OS-EXT-STS:power_state | 0 | 489s | OS-EXT-STS:task_state | scheduling | 489s | OS-EXT-STS:vm_state | building | 489s | OS-SRV-USG:launched_at | - | 489s | OS-SRV-USG:terminated_at | - | 489s | accessIPv4 | | 489s | accessIPv6 | | 489s | adminPass | MoM6kEH24QQa | 489s | config_drive | | 489s | created | 2024-05-24T09:45:27Z | 489s | description | - | 489s | flavor:disk | 20 | 489s | flavor:ephemeral | 0 | 489s | flavor:extra_specs | {"aggregate_instance_extra_specs:commit": "builder-arm64", "hw_rng:allowed": "True"} | 489s | flavor:original_name | autopkgtest | 489s | flavor:ram | 4096 | 489s | flavor:swap | 0 | 489s | flavor:vcpus | 2 | 489s | hostId | | 489s | id | bdce8c2f-4369-4ef7-a81c-5b447a4062fe | 489s | image | adt/ubuntu-oracular-arm64-server-20240523.img (ff48658f-96e6-43b8-b68b-32e64925c2cf) | 489s | key_name | testbed-juju-7f2275-prod-proposed-migration-environment-3 | 489s | locked | False | 489s | locked_reason | - | 489s | metadata | {} | 489s | name | adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 | 489s | os-extended-volumes:volumes_attached | [] | 489s | progress | 0 | 489s | security_groups | autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-8.secgroup | 489s | server_groups | [] | 489s | status | BUILD | 489s | tags | [] | 489s | tenant_id | bd8b3df3f03d43a0a9303b7c0434fdab | 489s | trusted_image_certificates | - | 489s | updated | 2024-05-24T09:45:26Z | 489s | user_id | 369f50a481564a2c9433776a4ebd224d | 489s +--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+DEBUG (session:517) REQ: curl -g -i -X GET https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.87" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}6a445ff9c0b148764fd7e1e932bab03e8d17e76ba2695d01fa19e3faccb21129" -H "X-OpenStack-Nova-API-Version: 2.87" 489s DEBUG (connectionpool:429) https://nova.ps6.canonical.com:8774 "GET /v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe HTTP/1.1" 200 3325 489s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 3325 Content-Type: application/json Date: Fri, 24 May 2024 09:45:27 GMT Keep-Alive: timeout=75, max=993 OpenStack-API-Version: compute 2.87 Server: Apache/2.4.52 (Ubuntu) Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version X-OpenStack-Nova-API-Version: 2.87 x-compute-request-id: req-f5fec7ca-1ae7-48be-8ffc-cbefb94780f4 x-openstack-request-id: req-f5fec7ca-1ae7-48be-8ffc-cbefb94780f4 489s DEBUG (session:580) RESP BODY: {"server": {"id": "bdce8c2f-4369-4ef7-a81c-5b447a4062fe", "name": "adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789", "status": "ERROR", "tenant_id": "bd8b3df3f03d43a0a9303b7c0434fdab", "user_id": "369f50a481564a2c9433776a4ebd224d", "metadata": {}, "hostId": "", "image": {"id": "ff48658f-96e6-43b8-b68b-32e64925c2cf", "links": [{"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/images/ff48658f-96e6-43b8-b68b-32e64925c2cf"}]}, "flavor": {"vcpus": 2, "ram": 4096, "disk": 20, "ephemeral": 0, "swap": 0, "original_name": "autopkgtest", "extra_specs": {"aggregate_instance_extra_specs:commit": "builder-arm64", "hw_rng:allowed": "True"}}, "created": "2024-05-24T09:45:26Z", "updated": "2024-05-24T09:45:27Z", "addresses": {}, "accessIPv4": "", "accessIPv6": "", "links": [{"rel": "self", "href": "https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}, {"rel": "bookmark", "href": "https://nova.ps6.canonical.com:8774/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe"}], "OS-DCF:diskConfig": "MANUAL", "fault": {"code": 500, "created": "2024-05-24T09:45:27Z", "message": "No valid host was found. There are not enough hosts available."}, "OS-EXT-AZ:availability_zone": "", "config_drive": "", "key_name": "testbed-juju-7f2275-prod-proposed-migration-environment-3", "OS-SRV-USG:launched_at": null, "OS-SRV-USG:terminated_at": null, "OS-EXT-SRV-ATTR:host": null, "OS-EXT-SRV-ATTR:instance_name": "instance-000141b5", "OS-EXT-SRV-ATTR:hypervisor_hostname": null, "OS-EXT-SRV-ATTR:reservation_id": "r-caji5sdg", "OS-EXT-SRV-ATTR:launch_index": 0, "OS-EXT-SRV-ATTR:hostname": "adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f22", "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:ramdisk_id": "", "OS-EXT-SRV-ATTR:root_device_name": null, "OS-EXT-SRV-ATTR:user_data": "I2Nsb3VkLWNvbmZpZwpob3N0bmFtZTogYXV0b3BrZ3Rlc3QKZnFkbjogYXV0b3BrZ3Rlc3QubG9jYWwKbWFuYWdlX2V0Y19ob3N0czogdHJ1ZQphcHRfdXBkYXRlOiB0cnVlCmFwdF91cGdyYWRlOiBmYWxzZQphcHRfbWlycm9yOiBodHRwOi8vZnRwbWFzdGVyLmludGVybmFsL3VidW50dS8KCnJ1bmNtZDoKIC0gZWNobyAnQWNxdWlyZTo6TGFuZ3VhZ2VzICJub25lIjsnID4gL2V0Yy9hcHQvYXB0LmNvbmYuZC85MG5vbGFuZ3VhZ2VzCiAtIGVjaG8gJ2ZvcmNlLXVuc2FmZS1pbycgPiAvZXRjL2Rwa2cvZHBrZy5jZmcuZC9hdXRvcGtndGVzdAogLSBwcmludGYgJ1xuVEVSTT1saW51eFxuJ2h0dHBfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4naHR0cHNfcHJveHk9aHR0cDovL3NxdWlkLmludGVybmFsOjMxMjgnXG4nbm9fcHJveHk9MTI3LjAuMC4xLDEyNy4wLjEuMSxsb2dpbi51YnVudHUuY29tLGxvY2FsaG9zdCxsb2NhbGRvbWFpbixub3ZhbG9jYWwsaW50ZXJuYWwsYXJjaGl2ZS51YnVudHUuY29tLHBvcnRzLnVidW50dS5jb20sc2VjdXJpdHkudWJ1bnR1LmNvbSxkZGVicy51YnVudHUuY29tLGNoYW5nZWxvZ3MudWJ1bnR1LmNvbSxrZXlzZXJ2ZXIudWJ1bnR1LmNvbSxsYXVuY2hwYWRsaWJyYXJpYW4ubmV0LGxhdW5jaHBhZGNvbnRlbnQubmV0LGxhdW5jaHBhZC5uZXQsMTAuMjQuMC4wLzI0LGtleXN0b25lLnBzNS5jYW5vbmljYWwuY29tLG9iamVjdHN0b3JhZ2UucHJvZHN0YWNrNS5jYW5vbmljYWwuY29tJ1xuJyA+PiAvZXRjL2Vudmlyb25tZW50CiAtIHNlZCAtaSAtciAnL14xMjcuMC4xLjEvIHMvYXV0b3BrZ3Rlc3QtW14gXStcLi9hdXRvcGtndGVzdFwuLycgL2V0Yy9ob3N0cwo=", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "error", "OS-EXT-STS:power_state": 0, "os-extended-volumes:volumes_attached": [], "locked": false, "locked_reason": null, "description": null, "tags": [], "trusted_image_certificates": null, "server_groups": []}} 489s DEBUG (session:936) GET call to compute for https://nova.ps6.canonical.com:8774/v2.1/servers/bdce8c2f-4369-4ef7-a81c-5b447a4062fe used request id req-f5fec7ca-1ae7-48be-8ffc-cbefb94780f4 489s DEBUG (shell:822) 489s Traceback (most recent call last): 489s File "/usr/lib/python3/dist-packages/novaclient/shell.py", line 820, in main 489s OpenStackComputeShell().main(argv) 489s File "/usr/lib/python3/dist-packages/novaclient/shell.py", line 742, in main 489s args.func(self.cs, args) 489s File "/usr/lib/python3/dist-packages/novaclient/v2/shell.py", line 980, in do_boot 489s _poll_for_status(cs.servers.get, server.id, 'building', ['active']) 489s File "/usr/lib/python3/dist-packages/novaclient/v2/shell.py", line 1019, in _poll_for_status 489s raise exceptions.ResourceInErrorState(obj) 489s novaclient.exceptions.ResourceInErrorState: 489s ERROR (ResourceInErrorState): 489s 489s 489s 489s Error building server 492s autopkgtest [09:52:06]: testbed dpkg architecture: arm64 492s autopkgtest [09:52:06]: testbed apt version: 2.9.3 492s autopkgtest [09:52:06]: @@@@@@@@@@@@@@@@@@@@ test bed setup 493s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 493s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [57.4 kB] 493s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 493s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [507 kB] 494s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 494s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main arm64 Packages [177 kB] 494s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/restricted arm64 Packages [12.3 kB] 494s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 Packages [505 kB] 494s Get:9 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse arm64 Packages [2532 B] 494s Fetched 1341 kB in 1s (1069 kB/s) 494s Reading package lists... 497s Reading package lists... 498s Building dependency tree... 498s Reading state information... 499s Calculating upgrade... 500s The following packages will be upgraded: 500s gir1.2-glib-2.0 klibc-utils libclang-cpp18 libclang1-18 libglib2.0-0t64 500s libglib2.0-data libklibc libllvm18 libuv1t64 500s 9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 500s Need to get 49.1 MB of archives. 500s After this operation, 1121 kB of additional disk space will be used. 500s Get:1 http://ftpmaster.internal/ubuntu oracular/main arm64 gir1.2-glib-2.0 arm64 2.80.2-1ubuntu1 [182 kB] 500s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 libglib2.0-0t64 arm64 2.80.2-1ubuntu1 [1533 kB] 501s Get:3 http://ftpmaster.internal/ubuntu oracular/main arm64 libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 501s Get:4 http://ftpmaster.internal/ubuntu oracular/main arm64 libuv1t64 arm64 1.48.0-4 [95.4 kB] 501s Get:5 http://ftpmaster.internal/ubuntu oracular/main arm64 klibc-utils arm64 2.0.13-4ubuntu1 [114 kB] 501s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 libklibc arm64 2.0.13-4ubuntu1 [51.8 kB] 501s Get:7 http://ftpmaster.internal/ubuntu oracular/main arm64 libclang-cpp18 arm64 1:18.1.6-1 [13.2 MB] 501s Get:8 http://ftpmaster.internal/ubuntu oracular/main arm64 libllvm18 arm64 1:18.1.6-1 [26.3 MB] 502s Get:9 http://ftpmaster.internal/ubuntu oracular/main arm64 libclang1-18 arm64 1:18.1.6-1 [7531 kB] 504s Fetched 49.1 MB in 2s (20.1 MB/s) 504s (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 ... 78193 files and directories currently installed.) 504s Preparing to unpack .../0-gir1.2-glib-2.0_2.80.2-1ubuntu1_arm64.deb ... 504s Unpacking gir1.2-glib-2.0:arm64 (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 504s Preparing to unpack .../1-libglib2.0-0t64_2.80.2-1ubuntu1_arm64.deb ... 504s Unpacking libglib2.0-0t64:arm64 (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 504s Preparing to unpack .../2-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 504s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 504s Preparing to unpack .../3-libuv1t64_1.48.0-4_arm64.deb ... 504s Unpacking libuv1t64:arm64 (1.48.0-4) over (1.48.0-1.1build1) ... 504s Preparing to unpack .../4-klibc-utils_2.0.13-4ubuntu1_arm64.deb ... 504s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 504s Preparing to unpack .../5-libklibc_2.0.13-4ubuntu1_arm64.deb ... 504s Unpacking libklibc:arm64 (2.0.13-4ubuntu1) over (2.0.13-4) ... 505s Preparing to unpack .../6-libclang-cpp18_1%3a18.1.6-1_arm64.deb ... 505s Unpacking libclang-cpp18 (1:18.1.6-1) over (1:18.1.3-1) ... 506s Preparing to unpack .../7-libllvm18_1%3a18.1.6-1_arm64.deb ... 506s Unpacking libllvm18:arm64 (1:18.1.6-1) over (1:18.1.3-1) ... 506s Preparing to unpack .../8-libclang1-18_1%3a18.1.6-1_arm64.deb ... 506s Unpacking libclang1-18 (1:18.1.6-1) over (1:18.1.3-1) ... 507s Setting up libuv1t64:arm64 (1.48.0-4) ... 507s Setting up libklibc:arm64 (2.0.13-4ubuntu1) ... 507s Setting up libglib2.0-0t64:arm64 (2.80.2-1ubuntu1) ... 507s No schema files found: doing nothing. 507s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 507s Setting up gir1.2-glib-2.0:arm64 (2.80.2-1ubuntu1) ... 507s Setting up klibc-utils (2.0.13-4ubuntu1) ... 507s Setting up libllvm18:arm64 (1:18.1.6-1) ... 507s Setting up libclang1-18 (1:18.1.6-1) ... 507s Setting up libclang-cpp18 (1:18.1.6-1) ... 507s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 507s Processing triggers for initramfs-tools (0.142ubuntu27) ... 507s update-initramfs: Generating /boot/initrd.img-6.8.0-31-generic 507s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 528s System running in EFI mode, skipping. 529s Reading package lists... 529s Building dependency tree... 529s Reading state information... 530s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 530s Hit:1 http://ftpmaster.internal/ubuntu oracular InRelease 530s Hit:2 http://ftpmaster.internal/ubuntu oracular-updates InRelease 531s Hit:3 http://ftpmaster.internal/ubuntu oracular-security InRelease 531s Hit:4 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 532s Reading package lists... 532s Reading package lists... 532s Building dependency tree... 532s Reading state information... 533s Calculating upgrade... 534s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 534s Reading package lists... 534s Building dependency tree... 534s Reading state information... 535s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 535s autopkgtest [09:52:49]: rebooting testbed after setup commands that affected boot 569s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 576s autopkgtest [09:53:30]: testbed running kernel: Linux 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 02:32:42 UTC 2024 579s autopkgtest [09:53:33]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-matrixstats 581s Get:1 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (dsc) [2230 B] 581s Get:2 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (tar) [211 kB] 581s Get:3 http://ftpmaster.internal/ubuntu oracular/universe r-cran-matrixstats 1.2.0-1 (diff) [4752 B] 581s gpgv: Signature made Mon Jan 8 21:38:59 2024 UTC 581s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 581s gpgv: issuer "tille@debian.org" 581s gpgv: Can't check signature: No public key 581s dpkg-source: warning: cannot verify inline signature for ./r-cran-matrixstats_1.2.0-1.dsc: no acceptable signature found 581s autopkgtest [09:53:35]: testing package r-cran-matrixstats version 1.2.0-1 582s autopkgtest [09:53:36]: build not needed 583s autopkgtest [09:53:37]: test run-unit-test: preparing testbed 584s Reading package lists... 585s Building dependency tree... 585s Reading state information... 585s Starting pkgProblemResolver with broken count: 0 585s Starting 2 pkgProblemResolver with broken count: 0 586s Done 587s The following additional packages will be installed: 587s fontconfig fonts-glyphicons-halflings fonts-mathjax libblas3 libcairo2 587s libdatrie1 libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 587s libjs-bootstrap libjs-highlight.js libjs-jquery libjs-jquery-datatables 587s libjs-mathjax liblapack3 libpango-1.0-0 libpangocairo-1.0-0 587s libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 libsm6 libtcl8.6 587s libthai-data libthai0 libtk8.6 libxcb-render0 libxcb-shm0 libxft2 587s libxrender1 libxss1 libxt6t64 node-normalize.css r-base-core 587s r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 587s r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 587s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 587s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 587s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 587s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 587s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 587s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 587s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 587s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 587s Suggested packages: 587s fonts-mathjax-extras fonts-stix libjs-mathjax-doc tk8.6 libjs-html5shiv 587s elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html r-cran-kernsmooth 587s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 587s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 587s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 587s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 587s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-cairo 587s r-cran-codetools r-cran-bench r-cran-blob r-cran-brio r-cran-callr 587s r-cran-crayon r-cran-here r-cran-hms r-cran-htmltools r-cran-pkgbuild 587s r-cran-pkgload r-cran-purrr r-cran-tidyr tcl-tclreadline 587s Recommended packages: 587s javascript-common r-recommended r-base-dev r-doc-html r-cran-callr 587s r-cran-covr r-cran-crayon r-cran-htmltools r-cran-htmlwidgets r-cran-mockery 587s r-cran-processx r-cran-ps r-cran-rmarkdown r-cran-rprojroot 587s r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl r-cran-xml2 587s r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc r-cran-mapproj 587s r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg r-cran-ragg 587s r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 587s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 587s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 587s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 587s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 587s r-cran-lubridate libjs-remark-slide r-cran-fs r-cran-usethis r-cran-bit64 587s r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table r-cran-mockr 587s r-cran-formattable r-cran-generics r-cran-pkgdown r-cran-zeallot r-cran-mime 587s r-cran-remotes r-cran-renv r-cran-jsonlite r-cran-runit 587s libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl x11-utils 587s x11-xserver-utils 587s The following NEW packages will be installed: 587s autopkgtest-satdep fontconfig fonts-glyphicons-halflings fonts-mathjax 587s libblas3 libcairo2 libdatrie1 libgfortran5 libgomp1 libgraphite2-3 587s libharfbuzz0b libice6 libjs-bootstrap libjs-highlight.js libjs-jquery 587s libjs-jquery-datatables libjs-mathjax liblapack3 libpango-1.0-0 587s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 587s libsm6 libtcl8.6 libthai-data libthai0 libtk8.6 libxcb-render0 libxcb-shm0 587s libxft2 libxrender1 libxss1 libxt6t64 node-normalize.css r-base-core 587s r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 587s r-cran-digest r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 587s r-cran-glue r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr 587s r-cran-labeling r-cran-lattice r-cran-lifecycle r-cran-magrittr 587s r-cran-markdown r-cran-mass r-cran-matrix r-cran-matrixstats r-cran-mgcv 587s r-cran-munsell r-cran-nlme r-cran-pillar r-cran-pkgconfig r-cran-r.cache 587s r-cran-r.devices r-cran-r.methodss3 r-cran-r.oo r-cran-r.rsp r-cran-r.utils 587s r-cran-r6 r-cran-rcolorbrewer r-cran-rlang r-cran-scales r-cran-tibble 587s r-cran-utf8 r-cran-vctrs r-cran-viridislite r-cran-withr r-cran-xfun 587s r-cran-yaml tcl tcl8.6 unzip x11-common xdg-utils zip 588s 0 upgraded, 87 newly installed, 0 to remove and 0 not upgraded. 588s Need to get 80.8 MB/80.8 MB of archives. 588s After this operation, 181 MB of additional disk space will be used. 588s Get:1 /tmp/autopkgtest.ROsdPH/1-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [760 B] 588s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 fontconfig arm64 2.15.0-1.1ubuntu2 [190 kB] 589s Get:3 http://ftpmaster.internal/ubuntu oracular/universe arm64 fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 589s Get:4 http://ftpmaster.internal/ubuntu oracular/main arm64 fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 589s Get:5 http://ftpmaster.internal/ubuntu oracular/main arm64 libblas3 arm64 3.12.0-3build1 [143 kB] 589s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 libpixman-1-0 arm64 0.42.2-1build1 [204 kB] 589s Get:7 http://ftpmaster.internal/ubuntu oracular/main arm64 libxcb-render0 arm64 1.17.0-2 [16.6 kB] 589s Get:8 http://ftpmaster.internal/ubuntu oracular/main arm64 libxcb-shm0 arm64 1.17.0-2 [5884 B] 589s Get:9 http://ftpmaster.internal/ubuntu oracular/main arm64 libxrender1 arm64 1:0.9.10-1.1build1 [18.8 kB] 589s Get:10 http://ftpmaster.internal/ubuntu oracular/main arm64 libcairo2 arm64 1.18.0-3build1 [555 kB] 589s Get:11 http://ftpmaster.internal/ubuntu oracular/main arm64 libdatrie1 arm64 0.2.13-3build1 [19.2 kB] 589s Get:12 http://ftpmaster.internal/ubuntu oracular/main arm64 libgfortran5 arm64 14.1.0-1ubuntu1 [443 kB] 589s Get:13 http://ftpmaster.internal/ubuntu oracular/main arm64 libgomp1 arm64 14.1.0-1ubuntu1 [144 kB] 589s Get:14 http://ftpmaster.internal/ubuntu oracular/main arm64 libgraphite2-3 arm64 1.3.14-2build1 [70.8 kB] 589s Get:15 http://ftpmaster.internal/ubuntu oracular/main arm64 libharfbuzz0b arm64 8.3.0-2build2 [463 kB] 589s Get:16 http://ftpmaster.internal/ubuntu oracular/main arm64 x11-common all 1:7.7+23ubuntu3 [21.7 kB] 589s Get:17 http://ftpmaster.internal/ubuntu oracular/main arm64 libice6 arm64 2:1.0.10-1build3 [41.1 kB] 589s Get:18 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 589s Get:19 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 589s Get:20 http://ftpmaster.internal/ubuntu oracular/main arm64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 589s Get:21 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 589s Get:22 http://ftpmaster.internal/ubuntu oracular/main arm64 liblapack3 arm64 3.12.0-3build1 [2241 kB] 589s Get:23 http://ftpmaster.internal/ubuntu oracular/main arm64 libthai-data all 0.1.29-2build1 [158 kB] 589s Get:24 http://ftpmaster.internal/ubuntu oracular/main arm64 libthai0 arm64 0.1.29-2build1 [18.2 kB] 589s Get:25 http://ftpmaster.internal/ubuntu oracular/main arm64 libpango-1.0-0 arm64 1.52.2+ds-1 [230 kB] 589s Get:26 http://ftpmaster.internal/ubuntu oracular/main arm64 libpangoft2-1.0-0 arm64 1.52.2+ds-1 [41.9 kB] 589s Get:27 http://ftpmaster.internal/ubuntu oracular/main arm64 libpangocairo-1.0-0 arm64 1.52.2+ds-1 [27.2 kB] 589s Get:28 http://ftpmaster.internal/ubuntu oracular/main arm64 libpaper1 arm64 1.1.29build1 [13.4 kB] 589s Get:29 http://ftpmaster.internal/ubuntu oracular/main arm64 libpaper-utils arm64 1.1.29build1 [8490 B] 589s Get:30 http://ftpmaster.internal/ubuntu oracular/main arm64 libsm6 arm64 2:1.2.3-1build3 [15.6 kB] 589s Get:31 http://ftpmaster.internal/ubuntu oracular/main arm64 libtcl8.6 arm64 8.6.14+dfsg-1build1 [978 kB] 589s Get:32 http://ftpmaster.internal/ubuntu oracular/main arm64 libxft2 arm64 2.3.6-1build1 [44.1 kB] 589s Get:33 http://ftpmaster.internal/ubuntu oracular/main arm64 libxss1 arm64 1:1.2.3-1build3 [7244 B] 589s Get:34 http://ftpmaster.internal/ubuntu oracular/main arm64 libtk8.6 arm64 8.6.14-1build1 [767 kB] 589s Get:35 http://ftpmaster.internal/ubuntu oracular/main arm64 libxt6t64 arm64 1:1.2.1-1.2build1 [168 kB] 589s Get:36 http://ftpmaster.internal/ubuntu oracular/universe arm64 node-normalize.css all 8.0.1-5 [10.8 kB] 589s Get:37 http://ftpmaster.internal/ubuntu oracular/main arm64 zip arm64 3.0-13build1 [171 kB] 589s Get:38 http://ftpmaster.internal/ubuntu oracular/main arm64 unzip arm64 6.0-28ubuntu4 [171 kB] 589s Get:39 http://ftpmaster.internal/ubuntu oracular/main arm64 xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 589s Get:40 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-base-core arm64 4.4.0-2 [28.3 MB] 590s Get:41 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-base64enc arm64 0.1-3-3 [27.4 kB] 590s Get:42 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-cli arm64 3.6.2-1 [1377 kB] 590s Get:43 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-colorspace arm64 2.1-0+dfsg-1 [1540 kB] 590s Get:44 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-commonmark arm64 1.9.1-1 [127 kB] 590s Get:45 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-digest arm64 0.6.35-1 [195 kB] 590s Get:46 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-evaluate all 0.23-1 [90.2 kB] 590s Get:47 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-fansi arm64 1.0.5-1 [616 kB] 590s Get:48 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-farver arm64 2.1.1-2 [1340 kB] 590s Get:49 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-glue arm64 1.7.0-1 [154 kB] 590s Get:50 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-rlang arm64 1.1.3-1 [1663 kB] 590s Get:51 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 590s Get:52 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 590s Get:53 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-isoband arm64 0.2.7-1 [1481 kB] 590s Get:54 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-mass arm64 7.3-60.2-1 [1109 kB] 590s Get:55 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-lattice arm64 0.22-6-1 [1363 kB] 590s Get:56 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-nlme arm64 3.1.164-1build1 [2264 kB] 590s Get:57 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-matrix arm64 1.6-5-1 [3776 kB] 590s Get:58 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-mgcv arm64 1.9-1-1 [3248 kB] 590s Get:59 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-labeling all 0.4.3-1 [62.1 kB] 590s Get:60 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-munsell all 0.5.0-2build1 [208 kB] 590s Get:61 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r6 all 2.5.1-1 [99.0 kB] 590s Get:62 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 590s Get:63 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-viridislite all 0.4.2-2 [1088 kB] 590s Get:64 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-scales all 1.3.0-1 [603 kB] 590s Get:65 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-magrittr arm64 2.0.3-1 [154 kB] 590s Get:66 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-utf8 arm64 1.2.4-1 [140 kB] 590s Get:67 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-vctrs arm64 0.6.5-1 [1327 kB] 591s Get:68 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 591s Get:69 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 591s Get:70 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-tibble arm64 3.2.1+dfsg-2 [415 kB] 591s Get:71 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-withr all 2.5.0-1 [225 kB] 591s Get:72 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 591s Get:73 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-xfun arm64 0.44+dfsg-1 [517 kB] 591s Get:74 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-highr all 0.10+dfsg-2 [38.5 kB] 591s Get:75 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-yaml arm64 2.3.8-2 [108 kB] 591s Get:76 http://ftpmaster.internal/ubuntu oracular/main arm64 libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 591s Get:77 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-knitr all 1.46+dfsg-1 [911 kB] 591s Get:78 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-markdown all 1.12+dfsg-2 [179 kB] 591s Get:79 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-matrixstats arm64 1.2.0-1 [475 kB] 591s Get:80 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.methodss3 all 1.8.2-1 [84.0 kB] 591s Get:81 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.oo all 1.26.0-1 [955 kB] 591s Get:82 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.utils all 2.12.3-1 [1386 kB] 591s Get:83 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.cache all 0.16.0-1 [113 kB] 591s Get:84 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.devices all 2.17.2+ds-1 [398 kB] 591s Get:85 http://ftpmaster.internal/ubuntu oracular/main arm64 tcl8.6 arm64 8.6.14+dfsg-1build1 [14.6 kB] 591s Get:86 http://ftpmaster.internal/ubuntu oracular/main arm64 tcl arm64 8.6.14build1 [4124 B] 591s Get:87 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r.rsp all 0.46.0+ds-1 [1412 kB] 592s Preconfiguring packages ... 592s Fetched 80.8 MB in 3s (23.8 MB/s) 592s Selecting previously unselected package fontconfig. 592s (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 ... 78194 files and directories currently installed.) 592s Preparing to unpack .../00-fontconfig_2.15.0-1.1ubuntu2_arm64.deb ... 592s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 592s Selecting previously unselected package fonts-glyphicons-halflings. 592s Preparing to unpack .../01-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 592s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 592s Selecting previously unselected package fonts-mathjax. 592s Preparing to unpack .../02-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 592s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 592s Selecting previously unselected package libblas3:arm64. 592s Preparing to unpack .../03-libblas3_3.12.0-3build1_arm64.deb ... 592s Unpacking libblas3:arm64 (3.12.0-3build1) ... 592s Selecting previously unselected package libpixman-1-0:arm64. 592s Preparing to unpack .../04-libpixman-1-0_0.42.2-1build1_arm64.deb ... 592s Unpacking libpixman-1-0:arm64 (0.42.2-1build1) ... 592s Selecting previously unselected package libxcb-render0:arm64. 592s Preparing to unpack .../05-libxcb-render0_1.17.0-2_arm64.deb ... 593s Unpacking libxcb-render0:arm64 (1.17.0-2) ... 593s Selecting previously unselected package libxcb-shm0:arm64. 593s Preparing to unpack .../06-libxcb-shm0_1.17.0-2_arm64.deb ... 593s Unpacking libxcb-shm0:arm64 (1.17.0-2) ... 593s Selecting previously unselected package libxrender1:arm64. 593s Preparing to unpack .../07-libxrender1_1%3a0.9.10-1.1build1_arm64.deb ... 593s Unpacking libxrender1:arm64 (1:0.9.10-1.1build1) ... 593s Selecting previously unselected package libcairo2:arm64. 593s Preparing to unpack .../08-libcairo2_1.18.0-3build1_arm64.deb ... 593s Unpacking libcairo2:arm64 (1.18.0-3build1) ... 593s Selecting previously unselected package libdatrie1:arm64. 593s Preparing to unpack .../09-libdatrie1_0.2.13-3build1_arm64.deb ... 593s Unpacking libdatrie1:arm64 (0.2.13-3build1) ... 593s Selecting previously unselected package libgfortran5:arm64. 593s Preparing to unpack .../10-libgfortran5_14.1.0-1ubuntu1_arm64.deb ... 593s Unpacking libgfortran5:arm64 (14.1.0-1ubuntu1) ... 593s Selecting previously unselected package libgomp1:arm64. 593s Preparing to unpack .../11-libgomp1_14.1.0-1ubuntu1_arm64.deb ... 593s Unpacking libgomp1:arm64 (14.1.0-1ubuntu1) ... 593s Selecting previously unselected package libgraphite2-3:arm64. 593s Preparing to unpack .../12-libgraphite2-3_1.3.14-2build1_arm64.deb ... 593s Unpacking libgraphite2-3:arm64 (1.3.14-2build1) ... 593s Selecting previously unselected package libharfbuzz0b:arm64. 593s Preparing to unpack .../13-libharfbuzz0b_8.3.0-2build2_arm64.deb ... 593s Unpacking libharfbuzz0b:arm64 (8.3.0-2build2) ... 593s Selecting previously unselected package x11-common. 593s Preparing to unpack .../14-x11-common_1%3a7.7+23ubuntu3_all.deb ... 593s Unpacking x11-common (1:7.7+23ubuntu3) ... 593s Selecting previously unselected package libice6:arm64. 593s Preparing to unpack .../15-libice6_2%3a1.0.10-1build3_arm64.deb ... 593s Unpacking libice6:arm64 (2:1.0.10-1build3) ... 593s Selecting previously unselected package libjs-bootstrap. 593s Preparing to unpack .../16-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 593s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 593s Selecting previously unselected package libjs-highlight.js. 593s Preparing to unpack .../17-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 593s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 593s Selecting previously unselected package libjs-jquery. 593s Preparing to unpack .../18-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 593s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 593s Selecting previously unselected package libjs-jquery-datatables. 593s Preparing to unpack .../19-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 593s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 593s Selecting previously unselected package liblapack3:arm64. 593s Preparing to unpack .../20-liblapack3_3.12.0-3build1_arm64.deb ... 593s Unpacking liblapack3:arm64 (3.12.0-3build1) ... 593s Selecting previously unselected package libthai-data. 593s Preparing to unpack .../21-libthai-data_0.1.29-2build1_all.deb ... 593s Unpacking libthai-data (0.1.29-2build1) ... 593s Selecting previously unselected package libthai0:arm64. 593s Preparing to unpack .../22-libthai0_0.1.29-2build1_arm64.deb ... 593s Unpacking libthai0:arm64 (0.1.29-2build1) ... 593s Selecting previously unselected package libpango-1.0-0:arm64. 593s Preparing to unpack .../23-libpango-1.0-0_1.52.2+ds-1_arm64.deb ... 593s Unpacking libpango-1.0-0:arm64 (1.52.2+ds-1) ... 593s Selecting previously unselected package libpangoft2-1.0-0:arm64. 593s Preparing to unpack .../24-libpangoft2-1.0-0_1.52.2+ds-1_arm64.deb ... 593s Unpacking libpangoft2-1.0-0:arm64 (1.52.2+ds-1) ... 593s Selecting previously unselected package libpangocairo-1.0-0:arm64. 593s Preparing to unpack .../25-libpangocairo-1.0-0_1.52.2+ds-1_arm64.deb ... 593s Unpacking libpangocairo-1.0-0:arm64 (1.52.2+ds-1) ... 593s Selecting previously unselected package libpaper1:arm64. 593s Preparing to unpack .../26-libpaper1_1.1.29build1_arm64.deb ... 593s Unpacking libpaper1:arm64 (1.1.29build1) ... 593s Selecting previously unselected package libpaper-utils. 593s Preparing to unpack .../27-libpaper-utils_1.1.29build1_arm64.deb ... 593s Unpacking libpaper-utils (1.1.29build1) ... 594s Selecting previously unselected package libsm6:arm64. 594s Preparing to unpack .../28-libsm6_2%3a1.2.3-1build3_arm64.deb ... 594s Unpacking libsm6:arm64 (2:1.2.3-1build3) ... 594s Selecting previously unselected package libtcl8.6:arm64. 594s Preparing to unpack .../29-libtcl8.6_8.6.14+dfsg-1build1_arm64.deb ... 594s Unpacking libtcl8.6:arm64 (8.6.14+dfsg-1build1) ... 594s Selecting previously unselected package libxft2:arm64. 594s Preparing to unpack .../30-libxft2_2.3.6-1build1_arm64.deb ... 594s Unpacking libxft2:arm64 (2.3.6-1build1) ... 594s Selecting previously unselected package libxss1:arm64. 594s Preparing to unpack .../31-libxss1_1%3a1.2.3-1build3_arm64.deb ... 594s Unpacking libxss1:arm64 (1:1.2.3-1build3) ... 594s Selecting previously unselected package libtk8.6:arm64. 594s Preparing to unpack .../32-libtk8.6_8.6.14-1build1_arm64.deb ... 594s Unpacking libtk8.6:arm64 (8.6.14-1build1) ... 594s Selecting previously unselected package libxt6t64:arm64. 594s Preparing to unpack .../33-libxt6t64_1%3a1.2.1-1.2build1_arm64.deb ... 594s Unpacking libxt6t64:arm64 (1:1.2.1-1.2build1) ... 594s Selecting previously unselected package node-normalize.css. 594s Preparing to unpack .../34-node-normalize.css_8.0.1-5_all.deb ... 594s Unpacking node-normalize.css (8.0.1-5) ... 594s Selecting previously unselected package zip. 594s Preparing to unpack .../35-zip_3.0-13build1_arm64.deb ... 594s Unpacking zip (3.0-13build1) ... 594s Selecting previously unselected package unzip. 594s Preparing to unpack .../36-unzip_6.0-28ubuntu4_arm64.deb ... 594s Unpacking unzip (6.0-28ubuntu4) ... 594s Selecting previously unselected package xdg-utils. 594s Preparing to unpack .../37-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 594s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 594s Selecting previously unselected package r-base-core. 594s Preparing to unpack .../38-r-base-core_4.4.0-2_arm64.deb ... 594s Unpacking r-base-core (4.4.0-2) ... 594s Selecting previously unselected package r-cran-base64enc. 594s Preparing to unpack .../39-r-cran-base64enc_0.1-3-3_arm64.deb ... 594s Unpacking r-cran-base64enc (0.1-3-3) ... 594s Selecting previously unselected package r-cran-cli. 594s Preparing to unpack .../40-r-cran-cli_3.6.2-1_arm64.deb ... 594s Unpacking r-cran-cli (3.6.2-1) ... 595s Selecting previously unselected package r-cran-colorspace. 595s Preparing to unpack .../41-r-cran-colorspace_2.1-0+dfsg-1_arm64.deb ... 595s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 595s Selecting previously unselected package r-cran-commonmark. 595s Preparing to unpack .../42-r-cran-commonmark_1.9.1-1_arm64.deb ... 595s Unpacking r-cran-commonmark (1.9.1-1) ... 595s Selecting previously unselected package r-cran-digest. 595s Preparing to unpack .../43-r-cran-digest_0.6.35-1_arm64.deb ... 595s Unpacking r-cran-digest (0.6.35-1) ... 595s Selecting previously unselected package r-cran-evaluate. 595s Preparing to unpack .../44-r-cran-evaluate_0.23-1_all.deb ... 595s Unpacking r-cran-evaluate (0.23-1) ... 595s Selecting previously unselected package r-cran-fansi. 595s Preparing to unpack .../45-r-cran-fansi_1.0.5-1_arm64.deb ... 595s Unpacking r-cran-fansi (1.0.5-1) ... 595s Selecting previously unselected package r-cran-farver. 595s Preparing to unpack .../46-r-cran-farver_2.1.1-2_arm64.deb ... 595s Unpacking r-cran-farver (2.1.1-2) ... 595s Selecting previously unselected package r-cran-glue. 595s Preparing to unpack .../47-r-cran-glue_1.7.0-1_arm64.deb ... 595s Unpacking r-cran-glue (1.7.0-1) ... 595s Selecting previously unselected package r-cran-rlang. 595s Preparing to unpack .../48-r-cran-rlang_1.1.3-1_arm64.deb ... 595s Unpacking r-cran-rlang (1.1.3-1) ... 595s Selecting previously unselected package r-cran-lifecycle. 595s Preparing to unpack .../49-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 595s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 595s Selecting previously unselected package r-cran-gtable. 595s Preparing to unpack .../50-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 595s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 595s Selecting previously unselected package r-cran-isoband. 595s Preparing to unpack .../51-r-cran-isoband_0.2.7-1_arm64.deb ... 595s Unpacking r-cran-isoband (0.2.7-1) ... 595s Selecting previously unselected package r-cran-mass. 595s Preparing to unpack .../52-r-cran-mass_7.3-60.2-1_arm64.deb ... 595s Unpacking r-cran-mass (7.3-60.2-1) ... 595s Selecting previously unselected package r-cran-lattice. 595s Preparing to unpack .../53-r-cran-lattice_0.22-6-1_arm64.deb ... 595s Unpacking r-cran-lattice (0.22-6-1) ... 595s Selecting previously unselected package r-cran-nlme. 595s Preparing to unpack .../54-r-cran-nlme_3.1.164-1build1_arm64.deb ... 595s Unpacking r-cran-nlme (3.1.164-1build1) ... 596s Selecting previously unselected package r-cran-matrix. 596s Preparing to unpack .../55-r-cran-matrix_1.6-5-1_arm64.deb ... 596s Unpacking r-cran-matrix (1.6-5-1) ... 596s Selecting previously unselected package r-cran-mgcv. 596s Preparing to unpack .../56-r-cran-mgcv_1.9-1-1_arm64.deb ... 596s Unpacking r-cran-mgcv (1.9-1-1) ... 596s Selecting previously unselected package r-cran-labeling. 596s Preparing to unpack .../57-r-cran-labeling_0.4.3-1_all.deb ... 596s Unpacking r-cran-labeling (0.4.3-1) ... 596s Selecting previously unselected package r-cran-munsell. 596s Preparing to unpack .../58-r-cran-munsell_0.5.0-2build1_all.deb ... 596s Unpacking r-cran-munsell (0.5.0-2build1) ... 596s Selecting previously unselected package r-cran-r6. 596s Preparing to unpack .../59-r-cran-r6_2.5.1-1_all.deb ... 596s Unpacking r-cran-r6 (2.5.1-1) ... 596s Selecting previously unselected package r-cran-rcolorbrewer. 596s Preparing to unpack .../60-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 596s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 596s Selecting previously unselected package r-cran-viridislite. 596s Preparing to unpack .../61-r-cran-viridislite_0.4.2-2_all.deb ... 596s Unpacking r-cran-viridislite (0.4.2-2) ... 596s Selecting previously unselected package r-cran-scales. 596s Preparing to unpack .../62-r-cran-scales_1.3.0-1_all.deb ... 596s Unpacking r-cran-scales (1.3.0-1) ... 596s Selecting previously unselected package r-cran-magrittr. 596s Preparing to unpack .../63-r-cran-magrittr_2.0.3-1_arm64.deb ... 596s Unpacking r-cran-magrittr (2.0.3-1) ... 596s Selecting previously unselected package r-cran-utf8. 596s Preparing to unpack .../64-r-cran-utf8_1.2.4-1_arm64.deb ... 596s Unpacking r-cran-utf8 (1.2.4-1) ... 596s Selecting previously unselected package r-cran-vctrs. 596s Preparing to unpack .../65-r-cran-vctrs_0.6.5-1_arm64.deb ... 596s Unpacking r-cran-vctrs (0.6.5-1) ... 596s Selecting previously unselected package r-cran-pillar. 596s Preparing to unpack .../66-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 596s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 596s Selecting previously unselected package r-cran-pkgconfig. 596s Preparing to unpack .../67-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 596s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 596s Selecting previously unselected package r-cran-tibble. 596s Preparing to unpack .../68-r-cran-tibble_3.2.1+dfsg-2_arm64.deb ... 596s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 596s Selecting previously unselected package r-cran-withr. 596s Preparing to unpack .../69-r-cran-withr_2.5.0-1_all.deb ... 596s Unpacking r-cran-withr (2.5.0-1) ... 596s Selecting previously unselected package r-cran-ggplot2. 596s Preparing to unpack .../70-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 596s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 597s Selecting previously unselected package r-cran-xfun. 597s Preparing to unpack .../71-r-cran-xfun_0.44+dfsg-1_arm64.deb ... 597s Unpacking r-cran-xfun (0.44+dfsg-1) ... 597s Selecting previously unselected package r-cran-highr. 597s Preparing to unpack .../72-r-cran-highr_0.10+dfsg-2_all.deb ... 597s Unpacking r-cran-highr (0.10+dfsg-2) ... 597s Selecting previously unselected package r-cran-yaml. 597s Preparing to unpack .../73-r-cran-yaml_2.3.8-2_arm64.deb ... 597s Unpacking r-cran-yaml (2.3.8-2) ... 597s Selecting previously unselected package libjs-mathjax. 597s Preparing to unpack .../74-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 597s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 597s Selecting previously unselected package r-cran-knitr. 597s Preparing to unpack .../75-r-cran-knitr_1.46+dfsg-1_all.deb ... 597s Unpacking r-cran-knitr (1.46+dfsg-1) ... 597s Selecting previously unselected package r-cran-markdown. 597s Preparing to unpack .../76-r-cran-markdown_1.12+dfsg-2_all.deb ... 597s Unpacking r-cran-markdown (1.12+dfsg-2) ... 597s Selecting previously unselected package r-cran-matrixstats. 598s Preparing to unpack .../77-r-cran-matrixstats_1.2.0-1_arm64.deb ... 598s Unpacking r-cran-matrixstats (1.2.0-1) ... 598s Selecting previously unselected package r-cran-r.methodss3. 598s Preparing to unpack .../78-r-cran-r.methodss3_1.8.2-1_all.deb ... 598s Unpacking r-cran-r.methodss3 (1.8.2-1) ... 598s Selecting previously unselected package r-cran-r.oo. 598s Preparing to unpack .../79-r-cran-r.oo_1.26.0-1_all.deb ... 598s Unpacking r-cran-r.oo (1.26.0-1) ... 598s Selecting previously unselected package r-cran-r.utils. 598s Preparing to unpack .../80-r-cran-r.utils_2.12.3-1_all.deb ... 598s Unpacking r-cran-r.utils (2.12.3-1) ... 598s Selecting previously unselected package r-cran-r.cache. 598s Preparing to unpack .../81-r-cran-r.cache_0.16.0-1_all.deb ... 598s Unpacking r-cran-r.cache (0.16.0-1) ... 598s Selecting previously unselected package r-cran-r.devices. 598s Preparing to unpack .../82-r-cran-r.devices_2.17.2+ds-1_all.deb ... 598s Unpacking r-cran-r.devices (2.17.2+ds-1) ... 598s Selecting previously unselected package tcl8.6. 598s Preparing to unpack .../83-tcl8.6_8.6.14+dfsg-1build1_arm64.deb ... 598s Unpacking tcl8.6 (8.6.14+dfsg-1build1) ... 598s Selecting previously unselected package tcl. 598s Preparing to unpack .../84-tcl_8.6.14build1_arm64.deb ... 598s Unpacking tcl (8.6.14build1) ... 598s Selecting previously unselected package r-cran-r.rsp. 598s Preparing to unpack .../85-r-cran-r.rsp_0.46.0+ds-1_all.deb ... 598s Unpacking r-cran-r.rsp (0.46.0+ds-1) ... 598s Selecting previously unselected package autopkgtest-satdep. 598s Preparing to unpack .../86-1-autopkgtest-satdep.deb ... 598s Unpacking autopkgtest-satdep (0) ... 598s Setting up libgraphite2-3:arm64 (1.3.14-2build1) ... 598s Setting up libpixman-1-0:arm64 (0.42.2-1build1) ... 598s Setting up libpaper1:arm64 (1.1.29build1) ... 599s 599s Creating config file /etc/papersize with new version 599s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 601s Regenerating fonts cache... done. 601s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 601s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 601s Setting up libxrender1:arm64 (1:0.9.10-1.1build1) ... 601s Setting up libdatrie1:arm64 (0.2.13-3build1) ... 601s Setting up libxcb-render0:arm64 (1.17.0-2) ... 601s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 601s Setting up unzip (6.0-28ubuntu4) ... 601s Setting up x11-common (1:7.7+23ubuntu3) ... 601s Setting up libxcb-shm0:arm64 (1.17.0-2) ... 601s Setting up libpaper-utils (1.1.29build1) ... 601s Setting up libgomp1:arm64 (14.1.0-1ubuntu1) ... 601s Setting up libcairo2:arm64 (1.18.0-3build1) ... 601s Setting up zip (3.0-13build1) ... 601s Setting up libblas3:arm64 (3.12.0-3build1) ... 601s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 601s Setting up libtcl8.6:arm64 (8.6.14+dfsg-1build1) ... 601s Setting up libgfortran5:arm64 (14.1.0-1ubuntu1) ... 601s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 601s Setting up libharfbuzz0b:arm64 (8.3.0-2build2) ... 601s Setting up libthai-data (0.1.29-2build1) ... 601s Setting up libxss1:arm64 (1:1.2.3-1build3) ... 601s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 601s Setting up node-normalize.css (8.0.1-5) ... 601s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 601s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 601s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 601s Setting up libice6:arm64 (2:1.0.10-1build3) ... 601s Setting up tcl8.6 (8.6.14+dfsg-1build1) ... 601s Setting up liblapack3:arm64 (3.12.0-3build1) ... 601s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 601s Setting up libxft2:arm64 (2.3.6-1build1) ... 601s Setting up libtk8.6:arm64 (8.6.14-1build1) ... 601s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 601s Setting up libthai0:arm64 (0.1.29-2build1) ... 601s Setting up tcl (8.6.14build1) ... 601s Setting up libsm6:arm64 (2:1.2.3-1build3) ... 601s Setting up libpango-1.0-0:arm64 (1.52.2+ds-1) ... 601s Setting up libxt6t64:arm64 (1:1.2.1-1.2build1) ... 601s Setting up libpangoft2-1.0-0:arm64 (1.52.2+ds-1) ... 601s Setting up libpangocairo-1.0-0:arm64 (1.52.2+ds-1) ... 601s Setting up r-base-core (4.4.0-2) ... 602s 602s Creating config file /etc/R/Renviron with new version 602s Setting up r-cran-labeling (0.4.3-1) ... 602s Setting up r-cran-lattice (0.22-6-1) ... 602s Setting up r-cran-nlme (3.1.164-1build1) ... 602s Setting up r-cran-farver (2.1.1-2) ... 602s Setting up r-cran-viridislite (0.4.2-2) ... 602s Setting up r-cran-commonmark (1.9.1-1) ... 602s Setting up r-cran-r6 (2.5.1-1) ... 602s Setting up r-cran-magrittr (2.0.3-1) ... 602s Setting up r-cran-rlang (1.1.3-1) ... 602s Setting up r-cran-matrixstats (1.2.0-1) ... 602s Setting up r-cran-xfun (0.44+dfsg-1) ... 602s Setting up r-cran-withr (2.5.0-1) ... 602s Setting up r-cran-base64enc (0.1-3-3) ... 602s Setting up r-cran-digest (0.6.35-1) ... 602s Setting up r-cran-yaml (2.3.8-2) ... 602s Setting up r-cran-evaluate (0.23-1) ... 602s Setting up r-cran-highr (0.10+dfsg-2) ... 602s Setting up r-cran-fansi (1.0.5-1) ... 602s Setting up r-cran-mass (7.3-60.2-1) ... 602s Setting up r-cran-glue (1.7.0-1) ... 602s Setting up r-cran-cli (3.6.2-1) ... 602s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 602s Setting up r-cran-r.methodss3 (1.8.2-1) ... 602s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 602s Setting up r-cran-utf8 (1.2.4-1) ... 602s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 602s Setting up r-cran-markdown (1.12+dfsg-2) ... 602s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 602s Setting up r-cran-isoband (0.2.7-1) ... 602s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 602s Setting up r-cran-matrix (1.6-5-1) ... 602s Setting up r-cran-knitr (1.46+dfsg-1) ... 602s Setting up r-cran-mgcv (1.9-1-1) ... 602s Setting up r-cran-vctrs (0.6.5-1) ... 602s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 602s Setting up r-cran-munsell (0.5.0-2build1) ... 602s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 602s Setting up r-cran-r.oo (1.26.0-1) ... 602s Setting up r-cran-scales (1.3.0-1) ... 602s Setting up r-cran-r.utils (2.12.3-1) ... 602s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 602s Setting up r-cran-r.devices (2.17.2+ds-1) ... 602s Setting up r-cran-r.cache (0.16.0-1) ... 602s Setting up r-cran-r.rsp (0.46.0+ds-1) ... 602s Setting up autopkgtest-satdep (0) ... 602s Processing triggers for man-db (2.12.1-1) ... 603s Processing triggers for install-info (7.1-3build2) ... 603s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 611s (Reading database ... 89246 files and directories currently installed.) 611s Removing autopkgtest-satdep (0) ... 612s autopkgtest [09:54:06]: test run-unit-test: [----------------------- 613s 613s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 613s Copyright (C) 2024 The R Foundation for Statistical Computing 613s Platform: aarch64-unknown-linux-gnu 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") 613s > 613s > allocArray_R <- function(nrow, ncol, value = NA) { 613s + array(data = value, dim = dim) 613s + } 613s > 613s > values <- list( 613s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 613s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 613s + .Machine$double.xmin, .Machine$double.xmax, 613s + .Machine$double.eps, .Machine$double.neg.eps, 613s + FALSE, TRUE, NA 613s + ) 613s > 613s > dim <- c(2L, 4L, 3L) 613s > for (value in values) { 613s + x0 <- allocArray_R(dim, value = value) 613s + x <- allocArray(dim, value = value) 613s + if (!identical(x, x0)) { 613s + str(list(dim = dim, value = value, x = x, x0 = x0)) 613s + stopifnot(identical(x, x0)) 613s + } 613s + } 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: aarch64-unknown-linux-gnu 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") 613s > 613s > allocMatrix_R <- function(nrow, ncol, value = NA) { 613s + matrix(data = value, nrow = nrow, ncol = ncol) 613s + } 613s > 613s > values <- list( 613s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 613s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 613s + .Machine$double.xmin, .Machine$double.xmax, 613s + .Machine$double.eps, .Machine$double.neg.eps, 613s + FALSE, TRUE, NA 613s + ) 613s > 613s > nrow <- 2L 613s > ncol <- 3L 613s > for (value in values) { 613s + x0 <- allocMatrix_R(nrow, ncol, value = value) 613s + x <- allocMatrix(nrow, ncol, value = value) 613s + if (!identical(x, x0)) { 613s + str(list(nrow = nrow, ncol = ncol, value = value, x = x, x0 = x0)) 613s + stopifnot(identical(x, x0)) 613s + } 613s + } 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: aarch64-unknown-linux-gnu 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 614s > library("matrixStats") 614s > 614s > allocVector_R <- function(length, value = NA) { 614s + x <- vector(mode = typeof(value), length = length) 614s + if (!is.finite(value) || value != 0) x[] <- value 614s + x 614s + } 614s > 614s > values <- list( 614s + -1L, 0L, +1L, NA_integer_, .Machine$integer.max, 614s + -1, 0, +1, NA_real_, NaN, -Inf, +Inf, 614s + .Machine$double.xmin, .Machine$double.xmax, 614s + .Machine$double.eps, .Machine$double.neg.eps, 614s + FALSE, TRUE, NA 614s + ) 614s > 614s > n <- 10L 614s > for (value in values) { 614s + x0 <- allocVector_R(n, value = value) 614s + x <- allocVector(n, value = value) 614s + if (!identical(x, x0)) { 614s + str(list(n = n, value = value, x = x, x0 = x0)) 614s + stopifnot(identical(x, x0)) 614s + } 614s + } 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: aarch64-unknown-linux-gnu 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 614s > library("matrixStats") 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Setup 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > data <- data.frame( 614s + logical = c(TRUE, FALSE, TRUE), 614s + integer = 1:3, 614s + double = seq(from = 1.0, to = 3.0, by = 1.0), 614s + complex = seq(from = 1.0, to = 3.0, by = 1.0) + 1.0i, 614s + character = letters[1:3], 614s + stringsAsFactors = FALSE 614s + ) 614s > 614s > modes <- names(data) 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Special cases 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > cat("NULL...\n") 614s NULL... 614s > stopifnot(identical(anyMissing(NULL), FALSE)) 614s > cat("NULL...done\n") 614s NULL...done 614s > 614s > cat("raw...\n") 614s raw... 614s > stopifnot(identical(anyMissing(as.raw(0:2)), FALSE)) 614s > cat("raw...done\n") 614s raw...done 614s > 614s > cat("list(NULL)...\n") 614s list(NULL)... 614s > stopifnot(identical(anyMissing(list(NULL)), FALSE)) 614s > cat("list(NULL)...done\n") 614s list(NULL)...done 614s > 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Scalars, vectors, and matrices of various modes 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > for (mode in modes) { 614s + cat(sprintf("Mode: %s...\n", mode)) 614s + values <- data[[mode]] 614s + 614s + # Scalars 614s + cat(" scalar\n") 614s + x <- values[1L] 614s + print(x) 614s + stopifnot(identical(anyMissing(x), FALSE)) 614s + is.na(x) <- TRUE 614s + print(x) 614s + stopifnot(identical(anyMissing(x), TRUE)) 614s + 614s + # Vectors 614s + cat(" vector\n") 614s + x <- values 614s + print(x) 614s + stopifnot(identical(anyMissing(x), FALSE)) 614s + is.na(x)[2L] <- TRUE 614s + print(x) 614s + stopifnot(identical(anyMissing(x), TRUE)) 614s + 614s + # Matrices 614s + cat(" matrix\n") 614s + x <- matrix(c(values, values), ncol = 2L) 614s + print(x) 614s + stopifnot(identical(anyMissing(x), FALSE)) 614s + is.na(x)[2L] <- TRUE 614s + print(x) 614s + stopifnot(identical(anyMissing(x), TRUE)) 614s + 614s + cat(sprintf("Mode: %s...done\n", mode)) 614s + } # for (mode ...) 614s Mode: logical... 614s scalar 614s [1] TRUE 614s [1] NA 614s vector 614s [1] TRUE FALSE TRUE 614s [1] TRUE NA TRUE 614s matrix 614s [,1] [,2] 614s [1,] TRUE TRUE 614s [2,] FALSE FALSE 614s [3,] TRUE TRUE 614s [,1] [,2] 614s [1,] TRUE TRUE 614s [2,] NA FALSE 614s [3,] TRUE TRUE 614s Mode: logical...done 614s Mode: integer... 614s scalar 614s [1] 1 614s [1] NA 614s vector 614s [1] 1 2 3 614s [1] 1 NA 3 614s matrix 614s [,1] [,2] 614s [1,] 1 1 614s [2,] 2 2 614s [3,] 3 3 614s [,1] [,2] 614s [1,] 1 1 614s [2,] NA 2 614s [3,] 3 3 614s Mode: integer...done 614s Mode: double... 614s scalar 614s [1] 1 614s [1] NA 614s vector 614s [1] 1 2 3 614s [1] 1 NA 3 614s matrix 614s [,1] [,2] 614s [1,] 1 1 614s [2,] 2 2 614s [3,] 3 3 614s [,1] [,2] 614s [1,] 1 1 614s [2,] NA 2 614s [3,] 3 3 614s Mode: double...done 614s Mode: complex... 614s scalar 614s [1] 1+1i 614s [1] NA 614s vector 614s [1] 1+1i 2+1i 3+1i 614s [1] 1+1i NA 3+1i 614s matrix 614s [,1] [,2] 614s [1,] 1+1i 1+1i 614s [2,] 2+1i 2+1i 614s [3,] 3+1i 3+1i 614s [,1] [,2] 614s [1,] 1+1i 1+1i 614s [2,] NA 2+1i 614s [3,] 3+1i 3+1i 614s Mode: complex...done 614s Mode: character... 614s scalar 614s [1] "a" 614s [1] NA 614s vector 614s [1] "a" "b" "c" 614s [1] "a" NA "c" 614s matrix 614s [,1] [,2] 614s [1,] "a" "a" 614s [2,] "b" "b" 614s [3,] "c" "c" 614s [,1] [,2] 614s [1,] "a" "a" 614s [2,] NA "b" 614s [3,] "c" "c" 614s Mode: character...done 614s > 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Data frames 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > cat("data.frame...\n") 614s data.frame... 614s > x <- data 614s > stopifnot(identical(anyMissing(x), FALSE)) 614s > for (mode in modes) { 614s + x <- data 614s + is.na(x[[mode]])[2L] <- TRUE 614s + print(x) 614s + stopifnot(identical(anyMissing(x), TRUE)) 614s + } # for (mode ...) 614s logical integer double complex character 614s 1 TRUE 1 1 1+1i a 614s 2 NA 2 2 2+1i b 614s 3 TRUE 3 3 3+1i c 614s logical integer double complex character 614s 1 TRUE 1 1 1+1i a 614s 2 FALSE NA 2 2+1i b 614s 3 TRUE 3 3 3+1i c 614s logical integer double complex character 614s 1 TRUE 1 1 1+1i a 614s 2 FALSE 2 NA 2+1i b 614s 3 TRUE 3 3 3+1i c 614s logical integer double complex character 614s 1 TRUE 1 1 1+1i a 614s 2 FALSE 2 2 NA b 614s 3 TRUE 3 3 3+1i c 614s logical integer double complex character 614s 1 TRUE 1 1 1+1i a 614s 2 FALSE 2 2 2+1i 614s 3 TRUE 3 3 3+1i c 614s > cat("data.frame...done\n") 614s data.frame...done 614s > 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Lists 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > cat("list...\n") 614s list... 614s > x <- as.list(data) 614s > stopifnot(identical(anyMissing(x), FALSE)) 614s > for (mode in modes) { 614s + x <- as.list(data) 614s + is.na(x[[mode]])[2L] <- TRUE 614s + print(x) 614s + stopifnot(identical(anyMissing(x), TRUE)) 614s + } # for (mode ...) 614s $logical 614s [1] TRUE NA TRUE 614s 614s $integer 614s [1] 1 2 3 614s 614s $double 614s [1] 1 2 3 614s 614s $complex 614s [1] 1+1i 2+1i 3+1i 614s 614s $character 614s [1] "a" "b" "c" 614s 614s $logical 614s [1] TRUE FALSE TRUE 614s 614s $integer 614s [1] 1 NA 3 614s 614s $double 614s [1] 1 2 3 614s 614s $complex 614s [1] 1+1i 2+1i 3+1i 614s 614s $character 614s [1] "a" "b" "c" 614s 614s $logical 614s [1] TRUE FALSE TRUE 614s 614s $integer 614s [1] 1 2 3 614s 614s $double 614s [1] 1 NA 3 614s 614s $complex 614s [1] 1+1i 2+1i 3+1i 614s 614s $character 614s [1] "a" "b" "c" 614s 614s $logical 614s [1] TRUE FALSE TRUE 614s 614s $integer 614s [1] 1 2 3 614s 614s $double 614s [1] 1 2 3 614s 614s $complex 614s [1] 1+1i NA 3+1i 614s 614s $character 614s [1] "a" "b" "c" 614s 614s $logical 614s [1] TRUE FALSE TRUE 614s 614s $integer 614s [1] 1 2 3 614s 614s $double 614s [1] 1 2 3 614s 614s $complex 614s [1] 1+1i 2+1i 3+1i 614s 614s $character 614s [1] "a" NA "c" 614s 614s > cat("list...done\n") 614s list...done 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: aarch64-unknown-linux-gnu 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 614s > library("matrixStats") 614s > 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > # Subsetted tests 614s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 614s > source("utils/validateIndicesFramework.R") 614s > x <- runif(4, min = -3, max = 3) 614s > x[2] <- NA 614s > for (mode in c("integer", "numeric")) { 614s + storage.mode(x) <- mode 614s + for (idxs in index_cases) { 614s + validateIndicesTestVector(x, idxs, 614s + ftest = anyMissing, fsure = function(x, ...) { 614s + anyValue(x, value = NA) 614s + }) 614s + } 614s + } 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: aarch64-unknown-linux-gnu 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 614s > ## 1. Don't test with valgrind 614s > ## 2. Test only R (>= 3.0.2) because of that's what knitr requires 614s > if (getRversion() >= "3.0.2" && Sys.getenv("_R_CHECK_USE_VALGRIND_") == "") { 614s + 614s + ## 3. Make sure all suggested packages are installed / can be loaded 614s + pkgs <- c("base64enc", "ggplot2", "knitr", "markdown", "microbenchmark", 614s + "R.devices", "R.rsp") 614s + if (all(unlist(lapply(pkgs, FUN = requireNamespace)))) { 614s + html <- matrixStats:::benchmark("binCounts") 614s + print(html) 614s + } 614s + 614s + rm(list = "pkgs") 614s + 614s + } 614s Loading required namespace: base64enc 614s Loading required namespace: ggplot2 615s Loading required namespace: knitr 615s Loading required namespace: markdown 615s Loading required namespace: microbenchmark 615s Failed with error: ‘there is no package called ‘microbenchmark’’ 615s Loading required namespace: R.devices 615s Loading required namespace: R.rsp 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: aarch64-unknown-linux-gnu 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 > library("stats") 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Local functions 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 616s + n0 <- graphics::hist(x, breaks = bx, right = right, 616s + include.lowest = TRUE, plot = FALSE)$counts 616s + } 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Non-sorted and sorted positions 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > nx <- 1000L # Number of data points 616s > nb <- 200L # Number of bins 616s > 616s > # Uniformely distributed bins 616s > bx <- seq(from = 0, to = 1, length.out = nb + 1L) 616s > bx <- c(-1, bx, 2) 616s > 616s > # Sample data points 616s > set.seed(0xBEEF) 616s > x <- runif(nx, min = 0, max = 1) 616s > 616s > for (kk in 1:2) { 616s + n0 <- binCounts_hist(x, bx = bx) 616s + n1 <- binCounts(x, bx = bx) 616s + # Sanity check 616s + stopifnot(identical(n1, n0)) 616s + 616s + # Check reversed 616s + n1r <- rev(binCounts(-x, bx = rev(-bx), right = TRUE)) 616s + stopifnot(identical(n1r, n1)) 616s + 616s + # Retry with a sorted vector 616s + x <- sort(x) 616s + } # for (kk in 1:2) 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Missing values 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > x <- 1:40 616s > x[20] <- NA_integer_ 616s > nx <- length(x) 616s > 616s > # Bins 616s > bx <- c(0.5, 50.5, 100.5, 150.5, 200.5) 616s > 616s > y_smooth0 <- binCounts_hist(x, bx = bx) 616s > y_smooth <- binCounts(x, bx = bx) 616s > # Sanity check 616s > stopifnot(all.equal(y_smooth, y_smooth0)) 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Border cases 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > x <- 1:10 616s > bx <- min(x) - c(10, 1) 616s > y_smooth <- binCounts(x, bx = bx) 616s > stopifnot(all.equal(y_smooth, 0L)) 616s > bx <- range(x) 616s > y_smooth <- binCounts(x, bx = bx) 616s > stopifnot(all.equal(y_smooth, length(x) - 1L)) 616s > bx <- max(x) + c(1, 10) 616s > y_smooth <- binCounts(x, bx = bx) 616s > stopifnot(all.equal(y_smooth, 0L)) 616s > 616s > # Every second empty 616s > x <- 1:10 616s > bx <- rep(x, each = 2L) 616s > y_smooth <- binCounts(x, bx = bx) 616s > stopifnot(all.equal(y_smooth, rep(c(0L, 1L), length.out = length(bx) - 1L))) 616s > ## NOTE: binCounts_hist() does not give the same last bin count 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Exception handling 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Zero bin bounderies (invalid bin definition) 616s > bx <- double(0L) 616s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 616s > stopifnot(inherits(res, "try-error")) 616s > 616s > # One bin boundery (invalid bin definition) 616s > bx <- double(1L) 616s > res <- try(y_smooth <- binCounts(1:10, bx = bx), silent = TRUE) 616s > stopifnot(inherits(res, "try-error")) 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: aarch64-unknown-linux-gnu 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 > # Local functions 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > binCounts_hist <- function(x, bx, right = FALSE, ...) { 616s + n0 <- graphics::hist(x, breaks = bx, right = right, 616s + include.lowest = TRUE, plot = FALSE)$counts 616s + } 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Subsetted tests 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > source("utils/validateIndicesFramework.R") 616s > x <- runif(6, min = -6, max = 6) 616s > storage.mode(x) <- "integer" 616s > bx <- c(-6, 0, 3, 4, 10) 616s > for (idxs in index_cases) { 616s + validateIndicesTestVector(x, idxs, 616s + ftest = binCounts, fsure = binCounts_hist, 616s + bx = bx, right = FALSE) 616s + validateIndicesTestVector(x, idxs, 616s + ftest = binCounts, fsure = binCounts_hist, 616s + bx = bx, right = TRUE) 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: aarch64-unknown-linux-gnu 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 > library("stats") 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Naive R implementation of binMeans() 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 616s + n_smooth <- length(bx) - 1L 616s + res <- double(n_smooth) 616s + counts <- rep(NaN, times = n_smooth) 616s + 616s + if (na.rm) { 616s + keep <- !is.na(x) & !is.na(y) 616s + x <- x[keep] 616s + y <- y[keep] 616s + } 616s + 616s + # For each bin... 616s + for (kk in seq_len(n_smooth)) { 616s + if (right) { 616s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 616s + } else { 616s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 616s + } 616s + y_kk <- y[idxs] 616s + res[kk] <- mean(y_kk) 616s + counts[kk] <- length(idxs) 616s + } # for (kk ...) 616s + 616s + if (count) attr(res, "count") <- counts 616s + res 616s + } 616s > 616s > 616s > 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > # Case #1 616s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 616s > x <- 1:100 616s > nx <- length(x) 616s > y <- double(nx) 616s > y[1:25] <- 5 616s > y[51:75] <- -5 616s > y <- y + rnorm(nx) 616s > 616s > # Bins 616s > bx <- c(0.5, 25.5, 50.5, 75.5, 100.5) 616s > 616s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 617s > y_smooth <- binMeans(y, x = x, bx = bx) 617s > n_smooth <- binCounts(x, bx = bx) 617s > # Sanity check 617s > stopifnot(all.equal(y_smooth, y_smooth0)) 617s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 617s > 617s > y_smooth0r <- rev(binMeans0(y, x = -x, bx = rev(-bx), 617s + count = FALSE, right = TRUE)) 617s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx), 617s + count = FALSE, right = TRUE)) 617s > # Sanity check 617s > stopifnot(all.equal(y_smooth0r, y_smooth0, check.attributes = FALSE)) 617s > stopifnot(all.equal(y_smoothr, y_smooth0r)) 617s > 617s > 617s > # Integer input 617s > y <- as.integer(y) 617s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 617s > y_smooth <- binMeans(y, x = x, bx = bx) 617s > n_smooth <- binCounts(x, bx = bx) 617s > # Sanity check 617s > stopifnot(is.integer(y), 617s + all.equal(y_smooth, y_smooth0), 617s + all.equal(attr(y_smooth, "count"), n_smooth)) 617s > 617s > # Logical input 617s > y <- as.logical(y) 617s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 617s > y_smooth <- binMeans(y, x = x, bx = bx) 617s > n_smooth <- binCounts(x, bx = bx) 617s > # Sanity check 617s > stopifnot(is.logical(y), 617s + all.equal(y_smooth, y_smooth0), 617s + all.equal(attr(y_smooth, "count"), n_smooth)) 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Case #2 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > nx <- 1e3 617s > x <- runif(nx) 617s > y <- runif(nx) 617s > 617s > nb <- 10 617s > bx <- do.call(seq, c(as.list(range(x)), length.out = nb)) 617s > bx1 <- c(bx[-1], bx[nb] + 1) 617s > 617s > y_smooth0 <- binMeans0(y, x = x, bx = bx1) 617s > y_smooth <- binMeans(y, x = x, bx = bx1) 617s > n_smooth <- binCounts(x, bx = bx1) 617s > y_smoothr <- rev(binMeans(y, x = -x, bx = rev(-bx1), right = TRUE)) 617s > 617s > # Sanity check 617s > stopifnot(all.equal(y_smooth, y_smooth0)) 617s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 617s > stopifnot(all.equal(y_smoothr, y_smooth, check.attributes = FALSE)) 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Empty bins 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > x <- c(6:8, 16:19) 617s > nx <- length(x) 617s > y <- runif(nx) 617s > bx <- c(0, 5, 10, 15, 20, 25) 617s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 617s > y_smooth <- binMeans(y, x = x, bx = bx) 617s > n_smooth <- binCounts(x, bx = bx) 617s > stopifnot(all.equal(attr(y_smooth, "count"), n_smooth)) 617s > stopifnot(all.equal(y_smooth, y_smooth0)) 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Missing values 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > x <- 1:100 617s > x[50] <- NA_integer_ 617s > nx <- length(x) 617s > y <- double(nx) 617s > y[1:25] <- 5 617s > y[51:75] <- -5 617s > y[82:92] <- NA_real_ 617s > y <- y + rnorm(nx) 617s > 617s > # Bins 617s > bx <- c(0.5, 25.5, 75.5, 82.5, 100.5) 617s > 617s > y_smooth0 <- binMeans0(y, x = x, bx = bx) 617s > y_smooth <- binMeans(y, x = x, bx = bx) 617s > # Sanity check 617s > stopifnot(all.equal(y_smooth, y_smooth0)) 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Exception handling 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Zero bin bounderies (invalid bin definition) 617s > bx <- double(0L) 617s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 617s > stopifnot(inherits(res, "try-error")) 617s > 617s > # One bin boundery (invalid bin definition) 617s > bx <- double(1L) 617s > res <- try(y_smooth <- binMeans(x = 1:5, y = 1:5, bx = bx), silent = TRUE) 617s > stopifnot(inherits(res, "try-error")) 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: aarch64-unknown-linux-gnu 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 > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Naive R implementation of binMeans() 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > binMeans0 <- function(y, x, bx, na.rm = TRUE, count = TRUE, right = FALSE) { 617s + n_smooth <- length(bx) - 1L 617s + res <- double(n_smooth) 617s + counts <- rep(NaN, times = n_smooth) 617s + 617s + if (na.rm) { 617s + keep <- !is.na(x) & !is.na(y) 617s + x <- x[keep] 617s + y <- y[keep] 617s + } 617s + 617s + # For each bin... 617s + for (kk in seq_len(n_smooth)) { 617s + if (right) { 617s + idxs <- which(bx[kk] < x & x <= bx[kk + 1L]) 617s + } else { 617s + idxs <- which(bx[kk] <= x & x < bx[kk + 1L]) 617s + } 617s + y_kk <- y[idxs] 617s + res[kk] <- mean(y_kk) 617s + counts[kk] <- length(idxs) 617s + } # for (kk ...) 617s + 617s + if (count) attr(res, "count") <- counts 617s + res 617s + } 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Subsetted tests 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > source("utils/validateIndicesFramework.R") 617s > y <- runif(6, min = -6, max = 6) 617s > x <- runif(6, min = -6, max = 6) 617s > storage.mode(x) <- "integer" 617s > bx <- c(-6, 0, 3, 4, 10) 617s > for (idxs in index_cases) { 617s + for (na.rm in c(TRUE, FALSE)) { 617s + validateIndicesTestVector_w(y, x, idxs, 617s + ftest = binMeans, fsure = binMeans0, 617s + bx = bx, na.rm = na.rm, 617s + count = TRUE, right = FALSE) 617s + validateIndicesTestVector_w(y, x, idxs, 617s + ftest = binMeans, fsure = binMeans0, 617s + bx = bx, na.rm = na.rm, 617s + count = TRUE, right = TRUE) 617s + } 617s + } 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: aarch64-unknown-linux-gnu 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 > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 617s + if (is.na(value)) { 617s + counts <- sum(is.na(x)) 617s + } else { 617s + counts <- sum(x == value, na.rm = na.rm) 617s + } 617s + as.integer(counts) 617s + } 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Data type: integer and numeric 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > for (mode in c("integer", "double")) { 617s + x <- runif(20 * 5, min = -3, max = 3) 617s + x[sample.int(length(x), size = 7)] <- 0 617s + storage.mode(x) <- mode 617s + 617s + for (na.rm in c(FALSE, TRUE)) { 617s + # Count zeros 617s + n0 <- count_R(x, value = 0, na.rm = na.rm) 617s + n1 <- count(x, value = 0, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + all <- allValue(x, value = 0, na.rm = na.rm) 617s + any <- anyValue(x, value = 0, na.rm = na.rm) 617s + 617s + # Count NAs 617s + n0 <- count_R(x, value = NA, na.rm = na.rm) 617s + n1 <- count(x, value = NA, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + all <- allValue(x, value = NA, na.rm = na.rm) 617s + any <- anyValue(x, value = NA, na.rm = na.rm) 617s + 617s + if (mode == "integer") { 617s + ux <- unique(as.vector(x)) 617s + n0 <- n1 <- integer(length(x)) 617s + for (value in ux) { 617s + n0 <- n0 + count_R(x, value = value, na.rm = na.rm) 617s + n1 <- n1 + count(x, value = value, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + } 617s + stopifnot(all(n0 == ncol(x))) 617s + } # if (mode == "integer") 617s + 617s + } # for (na.rm ...) 617s + } # for (mode ...) 617s > 617s > # All NAs 617s > na_list <- list(NA_integer_, NA_real_, NaN) 617s > for (na_value in na_list) { 617s + x <- rep(na_value, times = 10L) 617s + for (na.rm in c(FALSE, TRUE)) { 617s + n0 <- count_R(x, na.rm = na.rm) 617s + n1 <- count(x, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + 617s + # Count NAs 617s + n0 <- count_R(x, value = NA, na.rm = na.rm) 617s + n1 <- count(x, value = NA, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + any <- anyValue(x, value = NA, na.rm = na.rm) 617s + all <- allValue(x, value = NA, na.rm = na.rm) 617s + stopifnot(any) 617s + stopifnot(all) 617s + } 617s + } # for (na_value ...) 617s > 617s > 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > # Data type: logical 617s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 617s > x <- logical(length = 10L) 617s > x[3:7] <- TRUE 617s > 617s > # Row/column counts 617s > for (na.rm in c(FALSE, TRUE)) { 617s + n0 <- count_R(x, na.rm = na.rm) 617s + n1 <- count(x, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + 617s + n_true <- count(x, value = TRUE, na.rm = na.rm) 617s + n_false <- count(x, value = FALSE, na.rm = na.rm) 617s + stopifnot(n_true + n_false == ncol(x)) 617s + 617s + # Count NAs 617s + n0 <- count_R(x, value = NA, na.rm = na.rm) 617s + n1 <- count(x, value = NA, na.rm = na.rm) 617s + stopifnot(identical(n1, n0)) 617s + } 617s > 618s 618s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 618s Copyright (C) 2024 The R Foundation for Statistical Computing 618s Platform: aarch64-unknown-linux-gnu 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 > count_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 618s + if (is.na(value)) { 618s + counts <- sum(is.na(x)) 618s + } else { 618s + counts <- sum(x == value, na.rm = na.rm) 618s + } 618s + as.integer(counts) 618s + } 618s > 618s > 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > # Subsetted tests 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > source("utils/validateIndicesFramework.R") 618s > x <- runif(6, min = -3, max = 3) 618s > storage.mode(x) <- "integer" 618s > for (idxs in index_cases) { 618s + validateIndicesTestVector(x, idxs, 618s + ftest = count, fsure = count_R, 618s + value = 0, na.rm = TRUE) 618s + validateIndicesTestVector(x, idxs, 618s + ftest = count, fsure = count_R, 618s + value = 0, na.rm = FALSE) 618s + validateIndicesTestVector(x, idxs, 618s + ftest = count, fsure = count_R, 618s + value = NA_integer_) 618s + } 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: aarch64-unknown-linux-gnu 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 > diff2_R <- function(..., useNames = NA){ 618s + res <- diff(...) 618s + if (is.na(useNames) || !useNames) names(res) <- NULL 618s + res 618s + } 618s > 618s > set.seed(0x42) 618s > 618s > for (mode in c("integer", "double")) { 618s + x <- rnorm(10, sd = 5) 618s + storage.mode(x) <- mode 618s + str(x) 618s + 618s + for (has_na in c(FALSE, TRUE)) { 618s + for (setNames in c(TRUE, FALSE)) { 618s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 618s + if (has_na) { 618s + x[sample(1:10, size = 3)] <- NA 618s + } 618s + if (setNames) { 618s + names(x) <- LETTERS[1:10] 618s + } 618s + for (l in 1:3) { 618s + for (d in 1:4) { 618s + cat(sprintf("%s: NAs = %s, lag = %d, differences = %d, setNames = %d, useNames = %d\n", 618s + mode, has_na, l, d, setNames, useNames)) 618s + y0 <- diff2_R(x, lag = l, differences = d, useNames = useNames) 618s + str(y0) 618s + y1 <- diff2(x, lag = l, differences = d, useNames = useNames) 618s + str(y1) 618s + stopifnot(identical(y1, y0)) 618s + } 618s + } 618s + } 618s + } 618s + } # for (has_na ...) 618s + } 618s int [1:10] 11 1 2 0 -1 -3 -3 6 0 0 618s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 618s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 618s Named int [1:8] 11 -3 1 -1 2 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] 11 -3 1 -1 2 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 618s Named int [1:7] -14 4 -2 3 7 -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] -14 4 -2 3 7 -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 618s Named int [1:6] 18 -6 5 4 -31 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] 18 -6 5 4 -31 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 618s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 618s Named int [1:6] 6 -2 1 12 5 -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] 6 -2 1 12 5 -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 618s Named int [1:4] -5 14 4 -27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] -5 14 4 -27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 618s Named int [1:2] 9 -41 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named int [1:2] 9 -41 618s - attr(*, "names")= chr [1:2] "I" "J" 618s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 618s Named int [1:7] -11 -2 -5 -3 7 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] -11 -2 -5 -3 7 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 618s Named int [1:4] 8 9 8 6 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] 8 9 8 6 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 618s Named int -2 618s - attr(*, "names")= chr "J" 618s Named int -2 618s - attr(*, "names")= chr "J" 618s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 618s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 618s int [1:8] 11 -3 1 -1 2 9 -15 6 618s int [1:8] 11 -3 1 -1 2 9 -15 6 618s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 618s int [1:7] -14 4 -2 3 7 -24 21 618s int [1:7] -14 4 -2 3 7 -24 21 618s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 618s int [1:6] 18 -6 5 4 -31 45 618s int [1:6] 18 -6 5 4 -31 45 618s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 618s int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 618s int [1:6] 6 -2 1 12 5 -15 618s int [1:6] 6 -2 1 12 5 -15 618s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 618s int [1:4] -5 14 4 -27 618s int [1:4] -5 14 4 -27 618s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 618s int [1:2] 9 -41 618s int [1:2] 9 -41 618s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 618s int [1:7] -11 -2 -5 -3 7 3 3 618s int [1:7] -11 -2 -5 -3 7 3 3 618s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 618s int [1:4] 8 9 8 6 618s int [1:4] 8 9 8 6 618s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 618s int -2 618s int -2 618s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 618s int(0) 618s int(0) 618s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 618s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 618s Named int [1:8] 11 -3 1 -1 2 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] 11 -3 1 -1 2 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 618s Named int [1:7] -14 4 -2 3 7 -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] -14 4 -2 3 7 -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 618s Named int [1:6] 18 -6 5 4 -31 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] 18 -6 5 4 -31 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 618s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 618s Named int [1:6] 6 -2 1 12 5 -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] 6 -2 1 12 5 -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 618s Named int [1:4] -5 14 4 -27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] -5 14 4 -27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 618s Named int [1:2] 9 -41 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named int [1:2] 9 -41 618s - attr(*, "names")= chr [1:2] "I" "J" 618s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 618s Named int [1:7] -11 -2 -5 -3 7 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] -11 -2 -5 -3 7 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 618s Named int [1:4] 8 9 8 6 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] 8 9 8 6 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 618s Named int -2 618s - attr(*, "names")= chr "J" 618s Named int -2 618s - attr(*, "names")= chr "J" 618s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s integer: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 618s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s int [1:9] -10 1 -2 -1 -2 0 9 -6 0 618s integer: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 618s int [1:8] 11 -3 1 -1 2 9 -15 6 618s int [1:8] 11 -3 1 -1 2 9 -15 6 618s integer: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 618s int [1:7] -14 4 -2 3 7 -24 21 618s int [1:7] -14 4 -2 3 7 -24 21 618s integer: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 618s int [1:6] 18 -6 5 4 -31 45 618s int [1:6] 18 -6 5 4 -31 45 618s integer: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 618s int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s int [1:8] -9 -1 -3 -3 -2 9 3 -6 618s integer: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 618s int [1:6] 6 -2 1 12 5 -15 618s int [1:6] 6 -2 1 12 5 -15 618s integer: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 618s int [1:4] -5 14 4 -27 618s int [1:4] -5 14 4 -27 618s integer: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 618s int [1:2] 9 -41 618s int [1:2] 9 -41 618s integer: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 618s int [1:7] -11 -2 -5 -3 7 3 3 618s int [1:7] -11 -2 -5 -3 7 3 3 618s integer: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 618s int [1:4] 8 9 8 6 618s int [1:4] 8 9 8 6 618s integer: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 618s int -2 618s int -2 618s integer: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 618s int(0) 618s int(0) 618s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 618s Named int [1:9] NA NA NA NA NA 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named int [1:9] NA NA NA NA NA 0 9 -6 0 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 618s Named int [1:8] NA NA NA NA NA 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] NA NA NA NA NA 9 -15 6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 618s Named int [1:7] NA NA NA NA NA -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] NA NA NA NA NA -24 21 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 618s Named int [1:6] NA NA NA NA NA 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] NA NA NA NA NA 45 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 618s Named int [1:8] -9 NA NA NA NA 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] -9 NA NA NA NA 9 3 -6 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 618s Named int [1:6] NA NA NA NA NA -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] NA NA NA NA NA -15 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 618s Named int [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named int [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 618s Named int [1:7] NA NA -5 NA NA 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] NA NA -5 NA NA 3 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 618s Named int [1:4] NA NA 8 NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] NA NA 8 NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 618s Named int NA 618s - attr(*, "names")= chr "J" 618s Named int NA 618s - attr(*, "names")= chr "J" 618s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 618s int [1:9] NA NA NA NA NA 0 9 NA NA 618s int [1:9] NA NA NA NA NA 0 9 NA NA 618s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 618s int [1:8] NA NA NA NA NA 9 NA NA 618s int [1:8] NA NA NA NA NA 9 NA NA 618s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 618s int [1:7] NA NA NA NA NA NA NA 618s int [1:7] NA NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 618s int [1:6] NA NA NA NA NA NA 618s int [1:6] NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 618s int [1:8] NA NA NA NA NA 9 NA -6 618s int [1:8] NA NA NA NA NA 9 NA -6 618s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 618s int [1:6] NA NA NA NA NA -15 618s int [1:6] NA NA NA NA NA -15 618s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 618s int [1:4] NA NA NA NA 618s int [1:4] NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 618s int [1:2] NA NA 618s int [1:2] NA NA 618s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 618s int [1:7] NA NA NA NA NA NA 3 618s int [1:7] NA NA NA NA NA NA 3 618s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 618s int [1:4] NA NA NA NA 618s int [1:4] NA NA NA NA 618s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 618s int NA 618s int NA 618s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 618s int(0) 618s int(0) 618s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 618s Named int [1:9] NA NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named int [1:9] NA NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 618s Named int [1:8] NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 618s Named int [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 618s Named int [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 618s Named int [1:8] NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named int [1:8] NA NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 618s Named int [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named int [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 618s Named int [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named int [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 618s Named int [1:7] NA NA NA NA NA NA 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named int [1:7] NA NA NA NA NA NA 3 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named int [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 618s Named int NA 618s - attr(*, "names")= chr "J" 618s Named int NA 618s - attr(*, "names")= chr "J" 618s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s Named int(0) 618s - attr(*, "names")= chr(0) 618s integer: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 618s int [1:9] NA NA NA NA NA NA NA NA NA 618s int [1:9] NA NA NA NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 618s int [1:8] NA NA NA NA NA NA NA NA 618s int [1:8] NA NA NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 618s int [1:7] NA NA NA NA NA NA NA 618s int [1:7] NA NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 618s int [1:6] NA NA NA NA NA NA 618s int [1:6] NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 618s int [1:8] NA NA NA NA NA NA NA NA 618s int [1:8] NA NA NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 618s int [1:6] NA NA NA NA NA NA 618s int [1:6] NA NA NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 618s int [1:4] NA NA NA NA 618s int [1:4] NA NA NA NA 618s integer: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 618s int [1:2] NA NA 618s int [1:2] NA NA 618s integer: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 618s int [1:7] NA NA NA NA NA NA 3 618s int [1:7] NA NA NA NA NA NA 3 618s integer: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 618s int [1:4] NA NA NA NA 618s int [1:4] NA NA NA NA 618s integer: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 618s int NA 618s int NA 618s integer: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 618s int(0) 618s int(0) 618s num [1:10] 2.586 -0.344 0.33 9.155 -3.254 ... 618s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 1 618s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 1 618s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 1 618s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 1 618s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 1 618s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 1 618s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 1 618s Named num [1:4] 0.368 42.988 15.396 -29.313 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] 0.368 42.988 15.396 -29.313 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 1 618s Named num [1:2] 15 -72.3 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named num [1:2] 15 -72.3 618s - attr(*, "names")= chr [1:2] "I" "J" 618s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 1 618s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 1 618s Named num [1:4] -23.52 7.92 11.38 23.27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] -23.52 7.92 11.38 23.27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 1 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 1 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s double: NAs = FALSE, lag = 1, differences = 1, setNames = 1, useNames = 0 618s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s double: NAs = FALSE, lag = 1, differences = 2, setNames = 1, useNames = 0 618s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s double: NAs = FALSE, lag = 1, differences = 3, setNames = 1, useNames = 0 618s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s double: NAs = FALSE, lag = 1, differences = 4, setNames = 1, useNames = 0 618s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s double: NAs = FALSE, lag = 2, differences = 1, setNames = 1, useNames = 0 618s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s double: NAs = FALSE, lag = 2, differences = 2, setNames = 1, useNames = 0 618s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s double: NAs = FALSE, lag = 2, differences = 3, setNames = 1, useNames = 0 618s num [1:4] 0.368 42.988 15.396 -29.313 618s num [1:4] 0.368 42.988 15.396 -29.313 618s double: NAs = FALSE, lag = 2, differences = 4, setNames = 1, useNames = 0 618s num [1:2] 15 -72.3 618s num [1:2] 15 -72.3 618s double: NAs = FALSE, lag = 3, differences = 1, setNames = 1, useNames = 0 618s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s double: NAs = FALSE, lag = 3, differences = 2, setNames = 1, useNames = 0 618s num [1:4] -23.52 7.92 11.38 23.27 618s num [1:4] -23.52 7.92 11.38 23.27 618s double: NAs = FALSE, lag = 3, differences = 3, setNames = 1, useNames = 0 618s num 46.8 618s num 46.8 618s double: NAs = FALSE, lag = 3, differences = 4, setNames = 1, useNames = 0 618s num(0) 618s num(0) 618s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 1 618s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 1 618s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 1 618s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 1 618s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 1 618s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 1 618s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 1 618s Named num [1:4] 0.368 42.988 15.396 -29.313 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] 0.368 42.988 15.396 -29.313 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 1 618s Named num [1:2] 15 -72.3 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named num [1:2] 15 -72.3 618s - attr(*, "names")= chr [1:2] "I" "J" 618s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 1 618s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 1 618s Named num [1:4] -23.52 7.92 11.38 23.27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] -23.52 7.92 11.38 23.27 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 1 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 1 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s double: NAs = FALSE, lag = 1, differences = 1, setNames = 0, useNames = 0 618s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s num [1:9] -2.929 0.673 8.826 -12.409 -1.221 ... 618s double: NAs = FALSE, lag = 1, differences = 2, setNames = 0, useNames = 0 618s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s num [1:8] 3.6 8.15 -21.23 11.19 -2.1 ... 618s double: NAs = FALSE, lag = 1, differences = 3, setNames = 0, useNames = 0 618s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s num [1:7] 4.55 -29.39 32.42 -13.29 14.97 ... 618s double: NAs = FALSE, lag = 1, differences = 4, setNames = 0, useNames = 0 618s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s num [1:6] -33.9 61.8 -45.7 28.3 -37 ... 618s double: NAs = FALSE, lag = 2, differences = 1, setNames = 0, useNames = 0 618s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s num [1:8] -2.26 9.5 -3.58 -13.63 -4.54 ... 618s double: NAs = FALSE, lag = 2, differences = 2, setNames = 0, useNames = 0 618s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s num [1:6] -1.33 -23.13 -0.96 19.86 14.44 ... 618s double: NAs = FALSE, lag = 2, differences = 3, setNames = 0, useNames = 0 618s num [1:4] 0.368 42.988 15.396 -29.313 618s num [1:4] 0.368 42.988 15.396 -29.313 618s double: NAs = FALSE, lag = 2, differences = 4, setNames = 0, useNames = 0 618s num [1:2] 15 -72.3 618s num [1:2] 15 -72.3 618s double: NAs = FALSE, lag = 3, differences = 1, setNames = 0, useNames = 0 618s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s num [1:7] 6.57 -2.91 -4.81 -16.95 5.01 ... 618s double: NAs = FALSE, lag = 3, differences = 2, setNames = 0, useNames = 0 618s num [1:4] -23.52 7.92 11.38 23.27 618s num [1:4] -23.52 7.92 11.38 23.27 618s double: NAs = FALSE, lag = 3, differences = 3, setNames = 0, useNames = 0 618s num 46.8 618s num 46.8 618s double: NAs = FALSE, lag = 3, differences = 4, setNames = 0, useNames = 0 618s num(0) 618s num(0) 618s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 1 618s Named num [1:9] -2.929 0.673 8.826 NA NA ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named num [1:9] -2.929 0.673 8.826 NA NA ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 1 618s Named num [1:8] 3.6 8.15 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] 3.6 8.15 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 1 618s Named num [1:7] 4.55 NA NA NA NA ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 4.55 NA NA NA NA ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 1 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 1 618s Named num [1:8] -2.26 9.5 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] -2.26 9.5 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 1 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 1 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 1 618s Named num [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named num [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 1 618s Named num [1:7] 6.57 NA NA -16.95 NA ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] 6.57 NA NA -16.95 NA ... 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 1 618s Named num [1:4] -23.5 NA NA 23.3 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] -23.5 NA NA 23.3 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 1 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s Named num 46.8 618s - attr(*, "names")= chr "J" 618s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 1 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s double: NAs = TRUE, lag = 1, differences = 1, setNames = 1, useNames = 0 618s num [1:9] NA 0.673 8.826 NA NA ... 618s num [1:9] NA 0.673 8.826 NA NA ... 618s double: NAs = TRUE, lag = 1, differences = 2, setNames = 1, useNames = 0 618s num [1:8] NA 8.15 NA NA NA ... 618s num [1:8] NA 8.15 NA NA NA ... 618s double: NAs = TRUE, lag = 1, differences = 3, setNames = 1, useNames = 0 618s num [1:7] NA NA NA NA NA NA NA 618s num [1:7] NA NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 1, differences = 4, setNames = 1, useNames = 0 618s num [1:6] NA NA NA NA NA NA 618s num [1:6] NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 1, setNames = 1, useNames = 0 618s num [1:8] NA 9.5 NA NA NA ... 618s num [1:8] NA 9.5 NA NA NA ... 618s double: NAs = TRUE, lag = 2, differences = 2, setNames = 1, useNames = 0 618s num [1:6] NA NA NA NA NA NA 618s num [1:6] NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 3, setNames = 1, useNames = 0 618s num [1:4] NA NA NA NA 618s num [1:4] NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 4, setNames = 1, useNames = 0 618s num [1:2] NA NA 618s num [1:2] NA NA 618s double: NAs = TRUE, lag = 3, differences = 1, setNames = 1, useNames = 0 618s num [1:7] NA NA NA NA NA NA NA 618s num [1:7] NA NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 3, differences = 2, setNames = 1, useNames = 0 618s num [1:4] NA NA NA NA 618s num [1:4] NA NA NA NA 618s double: NAs = TRUE, lag = 3, differences = 3, setNames = 1, useNames = 0 618s num NA 618s num NA 618s double: NAs = TRUE, lag = 3, differences = 4, setNames = 1, useNames = 0 618s num(0) 618s num(0) 618s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 1 618s Named num [1:9] NA 0.673 8.826 NA NA ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s Named num [1:9] NA 0.673 8.826 NA NA ... 618s - attr(*, "names")= chr [1:9] "B" "C" "D" "E" ... 618s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 1 618s Named num [1:8] NA 8.15 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] NA 8.15 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 1 618s Named num [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 1 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 1 618s Named num [1:8] NA 9.5 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s Named num [1:8] NA 9.5 NA NA NA ... 618s - attr(*, "names")= chr [1:8] "C" "D" "E" "F" ... 618s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 1 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s Named num [1:6] NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:6] "E" "F" "G" "H" ... 618s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 1 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 1 618s Named num [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s Named num [1:2] NA NA 618s - attr(*, "names")= chr [1:2] "I" "J" 618s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 1 618s Named num [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s Named num [1:7] NA NA NA NA NA NA NA 618s - attr(*, "names")= chr [1:7] "D" "E" "F" "G" ... 618s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 1 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s Named num [1:4] NA NA NA NA 618s - attr(*, "names")= chr [1:4] "G" "H" "I" "J" 618s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 1 618s Named num NA 618s - attr(*, "names")= chr "J" 618s Named num NA 618s - attr(*, "names")= chr "J" 618s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 1 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s Named num(0) 618s - attr(*, "names")= chr(0) 618s double: NAs = TRUE, lag = 1, differences = 1, setNames = 0, useNames = 0 618s num [1:9] NA 0.673 8.826 NA NA ... 618s num [1:9] NA 0.673 8.826 NA NA ... 618s double: NAs = TRUE, lag = 1, differences = 2, setNames = 0, useNames = 0 618s num [1:8] NA 8.15 NA NA NA ... 618s num [1:8] NA 8.15 NA NA NA ... 618s double: NAs = TRUE, lag = 1, differences = 3, setNames = 0, useNames = 0 618s num [1:7] NA NA NA NA NA NA NA 618s num [1:7] NA NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 1, differences = 4, setNames = 0, useNames = 0 618s num [1:6] NA NA NA NA NA NA 618s num [1:6] NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 1, setNames = 0, useNames = 0 618s num [1:8] NA 9.5 NA NA NA ... 618s num [1:8] NA 9.5 NA NA NA ... 618s double: NAs = TRUE, lag = 2, differences = 2, setNames = 0, useNames = 0 618s num [1:6] NA NA NA NA NA NA 618s num [1:6] NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 3, setNames = 0, useNames = 0 618s num [1:4] NA NA NA NA 618s num [1:4] NA NA NA NA 618s double: NAs = TRUE, lag = 2, differences = 4, setNames = 0, useNames = 0 618s num [1:2] NA NA 618s num [1:2] NA NA 618s double: NAs = TRUE, lag = 3, differences = 1, setNames = 0, useNames = 0 618s num [1:7] NA NA NA NA NA NA NA 618s num [1:7] NA NA NA NA NA NA NA 618s double: NAs = TRUE, lag = 3, differences = 2, setNames = 0, useNames = 0 618s num [1:4] NA NA NA NA 618s num [1:4] NA NA NA NA 618s double: NAs = TRUE, lag = 3, differences = 3, setNames = 0, useNames = 0 618s num NA 618s num NA 618s double: NAs = TRUE, lag = 3, differences = 4, setNames = 0, useNames = 0 618s num(0) 618s num(0) 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: aarch64-unknown-linux-gnu 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 > diff2_R <- function(..., useNames=NA){ 618s + res <- diff(...) 618s + if (is.na(useNames) || !useNames) names(res) <- NULL 618s + res 618s + } 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > # Subsetted tests 618s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 618s > source("utils/validateIndicesFramework.R") 618s > x <- runif(6, min = -6, max = 6) 618s > for (setNames in c(TRUE, FALSE)) { 618s + if (setNames) names(x) <- LETTERS[1:6] 618s + else names(x) <- NULL 618s + for (l in 1:2) { 618s + for (d in 1:2) { 618s + for (idxs in index_cases) { 618s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 618s + validateIndicesTestVector(x, idxs, 618s + ftest = diff2, fsure = diff2_R, 618s + lag = l, differences = d, useNames = useNames) 618s + } 618s + } 618s + } 618s + } 618s + } 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: aarch64-unknown-linux-gnu 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 > indexByRow_R1 <- function(dim, idxs = NULL, ...) { 619s + n <- prod(dim) 619s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 619s + if (!is.null(idxs)) 619s + x <- x[idxs] 619s + as.vector(x) 619s + } 619s > 619s > 619s > indexByRow_R2 <- function(dim, idxs = NULL, ...) { 619s + n <- prod(dim) 619s + if (is.null(idxs)) { 619s + x <- matrix(seq_len(n), nrow = dim[2L], ncol = dim[1L], byrow = TRUE) 619s + as.vector(x) 619s + } else { 619s + idxs <- idxs - 1L 619s + cols <- idxs %/% dim[2L] 619s + rows <- idxs %% dim[2L] 619s + cols + dim[1L] * rows + 1L 619s + } 619s + } 619s > 619s > 619s > dim <- c(5L, 4L) 619s > x <- matrix(NA_integer_, nrow = dim[1L], ncol = dim[2L]) 619s > y <- t(x) 619s > idxs_by_cols <- seq_along(x) 619s > 619s > # Assign by columns 619s > x[idxs_by_cols] <- idxs_by_cols 619s > print(x) 619s [,1] [,2] [,3] [,4] 619s [1,] 1 6 11 16 619s [2,] 2 7 12 17 619s [3,] 3 8 13 18 619s [4,] 4 9 14 19 619s [5,] 5 10 15 20 619s > 619s > # Truth 619s > y0 <- t(x) 619s > idxs_by_rows <- as.vector(y0) 619s > 619s > # Assert 619s > idxs <- indexByRow(dim) 619s > stopifnot(all.equal(idxs, idxs_by_rows)) 619s > y <- x 619s > y[idxs_by_rows] <- idxs 619s > print(y) 619s [,1] [,2] [,3] [,4] 619s [1,] 1 6 11 16 619s [2,] 2 7 12 17 619s [3,] 3 8 13 18 619s [4,] 4 9 14 19 619s [5,] 5 10 15 20 619s > stopifnot(all(as.vector(y) == as.vector(x))) 619s > 619s > idxs_R1 <- indexByRow_R1(dim) 619s > stopifnot(all.equal(idxs_R1, idxs_by_rows)) 619s > 619s > idxs_R2 <- indexByRow_R2(dim) 619s > stopifnot(all.equal(idxs_R2, idxs_by_rows)) 619s > 619s > # Assert 619s > idxs_by_cols <- seq(from = 1, to = length(x), by = 3L) 619s > idxs_by_rows <- as.vector(t(x)[idxs_by_cols]) 619s > 619s > idxs <- indexByRow(dim, idxs = idxs_by_cols) 619s > stopifnot(all(idxs == idxs_by_rows)) 619s > 619s > idxs_R1 <- indexByRow_R1(dim, idxs = idxs_by_cols) 619s > stopifnot(all(idxs_R1 == idxs_by_rows)) 619s > 619s > idxs_R2 <- indexByRow_R2(dim, idxs = idxs_by_cols) 619s > stopifnot(all(idxs_R2 == idxs_by_rows)) 619s > 619s > 619s > ## DEFUNCT: Backward compatibility 619s > res <- tryCatch({ 619s + idxs1 <- indexByRow(x) 619s + }, error = identity) 619s > stopifnot(inherits(res, "error")) 619s > 619s > 619s > ## Exceptions: 619s > ## Too large matrices are not supported, which happens 619s > ## when prod(dim) > .Machine$integer.max 619s > dim_too_large <- c(.Machine$integer.max, 2L) 619s > res <- tryCatch({ 619s + idxs <- indexByRow(dim_too_large, idxs = 1L) 619s + }, error = identity) 619s > stopifnot(inherits(res, "error")) 619s > 619s > ## Non-positive indices are not supported 619s > res <- tryCatch({ 619s + idxs <- indexByRow(c(1,1), idxs = 0L) 619s + }, error = identity) 619s > stopifnot(inherits(res, "error")) 619s > 619s > res <- tryCatch({ 619s + idxs <- indexByRow(c(1,1), idxs = -1L) 619s + }, error = identity) 619s > stopifnot(inherits(res, "error")) 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: aarch64-unknown-linux-gnu 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 > library("stats") 619s > 619s > logSumExp_R <- function(lx, na.rm = FALSE) { 619s + log(sum(exp(lx), na.rm = na.rm)) 619s + } 619s > 619s > ## R-help thread \emph{'[R] Beyond double-precision?'} on May 9, 2009. 619s > 619s > for (mode in c("integer", "double")) { 619s + cat("mode: ", mode, "\n", sep = "") 619s + 619s + set.seed(1) 619s + x <- runif(20, min = 1.0, max = 3.0) 619s + storage.mode(x) <- mode 619s + str(x) 619s + 619s + ## The logarithm of the harmonic mean 619s + y0 <- log(1 / mean(1 / x)) 619s + print(y0) ## -1.600885 619s + 619s + lx <- log(x) 619s + y1 <- log(length(x)) - logSumExp(-lx) 619s + print(y1) ## [1] -1.600885 619s + 619s + # Sanity check 619s + stopifnot(all.equal(y1, y0)) 619s + 619s + y2 <- log(length(x)) - logSumExp_R(-lx) 619s + # Sanity check 619s + stopifnot(all.equal(y2, y0)) 619s + } # for (mode ...) 619s mode: integer 619s int [1:20] 1 1 2 2 1 2 2 2 2 1 ... 619s [1] 0.3215836 619s [1] 0.3215836 619s mode: double 619s num [1:20] 1.53 1.74 2.15 2.82 1.4 ... 619s [1] 0.6673156 619s [1] 0.6673156 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Missing values 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > ## NA values 619s > lx <- c(1, 2, 3) 619s > lx[2] <- NA_real_ 619s > y0 <- logSumExp_R(lx, na.rm = FALSE) 619s > y <- logSumExp(lx, na.rm = FALSE) 619s > print(y) 619s [1] NA 619s > stopifnot(identical(y, NA_real_)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > y0 <- logSumExp_R(lx, na.rm = TRUE) 619s > y <- logSumExp(lx, na.rm = TRUE) 619s > print(y) 619s [1] 3.126928 619s > stopifnot(all.equal(y, y0)) 619s > 619s > ## NaN values 619s > lx <- c(1, 2, 3) 619s > lx[2] <- NaN 619s > y0 <- logSumExp_R(lx, na.rm = FALSE) 619s > y <- logSumExp(lx, na.rm = FALSE) 619s > print(y) 619s [1] NA 619s > stopifnot(identical(y, NA_real_)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > y0 <- logSumExp_R(lx, na.rm = TRUE) 619s > y <- logSumExp(lx, na.rm = TRUE) 619s > print(y) 619s [1] 3.126928 619s > stopifnot(all.equal(y, y0)) 619s > 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Corner cases 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > ## Zero-length vectors 619s > lx <- numeric(0L) 619s > y0 <- logSumExp_R(lx) 619s > y <- logSumExp(lx) 619s > print(y) 619s [1] -Inf 619s > stopifnot(identical(y, -Inf)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > ## Vectors of length one 619s > lx <- 1.0 619s > y0 <- logSumExp_R(lx) 619s > y <- logSumExp(lx) 619s > print(y) 619s [1] 1 619s > stopifnot(identical(y, lx)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > lx <- NA_real_ 619s > y0 <- logSumExp_R(lx, na.rm = TRUE) 619s > y <- logSumExp(lx, na.rm = TRUE) 619s > print(y) 619s [1] -Inf 619s > stopifnot(identical(y, -Inf)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > ## All missing values 619s > lx <- c(NA_real_, NA_real_) 619s > y0 <- logSumExp_R(lx, na.rm = TRUE) 619s > y <- logSumExp(lx, na.rm = TRUE) 619s > print(y) 619s [1] -Inf 619s > stopifnot(identical(y, -Inf)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > lx <- c(NA_real_, NA_real_) 619s > y0 <- logSumExp_R(lx, na.rm = FALSE) 619s > y <- logSumExp(lx, na.rm = FALSE) 619s > print(y) 619s [1] NA 619s > stopifnot(identical(y, NA_real_)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > 619s > ## +Inf values 619s > lx <- c(1, 2, +Inf) 619s > y0 <- logSumExp_R(lx) 619s > y <- logSumExp(lx) 619s > print(y) 619s [1] Inf 619s > stopifnot(identical(y, +Inf)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > ## First element is a missing value, cf. PR #33 619s > lx <- c(NA_real_, 1) 619s > y0 <- logSumExp_R(lx) 619s > print(y0) 619s [1] NA 619s > y <- logSumExp(lx, na.rm = FALSE) 619s > print(y) 619s [1] NA 619s > stopifnot(identical(y, NA_real_)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > y0 <- logSumExp_R(lx, na.rm = TRUE) 619s > print(y0) 619s [1] 1 619s > y <- logSumExp(lx, na.rm = TRUE) 619s > print(y) 619s [1] 1 619s > stopifnot(identical(y, 1)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > ## Multiple -Inf values, cf. issue #84 619s > lx <- c(-Inf, -Inf) 619s > y0 <- logSumExp_R(lx) 619s > y <- logSumExp(lx) 619s > print(y) 619s [1] -Inf 619s > stopifnot(identical(y, -Inf)) 619s > stopifnot(all.equal(y, y0)) 619s > 619s > lx <- c(-Inf, 5, -Inf) 619s > y0 <- logSumExp_R(lx) 619s > y <- logSumExp(lx) 619s > print(y) 619s [1] 5 619s > stopifnot(identical(y, 5)) 619s > stopifnot(all.equal(y, y0)) 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: aarch64-unknown-linux-gnu 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 > logSumExp_R <- function(lx, na.rm = FALSE) { 619s + log(sum(exp(lx), na.rm = na.rm)) 619s + } 619s > 619s > 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Subsetted tests 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > source("utils/validateIndicesFramework.R") 619s > x <- runif(6, min = -6, max = 6) 619s > for (idxs in index_cases) { 619s + validateIndicesTestVector(x, idxs, 619s + ftest = logSumExp, fsure = logSumExp_R, 619s + na.rm = FALSE) 619s + validateIndicesTestVector(x, idxs, 619s + ftest = logSumExp, fsure = logSumExp_R, 619s + na.rm = TRUE) 619s + } 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: aarch64-unknown-linux-gnu 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 > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > # Consistency checks 619s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 619s > set.seed(1) 619s > 619s > mean2_R <- function(x, na.rm = FALSE, idxs = NULL) { 619s + if (is.null(idxs)) { 619s + mean(x, na.rm = na.rm) 619s + } else { 619s + mean(x[idxs], na.rm = na.rm) 619s + } 619s + } # mean2_R() 619s > 619s > 619s > cat("Consistency checks:\n") 619s Consistency checks: 619s > for (kk in 1:20) { 619s + cat("Random test #", kk, "\n", sep = "") 619s + 619s + # Simulate data in a matrix of any shape 619s + n <- sample(100L, size = 1L) 619s + x <- rnorm(n, sd = 100) 619s + 619s + # Add NAs? 619s + if ((kk %% 4) %in% c(3, 0)) { 619s + cat("Adding NAs\n") 619s + nna <- sample(n, size = 1L) 619s + na_values <- c(NA_real_, NaN) 619s + t <- sample(na_values, size = nna, replace = TRUE) 619s + x[sample(length(x), size = nna)] <- t 619s + } 619s + 619s + # Integer or double? 619s + if ((kk %% 4) %in% c(2, 0)) { 619s + cat("Coercing to integers\n") 619s + storage.mode(x) <- "integer" 619s + } 619s + 619s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 619s + 619s + # Sum over all 619s + y0 <- mean2_R(x, na.rm = na.rm) 619s + y1 <- mean2(x, na.rm = na.rm) 619s + stopifnot(all.equal(y1, y0)) 619s + 619s + # Sum over subset 619s + nidxs <- sample(n, size = 1L) 619s + idxs <- sample(n, size = nidxs) 619s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 619s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 619s + stopifnot(all.equal(y1, y0)) 619s + 619s + if (storage.mode(x) == "integer") { 619s + storage.mode(x) <- "logical" 619s + 619s + y0 <- mean2_R(x, na.rm = na.rm) 619s + y1 <- mean2(x, na.rm = na.rm) 619s + stopifnot(all.equal(y1, y0)) 619s + 619s + y0 <- mean2_R(x, na.rm = na.rm, idxs = idxs) 619s + y1 <- mean2(x, na.rm = na.rm, idxs = idxs) 619s + stopifnot(all.equal(y1, y0)) 619s + } 619s + } # for (kk ...) 620s Random test #1 620s Random test #2 620s Coercing to integers 620s Random test #3 620s Adding NAs 620s Random test #4 620s Adding NAs 620s Coercing to integers 620s Random test #5 620s Random test #6 620s Coercing to integers 620s Random test #7 620s Adding NAs 620s Random test #8 620s Adding NAs 620s Coercing to integers 620s Random test #9 620s Random test #10 620s Coercing to integers 620s Random test #11 620s Adding NAs 620s Random test #12 620s Adding NAs 620s Coercing to integers 620s Random test #13 620s Random test #14 620s Coercing to integers 620s Random test #15 620s Adding NAs 620s Random test #16 620s Adding NAs 620s Coercing to integers 620s Random test #17 620s Random test #18 620s Coercing to integers 620s Random test #19 620s Adding NAs 620s Random test #20 620s Adding NAs 620s Coercing to integers 620s > 620s > 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > # Special cases 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > for (na.rm in c(FALSE, TRUE)) { 620s + # Averaging over zero elements (integers) 620s + x <- integer(0) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + x <- 1:5 620s + idxs <- integer(0) 620s + s1 <- mean(x[idxs], na.rm = na.rm) 620s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over NA_integer_:s 620s + x <- rep(NA_integer_, times = 5L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + x <- rep(NA_integer_, times = 5L) 620s + idxs <- 1:3 620s + s1 <- mean(x[idxs], na.rm = na.rm) 620s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + 620s + # Averaging over zero elements (doubles) 620s + x <- double(0) 620s + s1 <- mean(x) 620s + s2 <- mean2(x) 620s + stopifnot(identical(s1, s2)) 620s + 620s + x <- as.double(1:10) 620s + idxs <- integer(0) 620s + s1 <- mean(x[idxs]) 620s + s2 <- mean2(x, idxs = idxs) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over NA_real_:s 620s + x <- rep(NA_real_, times = 5L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + x <- rep(NA_real_, times = 5L) 620s + idxs <- 1:3 620s + s1 <- mean(x[idxs], na.rm = na.rm) 620s + s2 <- mean2(x, idxs = idxs, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over -Inf:s 620s + x <- rep(-Inf, times = 3L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over +Inf:s 620s + x <- rep(+Inf, times = 3L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over mix of -Inf:s and +Inf:s 620s + x <- rep(c(-Inf, +Inf), times = 3L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over mix of -Inf:s and +Inf:s and numerics 620s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + stopifnot(identical(s1, s2)) 620s + 620s + # Averaging over mix of NaN, NA, +Inf, and numerics 620s + x <- c(NaN, NA, +Inf, 3.14) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + if (na.rm) { 620s + stopifnot(identical(s2, s1)) 620s + } else { 620s + stopifnot(is.na(s1), is.na(s2)) 620s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 620s + ## returned here (as one would expect). NaN might very well be returned, 620s + ## when both NA and NaN are involved. This is an accepted feature in R, 620s + ## which is documented in help("is.nan"). See also 620s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 620s + ## Thus, we cannot guarantee that s1 is identical to s0. 620s + } 620s + 620s + # Averaging over mix of NaN, NA_real_, +Inf, and numerics 620s + x <- c(NA_real_, NaN, +Inf, 3.14) 620s + s1 <- mean(x, na.rm = na.rm) 620s + s2 <- mean2(x, na.rm = na.rm) 620s + if (na.rm) { 620s + stopifnot(identical(s2, s1)) 620s + } else { 620s + stopifnot(is.na(s1), is.na(s2)) 620s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 620s + ## returned here (as one would expect). NaN might very well be returned, 620s + ## when both NA and NaN are involved. This is an accepted feature in R, 620s + ## which is documented in help("is.nan"). See also 620s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 620s + ## Thus, we cannot guarantee that s1 is identical to s0. 620s + } 620s + } 620s > 620s > 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > # Argument 'idxs' 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > x <- 1:5 620s > idxs_list <- list( 620s + integer = 1:3, 620s + double = as.double(1:3), 620s + logical = (x <= 3) 620s + ) 620s > 620s > for (idxs in idxs_list) { 620s + cat("idxs:\n") 620s + str(idxs) 620s + s1 <- mean(x[idxs], na.rm = TRUE) 620s + s2 <- mean2(x, idxs = idxs, na.rm = TRUE) 620s + stopifnot(identical(s1, s2)) 620s + } 620s idxs: 620s int [1:3] 1 2 3 620s idxs: 620s num [1:3] 1 2 3 620s idxs: 620s logi [1:5] TRUE TRUE TRUE FALSE FALSE 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: aarch64-unknown-linux-gnu 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 > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > # Subsetted tests 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > source("utils/validateIndicesFramework.R") 620s > x <- runif(6, min = -6, max = 6) 620s > storage.mode(x) <- "integer" 620s > for (idxs in index_cases) { 620s + validateIndicesTestVector(x, idxs, 620s + ftest = mean2, fsure = mean, 620s + na.rm = FALSE) 620s + validateIndicesTestVector(x, idxs, 620s + ftest = mean2, fsure = mean, 620s + na.rm = TRUE) 620s + } 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: aarch64-unknown-linux-gnu 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 > for (mode in c("integer", "double")) { 620s + cat("mode: ", mode, "\n", sep = "") 620s + 620s + # Empty vector 620s + x <- 0 620s + storage.mode(x) <- mode 620s + y <- prod(x, na.rm = TRUE) 620s + print(y) 620s + z <- product(x, na.rm = TRUE) 620s + print(z) 620s + stopifnot(all.equal(z, y)) 620s + 620s + # Test negative values 620s + x <- c(1, -4, 2) 620s + storage.mode(x) <- mode 620s + y <- prod(x, na.rm = TRUE) 620s + print(y) 620s + z <- product(x, na.rm = TRUE) 620s + print(z) 620s + stopifnot(all.equal(z, y)) 620s + 620s + # Test missing values 620s + x <- c(1, NA, NaN, 2) 620s + storage.mode(x) <- mode 620s + y <- prod(x, na.rm = TRUE) 620s + print(y) 620s + z <- product(x, na.rm = TRUE) 620s + print(z) 620s + stopifnot(all.equal(z, y)) 620s + 620s + x <- c(1, NA, NaN, 2) 620s + storage.mode(x) <- mode 620s + y <- prod(x, na.rm = FALSE) 620s + print(y) 620s + z <- product(x, na.rm = FALSE) 620s + print(z) 620s + stopifnot(all(is.na(z), is.na(y))) 620s + 620s + x <- c(1, NaN, 2) 620s + storage.mode(x) <- mode 620s + y <- prod(x, na.rm = FALSE) 620s + print(y) 620s + stopifnot(is.na(y)) 620s + z <- product(x, na.rm = FALSE) 620s + print(z) 620s + stopifnot(is.na(z)) 620s + 620s + } # for (mode ...) 620s mode: integer 620s [1] 0 620s [1] 0 620s [1] -8 620s [1] -8 620s [1] 2 620s [1] 2 620s [1] NA 620s [1] NA 620s [1] NA 620s [1] NA 620s mode: double 620s [1] 0 620s [1] 0 620s [1] -8 620s [1] -8 620s [1] 2 620s [1] 2 620s [1] NA 620s [1] NA 620s [1] NaN 620s [1] NA 620s > 620s > 620s > # NAs following 0s 620s > x <- c(0L, NA_integer_) 620s > y <- prod(x, na.rm = FALSE) 620s > print(y) 620s [1] NA 620s > z <- product(x, na.rm = FALSE) 620s > print(z) 620s [1] NA 620s > stopifnot(identical(z, y)) 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: aarch64-unknown-linux-gnu 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 > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > # Subsetted tests 620s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 620s > source("utils/validateIndicesFramework.R") 620s > x <- runif(6, min = -6, max = 6) 620s > storage.mode(x) <- "integer" 620s > for (idxs in index_cases) { 620s + validateIndicesTestVector(x, idxs, 620s + ftest = product, fsure = prod, 620s + na.rm = TRUE) 620s + validateIndicesTestVector(x, idxs, 620s + ftest = product, fsure = prod, 620s + na.rm = FALSE) 620s + } 620s > 621s 621s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 621s Copyright (C) 2024 The R Foundation for Statistical Computing 621s Platform: aarch64-unknown-linux-gnu 621s 621s R is free software and comes with ABSOLUTELY NO WARRANTY. 621s You are welcome to redistribute it under certain conditions. 621s Type 'license()' or 'licence()' for distribution details. 621s 621s R is a collaborative project with many contributors. 621s Type 'contributors()' for more information and 621s 'citation()' on how to cite R or R packages in publications. 621s 621s Type 'demo()' for some demos, 'help()' for on-line help, or 621s 'help.start()' for an HTML browser interface to help. 621s Type 'q()' to quit R. 621s 621s > library("matrixStats") 621s > library("utils") ## utils::str 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # Local functions 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > psortKM_R <- function(x, k, m) { 621s + x <- sort(x) 621s + x[(k - m + 1):k] 621s + } 621s > 621s > psortKM_R2 <- function(x, k, m) { 621s + partial <- (k - m + 1):k 621s + x <- sort.int(x, partial = partial) 621s + x[partial] 621s + } 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # Consistency checks 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > set.seed(1) 621s > 621s > cat("Consistency checks:\n") 621s Consistency checks: 621s > x <- 1:30 621s > x[18:20] <- 20 621s > y <- sample(x) 621s > cat("x:\n") 621s x: 621s > str(x) 621s num [1:30] 1 2 3 4 5 6 7 8 9 10 ... 621s > cat("sample(x):\n") 621s sample(x): 621s > str(y) 621s num [1:30] 25 4 7 1 2 23 11 14 20 20 ... 621s > 621s > for (k in c(1L, 2L, 20L, 21L, length(x))) { 621s + for (m in 1:min(5L, k)) { 621s + px0 <- psortKM_R(x, k = k, m = m) 621s + px0b <- psortKM_R2(x, k = k, m = m) 621s + stopifnot(identical(px0b, px0)) 621s + px1 <- matrixStats:::.psortKM(x, k = k, m = m) 621s + cat(sprintf(".psortKM(x, k = %d, m = %d):\n", k, m)) 621s + print(px1) 621s + stopifnot(identical(px1, px0)) 621s + 621s + py0 <- psortKM_R(y, k = k, m = m) 621s + py0b <- psortKM_R2(y, k = k, m = m) 621s + stopifnot(identical(py0b, py0)) 621s + py1 <- matrixStats:::.psortKM(y, k = k, m = m) 621s + cat(sprintf(".psortKM(y, k = %d, m = %d):\n", k, m)) 621s + print(py1) 621s + stopifnot(identical(py1, py0)) 621s + stopifnot(identical(py1, px1)) 621s + } # for (m ...) 621s + } # for (k ...) 621s .psortKM(x, k = 1, m = 1): 621s [1] 1 621s .psortKM(y, k = 1, m = 1): 621s [1] 1 621s .psortKM(x, k = 2, m = 1): 621s [1] 2 621s .psortKM(y, k = 2, m = 1): 621s [1] 2 621s .psortKM(x, k = 2, m = 2): 621s [1] 1 2 621s .psortKM(y, k = 2, m = 2): 621s [1] 1 2 621s .psortKM(x, k = 20, m = 1): 621s [1] 20 621s .psortKM(y, k = 20, m = 1): 621s [1] 20 621s .psortKM(x, k = 20, m = 2): 621s [1] 20 20 621s .psortKM(y, k = 20, m = 2): 621s [1] 20 20 621s .psortKM(x, k = 20, m = 3): 621s [1] 20 20 20 621s .psortKM(y, k = 20, m = 3): 621s [1] 20 20 20 621s .psortKM(x, k = 20, m = 4): 621s [1] 17 20 20 20 621s .psortKM(y, k = 20, m = 4): 621s [1] 17 20 20 20 621s .psortKM(x, k = 20, m = 5): 621s [1] 16 17 20 20 20 621s .psortKM(y, k = 20, m = 5): 621s [1] 16 17 20 20 20 621s .psortKM(x, k = 21, m = 1): 621s [1] 21 621s .psortKM(y, k = 21, m = 1): 621s [1] 21 621s .psortKM(x, k = 21, m = 2): 621s [1] 20 21 621s .psortKM(y, k = 21, m = 2): 621s [1] 20 21 621s .psortKM(x, k = 21, m = 3): 621s [1] 20 20 21 621s .psortKM(y, k = 21, m = 3): 621s [1] 20 20 21 621s .psortKM(x, k = 21, m = 4): 621s [1] 20 20 20 21 621s .psortKM(y, k = 21, m = 4): 621s [1] 20 20 20 21 621s .psortKM(x, k = 21, m = 5): 621s [1] 17 20 20 20 21 621s .psortKM(y, k = 21, m = 5): 621s [1] 17 20 20 20 21 621s .psortKM(x, k = 30, m = 1): 621s [1] 30 621s .psortKM(y, k = 30, m = 1): 621s [1] 30 621s .psortKM(x, k = 30, m = 2): 621s [1] 29 30 621s .psortKM(y, k = 30, m = 2): 621s [1] 29 30 621s .psortKM(x, k = 30, m = 3): 621s [1] 28 29 30 621s .psortKM(y, k = 30, m = 3): 621s [1] 28 29 30 621s .psortKM(x, k = 30, m = 4): 621s [1] 27 28 29 30 621s .psortKM(y, k = 30, m = 4): 621s [1] 27 28 29 30 621s .psortKM(x, k = 30, m = 5): 621s [1] 26 27 28 29 30 621s .psortKM(y, k = 30, m = 5): 621s [1] 26 27 28 29 30 621s > 621s 621s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 621s Copyright (C) 2024 The R Foundation for Statistical Computing 621s Platform: aarch64-unknown-linux-gnu 621s 621s R is free software and comes with ABSOLUTELY NO WARRANTY. 621s You are welcome to redistribute it under certain conditions. 621s Type 'license()' or 'licence()' for distribution details. 621s 621s R is a collaborative project with many contributors. 621s Type 'contributors()' for more information and 621s 'citation()' on how to cite R or R packages in publications. 621s 621s Type 'demo()' for some demos, 'help()' for on-line help, or 621s 'help.start()' for an HTML browser interface to help. 621s Type 'q()' to quit R. 621s 621s > library("matrixStats") 621s > 621s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 621s + if (is.na(value)) { 621s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 621s + } else { 621s + y <- x == value 621s + 621s + # Preserve dimnames attribute 621s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 621s + if (!isTRUE(all.equal(dim(y), dim))) { 621s + dim(y) <- dim 621s + dimnames(y) <- dimnames(x) 621s + } 621s + 621s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 621s + } 621s + if (is.na(useNames) || !useNames) names(res) <- NULL 621s + res 621s + } 621s > 621s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 621s + if (is.na(value)) { 621s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 621s + } else { 621s + y <- x == value 621s + 621s + # Preserve dimnames attribute 621s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 621s + if (!isTRUE(all.equal(dim(y), dim))) { 621s + dim(y) <- dim 621s + dimnames(y) <- dimnames(x) 621s + } 621s + 621s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 621s + } 621s + if (is.na(useNames) || !useNames) names(res) <- NULL 621s + res 621s + } 621s > 621s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 621s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 621s + if (is.na(useNames) || !useNames) names(res) <- NULL 621s + res 621s + } 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # Data type: logical 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 621s > x[7:8, 2:3] <- TRUE 621s > x[1:3, ] <- TRUE 621s > x[, 1] <- TRUE 621s > x[4, ] <- FALSE 621s > x[, 4] <- FALSE 621s > x[2, ] <- FALSE 621s > x[3, ] <- TRUE 621s > 621s > # To check names attribute 621s > dimnames <- list(letters[1:10], LETTERS[1:4]) 621s > 621s > for (kk in 1:3) { 621s + if (kk == 2) { 621s + x[2, 2] <- NA 621s + } else if (kk == 3) { 621s + x[, 2] <- NA 621s + x[2, ] <- NA 621s + } 621s + 621s + # Test with and without dimnames on x 621s + for (setDimnames in c(TRUE, FALSE)) { 621s + dimnames(x) <- if (setDimnames) dimnames else NULL 621s + 621s + for (na.rm in c(FALSE, TRUE)) { 621s + # Check names attribute 621s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 621s + m0 <- rowAlls_R(x, na.rm = na.rm, useNames = useNames) 621s + m1 <- rowAlls(x, na.rm = na.rm, useNames = useNames) 621s + m2 <- colAlls(t(x), na.rm = na.rm, useNames = useNames) 621s + str(list("all()", m0 = m0, m1 = m1, m2 = m2)) 621s + stopifnot(identical(m1, m0)) 621s + stopifnot(identical(m2, m0)) 621s + 621s + m0 <- rowAnys_R(x, na.rm = na.rm, useNames = useNames) 621s + m1 <- rowAnys(x, na.rm = na.rm, useNames = useNames) 621s + m2 <- colAnys(t(x), na.rm = na.rm, useNames = useNames) 621s + str(list("any()", m0 = m0, m1 = m1, m2 = m2)) 621s + stopifnot(identical(m1, m0)) 621s + stopifnot(identical(m2, m0)) 621s + 621s + m0 <- rowAnyMissings_R(x, useNames = useNames) 621s + m1 <- rowAnyMissings(x, useNames = useNames) 621s + m2 <- colAnyMissings(t(x), useNames = useNames) 621s + str(list("anyMissing()", m0 = m0, m1 = m1, m2 = m2)) 621s + stopifnot(identical(m1, m0)) 621s + stopifnot(identical(m2, m0)) 621s + } 621s + } 621s + } 621s + } # for (kk ...) 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE FALSE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE FALSE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "any()" 621s $ m0: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m1: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s $ m2: Named logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s ..- attr(*, "names")= chr [1:10] "a" "b" "c" "d" ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE NA NA FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m1: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s $ m2: logi [1:10] TRUE NA TRUE NA TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s List of 4 621s $ : chr "all()" 621s $ m0: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m1: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s $ m2: logi [1:10] FALSE TRUE TRUE FALSE FALSE FALSE ... 621s List of 4 621s $ : chr "any()" 621s $ m0: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE FALSE TRUE FALSE TRUE TRUE ... 621s List of 4 621s $ : chr "anyMissing()" 621s $ m0: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m1: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s $ m2: logi [1:10] TRUE TRUE TRUE TRUE TRUE TRUE ... 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # Data type: integer 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > x <- matrix(rep(1:6, length.out = 4 * 5), nrow = 4L, ncol = 5L) 621s > x[2, ] <- 7L 621s > x[3, 1] <- 7L 621s > x[2:3, 3:4] <- NA_integer_ 621s > 621s > # To check names attribute 621s > dimnames <- list(letters[1:4], LETTERS[1:5]) 621s > 621s > # Row/column counts 621s > value <- 7L 621s > 621s > # Test with and without dimnames on x 621s > for (setDimnames in c(TRUE, FALSE)) { 621s + dimnames(x) <- if (setDimnames) dimnames else NULL 621s + for (na.rm in c(FALSE, TRUE)) { 621s + # Check names attribute 621s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 621s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 621s + stopifnot(identical(r1, r0)) 621s + stopifnot(identical(r2, r1)) 621s + if (!is.na(useNames) && !useNames && !setDimnames) { 621s + for (rr in seq_len(nrow(x))) { 621s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, r1[rr])) 621s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, r1[rr])) 621s + } 621s + } 621s + 621s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 621s + stopifnot(identical(r1, r0)) 621s + stopifnot(identical(r2, r1)) 621s + if (!is.na(useNames) && !useNames && !setDimnames) { 621s + for (rr in seq_len(nrow(x))) { 621s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, r1[rr])) 621s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, r1[rr])) 621s + } 621s + } 621s + } 621s + } 621s + } 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # rowAlls(x) et al. on numeric 'x' with logical 'value' 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > x <- matrix(0, nrow = 4L, ncol = 5L) 621s > x[2:4, 2] <- (1:3) / 4 621s > x[2, 2:4] <- (1:3) / 4 621s > x[3:4, 3] <- (3:4) / 4 621s > x[3, 3:4] <- (3:4) / 4 621s > x[1:4, 5] <- (1:4) / 5 621s > x[4, 4] <- NA_real_ 621s > 621s > # To check names attribute 621s > dimnames <- list(letters[1:4], LETTERS[1:5]) 621s > 621s > for (value in c(TRUE, FALSE)) { 621s + for (na.rm in c(FALSE, TRUE)) { 621s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 621s + y <- rowAnys(x, na.rm = na.rm, value = value) 621s + stopifnot(identical(y, y0)) 621s + # Check names attribute 621s + dimnames(x) <- dimnames 621s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 621s + stopifnot(all.equal(y, y0)) 621s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 621s + y <- rowAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 621s + stopifnot(all.equal(y, y0)) 621s + dimnames(x) <- NULL 621s + 621s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 621s + y <- colAnys(x, na.rm = na.rm, value = value) 621s + stopifnot(identical(y, y0)) 621s + # Check names attribute 621s + dimnames(x) <- dimnames 621s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = FALSE) 621s + stopifnot(all.equal(y, y0)) 621s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) any(as.logical(e) == value, na.rm = na.rm))) 621s + y <- colAnys(x, na.rm = na.rm, value = value, useNames = TRUE) 621s + stopifnot(all.equal(y, y0)) 621s + dimnames(x) <- NULL 621s + 621s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 621s + y <- rowAlls(x, na.rm = na.rm, value = value) 621s + stopifnot(identical(y, y0)) 621s + # Check names attribute 621s + dimnames(x) <- dimnames 621s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 621s + stopifnot(all.equal(y, y0)) 621s + y0 <- suppressWarnings(apply(x, MARGIN = 1L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 621s + y <- rowAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 621s + stopifnot(all.equal(y, y0)) 621s + dimnames(x) <- NULL 621s + 621s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 621s + y <- colAlls(x, na.rm = na.rm, value = value) 621s + stopifnot(identical(y, y0)) 621s + print(y0) 621s + # Check names attribute 621s + dimnames(x) <- dimnames 621s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = FALSE) 621s + stopifnot(all.equal(y, y0)) 621s + y0 <- suppressWarnings(apply(x, MARGIN = 2L, FUN = function(e) all(as.logical(e) == value, na.rm = na.rm))) 621s + y <- colAlls(x, na.rm = na.rm, value = value, useNames = TRUE) 621s + stopifnot(all.equal(y, y0)) 621s + dimnames(x) <- NULL 621s + } ## for (na.rm ...) 621s + } ## for(value ...) 621s [1] FALSE FALSE FALSE FALSE TRUE 621s [1] FALSE FALSE FALSE FALSE TRUE 621s [1] TRUE FALSE FALSE FALSE FALSE 621s [1] TRUE FALSE FALSE FALSE FALSE 621s > 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # Data type: character (not sure if this should be supported) 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > all_R <- function(x, value = TRUE, ...) { 621s + if (is.na(value)) { 621s + all(is.na(x), ...) 621s + } else { 621s + all(x == value, ...) 621s + } 621s + } 621s > 621s > any_R <- function(x, value = TRUE, ...) { 621s + if (is.na(value)) { 621s + any(is.na(x), ...) 621s + } else { 621s + any(x == value, ...) 621s + } 621s + } 621s > 621s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 621s > x[2, ] <- "g" 621s > x[2:4, 3:4] <- NA_character_ 621s > 621s > # To check names attribute 621s > dimnames <- list(letters[1:10], LETTERS[1:5]) 621s > 621s > # Test with and without dimnames on x 621s > for (setDimnames in c(TRUE, FALSE)) { 621s + dimnames(x) <- if (setDimnames) dimnames else NULL 621s + 621s + # Row/column counts 621s + for (value in c("g", NA_character_)) { 621s + for (na.rm in c(FALSE, TRUE)) { 621s + # Check names attribute 621s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 621s + r0 <- rowAlls_R(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r1 <- rowAlls(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r2 <- colAlls(t(x), value = value, na.rm = na.rm, useNames = useNames) 621s + stopifnot(identical(r1, r0)) 621s + stopifnot(identical(r2, r1)) 621s + if (!is.na(useNames) && !useNames && !setDimnames) { 621s + for (rr in seq_len(nrow(x))) { 621s + c0 <- all_R(x[rr, ], value, na.rm = na.rm) 621s + c <- allValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, r1[rr])) 621s + stopifnot(identical(c, c0)) 621s + } 621s + } 621s + 621s + r0 <- rowAnys_R(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r1 <- rowAnys(x, value = value, na.rm = na.rm, useNames = useNames) 621s + r2 <- colAnys(t(x), value = value, na.rm = na.rm, useNames = useNames) 621s + stopifnot(identical(r1, r0)) 621s + stopifnot(identical(r2, r1)) 621s + if (!is.na(useNames) && !useNames && !setDimnames) { 621s + for (rr in seq_len(nrow(x))) { 621s + c0 <- any_R(x[rr, ], value, na.rm = na.rm) 621s + c <- anyValue(x[rr, ], value = value, na.rm = na.rm) 621s + stopifnot(identical(c, c0)) 621s + stopifnot(identical(c, r1[rr])) 621s + } 621s + } 621s + } 621s + } 621s + } 621s + } 621s > 621s > 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > # NA 0 test 621s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 621s > x <- matrix(0, nrow = 3L, ncol = 3L) 621s > x[1, ] <- c(NA_real_, NA_real_, 0) 621s > x[3, ] <- c(1, 0, 1) 621s > 621s > dimnames <- list(letters[1:3], LETTERS[1:3]) 621s > 621s > # Test with and without dimnames on x 621s > for (setDimnames in c(TRUE, FALSE)) { 621s + dimnames(x) <- if (setDimnames) dimnames else NULL 621s + # Check names attribute 621s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 621s + r0 <- rowAnys_R(x, value = 0, useNames = useNames) 621s + r1 <- rowAnys(x, value = 0, useNames = useNames) 621s + stopifnot(identical(r0, r1)) 621s + } 621s + } 621s > 622s 622s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 622s Copyright (C) 2024 The R Foundation for Statistical Computing 622s Platform: aarch64-unknown-linux-gnu 622s 622s R is free software and comes with ABSOLUTELY NO WARRANTY. 622s You are welcome to redistribute it under certain conditions. 622s Type 'license()' or 'licence()' for distribution details. 622s 622s R is a collaborative project with many contributors. 622s Type 'contributors()' for more information and 622s 'citation()' on how to cite R or R packages in publications. 622s 622s Type 'demo()' for some demos, 'help()' for on-line help, or 622s 'help.start()' for an HTML browser interface to help. 622s Type 'q()' to quit R. 622s 622s > library("matrixStats") 622s > 622s > rowAlls_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 622s + if (is.na(value)) { 622s + res <- apply(is.na(x), MARGIN = 1L, FUN = all, na.rm = na.rm) 622s + } else { 622s + y <- x == value 622s + 622s + # Preserve dimnames attribute 622s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 622s + if (!isTRUE(all.equal(dim(y), dim))) { 622s + dim(y) <- dim 622s + dimnames(y) <- dimnames(x) 622s + } 622s + 622s + res <- apply(y, MARGIN = 1L, FUN = all, na.rm = na.rm) 622s + } 622s + if (is.na(useNames) || !useNames) names(res) <- NULL 622s + res 622s + } 622s > 622s > rowAnys_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 622s + if (is.na(value)) { 622s + res <- apply(is.na(x), MARGIN = 1L, FUN = any, na.rm = na.rm) 622s + } else { 622s + y <- x == value 622s + 622s + # Preserve dimnames attribute 622s + dim <- dim(x) # for 0xN and Mx0 cases; needed in R (< 3.4.0) 622s + if (!isTRUE(all.equal(dim(y), dim))) { 622s + dim(y) <- dim 622s + dimnames(y) <- dimnames(x) 622s + } 622s + 622s + res <- apply(y, MARGIN = 1L, FUN = any, na.rm = na.rm) 622s + } 622s + if (is.na(useNames) || !useNames) names(res) <- NULL 622s + res 622s + } 622s > 622s > rowAnyMissings_R <- function(x, ..., useNames = NA) { 622s + res <- apply(x, MARGIN = 1L, FUN = anyMissing) 622s + if (is.na(useNames) || !useNames) names(res) <- NULL 622s + res 622s + } 622s > 622s > 622s > all_R <- function(x, value = TRUE, ...) { 622s + if (is.na(value)) { 622s + all(is.na(x), ...) 622s + } else { 622s + all(x == value, ...) 622s + } 622s + } 622s > 622s > any_R <- function(x, value = TRUE, ...) { 622s + if (is.na(value)) { 622s + any(is.na(x), ...) 622s + } else { 622s + any(x == value, ...) 622s + } 622s + } 622s > 622s > 622s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 622s > # Subsetted tests 622s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 622s > source("utils/validateIndicesFramework.R") 622s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 622s > storage.mode(x) <- "integer" 622s > x[2:3, ] <- NA_integer_ 622s > x[2, 1] <- 0L 622s > x[4:5, ] <- 0L 622s > x[4, 6] <- NA_integer_ 622s > 622s > # To check names attribute 622s > dimnames <- list(letters[1:6], LETTERS[1:6]) 622s > 622s > # Test with and without dimnames on x 622s > for (setDimnames in c(TRUE, FALSE)) { 622s + if (setDimnames) dimnames(x) <- dimnames 622s + else dimnames(x) <- NULL 622s + 622s + count <- 0L 622s + for (rows in index_cases) { 622s + for (cols in index_cases) { 622s + count <- count + 1L 622s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 622s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 622s + useNames <- useNames[count %% length(useNames) + 1] 622s + 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAlls, fsure = rowAlls_R, 622s + value = 0, na.rm = TRUE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAlls, fsure = rowAlls_R, 622s + value = 0, na.rm = FALSE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAlls, fsure = rowAlls_R, 622s + value = NA_integer_, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAlls, fsure = rowAlls_R, 622s + value = 0, na.rm = TRUE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAlls, fsure = rowAlls_R, 622s + value = 0, na.rm = FALSE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAlls, fsure = rowAlls_R, 622s + value = NA_integer_, useNames = useNames) 622s + 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAnys, fsure = rowAnys_R, 622s + value = 0, na.rm = TRUE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAnys, fsure = rowAnys_R, 622s + value = 0, na.rm = FALSE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAnys, fsure = rowAnys_R, 622s + value = NA_integer_, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAnys, fsure = rowAnys_R, 622s + value = 0, na.rm = TRUE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAnys, fsure = rowAnys_R, 622s + value = 0, na.rm = FALSE, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAnys, fsure = rowAnys_R, 622s + value = NA_integer_, useNames = useNames) 622s + 622s + validateIndicesTestMatrix(x, rows, cols, 622s + ftest = rowAnyMissings, 622s + fsure = rowAnyMissings_R, useNames = useNames) 622s + validateIndicesTestMatrix(x, rows, cols, 622s + fcoltest = colAnyMissings, 622s + fsure = rowAnyMissings_R, useNames = useNames) 622s + } 622s + } 622s + } 624s > 624s > for (rr in seq_len(nrow(x))) { 624s + for (idxs in index_cases) { 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = allValue, fsure = all_R, 624s + value = 0, na.rm = TRUE) 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = allValue, fsure = all_R, 624s + value = 0, na.rm = FALSE) 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = allValue, fsure = all_R, 624s + value = NA_integer_) 624s + 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = anyValue, fsure = any_R, 624s + value = 0, na.rm = TRUE) 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = anyValue, fsure = any_R, 624s + value = 0, na.rm = FALSE) 624s + validateIndicesTestVector(x[rr, ], idxs, 624s + ftest = anyValue, fsure = any_R, 624s + value = NA_integer_) 624s + } 624s + } 624s > 624s > 624s > storage.mode(x) <- "character" 624s > # Test with and without dimnames on x 624s > for (setDimnames in c(TRUE, FALSE)) { 624s + if (setDimnames) dimnames(x) <- dimnames 624s + else dimnames(x) <- NULL 624s + for (rows in index_cases) { 624s + for (cols in index_cases) { 624s + # Check names attribute 624s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAlls, fsure = rowAlls_R, 624s + value = "0", na.rm = TRUE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAlls, fsure = rowAlls_R, 624s + value = "0", na.rm = FALSE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAlls, fsure = rowAlls_R, 624s + value = NA_character_, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAlls, fsure = rowAlls_R, 624s + value = "0", na.rm = TRUE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAlls, fsure = rowAlls_R, 624s + value = "0", na.rm = FALSE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAlls, fsure = rowAlls_R, 624s + value = NA_character_, useNames = useNames) 624s + 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAnys, fsure = rowAnys_R, 624s + value = "0", na.rm = TRUE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAnys, fsure = rowAnys_R, 624s + value = "0", na.rm = FALSE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAnys, fsure = rowAnys_R, 624s + value = NA_character_, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAnys, fsure = rowAnys_R, 624s + value = "0", na.rm = TRUE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAnys, fsure = rowAnys_R, 624s + value = "0", na.rm = FALSE, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAnys, fsure = rowAnys_R, 624s + value = NA_character_, useNames = useNames) 624s + 624s + validateIndicesTestMatrix(x, rows, cols, 624s + ftest = rowAnyMissings, 624s + fsure = rowAnyMissings_R, useNames = useNames) 624s + validateIndicesTestMatrix(x, rows, cols, 624s + fcoltest = colAnyMissings, 624s + fsure = rowAnyMissings_R, useNames = useNames) 624s + } 624s + } 624s + } 624s + } 627s > 627s > for (rr in seq_len(nrow(x))) { 627s + for (idxs in index_cases) { 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = allValue, fsure = all_R, 627s + value = "0", na.rm = TRUE) 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = allValue, fsure = all_R, 627s + value = "0", na.rm = FALSE) 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = allValue, fsure = all_R, 627s + value = NA_integer_) 627s + 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = anyValue, fsure = any_R, 627s + value = "0", na.rm = TRUE) 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = anyValue, fsure = any_R, 627s + value = "0", na.rm = FALSE) 627s + validateIndicesTestVector(x[rr, ], idxs, 627s + ftest = anyValue, fsure = any_R, 627s + value = NA_integer_) 627s + } 627s + } 627s > 627s 627s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 627s Copyright (C) 2024 The R Foundation for Statistical Computing 627s Platform: aarch64-unknown-linux-gnu 627s 627s R is free software and comes with ABSOLUTELY NO WARRANTY. 627s You are welcome to redistribute it under certain conditions. 627s Type 'license()' or 'licence()' for distribution details. 627s 627s R is a collaborative project with many contributors. 627s Type 'contributors()' for more information and 627s 'citation()' on how to cite R or R packages in publications. 627s 627s Type 'demo()' for some demos, 'help()' for on-line help, or 627s 'help.start()' for an HTML browser interface to help. 627s Type 'q()' to quit R. 627s 627s > library("matrixStats") 627s > 627s > X <- matrix(rnorm(20 * 6), nrow = 20, ncol = 6) 627s > rownames(X) <- LETTERS[1:nrow(X)] 627s > colnames(X) <- letters[1:ncol(X)] 627s > print(X) 627s a b c d e f 627s A 0.06288157 0.28345390 0.53177702 0.1996747 0.05026718 -0.1924874 627s B -0.51637812 -0.18268130 -0.92603747 -1.8739388 0.81670352 -0.1349729 627s C 1.08075068 0.61083587 -1.21352704 -0.2032491 -1.55990773 0.6763674 627s D -0.38016694 1.93178297 -0.80181035 1.5931375 -0.42349087 -0.5087410 627s E -1.11394031 0.71216705 -0.66248734 -0.3524175 1.96779782 -0.7867995 627s F 0.81016651 -0.03903696 1.11640578 -0.1783368 -0.35398800 -0.4156309 627s G -0.15597665 -1.11276898 0.85347206 0.8044517 -0.75869476 -1.9476690 627s H 0.85480381 2.08765276 -1.09333595 1.1924458 0.82636451 1.2664237 627s I -1.75445285 0.39027035 -0.74266541 0.5083790 1.54727529 -1.3911978 627s J -1.09030050 -0.97796624 -0.05572787 -1.0886265 -0.54442756 -0.8194885 627s K 1.00974836 2.28875774 -1.35289398 -0.3928088 -0.65944801 -0.5085369 627s L -1.16060227 1.60696715 0.53919710 0.4131660 -0.02999582 -0.4388424 627s M -0.05448856 0.68925371 -1.60974836 0.5128415 -0.62095949 -0.3089564 627s N -0.30547319 -0.91696525 -2.59848820 0.8842983 0.83852195 0.6398806 627s O 0.17559288 0.51146889 0.19333751 0.1142883 0.51109513 1.0516925 627s P -1.48584744 -1.14961894 -1.29478716 -0.9730343 -0.39801407 -0.1632706 627s Q -0.08677187 1.24613260 -1.34766235 1.0252051 -0.61134197 1.5592712 627s R 1.29929261 0.28972855 -1.36002693 -0.4818927 -1.68012909 -1.5669620 627s S 0.54386318 -1.43175247 -0.94067258 -0.7922124 -0.30624980 1.2069070 627s T -0.87232247 0.19261707 -0.05306532 0.8796132 -0.23247618 0.9043054 627s > 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Apply rowMeans() for 3 sets of 2 columns 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > nbr_of_sets <- 3L 627s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 627s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 627s > print(S) 627s s1 s2 s3 627s [1,] 1 3 5 627s [2,] 2 4 6 627s > 627s > Z <- rowAvgsPerColSet(X, S = S) 627s > print(Z) 627s s1 s2 s3 627s A 0.1731677 0.3657259 -0.07111012 627s B -0.3495297 -1.3999881 0.34086529 627s C 0.8457933 -0.7083880 -0.44177018 627s D 0.7758080 0.3956636 -0.46611592 627s E -0.2008866 -0.5074524 0.59049918 627s F 0.3855648 0.4690345 -0.38480947 627s G -0.6343728 0.8289619 -1.35318188 627s H 1.4712283 0.0495549 1.04639411 627s I -0.6820912 -0.1171432 0.07803876 627s J -1.0341334 -0.5721772 -0.68195801 627s K 1.6492531 -0.8728514 -0.58399247 627s L 0.2231824 0.4761815 -0.23441909 627s M 0.3173826 -0.5484535 -0.46495794 627s N -0.6112192 -0.8570949 0.73920127 627s O 0.3435309 0.1538129 0.78139383 627s P -1.3177332 -1.1339107 -0.28064231 627s Q 0.5796804 -0.1612286 0.47396461 627s R 0.7945106 -0.9209598 -1.62354555 627s S -0.4439446 -0.8664425 0.45032861 627s T -0.3398527 0.4132739 0.33591464 627s > 627s > # Validation 627s > Z0 <- cbind(s1 = rowMeans(X[, 1:2]), s2 = rowMeans(X[, 3:4]), 627s + s3 = rowMeans(X[, 5:6])) 627s > stopifnot(identical(drop(Z), Z0)) 627s > 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Apply colMeans() for 5 sets of 4 rows 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > nbr_of_sets <- 5L 627s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 627s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 627s > print(S) 627s s1 s2 s3 s4 s5 627s [1,] 1 5 9 13 17 627s [2,] 2 6 10 14 18 627s [3,] 3 7 11 15 19 627s [4,] 4 8 12 16 20 627s > 627s > Z <- colAvgsPerRowSet(X, S = S) 627s > print(Z) 627s a b c d e f 627s s1 0.06177180 0.66084786 -0.60239946 -0.07109392 -0.27910698 -0.03995849 627s s2 0.09876334 0.41200347 0.05351364 0.36653579 0.42036989 -0.47091892 627s s3 -0.74890181 0.82700725 -0.40302254 -0.13997260 0.07835097 -0.78951638 627s s4 -0.41755408 -0.21646540 -1.32742155 0.13459844 0.08266088 0.30483654 627s s5 0.22101536 0.07418144 -0.92535679 0.15767829 -0.70754926 0.52588041 627s > 627s > # Validation 627s > Z0 <- rbind(s1 = colMeans(X[1:4, ]), s2 = colMeans(X[5:8, ]), 627s + s3 = colMeans(X[9:12, ]), s4 = colMeans(X[13:16, ]), 627s + s5 = colMeans(X[17:20, ])) 627s > stopifnot(identical(drop(Z), Z0)) 627s > 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # When there is only one "complete" set 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > nbr_of_sets <- 1L 627s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 627s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 627s > print(S) 627s s1 627s [1,] 1 627s [2,] 2 627s [3,] 3 627s [4,] 4 627s [5,] 5 627s [6,] 6 627s > 627s > Z <- rowAvgsPerColSet(X, S = S, FUN = rowMeans) 627s > print(Z) 627s s1 627s A 0.15592783 627s B -0.46955085 627s C -0.10145498 627s D 0.23511856 627s E -0.03927995 627s F 0.15659660 627s G -0.38619761 627s H 0.85572577 627s I -0.24039857 627s J -0.76275619 627s K 0.06413640 627s L 0.15498163 627s M -0.23200960 627s N -0.24303763 627s O 0.42624587 627s P -0.91076208 627s Q 0.29747212 627s R -0.58333160 627s S -0.28668618 627s T 0.13644529 627s > 627s > Z0 <- rowMeans(X) 627s > stopifnot(identical(drop(Z), Z0)) 627s > 627s > 627s > nbr_of_sets <- 1L 627s > S <- matrix(1:nrow(X), ncol = nbr_of_sets) 627s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 627s > print(S) 627s s1 627s [1,] 1 627s [2,] 2 627s [3,] 3 627s [4,] 4 627s [5,] 5 627s [6,] 6 627s [7,] 7 627s [8,] 8 627s [9,] 9 627s [10,] 10 627s [11,] 11 627s [12,] 12 627s [13,] 13 627s [14,] 14 627s [15,] 15 627s [16,] 16 627s [17,] 17 627s [18,] 18 627s [19,] 19 627s [20,] 20 627s > 627s > Z <- colAvgsPerRowSet(X, S = S, FUN = colMeans) 627s > print(Z) 627s a b c d e f 627s s1 -0.1569811 0.3515149 -0.6409373 0.0895492 -0.0810549 -0.09393537 627s > 627s > Z0 <- colMeans(X) 627s > stopifnot(identical(drop(Z), Z0)) 627s > 627s > 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Use weights 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > nbr_of_sets <- 3L 627s > S <- matrix(1:ncol(X), ncol = nbr_of_sets) 627s > colnames(S) <- sprintf("s%d", 1:nbr_of_sets) 627s > print(S) 627s s1 s2 s3 627s [1,] 1 3 5 627s [2,] 2 4 6 627s > 627s > W <- matrix(runif(length(X)), nrow = nrow(X), ncol = ncol(X)) 627s > Z1 <- rowAvgsPerColSet(X, W = W, S = S, FUN = rowWeightedMeans) 627s > print(Z1) 627s s1 s2 s3 627s A 0.1731677 0.3657259 -0.07111012 627s B -0.3495297 -1.3999881 0.34086529 627s C 0.8457933 -0.7083880 -0.44177018 627s D 0.7758080 0.3956636 -0.46611592 627s E -0.2008866 -0.5074524 0.59049918 627s F 0.3855648 0.4690345 -0.38480947 627s G -0.6343728 0.8289619 -1.35318188 627s H 1.4712283 0.0495549 1.04639411 627s I -0.6820912 -0.1171432 0.07803876 627s J -1.0341334 -0.5721772 -0.68195801 627s K 1.6492531 -0.8728514 -0.58399247 627s L 0.2231824 0.4761815 -0.23441909 627s M 0.3173826 -0.5484535 -0.46495794 627s N -0.6112192 -0.8570949 0.73920127 627s O 0.3435309 0.1538129 0.78139383 627s P -1.3177332 -1.1339107 -0.28064231 627s Q 0.5796804 -0.1612286 0.47396461 627s R 0.7945106 -0.9209598 -1.62354555 627s S -0.4439446 -0.8664425 0.45032861 627s T -0.3398527 0.4132739 0.33591464 627s > Z2 <- colAvgsPerRowSet(X, W = W, S = S, FUN = colWeightedMeans) 627s > print(Z2) 627s a b c d e f 627s s1 -0.2267483 0.0503863 -0.1971302 -0.8371321 0.4334853 -0.1637302 627s s2 0.3502919 1.2713094 -1.0076687 0.6949442 -0.9916993 0.0838132 627s s3 -0.1518869 0.3365650 0.2269592 -0.2653771 0.8069049 -0.6012152 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Result should always be a matrix, including when nrow(X) <= 1 627s > # (https://github.com/HenrikBengtsson/matrixStats/issues/108) 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > X <- matrix(1:3, nrow = 1L, ncol = 3L) 627s > S <- matrix(1, nrow = 1L, ncol = 1L) 627s > Z1 <- rowAvgsPerColSet(X, S = S) 627s > stopifnot(is.matrix(Z1)) 627s > Z2 <- rowAvgsPerColSet(X, S = S, rows = 0) 627s > stopifnot(is.matrix(Z2)) 627s > 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Works with many, one or zero columns / rows 627s > # (https://github.com/HenrikBengtsson/matrixStats/issues/172) 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > S <- cbind(1:2, 3:4, 5:6) 627s > X <- matrix(rnorm(2 * 6), nrow = 6, ncol = 2) 627s > Z2 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 627s > Z2_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 627s + colSums2(X[S[,2], ,drop=FALSE]), 627s + colSums2(X[S[,3], ,drop=FALSE])) 627s > stopifnot(identical(Z2, Z2_ref)) 627s > X <- matrix(rnorm(6), nrow = 6, ncol = 1) 627s > Z1 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 627s > Z1_ref <- rbind(colSums2(X[S[,1], ,drop=FALSE]), 627s + colSums2(X[S[,2], ,drop=FALSE]), 627s + colSums2(X[S[,3], ,drop=FALSE])) 627s > stopifnot(identical(Z1, Z1_ref)) 627s > X <- matrix(numeric(0), nrow = 6, ncol = 0) 627s > Z0 <- colAvgsPerRowSet(X, S = S, FUN = colSums2) 627s > Z0_ref <- matrix(numeric(0), nrow = ncol(S), ncol = 0) 627s > stopifnot(identical(Z0, unname(Z0_ref))) 627s > 627s > 627s > S <- rbind(1:4, 5:8) 627s > X <- matrix(rnorm(n = 2 * 8), nrow = 2, ncol = 8) 627s > Z2 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 627s > Z2_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 627s + rowMeans2(X[,S[,2],drop=FALSE]), 627s + rowMeans2(X[,S[,3],drop=FALSE]), 627s + rowMeans2(X[,S[,4],drop=FALSE])) 627s > stopifnot(identical(Z2, Z2_ref)) 627s > X <- matrix(rnorm(n = 8), nrow = 1, ncol = 8) 627s > Z1 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 627s > Z1_ref <- cbind(rowMeans2(X[,S[,1],drop=FALSE]), 627s + rowMeans2(X[,S[,2],drop=FALSE]), 627s + rowMeans2(X[,S[,3],drop=FALSE]), 627s + rowMeans2(X[,S[,4],drop=FALSE])) 627s > stopifnot(identical(Z1, Z1_ref)) 627s > X <- matrix(numeric(0), nrow = 0, ncol = 8) 627s > Z0 <- rowAvgsPerColSet(X, S = S, FUN = rowMeans2) 627s > Z0_ref <- matrix(numeric(0), nrow = 0, ncol = ncol(S)) 627s > stopifnot(identical(Z0, Z0_ref)) 627s > 627s 627s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 627s Copyright (C) 2024 The R Foundation for Statistical Computing 627s Platform: aarch64-unknown-linux-gnu 627s 627s R is free software and comes with ABSOLUTELY NO WARRANTY. 627s You are welcome to redistribute it under certain conditions. 627s Type 'license()' or 'licence()' for distribution details. 627s 627s R is a collaborative project with many contributors. 627s Type 'contributors()' for more information and 627s 'citation()' on how to cite R or R packages in publications. 627s 627s Type 'demo()' for some demos, 'help()' for on-line help, or 627s 'help.start()' for an HTML browser interface to help. 627s Type 'q()' to quit R. 627s 627s > library("matrixStats") 627s > 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > # Subsetted tests 627s > # - - - - - - - - - - - - - - - - - - - - - - - - - - 627s > source("utils/validateIndicesFramework.R") 627s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 627s > #W <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 627s > for (rows in index_cases) { 627s + for (cols in index_cases) { 627s + if (is.null(rows)) { 627s + rows <- seq_len(nrow(x)) 627s + rows_finite <- rows 627s + } else { 627s + rows_finite <- rows[is.finite(rows)] 627s + } 627s + 627s + if (is.null(cols)) { 627s + cols <- seq_len(ncol(x)) 627s + cols_finite <- cols 627s + } else { 627s + cols_finite <- cols[is.finite(cols)] 627s + } 627s + 627s + suppressWarnings({ 627s + actual <- tryCatch({ 627s + rowAvgsPerColSet(x, rows = rows, S = matrix(cols, ncol = 1), 627s + FUN = rowMeans) 627s + }, error = function(c) "error") 627s + expect <- tryCatch({ 627s + rowMeans(x[rows, cols_finite, drop = FALSE], na.rm = TRUE) 627s + }, error = function(c) "error") 627s + }) 627s + stopifnot(all.equal(as.vector(actual), expect)) 627s + 627s + suppressWarnings({ 627s + actual <- tryCatch({ 627s + colAvgsPerRowSet(x, cols = cols, S = matrix(rows, ncol = 1), 627s + FUN = colMeans) 627s + }, error = function(c) "error") 627s + expect <- tryCatch({ 627s + colMeans(x[rows_finite, cols, drop = FALSE], na.rm = TRUE) 627s + }, error = function(c) "error") 627s + }) 627s + stopifnot(all.equal(as.vector(actual), expect)) 627s + } 627s + } 628s > 628s 628s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 628s Copyright (C) 2024 The R Foundation for Statistical Computing 628s Platform: aarch64-unknown-linux-gnu 628s 628s R is free software and comes with ABSOLUTELY NO WARRANTY. 628s You are welcome to redistribute it under certain conditions. 628s Type 'license()' or 'licence()' for distribution details. 628s 628s R is a collaborative project with many contributors. 628s Type 'contributors()' for more information and 628s 'citation()' on how to cite R or R packages in publications. 628s 628s Type 'demo()' for some demos, 'help()' for on-line help, or 628s 'help.start()' for an HTML browser interface to help. 628s Type 'q()' to quit R. 628s 628s > library("matrixStats") 628s > 628s > x <- matrix(1:27, ncol = 3) 628s > 628s > # To check names attribute 628s > dimnames <- list(letters[1:9], LETTERS[1:3]) 628s > 628s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 628s + res <- x[, idxs] 628s + # Preserve names attribute? 628s + if (is.na(useNames) || !useNames) names(res) <- NULL 628s + res 628s + } 628s > 628s > idxs <- 1L 628s > # Test with and without dimnames on x 628s > for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 628s + y <- rowCollapse(x, idxs, useNames = useNames) 628s + stopifnot(identical(y, y_truth)) 628s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 628s + stopifnot(identical(y2, y)) 628s + } 628s + } 628s > 628s > idxs <- 2L 628s > # Test with and without dimnames on x 628s > for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 628s + y <- rowCollapse(x, idxs, useNames = useNames) 628s + stopifnot(identical(y, y_truth)) 628s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 628s + stopifnot(identical(y2, y)) 628s + } 628s + } 628s > 628s > 628s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 628s + res <- c(x[1:5, 1], x[6:9, 3]) 628s + # Preserve names attribute? 628s + if (is.na(useNames) || !useNames) names(res) <- NULL 628s + res 628s + } 628s > 628s > idxs <- c(1, 1, 1, 1, 1, 3, 3, 3, 3) 628s > # Test with and without dimnames on x 628s > for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 628s + y <- rowCollapse(x, idxs, useNames = useNames) 628s + stopifnot(identical(y, y_truth)) 628s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 628s + stopifnot(identical(y2, y)) 628s + } 628s + } 628s > 628s > 628s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 628s + res <- c(x[1, 1], x[2, 2], x[3, 3], x[4, 1], x[5, 2], 628s + x[6, 3], x[7, 1], x[8, 2], x[9, 3]) 628s + # Preserve names attribute? 628s + if (isTRUE(useNames)) { 628s + names <- rownames(x) 628s + if (!is.null(names)) names(res) <- names 628s + } 628s + res 628s + } 628s > 628s > idxs <- 1:3 628s > # Test with and without dimnames on x 628s > for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + y_truth <- rowCollapse_R(x, idxs, useNames = useNames) 628s + y <- rowCollapse(x, idxs, useNames = useNames) 628s + stopifnot(identical(y, y_truth)) 628s + y2 <- colCollapse(t(x), idxs, useNames = useNames) 628s + stopifnot(identical(y2, y)) 628s + } 628s + } 628s > 628s 628s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 628s Copyright (C) 2024 The R Foundation for Statistical Computing 628s Platform: aarch64-unknown-linux-gnu 628s 628s R is free software and comes with ABSOLUTELY NO WARRANTY. 628s You are welcome to redistribute it under certain conditions. 628s Type 'license()' or 'licence()' for distribution details. 628s 628s R is a collaborative project with many contributors. 628s Type 'contributors()' for more information and 628s 'citation()' on how to cite R or R packages in publications. 628s 628s Type 'demo()' for some demos, 'help()' for on-line help, or 628s 'help.start()' for an HTML browser interface to help. 628s Type 'q()' to quit R. 628s 628s > library("matrixStats") 628s > 628s > rowCollapse_R <- function(x, idxs, ..., useNames = NA) { 628s + ans <- c() 628s + storage.mode(ans) <- storage.mode(x) 628s + for (ii in seq_len(length(idxs))) { 628s + ans[ii] <- x[ii, idxs[ii]] 628s + } 628s + 628s + # Preserve names attribute 628s + if (isTRUE(useNames)) { 628s + names <- rownames(x) 628s + if (!is.null(names)) names(ans) <- names 628s + } 628s + 628s + ans 628s + } 628s > 628s > 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > # Subsetted tests 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > source("utils/validateIndicesFramework.R") 628s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 628s > storage.mode(x) <- "integer" 628s > 628s > # To check names attribute 628s > dimnames <- list(letters[1:6], LETTERS[1:6]) 628s > 628s > for (rows in index_cases) { 628s + if (is.null(rows)) rows <- seq_len(nrow(x)) 628s + 628s + for (idxs in list(2L, seq_len(6L))) { 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + suppressWarnings({ 628s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 628s + error = function(c) "error") 628s + expect <- tryCatch({ 628s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 628s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 628s + }, error = function(c) "error") 628s + }) 628s + stopifnot(all.equal(actual, expect)) 628s + 628s + suppressWarnings({ 628s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 628s + error = function(c) "error") 628s + }) 628s + stopifnot(all.equal(actual, expect)) 628s + 628s + # Check names attribute 628s + dimnames(x) <- dimnames 628s + suppressWarnings({ 628s + actual <- tryCatch(rowCollapse(x, idxs, rows = rows, useNames = useNames), 628s + error = function(c) "error") 628s + expect <- tryCatch({ 628s + idxs_0 <- rep(idxs, length.out = nrow(x))[rows] 628s + rowCollapse_R(x[rows, , drop = FALSE], idxs_0, useNames = useNames) 628s + }, error = function(c) "error") 628s + }) 628s + stopifnot(all.equal(actual, expect)) 628s + 628s + suppressWarnings({ 628s + actual <- tryCatch(colCollapse(t(x), idxs, cols = rows, useNames = useNames), 628s + error = function(c) "error") 628s + }) 628s + stopifnot(all.equal(actual, expect)) 628s + 628s + dimnames(x) <- NULL 628s + } 628s + } 628s + } 628s > 628s 628s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 628s Copyright (C) 2024 The R Foundation for Statistical Computing 628s Platform: aarch64-unknown-linux-gnu 628s 628s R is free software and comes with ABSOLUTELY NO WARRANTY. 628s You are welcome to redistribute it under certain conditions. 628s Type 'license()' or 'licence()' for distribution details. 628s 628s R is a collaborative project with many contributors. 628s Type 'contributors()' for more information and 628s 'citation()' on how to cite R or R packages in publications. 628s 628s Type 'demo()' for some demos, 'help()' for on-line help, or 628s 'help.start()' for an HTML browser interface to help. 628s Type 'q()' to quit R. 628s 628s > library("matrixStats") 628s > 628s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ...) { 628s + if (is.na(value)) { 628s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 628s + sum(is.na(x)) 628s + ) 628s + } else { 628s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 628s + sum(x == value, na.rm = na.rm) 628s + ) 628s + } 628s + # Preserve names attribute 628s + names <- names(counts) 628s + counts <- as.integer(counts) 628s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 628s + counts 628s + } 628s > 628s > 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > # Data type: integer and numeric 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > for (mode in c("integer", "double")) { 628s + x <- matrix(runif(10 * 5, min = -3, max = 3), nrow = 10L, ncol = 5L) 628s + x[sample.int(length(x), size = 7L)] <- 0 628s + storage.mode(x) <- mode 628s + 628s + dimnames = list(letters[1:10], LETTERS[1:5]) 628s + 628s + # Test with and without dimnames on x 628s + for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + for (na.rm in c(FALSE, TRUE)) { 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + # Count zeros 628s + r0 <- rowCounts_R(x, value = 0, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, value = 0, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), value = 0, na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + 628s + # Count NAs 628s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + 628s + if (mode == "integer") { 628s + ux <- unique(as.vector(x)) 628s + r0 <- r1 <- r2 <- integer(nrow(x)) 628s + for (value in ux) { 628s + r0 <- r0 + rowCounts_R(x, value = value, na.rm = na.rm, useNames = useNames) 628s + r1 <- r1 + rowCounts(x, value = value, na.rm = na.rm, useNames = useNames) 628s + r2 <- r2 + colCounts(t(x), value = value, na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + } 628s + stopifnot(all(r0 == ncol(x))) 628s + } # if (mode == "integer") 628s + } # for (useNames ...) 628s + } # for (na.rm ...) 628s + } # for (setDimnames ...) 628s + } # for (mode ...) 628s > 628s > 628s > # All NAs 628s > na_list <- list(NA_integer_, NA_real_, NaN) 628s > for (na_value in na_list) { 628s + x <- matrix(na_value, nrow = 10L, ncol = 5L) 628s + # Test with and without dimnames on x 628s + for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + for (na.rm in c(FALSE, TRUE)) { 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + 628s + # Count NAs 628s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 628s + stopifnot(all(r0 == ncol(x))) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + } 628s + } 628s + } 628s + } # for (na_value ...) 628s > 628s > 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > # Data type: logical 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > x <- matrix(FALSE, nrow = 10L, ncol = 4L) 628s > x[7:8, 2:3] <- TRUE 628s > x[1:3, ] <- TRUE 628s > x[, 1] <- TRUE 628s > x[4, ] <- FALSE 628s > x[, 4] <- FALSE 628s > x[2, ] <- FALSE 628s > x[3, ] <- TRUE 628s > 628s > # To check names attribute 628s > dimnames <- list(letters[1:10], LETTERS[1:4]) 628s > 628s > # Test with and without dimnames on x 628s > for (setDimnames in c(TRUE, FALSE)) { 628s + if (setDimnames) dimnames(x) <- dimnames 628s + else dimnames(x) <- NULL 628s + # Row/column counts 628s + for (na.rm in c(FALSE, TRUE)) { 628s + # Check names attribute 628s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 628s + r0 <- rowCounts_R(x, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + 628s + r_true <- rowCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 628s + r_false <- rowCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 628s + stopifnot(r_true + r_false == ncol(x)) 628s + 628s + c_true <- colCounts(x, value = TRUE, na.rm = na.rm, useNames = useNames) 628s + c_false <- colCounts(x, value = FALSE, na.rm = na.rm, useNames = useNames) 628s + stopifnot(c_true + c_false == nrow(x)) 628s + 628s + # Count NAs 628s + r0 <- rowCounts_R(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r1 <- rowCounts(x, value = NA, na.rm = na.rm, useNames = useNames) 628s + r2 <- colCounts(t(x), value = NA, na.rm = na.rm, useNames = useNames) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + } 628s + } 628s + } 628s > 628s > 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > # Data type: character (not sure if this should be supported) 628s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 628s > x <- matrix(rep(letters, length.out = 10 * 5), nrow = 10L, ncol = 5L) 628s > x[2:3, 3:4] <- NA_character_ 628s > 628s > # Row/column counts 628s > for (na.rm in c(FALSE, TRUE)) { 628s + for (value in c("g", NA_character_)) { 628s + r0 <- rowCounts_R(x, value = value, na.rm = na.rm) 628s + r1 <- rowCounts(x, value = value, na.rm = na.rm) 628s + r2 <- colCounts(t(x), value = value, na.rm = na.rm) 628s + stopifnot(identical(r1, r0)) 628s + stopifnot(identical(r2, r0)) 628s + 628s + c <- count(x[1, ], value = value, na.rm = na.rm) 628s + stopifnot(identical(c, r1[1])) 628s + 628s + c <- count(x[2, ], value = value, na.rm = na.rm) 628s + stopifnot(identical(c, r1[2])) 629s + } 629s + } 629s > 629s > # NA row 629s > x <- matrix(0, nrow = 2L, ncol = 2L) 629s > x[1, ] <- NA_integer_ 629s > 629s > dimnames <- list(letters[1:2], LETTERS[1:2]) 629s > 629s > # Test with and without dimnames on x 629s > for (setDimnames in c(TRUE, FALSE)) { 629s + if (setDimnames) dimnames(x) <- dimnames 629s + else dimnames(x) <- NULL 629s + # Check names attribute 629s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 629s + r0 <- rowCounts(x, value = 0, useNames = useNames) 629s + r1 <- rowCounts_R(x, value = 0, useNames = useNames) 629s + stopifnot(identical(r0, r1)) 629s + } 629s + } 629s > 629s 629s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 629s Copyright (C) 2024 The R Foundation for Statistical Computing 629s Platform: aarch64-unknown-linux-gnu 629s 629s R is free software and comes with ABSOLUTELY NO WARRANTY. 629s You are welcome to redistribute it under certain conditions. 629s Type 'license()' or 'licence()' for distribution details. 629s 629s R is a collaborative project with many contributors. 629s Type 'contributors()' for more information and 629s 'citation()' on how to cite R or R packages in publications. 629s 629s Type 'demo()' for some demos, 'help()' for on-line help, or 629s 'help.start()' for an HTML browser interface to help. 629s Type 'q()' to quit R. 629s 629s > library("matrixStats") 629s > 629s > rowCounts_R <- function(x, value = TRUE, na.rm = FALSE, ..., useNames = NA) { 629s + if (is.na(value)) { 629s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 629s + sum(is.na(x)) 629s + ) 629s + } else { 629s + counts <- apply(x, MARGIN = 1L, FUN = function(x) 629s + sum(x == value, na.rm = na.rm) 629s + ) 629s + } 629s + # Preserve names attribute 629s + names <- names(counts) 629s + counts <- as.integer(counts) 629s + if (isTRUE(useNames) && !is.null(names)) names(counts) <- names 629s + counts 629s + } # rowCounts_R() 629s > 629s > 629s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 629s > # Subsetted tests 629s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 629s > source("utils/validateIndicesFramework.R") 629s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 629s > x[2:3, 3:4] <- NA_real_ 629s > storage.mode(x) <- "integer" 629s > 629s > # To check names attribute 629s > dimnames <- list(letters[1:6], LETTERS[1:6]) 629s > 629s > # Test with and without dimnames on x 629s > for (setDimnames in c(TRUE, FALSE)) { 629s + if (setDimnames) dimnames(x) <- dimnames 629s + else dimnames(x) <- NULL 629s + for (rows in index_cases) { 629s + for (cols in index_cases) { 629s + # Check names attribute 629s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 629s + validateIndicesTestMatrix(x, rows, cols, 629s + ftest = rowCounts, fsure = rowCounts_R, 629s + value = 0, na.rm = TRUE, useNames = useNames) 629s + validateIndicesTestMatrix(x, rows, cols, 629s + fcoltest = colCounts, fsure = rowCounts_R, 629s + value = 0, na.rm = TRUE, useNames = useNames) 629s + for (value in c(0, NA_integer_)) { 629s + validateIndicesTestMatrix(x, rows, cols, 629s + ftest = rowCounts, fsure = rowCounts_R, 629s + value = value, useNames = useNames) 629s + validateIndicesTestMatrix(x, rows, cols, 629s + fcoltest = colCounts, fsure = rowCounts_R, 629s + value = value, useNames = useNames) 629s + } 629s + } 629s + } 629s + } 629s + } 630s > 630s > x <- matrix(rep(letters, length.out = 6 * 6), nrow = 6, ncol = 6) 630s > x[2:3, 3:4] <- NA_character_ 630s > # Test with and without dimnames on x 630s > for (setDimnames in c(TRUE, FALSE)) { 630s + if (setDimnames) dimnames(x) <- dimnames 630s + else dimnames(x) <- NULL 630s + 630s + count <- 0L 630s + for (rows in index_cases) { 630s + for (cols in index_cases) { 630s + count <- count + 1L 630s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 630s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 630s + useNames <- useNames[count %% length(useNames) + 1] 630s + 630s + validateIndicesTestMatrix(x, rows, cols, 630s + ftest = rowCounts, fsure = rowCounts_R, 630s + value = "g", na.rm = TRUE, useNames = useNames) 630s + validateIndicesTestMatrix(x, rows, cols, 630s + fcoltest = colCounts, fsure = rowCounts_R, 630s + value = "g", na.rm = TRUE, useNames = useNames) 630s + for (value in c("g", NA_character_)) { 630s + validateIndicesTestMatrix(x, rows, cols, 630s + ftest = rowCounts, fsure = rowCounts_R, 630s + value = value, useNames = useNames) 630s + validateIndicesTestMatrix(x, rows, cols, 630s + fcoltest = colCounts, fsure = rowCounts_R, 630s + value = value, useNames = useNames) 630s + } 630s + } 630s + } 630s + } 631s > 631s 631s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 631s Copyright (C) 2024 The R Foundation for Statistical Computing 631s Platform: aarch64-unknown-linux-gnu 631s 631s R is free software and comes with ABSOLUTELY NO WARRANTY. 631s You are welcome to redistribute it under certain conditions. 631s Type 'license()' or 'licence()' for distribution details. 631s 631s R is a collaborative project with many contributors. 631s Type 'contributors()' for more information and 631s 'citation()' on how to cite R or R packages in publications. 631s 631s Type 'demo()' for some demos, 'help()' for on-line help, or 631s 'help.start()' for an HTML browser interface to help. 631s Type 'q()' to quit R. 631s 631s > library("matrixStats") 631s > 631s > rowCummins_R <- function(x, ..., useNames = NA) { 631s + suppressWarnings({ 631s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 631s + }) 631s + 631s + # Preserve dimnames attribute? 631s + dim(y) <- dim(x) 631s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 631s + y 631s + } 631s > 631s > rowCummaxs_R <- function(x, ..., useNames = NA) { 631s + mode <- storage.mode(x) 631s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 631s + storage.mode(x) <- "numeric" 631s + suppressWarnings({ 631s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 631s + }) 631s + 631s + # Preserve dimnames attribute? 631s + dim(y) <- dim(x) 631s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 631s + 631s + y 631s + } 631s > 631s > 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > # With and without some NAs 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > for (mode in c("logical", "integer", "double")) { 631s + for (add_na in c(FALSE, TRUE)) { 631s + cat("add_na = ", add_na, "\n", sep = "") 631s + 631s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 631s + diag(x) <- 0 631s + if (add_na) { 631s + x[3:7, c(2, 4)] <- NA_real_ 631s + } 631s + cat("mode: ", mode, "\n", sep = "") 631s + storage.mode(x) <- mode 631s + str(x) 631s + 631s + # To check dimnames attribute 631s + dimnames <- list(letters[1:10], LETTERS[1:5]) 631s + 631s + # Test with and without dimnames on x 631s + for (setDimnames in c(TRUE, FALSE)) { 631s + if (setDimnames) dimnames(x) <- dimnames 631s + else dimnames(x) <- NULL 631s + # Check names attribute 631s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 631s + # Row/column ranges 631s + r0 <- rowCummins_R(x, useNames = useNames) 631s + r1 <- rowCummins(x, useNames = useNames) 631s + r2 <- t(colCummins(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + 631s + r0 <- rowCummaxs_R(x, useNames = useNames) 631s + r1 <- rowCummaxs(x, useNames = useNames) 631s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + } # for (useNames ...) 631s + } # for (setDimnames ...) 631s + } # for (add_na ...) 631s + } # for (mode ...) 631s add_na = FALSE 631s mode: logical 631s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 631s add_na = TRUE 631s mode: logical 631s logi [1:10, 1:5] FALSE TRUE TRUE TRUE TRUE TRUE ... 631s add_na = FALSE 631s mode: integer 631s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 631s add_na = TRUE 631s mode: integer 631s int [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 631s add_na = FALSE 631s mode: double 631s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 631s add_na = TRUE 631s mode: double 631s num [1:10, 1:5] 0 2 3 4 5 6 7 8 9 10 ... 631s > 631s > 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > # All NAs 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > for (mode in c("logical", "integer", "double")) { 631s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 631s + cat("mode: ", mode, "\n", sep = "") 631s + storage.mode(x) <- mode 631s + str(x) 631s + 631s + # Test with and without dimnames on x 631s + for (setDimnames in c(TRUE, FALSE)) { 631s + if (setDimnames) dimnames(x) <- dimnames 631s + else dimnames(x) <- NULL 631s + # Check names attribute 631s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 631s + r0 <- rowCummins_R(x, useNames = useNames) 631s + r1 <- rowCummins(x, useNames = useNames) 631s + r2 <- t(colCummins(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + 631s + r0 <- rowCummaxs_R(x, useNames = useNames) 631s + r1 <- rowCummaxs(x, useNames = useNames) 631s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + } # for (useNames ...) 631s + } # for (setDimnames ...) 631s + } # for (mode ...) 631s mode: logical 631s logi [1:10, 1:5] NA NA NA NA NA NA ... 631s mode: integer 631s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 631s mode: double 631s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 631s > 631s > 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > # A 1x1 matrix 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > for (mode in c("logical", "integer", "double")) { 631s + x <- matrix(0, nrow = 1L, ncol = 1L) 631s + cat("mode: ", mode, "\n", sep = "") 631s + storage.mode(x) <- mode 631s + str(x) 631s + 631s + # To check dimnames attribute 631s + dimnames <- list("a", "A") 631s + 631s + # Test with and without dimnames on x 631s + for (setDimnames in c(TRUE, FALSE)) { 631s + if (setDimnames) dimnames(x) <- dimnames 631s + else dimnames(x) <- NULL 631s + # Check names attribute 631s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 631s + r0 <- rowCummins_R(x, useNames = useNames) 631s + r1 <- rowCummins(x, useNames = useNames) 631s + r2 <- t(colCummins(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + 631s + r0 <- rowCummaxs_R(x, useNames = useNames) 631s + r1 <- rowCummaxs(x, useNames = useNames) 631s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + } # for (useNames ...) 631s + } # for (setDimnames ...) 631s + } # for (mode ...) 631s mode: logical 631s logi [1, 1] FALSE 631s mode: integer 631s int [1, 1] 0 631s mode: double 631s num [1, 1] 0 631s > 631s > 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > # Corner cases 631s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 631s > for (mode in c("logical", "integer", "double")) { 631s + cat("mode: ", mode, "\n", sep = "") 631s + value <- 0 631s + storage.mode(value) <- mode 631s + value0 <- if (mode == "logical") 0L else value 631s + 631s + # A 0x0 matrix 631s + x <- matrix(value, nrow = 0L, ncol = 0L) 631s + str(x) 631s + r0 <- matrix(value0, nrow = nrow(x), ncol = ncol(x)) 631s + r1 <- rowCummins(x) 631s + r2 <- t(colCummins(t(x))) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + 631s + # A 0xK matrix 631s + x <- matrix(value, nrow = 0L, ncol = 5L) 631s + str(x) 631s + colnames <- LETTERS[1:5] 631s + # Test with and without dimnames on x 631s + for (setDimnames in c(TRUE, FALSE)) { 631s + if (setDimnames) colnames(x) <- colnames 631s + else dimnames(x) <- NULL 631s + # Check names attribute 631s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 631s + r0 <- rowCummins_R(x, useNames = useNames) 631s + r1 <- rowCummins(x, useNames = useNames) 631s + r2 <- t(colCummins(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + r0 <- rowCummaxs_R(x, useNames = useNames) 631s + r1 <- rowCummaxs(x, useNames = useNames) 631s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + } # for (useNames ...) 631s + } # for (setDimnames ...) 631s + 631s + # A Nx0 matrix 631s + x <- matrix(value, nrow = 5L, ncol = 0L) 631s + str(x) 631s + rownames <- LETTERS[1:5] 631s + # Test with and without dimnames on x 631s + for (setDimnames in c(TRUE, FALSE)) { 631s + if (setDimnames) rownames(x) <- rownames 631s + else dimnames(x) <- NULL 631s + # Check names attribute 631s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 631s + r0 <- rowCummins_R(x, useNames = useNames) 631s + r1 <- rowCummins(x, useNames = useNames) 631s + r2 <- t(colCummins(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + 631s + r0 <- rowCummaxs_R(x, useNames = useNames) 631s + r1 <- rowCummaxs(x, useNames = useNames) 631s + r2 <- t(colCummaxs(t(x), useNames = useNames)) 631s + stopifnot(all.equal(r1, r2)) 631s + stopifnot(all.equal(r1, r0)) 631s + stopifnot(all.equal(r2, r0)) 631s + } # for (useNames ...) 631s + } # for (setDimnames ...) 631s + } # for (mode ...) 631s mode: logical 631s logi[0 , 0 ] 631s logi[0 , 1:5] 631s logi[1:5, 0 ] 631s mode: integer 631s int[0 , 0 ] 631s int[0 , 1:5] 631s int[1:5, 0 ] 631s mode: double 631s num[0 , 0 ] 631s num[0 , 1:5] 631s num[1:5, 0 ] 631s > 631s 631s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 631s Copyright (C) 2024 The R Foundation for Statistical Computing 631s Platform: aarch64-unknown-linux-gnu 631s 631s R is free software and comes with ABSOLUTELY NO WARRANTY. 631s You are welcome to redistribute it under certain conditions. 631s Type 'license()' or 'licence()' for distribution details. 631s 631s R is a collaborative project with many contributors. 631s Type 'contributors()' for more information and 631s 'citation()' on how to cite R or R packages in publications. 631s 631s Type 'demo()' for some demos, 'help()' for on-line help, or 631s 'help.start()' for an HTML browser interface to help. 631s Type 'q()' to quit R. 631s 631s > library("matrixStats") 631s > 631s > rowCummins_R <- function(x, ..., useNames = NA) { 631s + suppressWarnings({ 631s + y <- t(apply(x, MARGIN = 1L, FUN = cummin)) 631s + }) 631s + 631s + # Preserve dimnames attribute? 631s + dim(y) <- dim(x) 631s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 631s + 631s + y 631s + } 631s > 631s > rowCummaxs_R <- function(x, ..., useNames = NA) { 632s + mode <- storage.mode(x) 632s + # Change mode because a bug is detected on cummax for integer in R-3.2.0 632s + storage.mode(x) <- "numeric" 632s + suppressWarnings({ 632s + y <- t(apply(x, MARGIN = 1L, FUN = cummax)) 632s + }) 632s + 632s + # Preserve dimnames attribute? 632s + dim(y) <- dim(x) 632s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 632s + 632s + storage.mode(y) <- mode 632s + y 632s + } 632s > 632s > 632s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 632s > # Subsetted tests 632s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 632s > source("utils/validateIndicesFramework.R") 632s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 632s > storage.mode(x) <- "integer" 632s > 632s > # To check dimnames attribute 632s > dimnames <- list(letters[1:6], LETTERS[1:6]) 632s > 632s > # Test with and without dimnames on x 632s > for (setDimnames in c(TRUE, FALSE)) { 632s + if (setDimnames) dimnames(x) <- dimnames 632s + else dimnames(x) <- NULL 632s + for (rows in index_cases) { 632s + for (cols in index_cases) { 632s + # Check names attribute 632s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 632s + validateIndicesTestMatrix(x, rows, cols, 632s + ftest = rowCummins, fsure = rowCummins_R, useNames = useNames,verbose=TRUE) 632s + validateIndicesTestMatrix(x, rows, cols, 632s + ftest = function(x, rows, cols, ..., useNames) { 632s + t(colCummins(t(x), rows = cols, cols = rows, useNames = useNames)) 632s + }, fsure = rowCummins_R, useNames = useNames) 632s + 632s + validateIndicesTestMatrix(x, rows, cols, 632s + ftest = rowCummaxs, fsure = rowCummaxs_R, useNames = useNames) 632s + validateIndicesTestMatrix(x, rows, cols, 632s + ftest = function(x, rows, cols, ..., useNames) { 632s + t(colCummaxs(t(x), rows = cols, cols = rows, useNames = useNames)) 632s + }, fsure = rowCummaxs_R, useNames = useNames) 632s + } 632s + } 632s + } 632s + } 633s > 633s 633s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 633s Copyright (C) 2024 The R Foundation for Statistical Computing 633s Platform: aarch64-unknown-linux-gnu 633s 633s R is free software and comes with ABSOLUTELY NO WARRANTY. 633s You are welcome to redistribute it under certain conditions. 633s Type 'license()' or 'licence()' for distribution details. 633s 633s R is a collaborative project with many contributors. 633s Type 'contributors()' for more information and 633s 'citation()' on how to cite R or R packages in publications. 633s 633s Type 'demo()' for some demos, 'help()' for on-line help, or 633s 'help.start()' for an HTML browser interface to help. 633s Type 'q()' to quit R. 633s 633s > library("matrixStats") 633s > 633s > rowCumprods_R <- function(x, ..., useNames = NA) { 633s + suppressWarnings({ 633s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 633s + }) 633s + 633s + # Preserve dimnames attribute? 633s + dim(y) <- dim(x) 633s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 633s + 633s + y 633s + } 633s > 633s > 633s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 633s > # With and without some NAs 633s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 633s > for (mode in c("logical", "integer", "double")) { 633s + for (add_na in c(FALSE, TRUE)) { 633s + cat("add_na = ", add_na, "\n", sep = "") 633s + 633s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 633s + if (add_na) { 633s + x[3:7, c(2, 4)] <- NA_real_ 633s + } 633s + cat("mode: ", mode, "\n", sep = "") 633s + storage.mode(x) <- mode 633s + str(x) 633s + 633s + # To check dimnames attribute 633s + dimnames <- list(letters[1:10], LETTERS[1:5]) 633s + 633s + # Test with and without dimnames on x 633s + for (setDimnames in c(TRUE, FALSE)) { 633s + if (setDimnames) dimnames(x) <- dimnames 633s + else dimnames(x) <- NULL 633s + # Check names attribute 633s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 633s + # Row/column ranges 633s + r0 <- rowCumprods_R(x, useNames = useNames) 633s + r1 <- rowCumprods(x, useNames = useNames) 633s + r2 <- t(colCumprods(t(x), useNames = useNames)) 633s + stopifnot(all.equal(r1, r2)) 633s + stopifnot(all.equal(r1, r0)) 633s + stopifnot(all.equal(r2, r0)) 633s + } # for (useNames ...) 633s + } # for (setDimnames ...) 633s + } # for (add_na ...) 633s + } # for (mode ...) 634s add_na = FALSE 634s mode: logical 634s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 634s add_na = TRUE 634s mode: logical 634s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 634s add_na = FALSE 634s mode: integer 634s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 634s add_na = TRUE 634s mode: integer 634s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 634s add_na = FALSE 634s mode: double 634s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 634s add_na = TRUE 634s mode: double 634s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 634s > 634s > 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > # All NAs 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > for (mode in c("logical", "integer", "double")) { 634s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 634s + cat("mode: ", mode, "\n", sep = "") 634s + storage.mode(x) <- mode 634s + str(x) 634s + 634s + # Test with and without dimnames on x 634s + for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) dimnames(x) <- dimnames 634s + else dimnames(x) <- NULL 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + # Row/column ranges 634s + r0 <- rowCumprods_R(x, useNames = useNames) 634s + r1 <- rowCumprods(x, useNames = useNames) 634s + r2 <- t(colCumprods(t(x), useNames = useNames)) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + } # for (useNames ...) 634s + } # for (setDimnames ...) 634s + } # for (mode ...) 634s mode: logical 634s logi [1:10, 1:5] NA NA NA NA NA NA ... 634s mode: integer 634s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 634s mode: double 634s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 634s > 634s > 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > # A 1x1 matrix 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > for (mode in c("logical", "integer", "double")) { 634s + x <- matrix(0, nrow = 1L, ncol = 1L) 634s + cat("mode: ", mode, "\n", sep = "") 634s + storage.mode(x) <- mode 634s + str(x) 634s + 634s + dimnames <- list("a", "A") 634s + # Test with and without dimnames on x 634s + for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) dimnames(x) <- dimnames 634s + else dimnames(x) <- NULL 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + # Row/column ranges 634s + r0 <- rowCumprods_R(x, useNames = useNames) 634s + r1 <- rowCumprods(x, useNames = useNames) 634s + r2 <- t(colCumprods(t(x), useNames = useNames)) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + } # for (useNames ...) 634s + } # for (setDimnames ...) 634s + } 634s mode: logical 634s logi [1, 1] FALSE 634s mode: integer 634s int [1, 1] 0 634s mode: double 634s num [1, 1] 0 634s > 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > # BUG FIX TEST: Assert zeros don't trump NAs in integer matrices 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > for (mode in c("logical", "integer", "double")) { 634s + x <- matrix(NA_real_, nrow = 3L, ncol = 2L) 634s + x[1, 2] <- 0 634s + x[2, 2] <- 1 634s + x[3, 1] <- 0 634s + storage.mode(x) <- mode 634s + cat("mode: ", mode, "\n", sep = "") 634s + str(x) 634s + 634s + dimnames <- list(letters[1:3], LETTERS[1:2]) 634s + # Test with and without dimnames on x 634s + for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) dimnames(x) <- dimnames 634s + else dimnames(x) <- NULL 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + # Row/column ranges 634s + r0 <- rowCumprods_R(x, useNames = useNames) 634s + r1 <- rowCumprods(x, useNames = useNames) 634s + r2 <- t(colCumprods(t(x), useNames = useNames)) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + } # for (useNames ...) 634s + } # for (setDimnames ...) 634s + } 634s mode: logical 634s logi [1:3, 1:2] NA NA FALSE FALSE TRUE NA 634s mode: integer 634s int [1:3, 1:2] NA NA 0 0 1 NA 634s mode: double 634s num [1:3, 1:2] NA NA 0 0 1 NA 634s > 634s > 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > # Corner cases 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > for (mode in c("logical", "integer", "double")) { 634s + cat("mode: ", mode, "\n", sep = "") 634s + value <- 0 634s + storage.mode(value) <- mode 634s + if (mode == "logical") value2 <- 0L 634s + 634s + # A 0x0 matrix 634s + x <- matrix(value, nrow = 0L, ncol = 0L) 634s + str(x) 634s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 634s + r1 <- rowCumprods(x) 634s + r2 <- t(colCumprods(t(x))) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + 634s + # A 0xK matrix 634s + x <- matrix(value, nrow = 0L, ncol = 5L) 634s + str(x) 634s + colnames <- LETTERS[1:5] 634s + # Test with and without dimnames on x 634s + for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) colnames(x) <- colnames 634s + else dimnames(x) <- NULL 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + r0 <- rowCumprods_R(x, useNames = useNames) 634s + r1 <- rowCumprods(x, useNames = useNames) 634s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + } # for (useNames ...) 634s + } # for (setDimnames ...) 634s + 634s + # A Nx0 matrix 634s + x <- matrix(value, nrow = 5L, ncol = 0L) 634s + str(x) 634s + rownames <- LETTERS[1:5] 634s + # Test with and without dimnames on x 634s + for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) rownames(x) <- rownames 634s + else dimnames(x) <- NULL 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + r0 <- rowCumprods_R(x, useNames = useNames) 634s + r1 <- rowCumprods(x, useNames = useNames) 634s + r2 <- t(rowCumprods(t(x), useNames = useNames)) 634s + stopifnot(all.equal(r1, r2)) 634s + stopifnot(all.equal(r1, r0)) 634s + stopifnot(all.equal(r2, r0)) 634s + } # for (useNames ...) 634s + } # for (setDimnames ...) 634s + } # for (mode ...) 634s mode: logical 634s logi[0 , 0 ] 634s logi[0 , 1:5] 634s logi[1:5, 0 ] 634s mode: integer 634s int[0 , 0 ] 634s int[0 , 1:5] 634s int[1:5, 0 ] 634s mode: double 634s num[0 , 0 ] 634s num[0 , 1:5] 634s num[1:5, 0 ] 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: aarch64-unknown-linux-gnu 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 > library("matrixStats") 634s > 634s > rowCumprods_R <- function(x, ..., useNames = NA) { 634s + suppressWarnings({ 634s + y <- t(apply(x, MARGIN = 1L, FUN = cumprod)) 634s + }) 634s + 634s + # Preserve dimnames attribute? 634s + dim(y) <- dim(x) 634s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 634s + 634s + y 634s + } 634s > 634s > 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > # Subsetted tests 634s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 634s > source("utils/validateIndicesFramework.R") 634s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 634s > storage.mode(x) <- "integer" 634s > 634s > # To check dimnames attribute 634s > dimnames <- list(letters[1:6], LETTERS[1:6]) 634s > 634s > # Test with and without dimnames on x 634s > for (setDimnames in c(TRUE, FALSE)) { 634s + if (setDimnames) dimnames(x) <- dimnames 634s + else dimnames(x) <- NULL 634s + for (rows in index_cases) { 634s + for (cols in index_cases) { 634s + # Check names attribute 634s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 634s + validateIndicesTestMatrix(x, rows, cols, 634s + ftest = rowCumprods, fsure = rowCumprods_R, useNames = useNames) 634s + validateIndicesTestMatrix(x, rows, cols, 634s + ftest = function(x, rows, cols, ..., useNames) { 634s + t(colCumprods(t(x), rows = cols, cols = rows, useNames = useNames)) 634s + }, fsure = rowCumprods_R, useNames = useNames) 634s + } 634s + } 634s + } 634s + } 635s > 635s 635s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 635s Copyright (C) 2024 The R Foundation for Statistical Computing 635s Platform: aarch64-unknown-linux-gnu 635s 635s R is free software and comes with ABSOLUTELY NO WARRANTY. 635s You are welcome to redistribute it under certain conditions. 635s Type 'license()' or 'licence()' for distribution details. 635s 635s R is a collaborative project with many contributors. 635s Type 'contributors()' for more information and 635s 'citation()' on how to cite R or R packages in publications. 635s 635s Type 'demo()' for some demos, 'help()' for on-line help, or 635s 'help.start()' for an HTML browser interface to help. 635s Type 'q()' to quit R. 635s 635s > library("matrixStats") 635s > 635s > rowCumsums_R <- function(x, ..., useNames = NA) { 635s + suppressWarnings({ 635s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 635s + }) 635s + 635s + # Preserve dimnames attribute? 635s + dim(y) <- dim(x) 635s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 635s + 635s + y 635s + } 635s > 635s > 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > # With and without some NAs 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > dimnames <- list(letters[1:10], LETTERS[1:5]) # to check dimnames attribute 635s > for (mode in c("logical", "integer", "double")) { 635s + for (add_na in c(FALSE, TRUE)) { 635s + cat("add_na = ", add_na, "\n", sep = "") 635s + 635s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 635s + if (add_na) { 635s + x[3:7, c(2, 4)] <- NA_real_ 635s + } 635s + cat("mode: ", mode, "\n", sep = "") 635s + storage.mode(x) <- mode 635s + str(x) 635s + 635s + # Test with and without dimnames on x 635s + for (setDimnames in c(TRUE, FALSE)) { 635s + if (setDimnames) dimnames(x) <- dimnames 635s + else dimnames(x) <- NULL 635s + # Check names attribute 635s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 635s + # Row/column ranges 635s + r0 <- rowCumsums_R(x, useNames = useNames) 635s + r1 <- rowCumsums(x, useNames = useNames) 635s + r2 <- t(colCumsums(t(x), useNames = useNames)) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + } # for (useNames ...) 635s + } # for (setDimnames ...) 635s + } # for (add_na ...) 635s + } 635s add_na = FALSE 635s mode: logical 635s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 635s add_na = TRUE 635s mode: logical 635s logi [1:10, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 635s add_na = FALSE 635s mode: integer 635s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 635s add_na = TRUE 635s mode: integer 635s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 635s add_na = FALSE 635s mode: double 635s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 635s add_na = TRUE 635s mode: double 635s num [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 635s > 635s > 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > # All NAs 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > for (mode in c("logical", "integer", "double")) { 635s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 635s + cat("mode: ", mode, "\n", sep = "") 635s + storage.mode(x) <- mode 635s + str(x) 635s + 635s + # Test with and without dimnames on x 635s + for (setDimnames in c(TRUE, FALSE)) { 635s + if (setDimnames) dimnames(x) <- dimnames 635s + else dimnames(x) <- NULL 635s + # Check names attribute 635s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 635s + # Row/column ranges 635s + r0 <- rowCumsums_R(x, useNames = useNames) 635s + r1 <- rowCumsums(x, useNames = useNames) 635s + r2 <- t(colCumsums(t(x), useNames = useNames)) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + } # for (useNames ...) 635s + } # for (setDimnames ...) 635s + } # for (mode ...) 635s mode: logical 635s logi [1:10, 1:5] NA NA NA NA NA NA ... 635s mode: integer 635s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 635s mode: double 635s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 635s > 635s > 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > # A 1x1 matrix 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > dimnames <- list("a", "A") # to check dimnames attribute 635s > for (mode in c("logical", "integer", "double")) { 635s + x <- matrix(0, nrow = 1L, ncol = 1L) 635s + cat("mode: ", mode, "\n", sep = "") 635s + storage.mode(x) <- mode 635s + str(x) 635s + 635s + r0 <- rowCumsums_R(x) 635s + r1 <- rowCumsums(x) 635s + r2 <- t(colCumsums(t(x))) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + 635s + # Check dimnames attribute 635s + dimnames(x) <- dimnames 635s + # r0 <- rowCumsums_R(x) 635s + # > r0 635s + # a 635s + # [1,] 0 635s + r1 <- rowCumsums(x, useNames = TRUE) 635s + r2 <- t(colCumsums(t(x), useNames = TRUE)) 635s + stopifnot(identical(dimnames(r1), dimnames)) 635s + stopifnot(identical(dimnames(r2), dimnames)) 635s + dimnames(x) <- NULL 635s + } 635s mode: logical 635s logi [1, 1] FALSE 635s mode: integer 635s int [1, 1] 0 635s mode: double 635s num [1, 1] 0 635s > 635s > 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > # Corner cases 635s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 635s > names <- LETTERS[1:5] # to check dimnames attribute 635s > for (mode in c("logical", "integer", "double")) { 635s + cat("mode: ", mode, "\n", sep = "") 635s + value <- 0 635s + storage.mode(value) <- mode 635s + value2 <- value 635s + if (mode == "logical") value2 <- 0L 635s + 635s + # A 0x0 matrix 635s + x <- matrix(value, nrow = 0L, ncol = 0L) 635s + str(x) 635s + r0 <- matrix(value2, nrow = nrow(x), ncol = ncol(x)) 635s + r1 <- rowCumsums(x) 635s + r2 <- t(colCumsums(t(x))) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + 635s + # A 0xK matrix 635s + x <- matrix(value, nrow = 0L, ncol = 5L) 635s + str(x) 635s + colnames <- LETTERS[1:5] 635s + # Test with and without dimnames on x 635s + for (setDimnames in c(TRUE, FALSE)) { 635s + if (setDimnames) colnames(x) <- colnames 635s + else dimnames(x) <- NULL 635s + # Check names attribute 635s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 635s + r0 <- rowCumsums_R(x, useNames = useNames) 635s + r1 <- rowCumsums(x, useNames = useNames) 635s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + } # for (useNames ...) 635s + } # for (setDimnames ...) 635s + 635s + # A Nx0 matrix 635s + x <- matrix(value, nrow = 5L, ncol = 0L) 635s + str(x) 635s + rownames <- LETTERS[1:5] 635s + # Test with and without dimnames on x 635s + for (setDimnames in c(TRUE, FALSE)) { 635s + if (setDimnames) rownames(x) <- rownames 635s + else dimnames(x) <- NULL 635s + # Check names attribute 635s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 635s + r0 <- rowCumsums_R(x, useNames = useNames) 635s + r1 <- rowCumsums(x, useNames = useNames) 635s + r2 <- t(rowCumsums(t(x), useNames = useNames)) 635s + stopifnot(all.equal(r1, r2)) 635s + stopifnot(all.equal(r1, r0)) 635s + stopifnot(all.equal(r2, r0)) 635s + } # for (useNames ...) 635s + } # for (setDimnames ...) 635s + } # for (mode ...) 635s mode: logical 635s logi[0 , 0 ] 635s logi[0 , 1:5] 636s logi[1:5, 0 ] 636s mode: integer 636s int[0 , 0 ] 636s int[0 , 1:5] 636s int[1:5, 0 ] 636s mode: double 636s num[0 , 0 ] 636s num[0 , 1:5] 636s num[1:5, 0 ] 636s > 636s 636s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 636s Copyright (C) 2024 The R Foundation for Statistical Computing 636s Platform: aarch64-unknown-linux-gnu 636s 636s R is free software and comes with ABSOLUTELY NO WARRANTY. 636s You are welcome to redistribute it under certain conditions. 636s Type 'license()' or 'licence()' for distribution details. 636s 636s R is a collaborative project with many contributors. 636s Type 'contributors()' for more information and 636s 'citation()' on how to cite R or R packages in publications. 636s 636s Type 'demo()' for some demos, 'help()' for on-line help, or 636s 'help.start()' for an HTML browser interface to help. 636s Type 'q()' to quit R. 636s 636s > library("matrixStats") 636s > 636s > rowCumsums_R <- function(x, ..., useNames = NA) { 636s + suppressWarnings({ 636s + y <- t(apply(x, MARGIN = 1L, FUN = cumsum)) 636s + }) 636s + 636s + # Preserve dimnames attribute? 636s + dim(y) <- dim(x) 636s + dimnames(y) <- if (isTRUE(useNames)) dimnames(x) else NULL 636s + 636s + y 636s + } 636s > 636s > 636s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 636s > # Subsetted tests 636s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 636s > source("utils/validateIndicesFramework.R") 636s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 636s > storage.mode(x) <- "integer" 636s > 636s > # To check dimnames attribute 636s > dimnames <- list(letters[1:6], LETTERS[1:6]) 636s > 636s > # Test with and without dimnames on x 636s > for (setDimnames in c(TRUE, FALSE)) { 636s + if (setDimnames) dimnames(x) <- dimnames 636s + else dimnames(x) <- NULL 636s + for (rows in index_cases) { 636s + for (cols in index_cases) { 636s + # Check names attribute 636s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 636s + validateIndicesTestMatrix(x, rows, cols, 636s + ftest = rowCumsums, fsure = rowCumsums_R, useNames = useNames) 636s + validateIndicesTestMatrix(x, rows, cols, 636s + ftest = function(x, rows, cols, ..., useNames) { 636s + t(colCumsums(t(x), rows = cols, cols = rows, useNames = useNames)) 636s + }, fsure = rowCumsums_R, useNames = useNames) 636s + } 636s + } 636s + } 636s + } 637s > 637s 637s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 637s Copyright (C) 2024 The R Foundation for Statistical Computing 637s Platform: aarch64-unknown-linux-gnu 637s 637s R is free software and comes with ABSOLUTELY NO WARRANTY. 637s You are welcome to redistribute it under certain conditions. 637s Type 'license()' or 'licence()' for distribution details. 637s 637s R is a collaborative project with many contributors. 637s Type 'contributors()' for more information and 637s 'citation()' on how to cite R or R packages in publications. 637s 637s Type 'demo()' for some demos, 'help()' for on-line help, or 637s 'help.start()' for an HTML browser interface to help. 637s Type 'q()' to quit R. 637s 637s > library("matrixStats") 637s > 637s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 637s + ncol2 <- ncol(x) - lag * differences 637s + if (ncol2 <= 0) { 637s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 637s + # Preserve names attribute 637s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 637s + return(y) 637s + } 637s + suppressWarnings({ 637s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 637s + }) 637s + y <- t(y) 637s + 637s + # Preserve dimnames attribute 637s + dim(y) <- c(nrow(x), ncol2) 637s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 637s + colnames <- colnames(x) 637s + if (!is.null(colnames)) { 637s + len <- length(colnames) 637s + colnames <- colnames[(len - ncol2 + 1):len] 637s + } 637s + dimnames(y) <- list(rownames(x), colnames) 637s + } 637s + else dimnames(y) <- NULL 637s + 637s + y 637s + } 637s > 637s > 637s > set.seed(0x42) 637s > 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > # With and without some NAs 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > for (mode in c("integer", "double")) { 637s + cat("mode: ", mode, "\n", sep = "") 637s + 637s + for (add_na in c(FALSE, TRUE)) { 637s + cat("add_na = ", add_na, "\n", sep = "") 637s + 637s + x <- matrix(sample(10 * 8) + 0.1, nrow = 10L, ncol = 8L) 637s + if (add_na) { 637s + x[3:7, c(2, 4)] <- NA_real_ 637s + } 637s + storage.mode(x) <- mode 637s + str(x) 637s + 637s + dimnames <- list(letters[1:10], LETTERS[1:8]) 637s + 637s + # Test with and without dimnames on x 637s + for (setDimnames in c(TRUE, FALSE)) { 637s + if (setDimnames) dimnames(x) <- dimnames 637s + else dimnames(x) <- NULL 637s + # Check dimnames attribute 637s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 637s + for (lag in 1:4) { 637s + for (differences in 1:3) { 637s + cat(sprintf("mode: %s, lag = %d, differences = %d\n", 637s + mode, lag, differences)) 637s + # Row/column ranges 637s + r0 <- rowDiffs_R(x, lag = lag, differences = differences, useNames = useNames) 637s + r1 <- rowDiffs(x, lag = lag, differences = differences, useNames = useNames) 637s + r2 <- t(colDiffs(t(x), lag = lag, differences = differences, useNames = useNames)) 637s + stopifnot(all.equal(r1, r0)) 637s + stopifnot(all.equal(r2, r0)) 637s + stopifnot(all.equal(r1, r2)) 637s + } 637s + } 637s + } # for (useNames ...) 637s + } # for (setDimnames ...) 637s + } # for (add_na ...) 637s + } # for (mode ...) 637s mode: integer 637s add_na = FALSE 637s int [1:10, 1:8] 68 26 29 47 48 10 1 38 16 40 ... 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s add_na = TRUE 637s int [1:10, 1:8] 80 71 7 52 79 22 31 10 29 63 ... 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: integer, lag = 1, differences = 1 637s mode: integer, lag = 1, differences = 2 637s mode: integer, lag = 1, differences = 3 637s mode: integer, lag = 2, differences = 1 637s mode: integer, lag = 2, differences = 2 637s mode: integer, lag = 2, differences = 3 637s mode: integer, lag = 3, differences = 1 637s mode: integer, lag = 3, differences = 2 637s mode: integer, lag = 3, differences = 3 637s mode: integer, lag = 4, differences = 1 637s mode: integer, lag = 4, differences = 2 637s mode: integer, lag = 4, differences = 3 637s mode: double 637s add_na = FALSE 637s 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 ... 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s add_na = TRUE 637s 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 ... 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s mode: double, lag = 1, differences = 1 637s mode: double, lag = 1, differences = 2 637s mode: double, lag = 1, differences = 3 637s mode: double, lag = 2, differences = 1 637s mode: double, lag = 2, differences = 2 637s mode: double, lag = 2, differences = 3 637s mode: double, lag = 3, differences = 1 637s mode: double, lag = 3, differences = 2 637s mode: double, lag = 3, differences = 3 637s mode: double, lag = 4, differences = 1 637s mode: double, lag = 4, differences = 2 637s mode: double, lag = 4, differences = 3 637s > 637s > 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > # All NAs 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > for (mode in c("integer", "double")) { 637s + cat("mode: ", mode, "\n", sep = "") 637s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 637s + storage.mode(x) <- mode 637s + str(x) 637s + 637s + dimnames <- list(letters[1:10], LETTERS[1:5]) 637s + 637s + # Test with and without dimnames on x 637s + for (setDimnames in c(TRUE, FALSE)) { 637s + if (setDimnames) dimnames(x) <- dimnames 637s + else dimnames(x) <- NULL 637s + # Check dimnames attribute 637s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 637s + r0 <- rowDiffs_R(x, useNames = useNames) 637s + r1 <- rowDiffs(x, useNames = useNames) 637s + r2 <- t(colDiffs(t(x), useNames = useNames)) 637s + stopifnot(all.equal(r1, r0)) 637s + stopifnot(all.equal(r2, r0)) 637s + stopifnot(all.equal(r1, r2)) 637s + } # for (useNames ...) 637s + } # for (setDimnames ...) 637s + } # for (mode ...) 637s mode: integer 637s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 637s mode: double 637s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 637s > 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > # A 1x1 matrix 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > x <- matrix(0, nrow = 1L, ncol = 1L) 637s > dimnames <- list("a", "A") 637s > # Test with and without dimnames on x 637s > for (setDimnames in c(TRUE, FALSE)) { 637s + if (setDimnames) dimnames(x) <- dimnames 637s + else dimnames(x) <- NULL 637s + # Check dimnames attribute 637s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 637s + r0 <- rowDiffs_R(x, useNames = useNames) 637s + r1 <- rowDiffs(x, useNames = useNames) 637s + r2 <- t(colDiffs(t(x), useNames = useNames)) 637s + stopifnot(all.equal(r1, r0)) 637s + stopifnot(all.equal(r2, r0)) 637s + stopifnot(all.equal(r1, r2)) 637s + } # for (useNames ...) 637s + } # for (setDimnames ...) 637s > 637s 637s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 637s Copyright (C) 2024 The R Foundation for Statistical Computing 637s Platform: aarch64-unknown-linux-gnu 637s 637s R is free software and comes with ABSOLUTELY NO WARRANTY. 637s You are welcome to redistribute it under certain conditions. 637s Type 'license()' or 'licence()' for distribution details. 637s 637s R is a collaborative project with many contributors. 637s Type 'contributors()' for more information and 637s 'citation()' on how to cite R or R packages in publications. 637s 637s Type 'demo()' for some demos, 'help()' for on-line help, or 637s 'help.start()' for an HTML browser interface to help. 637s Type 'q()' to quit R. 637s 637s > library("matrixStats") 637s > 637s > rowDiffs_R <- function(x, lag = 1L, differences = 1L, ..., useNames = NA) { 637s + ncol2 <- ncol(x) - lag * differences 637s + if (ncol2 <= 0) { 637s + y <- matrix(x[integer(0L)], nrow = nrow(x), ncol = 0L) 637s + # Preserve names attribute 637s + if (isTRUE(useNames) && !is.null(rownames(x))) rownames(y) <- rownames(x) 637s + return(y) 637s + } 637s + suppressWarnings({ 637s + y <- apply(x, MARGIN = 1L, FUN = diff, lag = lag, differences = differences) 637s + }) 637s + y <- t(y) 637s + 637s + # Preserve dimnames attribute 637s + dim(y) <- c(nrow(x), ncol2) 637s + if (isTRUE(useNames) && !is.null(dimnames(x))) { 637s + colnames <- colnames(x) 637s + if (!is.null(colnames)) { 637s + len <- length(colnames) 637s + colnames <- colnames[(len - ncol2 + 1):len] 637s + } 637s + dimnames(y) <- list(rownames(x), colnames) 637s + } 637s + else dimnames(y) <- NULL 637s + 637s + y 637s + } 637s > 637s > 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > # Subsetted tests 637s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 637s > source("utils/validateIndicesFramework.R") 637s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 637s > storage.mode(x) <- "integer" 637s > 637s > # To check dimnames attribute 637s > dimnames <- list(letters[1:6], LETTERS[1:6]) 637s > 637s > # Test with and without dimnames on x 637s > for (setDimnames in c(TRUE, FALSE)) { 637s + if (setDimnames) dimnames(x) <- dimnames 637s + else dimnames(x) <- NULL 637s + 637s + count <- 0L 637s + for (rows in index_cases) { 637s + for (cols in index_cases) { 637s + count <- count + 1L 637s + for (lag in 1:2) { 637s + for (differences in 1:3) { 637s + # Check dimnames attribute 637s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 637s + useNames <- useNames[count %% length(useNames) + 1] 637s + validateIndicesTestMatrix(x, rows, cols, 637s + ftest = rowDiffs, fsure = rowDiffs_R, 637s + lag = lag, differences = differences, useNames = useNames) 637s + validateIndicesTestMatrix(x, rows, cols, 637s + ftest = function(x, rows, cols, ..., useNames) { 637s + t(colDiffs(t(x), rows = cols, cols = rows, ..., useNames = useNames)) 637s + }, fsure = rowDiffs_R, 637s + lag = lag, differences = differences, useNames = useNames) 637s + } 637s + } 637s + } 637s + } 637s + } 640s > 640s 640s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 640s Copyright (C) 2024 The R Foundation for Statistical Computing 640s Platform: aarch64-unknown-linux-gnu 640s 640s R is free software and comes with ABSOLUTELY NO WARRANTY. 640s You are welcome to redistribute it under certain conditions. 640s Type 'license()' or 'licence()' for distribution details. 640s 640s R is a collaborative project with many contributors. 640s Type 'contributors()' for more information and 640s 'citation()' on how to cite R or R packages in publications. 640s 640s Type 'demo()' for some demos, 'help()' for on-line help, or 640s 'help.start()' for an HTML browser interface to help. 640s Type 'q()' to quit R. 640s 640s > library("matrixStats") 640s > 640s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 640s + quantile_na <- function(x, ..., na.rm = FALSE) { 640s + if (!na.rm && anyMissing(x)) 640s + return(c(NA_real_, NA_real_)) 640s + quantile(x, ..., na.rm = na.rm) 640s + } 640s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 640s + probs = c(0.25, 0.75), na.rm = na.rm) 640s + rownames(q) <- NULL # Not needed anymore 640s + 640s + # Preserve names attribute 640s + dim(q) <- c(2L, nrow(x)) 640s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 640s + 640s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 640s + } 640s > 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > # Test with multiple quantiles 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > for (mode in c("integer", "double")) { 640s + cat("mode: ", mode, "\n", sep = "") 640s + x <- matrix(1:100 + 0.1, nrow = 10, ncol = 10) 640s + storage.mode(x) <- mode 640s + str(x) 640s + 640s + # To check names attribute 640s + dimnames <- list(letters[1:10], LETTERS[1:10]) 640s + 640s + for (add_na in c(FALSE, TRUE)) { 640s + if (add_na) { 640s + x[3:5, 6:9] <- NA 640s + } 640s + # Test with and without dimnames on x 640s + for (setDimnames in c(TRUE, FALSE)) { 640s + if (setDimnames) dimnames(x) <- dimnames 640s + else dimnames(x) <- NULL 640s + for (na.rm in c(FALSE, TRUE)) { 640s + # Check names attribute 640s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 640s + probs <- c(0, 0.5, 1) 640s + q0 <- rowIQRs_R(x, na.rm = na.rm, useNames = useNames) 640s + print(q0) 640s + q1 <- rowIQRs(x, na.rm = na.rm, useNames = useNames) 640s + print(q1) 640s + stopifnot(all.equal(q1, q0)) 640s + q2 <- colIQRs(t(x), na.rm = na.rm, useNames = useNames) 640s + stopifnot(all.equal(q2, q0)) 640s + 640s + q <- iqr(x[3, ], na.rm = na.rm) 640s + print(q) 640s + } # for (useNames ...) 640s + } # for (na.rm ...) 640s + } # for (setDimnames ...) 640s + } # for (add_na ...) 640s + } # for (mode ...) 640s mode: integer 640s int [1:10, 1:10] 1 2 3 4 5 6 7 8 9 10 ... 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s a b c d e f g h i j 640s 45 45 NA NA NA 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s a b c d e f g h i j 640s 45 45 25 25 25 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s mode: double 640s 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 ... 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 45 45 45 45 45 45 45 45 45 640s [1] 45 640s a b c d e f g h i j 640s 45 45 NA NA NA 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s a b c d e f g h i j 640s 45 45 25 25 25 45 45 45 45 45 640s a b c d e f g h i j 640s 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] 45 45 NA NA NA 45 45 45 45 45 640s [1] NA 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 45 45 25 25 25 45 45 45 45 45 640s [1] 25 640s > 640s > 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > # Test corner cases 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > for (mode in c("integer", "double")) { 640s + cat("mode: ", mode, "\n", sep = "") 640s + # Empty vectors 640s + x <- integer(0L) 640s + storage.mode(x) <- mode 640s + str(x) 640s + q <- iqr(x) 640s + print(q) 640s + stopifnot(identical(q, NA_real_)) 640s + 640s + # Scalar 640s + x <- 1L 640s + storage.mode(x) <- mode 640s + str(x) 640s + q <- iqr(x) 640s + str(q) 640s + stopifnot(identical(q, 0)) 640s + } 640s mode: integer 640s int(0) 640s [1] NA 640s int 1 640s num 0 640s mode: double 640s num(0) 640s [1] NA 640s num 1 640s num 0 640s > 640s > 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > # Single row matrices 640s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 640s > x <- matrix(1, nrow = 1L, ncol = 2L) 640s > dimnames <- list("a", LETTERS[1:2]) 640s > # Test with and without dimnames on x 640s > for (setDimnames in c(TRUE, FALSE)) { 640s + if (setDimnames) dimnames(x) <- dimnames 640s + else dimnames(x) <- NULL 640s + # Check names attribute 640s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 640s + q0 <- rowIQRs_R(x, useNames = useNames) 640s + q1 <- rowIQRs(x, useNames = useNames) 640s + q2 <- colIQRs(t(x), useNames = useNames) 640s + stopifnot(all.equal(q0, q1)) 640s + stopifnot(all.equal(q0, q2)) 640s + } 640s + } 640s > 640s > x <- matrix(1, nrow = 2L, ncol = 1L) 640s > q <- colIQRs(x) 640s > stopifnot(identical(q, 0)) 640s > 640s 640s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 640s Copyright (C) 2024 The R Foundation for Statistical Computing 640s Platform: aarch64-unknown-linux-gnu 640s 640s R is free software and comes with ABSOLUTELY NO WARRANTY. 640s You are welcome to redistribute it under certain conditions. 640s Type 'license()' or 'licence()' for distribution details. 640s 640s R is a collaborative project with many contributors. 640s Type 'contributors()' for more information and 640s 'citation()' on how to cite R or R packages in publications. 640s 640s Type 'demo()' for some demos, 'help()' for on-line help, or 640s 'help.start()' for an HTML browser interface to help. 640s Type 'q()' to quit R. 640s 641s > library("matrixStats") 641s > 641s > rowIQRs_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 641s + quantile_na <- function(x, ..., na.rm = FALSE) { 641s + if (!na.rm && anyMissing(x)) 641s + return(c(NA_real_, NA_real_)) 641s + quantile(x, ..., na.rm = na.rm) 641s + } 641s + q <- apply(x, MARGIN = 1L, FUN = quantile_na, 641s + probs = c(0.25, 0.75), na.rm = na.rm) 641s + rownames(q) <- NULL # Not needed anymore 641s + 641s + # Preserve names attribute 641s + dim(q) <- c(2L, nrow(x)) 641s + colnames(q) <- if (isTRUE(useNames)) rownames(x) else NULL 641s + 641s + q[2L, , drop = TRUE] - q[1L, , drop = TRUE] 641s + } 641s > 641s > 641s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 641s > # Subsetted tests 641s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 641s > source("utils/validateIndicesFramework.R") 641s > x <- runif(6, min = -6, max = 6) 641s > for (idxs in index_cases) { 641s + for (na.rm in c(TRUE, FALSE)) { 641s + validateIndicesTestVector(x, idxs, ftest = iqr, fsure = function(x, na.rm) { 641s + dim(x) <- c(1L, length(x)) 641s + rowIQRs_R(x, na.rm = na.rm) 641s + }, na.rm = na.rm) 641s + } 641s + } 641s > 641s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 641s > 641s > # To check names attribute 641s > dimnames <- list(letters[1:6], LETTERS[1:6]) 641s > 641s > # Test with and without dimnames on x 641s > for (setDimnames in c(TRUE, FALSE)) { 641s + if (setDimnames) dimnames(x) <- dimnames 641s + else dimnames(x) <- NULL 641s + 641s + count <- 0L 641s + for (rows in index_cases) { 641s + for (cols in index_cases) { 641s + count <- count + 1L 641s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 641s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 641s + useNames <- useNames[count %% length(useNames) + 1] 641s + 641s + validateIndicesTestMatrix(x, rows, cols, 641s + ftest = rowIQRs, fsure = rowIQRs_R, 641s + na.rm = na.rm, useNames = useNames) 641s + validateIndicesTestMatrix(x, rows, cols, 641s + fcoltest = colIQRs, fsure = rowIQRs_R, 641s + na.rm = na.rm, useNames = useNames) 641s + } 641s + } 641s + } 642s > 642s 642s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 642s Copyright (C) 2024 The R Foundation for Statistical Computing 642s Platform: aarch64-unknown-linux-gnu 642s 642s R is free software and comes with ABSOLUTELY NO WARRANTY. 642s You are welcome to redistribute it under certain conditions. 642s Type 'license()' or 'licence()' for distribution details. 642s 642s R is a collaborative project with many contributors. 642s Type 'contributors()' for more information and 642s 'citation()' on how to cite R or R packages in publications. 642s 642s Type 'demo()' for some demos, 'help()' for on-line help, or 642s 'help.start()' for an HTML browser interface to help. 642s Type 'q()' to quit R. 642s 642s > # Test inspired by the harmonic mean example in R-help 642s > # thread '[R] Beyond double-precision?' on May 9, 2009. 642s > 642s > library("matrixStats") 642s > library("stats") 642s > 642s > logSumExp0 <- function(lx) { 642s + idx_max <- which.max(lx) 642s + log1p(sum(exp(lx[-idx_max] - lx[idx_max]))) + lx[idx_max] 642s + } 642s > 642s > n <- 200L 642s > set.seed(1) 642s > 642s > for (mode in c("integer", "double")) { 642s + cat("mode: ", mode, "\n", sep = "") 642s + x <- matrix(runif(n, min = 1.0, max = 3.0), nrow = 20L) 642s + storage.mode(x) <- mode 642s + str(x) 642s + 642s + # The logarithm of the harmonic mean by rows 642s + y_h <- log(1 / rowMeans(1 / x)) 642s + str(y_h) 642s + 642s + lx_neg <- -log(x) 642s + 642s + y0 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp0) 642s + stopifnot(all.equal(y0, y_h)) 642s + 642s + y1 <- log(ncol(x)) - apply(lx_neg, MARGIN = 1L, FUN = logSumExp) 642s + stopifnot(all.equal(y1, y0)) 642s + 642s + y2 <- log(ncol(x)) - rowLogSumExps(lx_neg) 642s + stopifnot(all.equal(y2, y0)) 642s + 642s + y3 <- log(ncol(x)) - colLogSumExps(t(lx_neg)) 642s + stopifnot(all.equal(y3, y0)) 642s + 642s + 642s + # The logarithm of the harmonic mean by columns 642s + y_h <- log(1 / colMeans(1 / x)) 642s + str(y_h) 642s + 642s + y0 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp0) 642s + stopifnot(all.equal(y0, y_h)) 642s + 642s + y1 <- log(nrow(x)) - apply(lx_neg, MARGIN = 2L, FUN = logSumExp) 642s + stopifnot(all.equal(y1, y0)) 642s + 642s + y2 <- log(nrow(x)) - colLogSumExps(lx_neg) 642s + stopifnot(all.equal(y2, y0)) 642s + 642s + y3 <- log(nrow(x)) - rowLogSumExps(t(lx_neg)) 642s + stopifnot(all.equal(y3, y0)) 642s + 642s + # Testing names 642s + rownames(lx_neg) <- seq_len(nrow(x)) 642s + colnames(lx_neg) <- seq_len(ncol(x)) 642s + y2 <- rowLogSumExps(lx_neg, useNames = TRUE) 642s + stopifnot(identical(names(y2), rownames(lx_neg))) 642s + y3 <- colLogSumExps(t(lx_neg), useNames = TRUE) 642s + stopifnot(identical(names(y3), rownames(lx_neg))) 642s + } # for (mode ...) 642s mode: integer 642s int [1:20, 1:10] 1 1 2 2 1 2 2 2 2 1 ... 642s num [1:20] 0.357 0.223 0.223 0.288 0.511 ... 642s num [1:10] 0.322 0.223 0.322 0.255 0.255 ... 642s mode: double 642s num [1:20, 1:10] 1.54 1.44 2.03 1.54 1.36 ... 642s num [1:20] 0.526 0.466 0.734 0.638 0.604 ... 642s num [1:10] 0.627 0.582 0.617 0.474 0.418 ... 642s > 642s > 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > # Corner cases 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > ## Zero-size matrices 642s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 0L) 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s numeric(0) 642s > stopifnot(length(y) == nrow(lx)) 642s > 642s > y <- colLogSumExps(lx) 642s > print(y) 642s numeric(0) 642s > stopifnot(length(y) == ncol(lx)) 642s > 642s > ## Zero-height matrices 642s > lx <- matrix(numeric(0L), nrow = 0L, ncol = 5L) 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s numeric(0) 642s > stopifnot(length(y) == nrow(lx)) 642s > 642s > y <- colLogSumExps(lx) 642s > print(y) 642s [1] -Inf -Inf -Inf -Inf -Inf 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(all(y == -Inf)) 642s > 642s > ## Zero-width matrices 642s > lx <- matrix(numeric(0L), nrow = 5L, ncol = 0L) 642s > y <- colLogSumExps(lx) 642s > print(y) 642s numeric(0) 642s > stopifnot(length(y) == ncol(lx)) 642s > 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s [1] -Inf -Inf -Inf -Inf -Inf 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(y == -Inf)) 642s > 642s > 642s > ## Matrices with one element 642s > lx <- matrix(1.0, nrow = 1L, ncol = 1L) 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s [1] 1 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(y == lx)) 642s > 642s > y <- colLogSumExps(lx) 642s > print(y) 642s [1] 1 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(all(y == lx)) 642s > 642s > ## All missing values 642s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 642s > y <- rowLogSumExps(lx, na.rm = TRUE) 642s > print(y) 642s [1] -Inf 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(identical(y, -Inf)) 642s > 642s > lx <- matrix(NA_real_, nrow = 1L, ncol = 1L) 642s > y <- colLogSumExps(lx, na.rm = TRUE) 642s > print(y) 642s [1] -Inf 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(identical(y, -Inf)) 642s > 642s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 642s > y <- rowLogSumExps(lx, na.rm = TRUE) 642s > print(y) 642s [1] -Inf -Inf 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(y == -Inf)) 642s > 642s > y <- rowLogSumExps(lx, na.rm = FALSE) 642s > print(y) 642s [1] NA NA 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(is.na(y) & !is.nan(y))) 642s > 642s > lx <- matrix(NA_real_, nrow = 2L, ncol = 2L) 642s > y <- colLogSumExps(lx, na.rm = TRUE) 642s > print(y) 642s [1] -Inf -Inf 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(all(y == -Inf)) 642s > 642s > y <- colLogSumExps(lx, na.rm = FALSE) 642s > print(y) 642s [1] NA NA 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(all(is.na(y) & !is.nan(y))) 642s > 642s > ## +Inf values 642s > lx <- matrix(c(1, 2, +Inf), nrow = 3L, ncol = 2L) 642s > y <- colLogSumExps(lx, na.rm = TRUE) 642s > print(y) 642s [1] Inf Inf 642s > stopifnot(length(y) == ncol(lx)) 642s > stopifnot(all(y == +Inf)) 642s > 642s > ## multiple -Inf values 642s > lx <- matrix(c(-Inf, -Inf), nrow = 2L, ncol = 3L) 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s [1] -Inf -Inf 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(y == -Inf)) 642s > 642s > lx <- matrix(c(-Inf, 5, -Inf), nrow = 2L, ncol = 3L, byrow = TRUE) 642s > y <- rowLogSumExps(lx) 642s > print(y) 642s [1] 5 5 642s > stopifnot(length(y) == nrow(lx)) 642s > stopifnot(all(y == 5)) 642s > 642s > ## Bug report #104 (https://github.com/HenrikBengtsson/matrixStats/issues/104) 642s > ## (This would core dump on Windows) 642s > x <- matrix(0.0, nrow = 2L, ncol = 32762L) 642s > y <- colLogSumExps(x) 642s > str(y) 642s num [1:32762] 0.693 0.693 0.693 0.693 0.693 ... 642s > 642s > ## Bug report #120 (https://github.com/HenrikBengtsson/matrixStats/issues/120) 642s > ## (This would error if x had rownames/colnames and non-NULL rows/cols were 642s > ## used) 642s > x <- matrix(runif(6), nrow = 2L, ncol = 3L, 642s + dimnames = list(c("A", "B"), c("a", "b", "c"))) 642s > y <- colLogSumExps(x, cols = 3:1, useNames = TRUE) 642s > stopifnot(names(y) == c("c", "b", "a")) 642s > y <- rowLogSumExps(x, rows = 2, useNames = TRUE) 642s > stopifnot(names(y) == "B") 642s > 642s > 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > # Check names attributes 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > 642s > ## Create isFALSE() if running on an old version of R 642s > if (!exists("isFALSE", mode="function")) { 642s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 642s + } 642s > 642s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 642s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 642s + log(sum(exp(rx), ...)) 642s + }, ...) 642s + if (isFALSE(useNames)) names(res) <- NULL 642s + res 642s + } 642s > 642s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 642s > 642s > # To check names attribute 642s > dimnames <- list(letters[1:6], LETTERS[1:6]) 642s > 642s > # Test with and without dimnames on x 642s > for (setDimnames in c(TRUE, FALSE)) { 642s + if (setDimnames) dimnames(x) <- dimnames 642s + else dimnames(x) <- NULL 642s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 642s + y0 <- rowLogSumExps_R(x, useNames = useNames) 642s + y1 <- rowLogSumExps(x, useNames = useNames) 642s + y2 <- colLogSumExps(t(x), useNames = useNames) 642s + stopifnot(all.equal(y1, y0)) 642s + stopifnot(all.equal(y2, y0)) 642s + } 642s + } 642s > 642s 642s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 642s Copyright (C) 2024 The R Foundation for Statistical Computing 642s Platform: aarch64-unknown-linux-gnu 642s 642s R is free software and comes with ABSOLUTELY NO WARRANTY. 642s You are welcome to redistribute it under certain conditions. 642s Type 'license()' or 'licence()' for distribution details. 642s 642s R is a collaborative project with many contributors. 642s Type 'contributors()' for more information and 642s 'citation()' on how to cite R or R packages in publications. 642s 642s Type 'demo()' for some demos, 'help()' for on-line help, or 642s 'help.start()' for an HTML browser interface to help. 642s Type 'q()' to quit R. 642s 642s > library("matrixStats") 642s > 642s > ## Create isFALSE() if running on an old version of R 642s > if (!exists("isFALSE", mode="function")) { 642s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 642s + } 642s > 642s > rowLogSumExps_R <- function(x, ..., useNames = NA) { 642s + res <- apply(x, MARGIN = 1L, FUN = function(rx, ...) { 642s + log(sum(exp(rx), ...)) 642s + }, ...) 642s + if (isFALSE(useNames)) names(res) <- NULL 642s + res 642s + } 642s > 642s > 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > # Subsetted tests 642s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 642s > source("utils/validateIndicesFramework.R") 642s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 642s > 642s > # To check names attribute 642s > dimnames <- list(letters[1:6], LETTERS[1:6]) 642s > 642s > # Test with and without dimnames on x 642s > for (setDimnames in c(TRUE, FALSE)) { 642s + if (setDimnames) dimnames(x) <- dimnames 642s + else dimnames(x) <- NULL 642s + for (rows in index_cases) { 642s + for (cols in index_cases) { 642s + for (na.rm in c(TRUE, FALSE)) { 642s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 642s + validateIndicesTestMatrix(x, rows, cols, 642s + ftest = rowLogSumExps, 642s + fsure = rowLogSumExps_R, 642s + na.rm = na.rm, useNames = useNames) 642s + validateIndicesTestMatrix(x, rows, cols, 642s + fcoltest = colLogSumExps, 642s + fsure = rowLogSumExps_R, 642s + na.rm = na.rm, useNames = useNames) 642s + } 642s + } 642s + } 642s + } 642s + } 643s > 643s 643s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 643s Copyright (C) 2024 The R Foundation for Statistical Computing 643s Platform: aarch64-unknown-linux-gnu 643s 643s R is free software and comes with ABSOLUTELY NO WARRANTY. 643s You are welcome to redistribute it under certain conditions. 643s Type 'license()' or 'licence()' for distribution details. 643s 643s R is a collaborative project with many contributors. 643s Type 'contributors()' for more information and 643s 'citation()' on how to cite R or R packages in publications. 643s 643s Type 'demo()' for some demos, 'help()' for on-line help, or 643s 'help.start()' for an HTML browser interface to help. 643s Type 'q()' to quit R. 643s 643s > library("matrixStats") 643s > 643s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 643s > options(matrixStats.center.onUse = "ignore") 643s > 643s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 643s + suppressWarnings({ 643s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 643s + }) 643s + if (is.na(useNames) || !useNames) names(res) <- NULL 643s + res 643s + } 643s > 643s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 643s + suppressWarnings({ 643s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 643s + }) 643s + if (is.na(useNames) || !useNames) names(res) <- NULL 643s + res 643s + } 643s > 643s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 643s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 643s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 643s + } 643s > 643s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 643s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 643s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 643s + } 643s > 643s > 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > # A 3x3 matrix (no ties) 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > for (mode in c("integer", "double")) { 643s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 643s + cat("mode: ", mode, "\n", sep = "") 643s + storage.mode(x) <- mode 643s + str(x) 643s + 643s + # To check name attribute 643s + dimnames <- list(letters[1:3], LETTERS[1:3]) 643s + 643s + # Test with and without dimnames on x 643s + for (setDimnames in c(TRUE, FALSE)) { 643s + if (setDimnames) dimnames(x) <- dimnames 643s + else dimnames(x) <- NULL 643s + tx <- t(x) 643s + # Check names attribute 643s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 643s + cat("rowMads():\n") 643s + center <- rowMedians(x, na.rm = TRUE, useNames = useNames) 643s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 643s + r1b <- rowMads_center(x, na.rm = TRUE, useNames = useNames) 643s + r1c <- rowMads(x, center = center, na.rm = TRUE, useNames = useNames) 643s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 643s + r2b <- colMads_center(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r1b, r1)) 643s + stopifnot(all.equal(r1c, r1)) 643s + stopifnot(all.equal(r2, r0)) 643s + stopifnot(all.equal(r2b, r2)) 643s + 643s + cat("colMads():\n") 643s + center <- colMedians(x, na.rm = TRUE, useNames = useNames) 643s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 643s + r1b <- colMads_center(x, na.rm = TRUE, useNames = useNames) 643s + r1c <- colMads(x, center = center, na.rm = TRUE, useNames = useNames) 643s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 643s + r2b <- rowMads_center(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r1b, r1)) 643s + stopifnot(all.equal(r1c, r1)) 643s + stopifnot(all.equal(r2, r0)) 643s + stopifnot(all.equal(r2b, r2)) 643s + } 643s + } 643s + } 643s mode: integer 643s int [1:3, 1:3] 1 2 3 2 3 4 3 4 5 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s mode: double 643s num [1:3, 1:3] 1.1 2.1 3.1 2.1 3.1 4.1 3.1 4.1 5.1 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s > 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > # Ties: a 4x4 matrix 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > for (mode in c("integer", "double")) { 643s + x <- matrix(c(1:4, 2:5, 3:6, 4:7) + 0.1, nrow = 4, ncol = 4) 643s + cat("mode: ", mode, "\n", sep = "") 643s + storage.mode(x) <- mode 643s + str(x) 643s + tx <- t(x) 643s + 643s + # To check name attribute 643s + dimnames <- list(letters[1:4], LETTERS[1:4]) 643s + 643s + # Test with and without dimnames on x 643s + for (setDimnames in c(TRUE, FALSE)) { 643s + if (setDimnames) dimnames(x) <- dimnames 643s + else dimnames(x) <- NULL 643s + tx <- t(x) 643s + # Check names attribute 643s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 643s + cat("rowMads():\n") 643s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 643s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r2, r0)) 643s + 643s + cat("colMads():\n") 643s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 643s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r2, r0)) 643s + } 643s + } 643s + } 643s mode: integer 643s int [1:4, 1:4] 1 2 3 4 2 3 4 5 3 4 ... 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s mode: double 643s 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 ... 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s > tx <- NULL 643s > 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > # No ties: a 3x3 matrix with an NA value 643s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 643s > for (mode in c("integer", "double")) { 643s + x <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5) + 0.1, nrow = 3, ncol = 3) 643s + x[2, 2] <- NA_real_ 643s + 643s + cat("mode: ", mode, "\n", sep = "") 643s + storage.mode(x) <- mode 643s + str(x) 643s + tx <- t(x) 643s + 643s + # To check name attribute 643s + dimnames <- list(letters[1:3], LETTERS[1:3]) 643s + 643s + # Test with and without dimnames on x 643s + for (setDimnames in c(TRUE, FALSE)) { 643s + if (setDimnames) dimnames(x) <- dimnames 643s + else dimnames(x) <- NULL 643s + tx <- t(x) 643s + # Check names attribute 643s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 643s + cat("rowMads():\n") 643s + r0 <- rowMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- rowMads(x, na.rm = TRUE, useNames = useNames) 643s + r2 <- colMads(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r2, r0)) 643s + 643s + cat("colMads():\n") 643s + r0 <- colMads_R(x, na.rm = TRUE, useNames = useNames) 643s + r1 <- colMads(x, na.rm = TRUE, useNames = useNames) 643s + r2 <- rowMads(tx, na.rm = TRUE, useNames = useNames) 643s + stopifnot(all.equal(r1, r2)) 643s + stopifnot(all.equal(r1, r0)) 643s + stopifnot(all.equal(r2, r0)) 643s + } 643s + } 643s + } 643s mode: integer 643s int [1:3, 1:3] 1 2 3 2 NA 4 3 4 5 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s mode: double 643s num [1:3, 1:3] 1.1 2.1 3.1 2.1 NA 4.1 3.1 4.1 5.1 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 643s rowMads(): 643s colMads(): 644s rowMads(): 644s colMads(): 644s > tx <- NULL 644s > 644s > 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > # With and without some NAs 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > for (add_na in c(FALSE, TRUE)) { 644s + cat("add_na = ", add_na, "\n", sep = "") 644s + 644s + x <- matrix(1:50, nrow = 10L, ncol = 5L) 644s + if (add_na) { 644s + x[3:7, c(2, 4)] <- NA_real_ 644s + } 644s + 644s + # To check name attribute 644s + dimnames <- list(letters[1:10], LETTERS[1:5]) 644s + 644s + # Test with and without dimnames on x 644s + for (setDimnames in c(TRUE, FALSE)) { 644s + if (setDimnames) dimnames(x) <- dimnames 644s + else dimnames(x) <- NULL 644s + tx <- t(x) 644s + # Row/column ranges 644s + for (na.rm in c(FALSE, TRUE)) { 644s + # Check names attribute 644s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 644s + cat("na.rm = ", na.rm, "\n", sep = "") 644s + cat("rowMads():\n") 644s + center <- rowMedians(x, na.rm = na.rm, useNames = useNames) 644s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 644s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 644s + r2 <- rowMads(x, center = center, na.rm = na.rm, useNames = useNames) 644s + r3 <- colMads(tx, na.rm = na.rm, useNames = useNames) 644s + stopifnot(all.equal(r1, r0)) 644s + stopifnot(all.equal(r2, r0)) 644s + stopifnot(all.equal(r2, r1)) 644s + stopifnot(all.equal(r3, r0)) 644s + stopifnot(all.equal(r3, r1)) 644s + stopifnot(all.equal(r3, r2)) 644s + 644s + cat("colMads():\n") 644s + center <- colMedians(x, na.rm = na.rm, useNames = useNames) 644s + r0 <- colMads_R(x, na.rm = na.rm, useNames = useNames) 644s + r1 <- colMads(x, na.rm = na.rm, useNames = useNames) 644s + r2 <- colMads(x, center = center, na.rm = na.rm, useNames = useNames) 644s + r3 <- rowMads(tx, na.rm = na.rm, useNames = useNames) 644s + stopifnot(all.equal(r1, r0)) 644s + stopifnot(all.equal(r2, r0)) 644s + stopifnot(all.equal(r2, r1)) 644s + stopifnot(all.equal(r3, r0)) 644s + stopifnot(all.equal(r3, r1)) 644s + stopifnot(all.equal(r3, r2)) 644s + } 644s + } 644s + } 644s + tx <- NULL 644s + } # for (add_na ...) 644s add_na = FALSE 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s add_na = TRUE 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = FALSE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s na.rm = TRUE 644s rowMads(): 644s colMads(): 644s > 644s > 644s > 644s > 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > # All NAs 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 644s > # Test with and without dimnames on x 644s > for (setDimnames in c(TRUE, FALSE)) { 644s + if (setDimnames) dimnames(x) <- dimnames 644s + else dimnames(x) <- NULL 644s + tx <- t(x) 644s + # Row/column ranges 644s + for (na.rm in c(FALSE, TRUE)) { 644s + # Check names attribute 644s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 644s + cat("na.rm = ", na.rm, "\n", sep = "") 644s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 644s + if (na.rm) r0[is.na(r0)] <- NaN 644s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 644s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 644s + stopifnot(all.equal(r1, r0)) 644s + stopifnot(all.equal(r2, r0)) 644s + stopifnot(all.equal(r1, r2)) 644s + } 644s + } 644s + } 644s na.rm = FALSE 644s na.rm = FALSE 644s na.rm = TRUE 644s na.rm = TRUE 644s na.rm = FALSE 644s na.rm = FALSE 644s na.rm = TRUE 644s na.rm = TRUE 644s > tx <- NULL 644s > 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > # A 1x1 matrix 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > x <- matrix(0, nrow = 1L, ncol = 1L) 644s > dimnames <- list("a", "A") 644s > # Test with and without dimnames on x 644s > for (setDimnames in c(TRUE, FALSE)) { 644s + if (setDimnames) dimnames(x) <- dimnames 644s + else dimnames(x) <- NULL 644s + tx <- t(x) 644s + # Row/column ranges 644s + for (na.rm in c(FALSE, TRUE)) { 644s + # Check names attribute 644s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 644s + cat("na.rm = ", na.rm, "\n", sep = "") 644s + r0 <- rowMads_R(x, na.rm = na.rm, useNames = useNames) 644s + r1 <- rowMads(x, na.rm = na.rm, useNames = useNames) 644s + r2 <- colMads(tx, na.rm = na.rm, useNames = useNames) 644s + stopifnot(all.equal(r1, r0)) 644s + stopifnot(all.equal(r2, r0)) 644s + stopifnot(all.equal(r1, r2)) 644s + } 644s + } 644s + } 644s na.rm = FALSE 644s na.rm = FALSE 644s na.rm = TRUE 644s na.rm = TRUE 644s na.rm = FALSE 644s na.rm = FALSE 644s na.rm = TRUE 644s na.rm = TRUE 644s > 644s > 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > # A 0x0 matrix 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > x <- matrix(double(0), nrow = 0, ncol = 0) 644s > tx <- t(x) 644s > for (na.rm in c(FALSE, TRUE)) { 644s + cat("na.rm = ", na.rm, "\n", sep = "") 644s + r0 <- rowMads_R(x, na.rm = na.rm) 644s + r1 <- rowMads(x, na.rm = na.rm) 644s + r2 <- colMads(tx, na.rm = na.rm) 644s + stopifnot(all.equal(r1, r2)) 644s + stopifnot(all.equal(r1, r0)) 644s + stopifnot(all.equal(r2, r0)) 644s + } 644s na.rm = FALSE 644s na.rm = TRUE 644s > 644s 644s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 644s Copyright (C) 2024 The R Foundation for Statistical Computing 644s Platform: aarch64-unknown-linux-gnu 644s 644s R is free software and comes with ABSOLUTELY NO WARRANTY. 644s You are welcome to redistribute it under certain conditions. 644s Type 'license()' or 'licence()' for distribution details. 644s 644s R is a collaborative project with many contributors. 644s Type 'contributors()' for more information and 644s 'citation()' on how to cite R or R packages in publications. 644s 644s Type 'demo()' for some demos, 'help()' for on-line help, or 644s 'help.start()' for an HTML browser interface to help. 644s Type 'q()' to quit R. 644s 644s > library("matrixStats") 644s > 644s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 644s > options(matrixStats.center.onUse = "ignore") 644s > 644s > rowMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 644s + suppressWarnings({ 644s + res <- apply(x, MARGIN = 1L, FUN = mad, na.rm = na.rm) 644s + }) 644s + if (is.na(useNames) || !useNames) names(res) <- NULL 644s + res 644s + } 644s > 644s > colMads_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 644s + suppressWarnings({ 644s + res <- apply(x, MARGIN = 2L, FUN = mad, na.rm = na.rm) 644s + }) 644s + if (is.na(useNames) || !useNames) names(res) <- NULL 644s + res 644s + } 644s > 644s > rowMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 644s + center <- rowMedians(x, cols = cols, na.rm = na.rm, useNames = FALSE) 644s + rowMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 644s + } 644s > 644s > colMads_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 644s + center <- colMedians(x, rows = rows, na.rm = na.rm, useNames = FALSE) 644s + colMads(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 644s + } 644s > 644s > 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > # Subsetted tests 644s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 644s > source("utils/validateIndicesFramework.R") 644s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 644s > storage.mode(x) <- "integer" 644s > 644s > # To check names attribute 644s > dimnames <- list(letters[1:6], LETTERS[1:6]) 644s > 644s > # Test with and without dimnames on x 644s > for (setDimnames in c(TRUE, FALSE)) { 644s + if (setDimnames) dimnames(x) <- dimnames 644s + else dimnames(x) <- NULL 644s + 644s + count <- 0L 644s + for (rows in index_cases) { 644s + for (cols in index_cases) { 644s + count <- count + 1L 644s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 644s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 644s + useNames <- useNames[count %% length(useNames) + 1] 644s + 644s + validateIndicesTestMatrix(x, rows, cols, 644s + ftest = rowMads, fsure = rowMads_R, 644s + na.rm = na.rm, useNames = useNames) 644s + validateIndicesTestMatrix(x, rows, cols, 644s + ftest = rowMads_center, fsure = rowMads_R, 644s + na.rm = na.rm, useNames = useNames) 644s + 644s + validateIndicesTestMatrix(x, rows, cols, 644s + fcoltest = colMads, fsure = rowMads_R, 644s + na.rm = na.rm, useNames = useNames) 644s + validateIndicesTestMatrix(x, rows, cols, 644s + fcoltest = colMads_center, fsure = rowMads_R, 644s + na.rm = na.rm, useNames = useNames) 644s + } 644s + } 644s + } 645s > 645s 645s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 645s Copyright (C) 2024 The R Foundation for Statistical Computing 645s Platform: aarch64-unknown-linux-gnu 645s 645s R is free software and comes with ABSOLUTELY NO WARRANTY. 645s You are welcome to redistribute it under certain conditions. 645s Type 'license()' or 'licence()' for distribution details. 645s 645s R is a collaborative project with many contributors. 645s Type 'contributors()' for more information and 645s 'citation()' on how to cite R or R packages in publications. 645s 645s Type 'demo()' for some demos, 'help()' for on-line help, or 645s 'help.start()' for an HTML browser interface to help. 645s Type 'q()' to quit R. 645s 645s > library("matrixStats") 645s > 645s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 645s + res <- rowMeans(x, na.rm = na.rm) 645s + if (is.na(useNames) || !useNames) names(res) <- NULL 645s + res 645s + } 645s > 645s > colMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 645s + res <- colMeans(x, na.rm = na.rm) 645s + if (is.na(useNames) || !useNames) names(res) <- NULL 645s + res 645s + } 645s > 645s > for (mode in c("integer", "logical", "double")) { 645s + x <- matrix(-4:4, nrow = 3, ncol = 3) 645s + storage.mode(x) <- mode 645s + if (mode == "double") x <- x + 0.1 645s + 645s + # To check names attribute 645s + dimnames <- list(letters[1:3], LETTERS[1:3]) 645s + 645s + # Test with and without dimnames on x 645s + for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s + } 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: Single-element matrix 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: Single-element matrix:\n") 645s Special case: Single-element matrix: 645s > for (mode in c("integer", "logical", "double")) { 645s + x <- matrix(1, nrow = 1, ncol = 1) 645s + storage.mode(x) <- mode 645s + 645s + # To check names attribute 645s + dimnames <- list("a", "A") 645s + 645s + # Test with and without dimnames on x 645s + for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: Empty matrix 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: Empty matrix:\n") 645s Special case: Empty matrix: 645s > for (mode in c("integer", "logical", "double")) { 645s + x <- matrix(integer(0), nrow = 0, ncol = 0) 645s + storage.mode(x) <- mode 645s + 645s + y0 <- rowMeans(x, na.rm = FALSE) 645s + y1 <- rowMeans2(x, na.rm = FALSE) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans(x, na.rm = FALSE) 645s + y1 <- colMeans2(x, na.rm = FALSE) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: All NAs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: All NAs:\n") 645s Special case: All NAs: 645s > for (mode in c("integer", "logical", "double")) { 645s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 645s + storage.mode(x) <- mode 645s + 645s + # To check names attribute 645s + dimnames <- list(letters[1:3], LETTERS[1:3]) 645s + 645s + # Test with and without dimnames on x 645s + for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: All NaNs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: All NaNs:\n") 645s Special case: All NaNs: 645s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = TRUE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = TRUE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = TRUE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = TRUE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: All Infs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: All Infs:\n") 645s Special case: All Infs: 645s > x <- matrix(Inf, nrow = 3, ncol = 3) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: All -Infs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: All -Infs:\n") 645s Special case: All -Infs: 645s > x <- matrix(-Inf, nrow = 3, ncol = 3) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: Infs and -Infs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: Infs and -Infs:\n") 645s Special case: Infs and -Infs: 645s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 645s > 645s > # To check names attribute 645s > dimnames <- list(letters[1:4], LETTERS[1:4]) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: NaNs and NAs 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: NaNs and NAs:\n") 645s Special case: NaNs and NAs: 645s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + str(y0) 645s + stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + str(y1) 645s + stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s Named num [1:4] NaN NA NaN NA 645s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 645s Named num [1:4] NaN NA NaN NA 645s - attr(*, "names")= chr [1:4] "a" "b" "c" "d" 645s num [1:4] NaN NA NaN NA 645s num [1:4] NaN NA NaN NA 645s num [1:4] NaN NA NaN NA 645s num [1:4] NaN NA NaN NA 645s num [1:4] NaN NA NaN NA 645s num [1:4] NaN NA NaN NA 645s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 645s > ## returned here (as one would expect). NaN might very well be returned, 645s > ## when both NA and NaN are involved. This is an accepted feature in R, 645s > ## which is documented in help("is.nan"). See also 645s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 645s > ## Thus, we cannot guarantee that y1 is identical to y0. 645s > 645s > 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Special case: Integer overflow with ties 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > cat("Special case: Integer overflow with ties:\n") 645s Special case: Integer overflow with ties: 645s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + # Check names attribute 645s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 645s + y0 <- rowMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- rowMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + 645s + y0 <- colMeans_R(x, na.rm = FALSE, useNames = useNames) 645s + y1 <- colMeans2(x, na.rm = FALSE, useNames = useNames) 645s + stopifnot(all.equal(y1, y0)) 645s + } 645s + } 645s > 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Consistency checks 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > set.seed(1) 645s > 645s > cat("Consistency checks:\n") 645s Consistency checks: 645s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 645s > for (kk in seq_len(n_sims)) { 645s + cat("Random test #", kk, "\n", sep = "") 645s + 645s + # Simulate data in a matrix of any shape 645s + dim <- sample(50:200, size = 2) 645s + n <- prod(dim) 645s + x <- rnorm(n, sd = 100) 645s + dim(x) <- dim 645s + 645s + # Add NAs? 645s + if ((kk %% 4) %in% c(3, 0)) { 645s + cat("Adding NAs\n") 645s + nna <- sample(n, size = 1) 645s + na_values <- c(NA_real_, NaN) 645s + t <- sample(na_values, size = nna, replace = TRUE) 645s + x[sample(length(x), size = nna)] <- t 645s + } 645s + 645s + # Mode? 645s + modes <- "double" 645s + if ((kk %% 4) %in% c(2, 0)) { 645s + modes <- c("integer", "logical") 645s + } 645s + 645s + for (mode in modes) { 645s + if (mode != "double") { 645s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 645s + storage.mode(x) <- mode 645s + } 645s + 645s + na.rm <- sample(c(TRUE, FALSE), size = 1) 645s + 645s + # rowMeans2(): 645s + y0 <- rowMeans(x, na.rm = na.rm) 645s + y1 <- rowMeans2(x, na.rm = na.rm) 645s + stopifnot(all.equal(y1, y0)) 645s + y2 <- colMeans2(t(x), na.rm = na.rm) 645s + stopifnot(all.equal(y2, y0)) 645s + 645s + # colMeans2(): 645s + y0 <- colMeans(x, na.rm = na.rm) 645s + y1 <- colMeans2(x, na.rm = na.rm) 645s + stopifnot(all.equal(y1, y0)) 645s + y2 <- rowMeans2(t(x), na.rm = na.rm) 645s + stopifnot(all.equal(y2, y0)) 645s + } 645s + } # for (kk ...) 645s Random test #1 645s Random test #2 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #3 645s Adding NAs 645s Random test #4 645s Adding NAs 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #5 645s Random test #6 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #7 645s Adding NAs 645s Random test #8 645s Adding NAs 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #9 645s Random test #10 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #11 645s Adding NAs 645s Random test #12 645s Adding NAs 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #13 645s Random test #14 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #15 645s Adding NAs 645s Random test #16 645s Adding NAs 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #17 645s Random test #18 645s Coercing from double to integer 645s Coercing from integer to logical 645s Random test #19 645s Adding NAs 645s Random test #20 645s Adding NAs 645s Coercing from double to integer 645s Coercing from integer to logical 645s > 645s 645s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 645s Copyright (C) 2024 The R Foundation for Statistical Computing 645s Platform: aarch64-unknown-linux-gnu 645s 645s R is free software and comes with ABSOLUTELY NO WARRANTY. 645s You are welcome to redistribute it under certain conditions. 645s Type 'license()' or 'licence()' for distribution details. 645s 645s R is a collaborative project with many contributors. 645s Type 'contributors()' for more information and 645s 'citation()' on how to cite R or R packages in publications. 645s 645s Type 'demo()' for some demos, 'help()' for on-line help, or 645s 'help.start()' for an HTML browser interface to help. 645s Type 'q()' to quit R. 645s 645s > library("matrixStats") 645s > 645s > rowMeans_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 645s + res <- rowMeans(x, na.rm = na.rm) 645s + if (is.na(useNames) || !useNames) names(res) <- NULL 645s + res 645s + } 645s > 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > # Subsetted tests 645s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 645s > source("utils/validateIndicesFramework.R") 645s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 645s > storage.mode(x) <- "integer" 645s > 645s > # To check names attribute 645s > dimnames <- list(letters[1:6], LETTERS[1:6]) 645s > 645s > # Test with and without dimnames on x 645s > for (setDimnames in c(TRUE, FALSE)) { 645s + if (setDimnames) dimnames(x) <- dimnames 645s + else dimnames(x) <- NULL 645s + 645s + count <- 0L 645s + for (rows in index_cases) { 645s + for (cols in index_cases) { 645s + count <- count + 1L 645s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 645s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 645s + useNames <- useNames[count %% length(useNames) + 1] 645s + 645s + validateIndicesTestMatrix(x, rows, cols, 645s + ftest = rowMeans2, fsure = rowMeans_R, 645s + na.rm = na.rm, useNames = useNames) 645s + validateIndicesTestMatrix(x, rows, cols, 645s + fcoltest = colMeans2, fsure = rowMeans_R, 645s + na.rm = na.rm, useNames = useNames) 645s + } 645s + } 645s + } 646s > 646s 646s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 646s Copyright (C) 2024 The R Foundation for Statistical Computing 646s Platform: aarch64-unknown-linux-gnu 646s 646s R is free software and comes with ABSOLUTELY NO WARRANTY. 646s You are welcome to redistribute it under certain conditions. 646s Type 'license()' or 'licence()' for distribution details. 646s 646s R is a collaborative project with many contributors. 646s Type 'contributors()' for more information and 646s 'citation()' on how to cite R or R packages in publications. 646s 646s Type 'demo()' for some demos, 'help()' for on-line help, or 646s 'help.start()' for an HTML browser interface to help. 646s Type 'q()' to quit R. 646s 646s > library("matrixStats") 646s > 646s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 646s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 646s + if (is.na(useNames) || !useNames) names(res) <- NULL 646s + res 646s + } 646s > 646s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 646s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 646s + if (is.na(useNames) || !useNames) names(res) <- NULL 646s + res 646s + } 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Non-ties 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Non-ties:\n") 646s Special case: Non-ties: 646s > for (mode in c("integer", "double")) { 646s + x <- matrix(1:9 + 0.1, nrow = 3, ncol = 3) 646s + storage.mode(x) <- mode 646s + 646s + # To check names attribute 646s + dimnames <- list(letters[1:3], LETTERS[1:3]) 646s + 646s + # Test with and without dimnames on x 646s + for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Ties 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Ties:\n") 646s Special case: Ties: 646s > for (mode in c("integer", "double")) { 646s + x <- matrix(1:16 + 0.1, nrow = 4, ncol = 4) 646s + storage.mode(x) <- mode 646s + 646s + # To check names attribute 646s + dimnames <- list(letters[1:4], LETTERS[1:4]) 646s + 646s + # Test with and without dimnames on x 646s + for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Single-element matrix 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Single-element matrix:\n") 646s Special case: Single-element matrix: 646s > for (mode in c("integer", "double")) { 646s + x <- matrix(1, nrow = 1, ncol = 1) 646s + storage.mode(x) <- mode 646s + 646s + # To check names attribute 646s + dimnames <- list("a", "A") 646s + 646s + # Test with and without dimnames on x 646s + for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Empty matrix 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Empty matrix:\n") 646s Special case: Empty matrix: 646s > for (mode in c("integer", "double")) { 646s + x <- matrix(integer(0), nrow = 0, ncol = 0) 646s + storage.mode(x) <- mode 646s + 646s + y0 <- rowMedians_R(x, na.rm = FALSE) 646s + y1 <- rowMedians(x, na.rm = FALSE) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE) 646s + y1 <- colMedians(x, na.rm = FALSE) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: All NAs 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: All NAs:\n") 646s Special case: All NAs: 646s > for (mode in c("integer", "double")) { 646s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 646s + storage.mode(x) <- mode 646s + 646s + # To check names attribute 646s + dimnames <- list(letters[1:3], LETTERS[1:3]) 646s + 646s + # Test with and without dimnames on x 646s + for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: All NaNs 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: All NaNs:\n") 646s Special case: All NaNs: 646s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 646s > 646s > # Test with and without dimnames on x 646s > for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = TRUE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = TRUE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = TRUE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = TRUE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: All Infs 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: All Infs:\n") 646s Special case: All Infs: 646s > x <- matrix(Inf, nrow = 3, ncol = 3) 646s > 646s > # Test with and without dimnames on x 646s > for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: All -Infs 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: All -Infs:\n") 646s Special case: All -Infs: 646s > x <- matrix(-Inf, nrow = 3, ncol = 3) 646s > 646s > # Test with and without dimnames on x 646s > for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Infs and -Infs 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Infs and -Infs:\n") 646s Special case: Infs and -Infs: 646s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 646s > 646s > # To check names attribute 646s > dimnames <- list(letters[1:4], LETTERS[1:4]) 646s > 646s > # Test with and without dimnames on x 646s > for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Special case: Integer overflow with ties 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > cat("Special case: Integer overflow with ties:\n") 646s Special case: Integer overflow with ties: 646s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 646s > 646s > # Test with and without dimnames on x 646s > for (setDimnames in c(TRUE, FALSE)) { 646s + if (setDimnames) dimnames(x) <- dimnames 646s + else dimnames(x) <- NULL 646s + # Check names attribute 646s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 646s + y0 <- rowMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- rowMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + 646s + y0 <- colMedians_R(x, na.rm = FALSE, useNames = useNames) 646s + y1 <- colMedians(x, na.rm = FALSE, useNames = useNames) 646s + stopifnot(all.equal(y1, y0)) 646s + } 646s + } 646s > 646s > 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > # Consistency checks 646s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 646s > set.seed(1) 646s > 646s > cat("Consistency checks:\n") 646s Consistency checks: 646s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 646s > for (kk in seq_len(n_sims)) { 646s + cat("Random test #", kk, "\n", sep = "") 646s + 646s + # Simulate data in a matrix of any shape 646s + dim <- sample(50:200, size = 2) 646s + n <- prod(dim) 646s + x <- rnorm(n, sd = 100) 646s + dim(x) <- dim 646s + 646s + # Add NAs? 646s + if ((kk %% 4) %in% c(3, 0)) { 646s + cat("Adding NAs\n") 646s + nna <- sample(n, size = 1) 646s + na_values <- c(NA_real_, NaN) 646s + t <- sample(na_values, size = nna, replace = TRUE) 646s + x[sample(length(x), size = nna)] <- t 646s + } 646s + 646s + # Integer or double? 646s + if ((kk %% 4) %in% c(2, 0)) { 646s + cat("Coercing to integers\n") 646s + storage.mode(x) <- "integer" 646s + } 646s + 646s + na.rm <- sample(c(TRUE, FALSE), size = 1) 646s + 646s + # rowMedians(): 646s + y0 <- rowMedians_R(x, na.rm = na.rm) 646s + y1 <- rowMedians(x, na.rm = na.rm) 646s + stopifnot(all.equal(y1, y0)) 646s + y2 <- colMedians(t(x), na.rm = na.rm) 646s + stopifnot(all.equal(y2, y0)) 646s + 646s + # colMedians(): 646s + y0 <- colMedians_R(x, na.rm = na.rm) 646s + y1 <- colMedians(x, na.rm = na.rm) 646s + stopifnot(all.equal(y1, y0)) 646s + y2 <- rowMedians(t(x), na.rm = na.rm) 646s + stopifnot(all.equal(y2, y0)) 646s + } # for (kk ...) 646s Random test #1 646s Random test #2 646s Coercing to integers 646s Random test #3 646s Adding NAs 646s Random test #4 646s Adding NAs 646s Coercing to integers 646s Random test #5 646s Random test #6 646s Coercing to integers 646s Random test #7 646s Adding NAs 646s Random test #8 646s Adding NAs 646s Coercing to integers 646s Random test #9 646s Random test #10 646s Coercing to integers 646s Random test #11 646s Adding NAs 646s Random test #12 646s Adding NAs 646s Coercing to integers 646s Random test #13 646s Random test #14 646s Coercing to integers 646s Random test #15 646s Adding NAs 646s Random test #16 646s Adding NAs 646s Coercing to integers 646s Random test #17 646s Random test #18 646s Coercing to integers 646s Random test #19 646s Adding NAs 646s Random test #20 646s Adding NAs 646s Coercing to integers 646s > 646s 646s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 646s Copyright (C) 2024 The R Foundation for Statistical Computing 646s Platform: aarch64-unknown-linux-gnu 646s 646s R is free software and comes with ABSOLUTELY NO WARRANTY. 646s You are welcome to redistribute it under certain conditions. 646s Type 'license()' or 'licence()' for distribution details. 646s 646s R is a collaborative project with many contributors. 646s Type 'contributors()' for more information and 646s 'citation()' on how to cite R or R packages in publications. 646s 646s Type 'demo()' for some demos, 'help()' for on-line help, or 646s 'help.start()' for an HTML browser interface to help. 646s Type 'q()' to quit R. 646s 646s > library("matrixStats") 646s > 647s > rowMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 647s + res <- apply(x, MARGIN = 1L, FUN = median, na.rm = na.rm) 647s + if (is.na(useNames) || !useNames) names(res) <- NULL 647s + res 647s + } 647s > 647s > colMedians_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 647s + res <- apply(x, MARGIN = 2L, FUN = median, na.rm = na.rm) 647s + if (is.na(useNames) || !useNames) names(res) <- NULL 647s + res 647s + } 647s > 647s > 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > # Subsetted tests 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > source("utils/validateIndicesFramework.R") 647s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 647s > storage.mode(x) <- "integer" 647s > 647s > # To check names attribute 647s > dimnames <- list(letters[1:6], LETTERS[1:6]) 647s > 647s > # Test with and without dimnames on x 647s > for (setDimnames in c(TRUE, FALSE)) { 647s + if (setDimnames) dimnames(x) <- dimnames 647s + else dimnames(x) <- NULL 647s + 647s + count <- 0L 647s + for (rows in index_cases) { 647s + for (cols in index_cases) { 647s + count <- count + 1L 647s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 647s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 647s + useNames <- useNames[count %% length(useNames) + 1] 647s + 647s + validateIndicesTestMatrix(x, rows, cols, 647s + ftest = rowMedians, fsure = rowMedians_R, 647s + na.rm = na.rm, useNames = useNames) 647s + validateIndicesTestMatrix(x, rows, cols, 647s + fcoltest = colMedians, fsure = rowMedians_R, 647s + na.rm = na.rm, useNames = useNames) 647s + } 647s + } 647s + } 647s > 647s 647s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 647s Copyright (C) 2024 The R Foundation for Statistical Computing 647s Platform: aarch64-unknown-linux-gnu 647s 647s R is free software and comes with ABSOLUTELY NO WARRANTY. 647s You are welcome to redistribute it under certain conditions. 647s Type 'license()' or 'licence()' for distribution details. 647s 647s R is a collaborative project with many contributors. 647s Type 'contributors()' for more information and 647s 'citation()' on how to cite R or R packages in publications. 647s 647s Type 'demo()' for some demos, 'help()' for on-line help, or 647s 'help.start()' for an HTML browser interface to help. 647s Type 'q()' to quit R. 647s 647s > library("matrixStats") 647s > library("stats") 647s > 647s > asWhich <- function(probs, max) { 647s + idx <- as.integer(round(probs * max)) 647s + if (idx < 1L) { 647s + idx <- 1L 647s + } else if (idx > max) { 647s + idx <- max 647s + } 647s + idx 647s + } # asWhich() 647s > 647s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 647s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 647s + 647s + # Remove Attributes 647s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 647s + ans 647s + } # rowOrderStats_R() 647s > 647s > 647s > set.seed(1) 647s > 647s > 647s > # Simulate data in a matrix of any shape 647s > nrow <- 60L 647s > ncol <- 30L 647s > x <- rnorm(nrow * ncol) 647s > dim(x) <- c(nrow, ncol) 647s > probs <- 0.3 647s > which <- asWhich(probs, max = ncol) 647s > 647s > y0 <- rowOrderStats_R(x, probs = probs) 647s > y1 <- rowOrderStats(x, which = which) 647s > stopifnot(all.equal(y1, y0)) 647s > y2 <- colOrderStats(t(x), which = which) 647s > stopifnot(all.equal(y2, y0)) 647s > 647s > 647s > 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > # Consistency checks 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > for (mode in c("integer", "double")) { 647s + cat("Consistency checks without NAs:\n") 647s + for (kk in 1:3) { 647s + cat("Random test #", kk, "\n", sep = "") 647s + 647s + # Simulate data in a matrix of any shape 647s + nrow <- sample(20L, size = 1L) 647s + ncol <- sample(20L, size = 1L) 647s + x <- rnorm(nrow * ncol) 647s + dim(x) <- c(nrow, ncol) 647s + 647s + cat("mode: ", mode, "\n", sep = "") 647s + storage.mode(x) <- mode 647s + str(x) 647s + 647s + probs <- runif(1) 647s + which <- asWhich(probs, max = ncol) 647s + 647s + y0 <- rowOrderStats_R(x, probs = probs) 647s + y1 <- rowOrderStats(x, which = which) 647s + stopifnot(all.equal(y1, y0)) 647s + y2 <- colOrderStats(t(x), which = which) 647s + stopifnot(all.equal(y2, y0)) 647s + } # for (kk in ...) 647s + } # for (mode ...) 647s Consistency checks without NAs: 647s Random test #1 647s mode: integer 647s int [1:14, 1:6] 0 0 1 0 2 -1 1 0 0 0 ... 647s Random test #2 647s mode: integer 647s int [1:8, 1:13] 0 0 1 -2 0 0 0 0 1 0 ... 647s Random test #3 647s mode: integer 647s int [1:20, 1:17] 0 0 0 0 1 0 1 0 0 -1 ... 647s Consistency checks without NAs: 647s Random test #1 647s mode: double 647s num [1:9, 1:5] -1.4286 -0.00386 -0.70456 -0.29242 -0.49607 ... 647s Random test #2 647s mode: double 647s num [1:11, 1:20] -0.796 0.482 -0.952 0.5 1.242 ... 647s Random test #3 647s mode: double 647s num [1:7, 1:18] 1.553 -2.405 0.167 -0.403 -1.746 ... 647s > 647s > 647s > # Check names attribute 647s > x <- matrix(1:9 + 0.1, nrow = 3L, ncol = 3L) 647s > 647s > probs <- runif(1) 647s > which <- asWhich(probs, max = ncol(x)) 647s > 647s > dimnames <- list(letters[1:3], LETTERS[1:3]) 647s > 647s > # Test with and without dimnames on x 647s > for (setDimnames in c(TRUE, FALSE)) { 647s + if (setDimnames) dimnames(x) <- dimnames 647s + else dimnames(x) <- NULL 647s + # Check names attribute 647s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 647s + y0 <- rowOrderStats_R(x, probs = probs, useNames = useNames) 647s + y1 <- rowOrderStats(x, which = which, useNames = useNames) 647s + stopifnot(all.equal(y1, y0)) 647s + y2 <- colOrderStats(t(x), which = which, useNames = useNames) 647s + stopifnot(all.equal(y2, y0)) 647s + } 647s + } 647s > 647s 647s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 647s Copyright (C) 2024 The R Foundation for Statistical Computing 647s Platform: aarch64-unknown-linux-gnu 647s 647s R is free software and comes with ABSOLUTELY NO WARRANTY. 647s You are welcome to redistribute it under certain conditions. 647s Type 'license()' or 'licence()' for distribution details. 647s 647s R is a collaborative project with many contributors. 647s Type 'contributors()' for more information and 647s 'citation()' on how to cite R or R packages in publications. 647s 647s Type 'demo()' for some demos, 'help()' for on-line help, or 647s 'help.start()' for an HTML browser interface to help. 647s Type 'q()' to quit R. 647s 647s > library("matrixStats") 647s > 647s > rowOrderStats_R <- function(x, probs, ..., useNames = NA) { 647s + ans <- apply(x, MARGIN = 1L, FUN = quantile, probs = probs, type = 3L) 647s + 647s + # Remove Attributes 647s + if (is.na(useNames) || !useNames || length(ans) == 0L) attributes(ans) <- NULL 647s + ans 647s + } # rowOrderStats_R() 647s > 647s > 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > # Subsetted tests 647s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 647s > source("utils/validateIndicesFramework.R") 647s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 647s > storage.mode(x) <- "integer" 647s > 647s > # To check names attribute 647s > dimnames <- list(letters[1:6], LETTERS[1:6]) 647s > 647s > probs <- 0.3 647s > # Test with and without dimnames on x 647s > for (setDimnames in c(TRUE, FALSE)) { 647s + if (setDimnames) dimnames(x) <- dimnames 647s + else dimnames(x) <- NULL 647s + for (rows in index_cases) { 647s + for (cols in index_cases) { 647s + # Check names attribute 647s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 647s + if (is.null(cols)) which <- round(probs * ncol(x)) 647s + else { 647s + xxrows <- rows 647s + suppressWarnings({ 647s + xx <- tryCatch(x[, cols, drop = FALSE], error = function(c) "error") 647s + if (identical(xx, "error")) which <- 0L 647s + else which <- round(probs * ncol(xx)) 647s + }) 647s + } 647s + if (which == 0L) next 647s + 647s + validateIndicesTestMatrix(x, rows, cols, 647s + ftest = rowOrderStats, fsure = rowOrderStats_R, 647s + which = which, probs = probs, useNames = useNames) 647s + validateIndicesTestMatrix(x, rows, cols, 647s + fcoltest = colOrderStats, fsure = rowOrderStats_R, 647s + which = which, probs = probs, useNames = useNames) 647s + } 647s + } 647s + } 647s + } 648s > 648s 648s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 648s Copyright (C) 2024 The R Foundation for Statistical Computing 648s Platform: aarch64-unknown-linux-gnu 648s 648s R is free software and comes with ABSOLUTELY NO WARRANTY. 648s You are welcome to redistribute it under certain conditions. 648s Type 'license()' or 'licence()' for distribution details. 648s 648s R is a collaborative project with many contributors. 648s Type 'contributors()' for more information and 648s 'citation()' on how to cite R or R packages in publications. 648s 648s Type 'demo()' for some demos, 'help()' for on-line help, or 648s 'help.start()' for an HTML browser interface to help. 648s Type 'q()' to quit R. 648s 648s > library("matrixStats") 648s > 648s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 648s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 648s + if (is.na(useNames) || !useNames) names(res) <- NULL 648s + res 648s + } 648s > 648s > all.equal.na <- function(target, current, ...) { 648s + # Computations involving NaN may return NaN or NA, cf. ?is.nan 648s + current[is.nan(current)] <- NA_real_ 648s + target[is.nan(target)] <- NA_real_ 648s + all.equal(target, current, ...) 648s + } 648s > 648s > for (mode in c("integer", "double")) { 648s + # Missing values 648s + x <- matrix(c(1, NA, NaN, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 648s + cat("mode: ", mode, "\n", sep = "") 648s + storage.mode(x) <- mode 648s + str(x) 648s + 648s + # To check names attribute 648s + dimnames <- list(letters[1:4], LETTERS[1:2]) 648s + 648s + # Test with and without dimnames on x 648s + for (setDimnames in c(TRUE, FALSE)) { 648s + if (setDimnames) dimnames(x) <- dimnames 648s + else dimnames(x) <- NULL 648s + # Check names attribute 648s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 648s + y0 <- rowProds_R(x, na.rm = TRUE, useNames = useNames) 648s + print(y0) 648s + y1 <- rowProds(x, na.rm = TRUE, useNames = useNames) 648s + print(y1) 648s + y2 <- colProds(t(x), na.rm = TRUE, useNames = useNames) 648s + print(y2) 648s + stopifnot(all.equal(y1, y0)) 648s + stopifnot(all.equal(y2, y1)) 648s + 648s + # Missing values 648s + y0 <- rowProds_R(x, na.rm = FALSE, useNames = useNames) 648s + print(y0) 648s + y1 <- rowProds(x, na.rm = FALSE, useNames = useNames) 648s + print(y1) 648s + y2 <- colProds(t(x), na.rm = FALSE, useNames = useNames) 648s + print(y2) 648s + stopifnot(all.equal(y1, y0)) 648s + stopifnot(all.equal(y2, y1)) 648s + 648s + # "Empty" rows 648s + y0 <- rowProds_R(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 648s + print(y0) 648s + y1 <- rowProds(x[integer(0), , drop = FALSE], na.rm = FALSE, useNames = useNames) 648s + print(y1) 648s + y2 <- colProds(t(x[integer(0), , drop = FALSE]), na.rm = FALSE, useNames = useNames) 648s + print(y2) 648s + stopifnot(all.equal.na(y1, y0)) 648s + stopifnot(all.equal(y2, y1)) 648s + stopifnot(length(y1) == 0L) 648s + 648s + # Using product() 648s + y1 <- rowProds(x, method = "expSumLog", na.rm = FALSE, useNames = useNames) 648s + print(y1) 648s + y2 <- colProds(t(x), method = "expSumLog", na.rm = FALSE, useNames = useNames) 648s + print(y2) 648s + stopifnot(all.equal(y2, y1)) 648s + } 648s + } 648s + } # for (mode ...) 648s mode: integer 648s int [1:4, 1:2] 1 NA NA 1 1 0 1 0 648s a b c d 648s 1 0 1 0 648s a b c d 648s 1 0 1 0 648s a b c d 648s 1 0 1 0 648s a b c d 648s 1 NA NA 0 648s a b c d 648s 1 NA NA 0 648s a b c d 648s 1 NA NA 0 648s numeric(0) 648s numeric(0) 648s numeric(0) 648s a b c d 648s 1 NA NA 0 648s a b c d 648s 1 NA NA 0 648s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s mode: double 649s num [1:4, 1:2] 1 NA NaN 1 1 0 1 0 649s a b c d 649s 1 0 1 0 649s a b c d 649s 1 0 1 0 649s a b c d 649s 1 0 1 0 649s a b c d 649s 1 NA NaN 0 649s a b c d 649s 1 NA NaN 0 649s a b c d 649s 1 NA NaN 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s a b c d 649s 1 NA NA 0 649s a b c d 649s 1 NA NA 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 0 1 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s [1] 1 NA NaN 0 649s numeric(0) 649s numeric(0) 649s numeric(0) 649s [1] 1 NA NA 0 649s [1] 1 NA NA 0 649s > 649s > 649s > # Bug report 2012-06-25 649s > x <- matrix(c(1, 1, 1, 1, 1, 0, 1, 0), nrow = 4, ncol = 2) 649s > y0 <- rowProds_R(x) 649s > print(y0) 649s [1] 1 0 1 0 649s > y1 <- rowProds(x) 649s > print(y1) 649s [1] 1 0 1 0 649s > y2 <- colProds(t(x)) 649s > print(y2) 649s [1] 1 0 1 0 649s > stopifnot(all.equal.na(y1, y0)) 649s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 649s > stopifnot(all.equal.na(y2, y1)) 649s > # Check names attribute 649s > dimnames(x) <- dimnames 649s > y0 <- rowProds_R(x, useNames = TRUE) 649s > print(y0) 649s a b c d 649s 1 0 1 0 649s > y1 <- rowProds(x, useNames = TRUE) 649s > print(y1) 649s a b c d 649s 1 0 1 0 649s > y2 <- colProds(t(x), useNames = TRUE) 649s > print(y2) 649s a b c d 649s 1 0 1 0 649s > stopifnot(all.equal.na(y1, y0)) 649s > stopifnot(all.equal.na(y1, x[, 1] * x[, 2])) 649s > stopifnot(all.equal.na(y2, y1)) 649s > 649s > # Bug report 2014-03-25 ("all rows contains a zero") 649s > x <- matrix(c(0, 1, 1, 0), nrow = 2, ncol = 2) 649s > # To check names attribute 649s > dimnames <- list(letters[1:2], LETTERS[1:2]) 649s > y0 <- rowProds_R(x) 649s > print(y0) 649s [1] 0 0 649s > y1 <- rowProds(x) 649s > print(y1) 649s [1] 0 0 649s > y2 <- colProds(t(x)) 649s > print(y2) 649s [1] 0 0 649s > stopifnot(all.equal.na(y1, y0)) 649s > stopifnot(all.equal.na(y1, c(0, 0))) 649s > stopifnot(all.equal.na(y2, y1)) 649s > # Check names attribute 649s > dimnames(x) <- dimnames 649s > y0 <- rowProds_R(x, useNames = TRUE) 649s > print(y0) 649s a b 649s 0 0 649s > y1 <- rowProds(x, useNames = TRUE) 649s > print(y1) 649s a b 649s 0 0 649s > y2 <- colProds(t(x), useNames = TRUE) 649s > print(y2) 649s a b 649s 0 0 649s > stopifnot(all.equal.na(y1, y0)) 649s > stopifnot(all.equal.na(y2, y1)) 649s > 649s 649s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 649s Copyright (C) 2024 The R Foundation for Statistical Computing 649s Platform: aarch64-unknown-linux-gnu 649s 649s R is free software and comes with ABSOLUTELY NO WARRANTY. 649s You are welcome to redistribute it under certain conditions. 649s Type 'license()' or 'licence()' for distribution details. 649s 649s R is a collaborative project with many contributors. 649s Type 'contributors()' for more information and 649s 'citation()' on how to cite R or R packages in publications. 649s 649s Type 'demo()' for some demos, 'help()' for on-line help, or 649s 'help.start()' for an HTML browser interface to help. 649s Type 'q()' to quit R. 649s 649s > library("matrixStats") 649s > 649s > rowProds_R <- function(x, FUN = prod, na.rm = FALSE, ..., useNames = NA) { 649s + res <- apply(x, MARGIN = 1L, FUN = FUN, na.rm = na.rm) 649s + if (is.na(useNames) || !useNames) names(res) <- NULL 649s + res 649s + } 649s > 649s > 649s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 649s > # Subsetted tests 649s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 649s > source("utils/validateIndicesFramework.R") 649s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 649s > storage.mode(x) <- "integer" 649s > 649s > # To check names attribute 649s > dimnames <- list(letters[1:6], LETTERS[1:6]) 649s > 649s > # Test with and without dimnames on x 649s > for (setDimnames in c(TRUE, FALSE)) { 649s + if (setDimnames) dimnames(x) <- dimnames 649s + else dimnames(x) <- NULL 649s + for (rows in index_cases) { 649s + for (cols in index_cases) { 649s + for (na.rm in c(TRUE, FALSE)) { 649s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 649s + validateIndicesTestMatrix(x, rows, cols, 649s + ftest = rowProds, fsure = rowProds_R, 649s + method = "expSumLog", 649s + FUN = product, na.rm = na.rm, useNames = useNames) 649s + validateIndicesTestMatrix(x, rows, cols, 649s + fcoltest = colProds, fsure = rowProds_R, 649s + method = "expSumLog", 649s + FUN = product, na.rm = na.rm, useNames = useNames) 649s + } 649s + } 649s + } 649s + } 649s + } 650s > 650s 650s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 650s Copyright (C) 2024 The R Foundation for Statistical Computing 650s Platform: aarch64-unknown-linux-gnu 650s 650s R is free software and comes with ABSOLUTELY NO WARRANTY. 650s You are welcome to redistribute it under certain conditions. 650s Type 'license()' or 'licence()' for distribution details. 650s 650s R is a collaborative project with many contributors. 650s Type 'contributors()' for more information and 650s 'citation()' on how to cite R or R packages in publications. 650s 650s Type 'demo()' for some demos, 'help()' for on-line help, or 650s 'help.start()' for an HTML browser interface to help. 650s Type 'q()' to quit R. 650s 650s > library("matrixStats") 650s > 650s > ## Create isFALSE() if running on an old version of R 650s > if (!exists("isFALSE", mode="function")) { 650s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 650s + } 650s > 650s > rowQuantiles_R <- function(x, probs = c(0, 0.25, 0.50, 0.75, 1), na.rm = FALSE, drop = TRUE, type = 7L, ..., useNames = NA) { 650s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 650s + if (!na.rm && any(is.na(x))) { 650s + na_value <- NA_real_ 650s + if (type != 7L) storage.mode(na_value) <- storage.mode(x) 650s + rep(na_value, times = length(probs)) 650s + } else { 650s + as.vector(quantile(x, probs = probs, na.rm = na.rm, type = type, names = FALSE, ...)) 650s + } 650s + }, probs = probs, na.rm = na.rm) 650s + 650s + if (!is.null(dim(q))) q <- t(q) 650s + else dim(q) <- c(nrow(x), length(probs)) 650s + 650s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 650s + rownames(q) <- rownames(x) 650s + if (isFALSE(useNames)) dimnames(q) <- NULL 650s + 650s + if (drop) q <- drop(q) 650s + q 650s + } 650s > 650s > 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > # Test with multiple quantiles 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > for (mode in c("logical", "integer", "double")) { 650s + cat("mode: ", mode, "\n", sep = "") 650s + x <- matrix(1:40 + 0.1, nrow = 8, ncol = 5) 650s + storage.mode(x) <- mode 650s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 650s + str(x) 650s + 650s + probs <- c(0, 0.5, 1) 650s + # Test with and without dimnames on x 650s + for (setDimnames in c(TRUE, FALSE)) { 650s + if (setDimnames) dimnames(x) <- dimnames 650s + else dimnames(x) <- NULL 650s + # Check names attribute 650s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 650s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 650s + print(q0) 650s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 650s + print(q1) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 650s + stopifnot(all.equal(q1, q0)) 650s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 650s + stopifnot(all.equal(q2, q0)) 650s + } 650s + } 650s + } # for (mode ...) 650s mode: logical 650s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 650s 0% 50% 100% 650s a 1 1 1 650s b 1 1 1 650s c 1 1 1 650s d 1 1 1 650s e 1 1 1 650s f 1 1 1 650s g 1 1 1 650s h 1 1 1 650s 0% 50% 100% 650s a 1 1 1 650s b 1 1 1 650s c 1 1 1 650s d 1 1 1 650s e 1 1 1 650s f 1 1 1 650s g 1 1 1 650s h 1 1 1 650s [,1] [,2] [,3] 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s [,1] [,2] [,3] 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s 0% 50% 100% 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s 0% 50% 100% 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s [,1] [,2] [,3] 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s [,1] [,2] [,3] 650s [1,] 1 1 1 650s [2,] 1 1 1 650s [3,] 1 1 1 650s [4,] 1 1 1 650s [5,] 1 1 1 650s [6,] 1 1 1 650s [7,] 1 1 1 650s [8,] 1 1 1 650s mode: integer 650s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 650s 0% 50% 100% 650s a 1 17 33 650s b 2 18 34 650s c 3 19 35 650s d 4 20 36 650s e 5 21 37 650s f 6 22 38 650s g 7 23 39 650s h 8 24 40 650s 0% 50% 100% 650s a 1 17 33 650s b 2 18 34 650s c 3 19 35 650s d 4 20 36 650s e 5 21 37 650s f 6 22 38 650s g 7 23 39 650s h 8 24 40 650s [,1] [,2] [,3] 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s [,1] [,2] [,3] 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s 0% 50% 100% 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s 0% 50% 100% 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s [,1] [,2] [,3] 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s [,1] [,2] [,3] 650s [1,] 1 17 33 650s [2,] 2 18 34 650s [3,] 3 19 35 650s [4,] 4 20 36 650s [5,] 5 21 37 650s [6,] 6 22 38 650s [7,] 7 23 39 650s [8,] 8 24 40 650s mode: double 650s 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 ... 650s 0% 50% 100% 650s a 1.1 17.1 33.1 650s b 2.1 18.1 34.1 650s c 3.1 19.1 35.1 650s d 4.1 20.1 36.1 650s e 5.1 21.1 37.1 650s f 6.1 22.1 38.1 650s g 7.1 23.1 39.1 650s h 8.1 24.1 40.1 650s 0% 50% 100% 650s a 1.1 17.1 33.1 650s b 2.1 18.1 34.1 650s c 3.1 19.1 35.1 650s d 4.1 20.1 36.1 650s e 5.1 21.1 37.1 650s f 6.1 22.1 38.1 650s g 7.1 23.1 39.1 650s h 8.1 24.1 40.1 650s [,1] [,2] [,3] 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s [,1] [,2] [,3] 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s 0% 50% 100% 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s 0% 50% 100% 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s [,1] [,2] [,3] 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s [,1] [,2] [,3] 650s [1,] 1.1 17.1 33.1 650s [2,] 2.1 18.1 34.1 650s [3,] 3.1 19.1 35.1 650s [4,] 4.1 20.1 36.1 650s [5,] 5.1 21.1 37.1 650s [6,] 6.1 22.1 38.1 650s [7,] 7.1 23.1 39.1 650s [8,] 8.1 24.1 40.1 650s > 650s > 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > # Test with a single quantile 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > for (mode in c("logical", "integer", "double")) { 650s + cat("mode: ", mode, "\n", sep = "") 650s + x <- matrix(1:40, nrow = 8, ncol = 5) 650s + storage.mode(x) <- mode 650s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 650s + str(x) 650s + 650s + probs <- c(0.5) 650s + # Test with and without dimnames on x 650s + for (setDimnames in c(TRUE, FALSE)) { 650s + if (setDimnames) dimnames(x) <- dimnames 650s + else dimnames(x) <- NULL 650s + # Check names attribute 650s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 650s + q0 <- rowQuantiles_R(x, probs = probs, useNames = useNames) 650s + print(q0) 650s + q1 <- rowQuantiles(x, probs = probs, useNames = useNames) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q1) <- storage.mode(q0) 650s + print(q1) 650s + stopifnot(all.equal(q1, q0)) 650s + q2 <- colQuantiles(t(x), probs = probs, useNames = useNames) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical") storage.mode(q2) <- storage.mode(q0) 650s + stopifnot(all.equal(q2, q0)) 650s + } 650s + } 650s + } # for (mode ...) 650s mode: logical 650s logi [1:8, 1:5] TRUE TRUE TRUE TRUE TRUE TRUE ... 650s a b c d e f g h 650s 1 1 1 1 1 1 1 1 650s a b c d e f g h 650s 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s [1] 1 1 1 1 1 1 1 1 650s mode: integer 650s int [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 650s a b c d e f g h 650s 17 18 19 20 21 22 23 24 650s a b c d e f g h 650s 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s mode: double 650s num [1:8, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 650s a b c d e f g h 650s 17 18 19 20 21 22 23 24 650s a b c d e f g h 650s 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s [1] 17 18 19 20 21 22 23 24 650s > 650s > 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > # Consistency checks 650s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 650s > set.seed(1) 650s > 650s > probs <- seq(from = 0, to = 1, by = 0.25) 650s > 650s > cat("Consistency checks:\n") 650s Consistency checks: 650s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 6L else 24L 650s > for (kk in seq_len(n_sims)) { 650s + cat("Random test #", kk, "\n", sep = "") 650s + 650s + # Simulate data in a matrix of any shape 650s + dim <- sample(20:60, size = 2L) 650s + n <- prod(dim) 650s + x <- rnorm(n, sd = 100) 650s + dim(x) <- dim 650s + dimnames <- lapply(dim(x), FUN = function(n) rep(letters, length.out = n)) 650s + 650s + # Add NAs? 650s + has_na <- ((kk %% 2) == 0L) 650s + if (has_na) { 650s + cat("Adding NAs\n") 650s + nna <- sample(n, size = 1) 650s + na_values <- c(NA_real_, NaN) 650s + t <- sample(na_values, size = nna, replace = TRUE) 650s + x[sample(length(x), size = nna)] <- t 650s + } 650s + 650s + # Logical, integer, or double? 650s + mode <- "numeric" 650s + if ((kk %% 6) %in% 1:2) { 650s + cat("Coercing to logical\n") 650s + mode <- "logical" 650s + } else if ((kk %% 6) %in% 3:4) { 650s + cat("Coercing to integers\n") 650s + mode <- "integer" 650s + } 650s + storage.mode(x) <- mode 650s + 650s + str(x) 650s + 650s + # rowQuantiles(): 650s + for (type in 1:9) { 650s + cat(sprintf("type=%d, has_na=%s:\n", type, has_na)) 650s + # Test with and without dimnames on x 650s + for (setDimnames in c(TRUE, FALSE)) { 650s + if (setDimnames) dimnames(x) <- dimnames 650s + else dimnames(x) <- NULL 650s + # Check names attribute 650s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 650s + q0 <- rowQuantiles_R(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 650s + q1 <- rowQuantiles(x, probs = probs, na.rm = has_na, type = type, useNames = useNames) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q1) <- storage.mode(q0) 650s + stopifnot(all.equal(q1, q0)) 650s + q2 <- colQuantiles(t(x), probs = probs, na.rm = has_na, type = type, useNames = useNames) 650s + ## FIXME: Workaround for R (< 3.0.0) 650s + if (getRversion() < "3.0.0" && mode == "logical" && !has_na && type == 7L) storage.mode(q2) <- storage.mode(q0) 650s + stopifnot(all.equal(q2, q0)) 650s + } 650s + } 650s + } 650s + } # for (kk ...) 650s Random test #1 650s Coercing to logical 650s logi [1:23, 1:58] TRUE TRUE TRUE TRUE TRUE TRUE ... 650s type=1, has_na=FALSE: 650s type=2, has_na=FALSE: 650s type=3, has_na=FALSE: 650s type=4, has_na=FALSE: 650s type=5, has_na=FALSE: 650s type=6, has_na=FALSE: 650s type=7, has_na=FALSE: 650s type=8, has_na=FALSE: 650s type=9, has_na=FALSE: 650s Random test #2 650s Adding NAs 650s Coercing to logical 650s logi [1:58, 1:33] TRUE TRUE TRUE TRUE TRUE NA ... 650s type=1, has_na=TRUE: 650s type=2, has_na=TRUE: 650s type=3, has_na=TRUE: 651s type=4, has_na=TRUE: 651s type=5, has_na=TRUE: 651s type=6, has_na=TRUE: 651s type=7, has_na=TRUE: 651s type=8, has_na=TRUE: 651s type=9, has_na=TRUE: 651s Random test #3 651s Coercing to integers 651s int [1:28, 1:60] 119 -164 115 -129 209 -175 2 -32 120 -28 ... 651s type=1, has_na=FALSE: 651s type=2, has_na=FALSE: 651s type=3, has_na=FALSE: 651s type=4, has_na=FALSE: 651s type=5, has_na=FALSE: 651s type=6, has_na=FALSE: 651s type=7, has_na=FALSE: 651s type=8, has_na=FALSE: 651s type=9, has_na=FALSE: 651s Random test #4 651s Adding NAs 651s Coercing to integers 651s int [1:54, 1:35] 147 11 116 -50 NA -69 132 NA 114 NA ... 651s type=1, has_na=TRUE: 651s type=2, has_na=TRUE: 651s type=3, has_na=TRUE: 651s type=4, has_na=TRUE: 651s type=5, has_na=TRUE: 652s type=6, has_na=TRUE: 652s type=7, has_na=TRUE: 652s type=8, has_na=TRUE: 652s type=9, has_na=TRUE: 652s Random test #5 652s num [1:39, 1:53] 5.94 -27.16 -30.78 173 126.05 ... 652s type=1, has_na=FALSE: 652s type=2, has_na=FALSE: 652s type=3, has_na=FALSE: 652s type=4, has_na=FALSE: 652s type=5, has_na=FALSE: 652s type=6, has_na=FALSE: 652s type=7, has_na=FALSE: 652s type=8, has_na=FALSE: 652s type=9, has_na=FALSE: 652s Random test #6 652s Adding NAs 652s num [1:46, 1:22] 197 -107 15 148 -110 ... 652s type=1, has_na=TRUE: 652s type=2, has_na=TRUE: 652s type=3, has_na=TRUE: 652s type=4, has_na=TRUE: 652s type=5, has_na=TRUE: 652s type=6, has_na=TRUE: 652s type=7, has_na=TRUE: 652s type=8, has_na=TRUE: 653s type=9, has_na=TRUE: 653s Random test #7 653s Coercing to logical 653s logi [1:21, 1:51] TRUE TRUE TRUE TRUE TRUE TRUE ... 653s type=1, has_na=FALSE: 653s type=2, has_na=FALSE: 653s type=3, has_na=FALSE: 653s type=4, has_na=FALSE: 653s type=5, has_na=FALSE: 653s type=6, has_na=FALSE: 653s type=7, has_na=FALSE: 653s type=8, has_na=FALSE: 653s type=9, has_na=FALSE: 653s Random test #8 653s Adding NAs 653s Coercing to logical 653s logi [1:33, 1:53] NA NA TRUE TRUE TRUE TRUE ... 653s type=1, has_na=TRUE: 653s type=2, has_na=TRUE: 653s type=3, has_na=TRUE: 653s type=4, has_na=TRUE: 653s type=5, has_na=TRUE: 653s type=6, has_na=TRUE: 653s type=7, has_na=TRUE: 653s type=8, has_na=TRUE: 653s type=9, has_na=TRUE: 653s Random test #9 653s Coercing to integers 653s int [1:53, 1:24] -73 10 -73 -5 44 -107 -100 95 58 -50 ... 653s type=1, has_na=FALSE: 653s type=2, has_na=FALSE: 653s type=3, has_na=FALSE: 653s type=4, has_na=FALSE: 653s type=5, has_na=FALSE: 654s type=6, has_na=FALSE: 654s type=7, has_na=FALSE: 654s type=8, has_na=FALSE: 654s type=9, has_na=FALSE: 654s Random test #10 654s Adding NAs 654s Coercing to integers 654s int [1:44, 1:20] NA -140 NA -57 -252 NA NA 20 NA NA ... 654s type=1, has_na=TRUE: 654s type=2, has_na=TRUE: 654s type=3, has_na=TRUE: 654s type=4, has_na=TRUE: 654s type=5, has_na=TRUE: 654s type=6, has_na=TRUE: 654s type=7, has_na=TRUE: 654s type=8, has_na=TRUE: 654s type=9, has_na=TRUE: 654s Random test #11 654s num [1:54, 1:23] -160.87 74.13 196.08 7.27 4.92 ... 654s type=1, has_na=FALSE: 654s type=2, has_na=FALSE: 654s type=3, has_na=FALSE: 654s type=4, has_na=FALSE: 654s type=5, has_na=FALSE: 654s type=6, has_na=FALSE: 655s type=7, has_na=FALSE: 655s type=8, has_na=FALSE: 655s type=9, has_na=FALSE: 655s Random test #12 655s Adding NAs 655s num [1:59, 1:27] -139.2 -86.3 NA -40.7 NA ... 655s type=1, has_na=TRUE: 655s type=2, has_na=TRUE: 655s type=3, has_na=TRUE: 655s type=4, has_na=TRUE: 655s type=5, has_na=TRUE: 655s type=6, has_na=TRUE: 655s type=7, has_na=TRUE: 655s type=8, has_na=TRUE: 655s type=9, has_na=TRUE: 655s Random test #13 655s Coercing to logical 655s logi [1:53, 1:60] TRUE TRUE TRUE TRUE TRUE TRUE ... 655s type=1, has_na=FALSE: 655s type=2, has_na=FALSE: 655s type=3, has_na=FALSE: 655s type=4, has_na=FALSE: 655s type=5, has_na=FALSE: 656s type=6, has_na=FALSE: 656s type=7, has_na=FALSE: 656s type=8, has_na=FALSE: 656s type=9, has_na=FALSE: 656s Random test #14 656s Adding NAs 656s Coercing to logical 656s logi [1:22, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 656s type=1, has_na=TRUE: 656s type=2, has_na=TRUE: 656s type=3, has_na=TRUE: 656s type=4, has_na=TRUE: 656s type=5, has_na=TRUE: 656s type=6, has_na=TRUE: 656s type=7, has_na=TRUE: 656s type=8, has_na=TRUE: 656s type=9, has_na=TRUE: 656s Random test #15 656s Coercing to integers 656s int [1:20, 1:34] 78 -41 183 190 -71 37 0 -4 -86 27 ... 656s type=1, has_na=FALSE: 656s type=2, has_na=FALSE: 656s type=3, has_na=FALSE: 656s type=4, has_na=FALSE: 656s type=5, has_na=FALSE: 656s type=6, has_na=FALSE: 656s type=7, has_na=FALSE: 656s type=8, has_na=FALSE: 656s type=9, has_na=FALSE: 656s Random test #16 656s Adding NAs 656s Coercing to integers 656s int [1:42, 1:37] NA 12 -15 41 -28 17 NA -74 NA NA ... 656s type=1, has_na=TRUE: 656s type=2, has_na=TRUE: 656s type=3, has_na=TRUE: 656s type=4, has_na=TRUE: 656s type=5, has_na=TRUE: 656s type=6, has_na=TRUE: 656s type=7, has_na=TRUE: 657s type=8, has_na=TRUE: 657s type=9, has_na=TRUE: 657s Random test #17 657s num [1:42, 1:29] -50.51 -6.51 -117.59 135.58 226.87 ... 657s type=1, has_na=FALSE: 657s type=2, has_na=FALSE: 657s type=3, has_na=FALSE: 657s type=4, has_na=FALSE: 657s type=5, has_na=FALSE: 657s type=6, has_na=FALSE: 657s type=7, has_na=FALSE: 657s type=8, has_na=FALSE: 657s type=9, has_na=FALSE: 657s Random test #18 657s Adding NAs 657s num [1:57, 1:39] 223 156.8 -44.6 -127.5 -147.7 ... 657s type=1, has_na=TRUE: 657s type=2, has_na=TRUE: 657s type=3, has_na=TRUE: 657s type=4, has_na=TRUE: 657s type=5, has_na=TRUE: 657s type=6, has_na=TRUE: 657s type=7, has_na=TRUE: 657s type=8, has_na=TRUE: 657s type=9, has_na=TRUE: 658s Random test #19 658s Coercing to logical 658s logi [1:52, 1:57] TRUE TRUE TRUE TRUE TRUE TRUE ... 658s type=1, has_na=FALSE: 658s type=2, has_na=FALSE: 658s type=3, has_na=FALSE: 658s type=4, has_na=FALSE: 658s type=5, has_na=FALSE: 658s type=6, has_na=FALSE: 658s type=7, has_na=FALSE: 658s type=8, has_na=FALSE: 658s type=9, has_na=FALSE: 658s Random test #20 658s Adding NAs 658s Coercing to logical 658s logi [1:25, 1:48] NA TRUE NA NA NA NA ... 658s type=1, has_na=TRUE: 658s type=2, has_na=TRUE: 658s type=3, has_na=TRUE: 658s type=4, has_na=TRUE: 658s type=5, has_na=TRUE: 658s type=6, has_na=TRUE: 658s type=7, has_na=TRUE: 658s type=8, has_na=TRUE: 658s type=9, has_na=TRUE: 658s Random test #21 658s Coercing to integers 658s int [1:53, 1:27] 3 -30 203 -49 19 -45 -138 28 46 -44 ... 658s type=1, has_na=FALSE: 658s type=2, has_na=FALSE: 658s type=3, has_na=FALSE: 658s type=4, has_na=FALSE: 659s type=5, has_na=FALSE: 659s type=6, has_na=FALSE: 659s type=7, has_na=FALSE: 659s type=8, has_na=FALSE: 659s type=9, has_na=FALSE: 659s Random test #22 659s Adding NAs 659s Coercing to integers 659s int [1:48, 1:36] -131 NA NA -201 45 -17 NA 57 NA NA ... 659s type=1, has_na=TRUE: 659s type=2, has_na=TRUE: 659s type=3, has_na=TRUE: 659s type=4, has_na=TRUE: 659s type=5, has_na=TRUE: 659s type=6, has_na=TRUE: 659s type=7, has_na=TRUE: 659s type=8, has_na=TRUE: 659s type=9, has_na=TRUE: 659s Random test #23 659s num [1:23, 1:43] -99.2 -68.8 -86.7 -104.2 48 ... 659s type=1, has_na=FALSE: 659s type=2, has_na=FALSE: 659s type=3, has_na=FALSE: 659s type=4, has_na=FALSE: 659s type=5, has_na=FALSE: 659s type=6, has_na=FALSE: 659s type=7, has_na=FALSE: 659s type=8, has_na=FALSE: 659s type=9, has_na=FALSE: 660s Random test #24 660s Adding NAs 660s num [1:53, 1:29] NaN -67.6 10.8 -88.4 130.1 ... 660s type=1, has_na=TRUE: 660s type=2, has_na=TRUE: 660s type=3, has_na=TRUE: 660s type=4, has_na=TRUE: 660s type=5, has_na=TRUE: 660s type=6, has_na=TRUE: 660s type=7, has_na=TRUE: 660s type=8, has_na=TRUE: 660s type=9, has_na=TRUE: 660s > 660s > 660s > 660s > for (mode in c("logical", "integer", "double")) { 660s + naValue <- NA_real_ 660s + storage.mode(naValue) <- mode 660s + 660s + someValue <- 1 660s + storage.mode(someValue) <- mode 660s + 660s + for (type in 1:9) { 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + # All NA 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + x <- matrix(naValue, nrow = 3L, ncol = 4L) 660s + dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + # Test with and without dimnames on x 660s + for (setDimnames in c(TRUE, FALSE)) { 660s + if (setDimnames) dimnames(x) <- dimnames 660s + else dimnames(x) <- NULL 660s + # Check names attribute 660s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 660s + qr0 <- rowQuantiles_R(x, type = type, useNames = useNames) 660s + 660s + qr <- rowQuantiles(x, type = type, useNames = useNames) 660s + stopifnot(identical(qr, qr0)) 660s + 660s + # x <- matrix(naValue, nrow = 4L, ncol = 3L) 660s + qc <- colQuantiles(t(x), type = type, useNames = useNames) 660s + 660s + stopifnot(identical(qc, qr)) 660s + } 660s + } 660s + 660s + 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + # Empty matrices 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + probs <- c(0, 0.25, 0.75, 1) 660s + x <- matrix(naValue, nrow = 0L, ncol = 0L) 660s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 660s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 660s + 660s + x <- matrix(naValue, nrow = 2L, ncol = 0L) 660s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + q <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + stopifnot(identical(dim(q), c(nrow(x), length(probs)))) 660s + 660s + x <- matrix(naValue, nrow = 0L, ncol = 2L) 660s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + q <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + stopifnot(identical(dim(q), c(ncol(x), length(probs)))) 660s + 660s + 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + # Single column matrices 660s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 660s + probs <- c(0, 0.25, 0.75, 1) 660s + x <- matrix(someValue, nrow = 2L, ncol = 1L) 660s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + qr <- rowQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + print(qr) 660s + 660s + x <- matrix(someValue, nrow = 1L, ncol = 2L) 660s + dimnames(x) <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 660s + qc <- colQuantiles(x, probs = probs, type = type, useNames = TRUE) 660s + print(qc) 660s + 660s + stopifnot(identical(qc, qr)) 660s + } 660s + } 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s 0% 25% 75% 100% 660s a 1 1 1 1 660s b 1 1 1 1 660s > 661s 661s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 661s Copyright (C) 2024 The R Foundation for Statistical Computing 661s Platform: aarch64-unknown-linux-gnu 661s 661s R is free software and comes with ABSOLUTELY NO WARRANTY. 661s You are welcome to redistribute it under certain conditions. 661s Type 'license()' or 'licence()' for distribution details. 661s 661s R is a collaborative project with many contributors. 661s Type 'contributors()' for more information and 661s 'citation()' on how to cite R or R packages in publications. 661s 661s Type 'demo()' for some demos, 'help()' for on-line help, or 661s 'help.start()' for an HTML browser interface to help. 661s Type 'q()' to quit R. 661s 661s > library("matrixStats") 661s > 661s > ## Create isFALSE() if running on an old version of R 661s > if (!exists("isFALSE", mode="function")) { 661s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 661s + } 661s > 661s > rowQuantiles_R <- function(x, probs, na.rm = FALSE, drop = TRUE, ..., useNames = NA) { 661s + q <- apply(x, MARGIN = 1L, FUN = function(x, probs, na.rm) { 661s + if (!na.rm && any(is.na(x))) { 661s + na_value <- NA_real_ 661s + storage.mode(na_value) <- storage.mode(x) 661s + rep(na_value, times = length(probs)) 661s + 661s + } else { 661s + as.vector(quantile(x, probs = probs, na.rm = na.rm, names = FALSE, ...)) 661s + } 661s + }, probs = probs, na.rm = na.rm) 661s + 661s + if (!is.null(dim(q))) q <- t(q) 661s + else dim(q) <- c(nrow(x), length(probs)) 661s + 661s + colnames(q) <- matrixStats:::quantile_probs_names(probs) 661s + rownames(q) <- rownames(x) 661s + if (isFALSE(useNames)) dimnames(q) <- NULL 661s + 661s + if (drop) q <- drop(q) 661s + q 661s + } 661s > 661s > 661s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 661s > # Subsetted tests 661s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 661s > source("utils/validateIndicesFramework.R") 661s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 661s > dimnames <- lapply(dim(x), FUN = function(n) letters[seq_len(n)]) 661s > probs <- c(0, 0.25, 0.75, 1) 661s > # Test with and without dimnames on x 661s > for (setDimnames in c(TRUE, FALSE)) { 661s + if (setDimnames) dimnames(x) <- dimnames 661s + else dimnames(x) <- NULL 661s + 661s + count <- 0L 661s + for (rows in index_cases) { 661s + for (cols in index_cases) { 661s + count <- count + 1L 661s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 661s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 661s + useNames <- useNames[count %% length(useNames) + 1] 661s + 661s + validateIndicesTestMatrix(x, rows, cols, 661s + ftest = rowQuantiles, fsure = rowQuantiles_R, 661s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 661s + validateIndicesTestMatrix(x, rows, cols, 661s + fcoltest = colQuantiles, fsure = rowQuantiles_R, 661s + probs = probs, na.rm = na.rm, drop = FALSE, useNames = useNames) 661s + } 661s + } 661s + } 662s > 662s > 662s 662s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 662s Copyright (C) 2024 The R Foundation for Statistical Computing 662s Platform: aarch64-unknown-linux-gnu 662s 662s R is free software and comes with ABSOLUTELY NO WARRANTY. 662s You are welcome to redistribute it under certain conditions. 662s Type 'license()' or 'licence()' for distribution details. 662s 662s R is a collaborative project with many contributors. 662s Type 'contributors()' for more information and 662s 'citation()' on how to cite R or R packages in publications. 662s 662s Type 'demo()' for some demos, 'help()' for on-line help, or 662s 'help.start()' for an HTML browser interface to help. 662s Type 'q()' to quit R. 662s 662s > library("matrixStats") 662s > 662s > rowMins_R <- function(x, ..., useNames = NA) { 662s + suppressWarnings({ 662s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 662s + }) 662s + if (is.na(useNames) || !useNames) names(res) <- NULL 663s + res 663s + } # rowMins_R() 663s > 663s > rowMaxs_R <- function(x, ..., useNames = NA) { 663s + suppressWarnings({ 663s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 663s + }) 663s + if (is.na(useNames) || !useNames) names(res) <- NULL 663s + res 663s + } # rowMaxs_R() 663s > 663s > rowRanges_R <- function(x, ..., useNames = NA) { 663s + suppressWarnings({ 663s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 663s + }) 663s + 663s + # Preserve rownames attribute 663s + dim <- c(dim(x)[1], 2L) 663s + if (!isTRUE(all.equal(dim(ans), dim))) { 663s + dim(ans) <- dim 663s + rownames <- rownames(x) 663s + if (!is.null(dimnames)) rownames(ans) <- rownames 663s + } 663s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 663s + ans 663s + } # rowRanges_R() 663s > 663s > 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # With and without some NAs 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > for (mode in c("integer", "double")) { 663s + cat("mode: ", mode, "\n", sep = "") 663s + 663s + for (add_na in c(FALSE, TRUE)) { 663s + cat("add_na = ", add_na, "\n", sep = "") 663s + 663s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 663s + if (add_na) { 663s + x[3:7, c(2, 4)] <- NA_real_ 663s + } 663s + storage.mode(x) <- mode 663s + str(x) 663s + 663s + # To check names attribute 663s + dimnames <- list(letters[1:10], LETTERS[1:5]) 663s + 663s + # Test with and without dimnames on x 663s + for (setDimnames in c(TRUE, FALSE)) { 663s + if (setDimnames) dimnames(x) <- dimnames 663s + else dimnames(x) <- NULL 663s + # Row/column extremes 663s + for (na.rm in c(FALSE, TRUE)) { 663s + # Check names attribute 663s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 663s + cat("na.rm = ", na.rm, "\n", sep = "") 663s + 663s + # Ranges 663s + cat("range:\n") 663s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 663s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 663s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 663s + stopifnot(all.equal(r1, r2)) 663s + stopifnot(all.equal(r1, r0)) 663s + 663s + # Min 663s + cat("min:\n") 663s + m0 <- rowMins_R(x, na.rm = na.rm, useNames = useNames) 663s + m1 <- rowMins(x, na.rm = na.rm, useNames = useNames) 663s + m2 <- colMins(t(x), na.rm = na.rm, useNames = useNames) 663s + stopifnot(all.equal(m1, m2)) 663s + stopifnot(all.equal(m1, m0)) 663s + 663s + # Max 663s + cat("max:\n") 663s + m0 <- rowMaxs_R(x, na.rm = na.rm, useNames = useNames) 663s + m1 <- rowMaxs(x, na.rm = na.rm, useNames = useNames) 663s + m2 <- colMaxs(t(x), na.rm = na.rm, useNames = useNames) 663s + stopifnot(all.equal(m1, m2)) 663s + stopifnot(all.equal(m1, m0)) 663s + } 663s + } 663s + } 663s + } # for (add_na ...) 663s + } # for (mode ...) 663s mode: integer 663s add_na = FALSE 663s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s add_na = TRUE 663s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s mode: double 663s add_na = FALSE 663s 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 ... 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s add_na = TRUE 663s 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 ... 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = FALSE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s na.rm = TRUE 663s range: 663s min: 663s max: 663s > 663s > 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # All NAs 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > for (mode in c("integer", "double")) { 663s + cat("mode: ", mode, "\n", sep = "") 663s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 663s + storage.mode(x) <- mode 663s + str(x) 663s + 663s + # Test with and without dimnames on x 663s + for (setDimnames in c(TRUE, FALSE)) { 663s + if (setDimnames) dimnames(x) <- dimnames 663s + else dimnames(x) <- NULL 663s + for (na.rm in c(FALSE, TRUE)) { 663s + # Check names attribute 663s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 663s + cat("na.rm = ", na.rm, "\n", sep = "") 663s + r0 <- rowRanges_R(x, na.rm = na.rm, useNames = useNames) 663s + r1 <- rowRanges(x, na.rm = na.rm, useNames = useNames) 663s + r2 <- colRanges(t(x), na.rm = na.rm, useNames = useNames) 663s + stopifnot(all.equal(r1, r2)) 663s + stopifnot(all.equal(r1, r0)) 663s + } 663s + } 663s + } 663s + } # for (mode ...) 663s mode: integer 663s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 663s na.rm = FALSE 663s na.rm = FALSE 663s na.rm = TRUE 663s na.rm = TRUE 663s na.rm = FALSE 663s na.rm = FALSE 663s na.rm = TRUE 663s na.rm = TRUE 663s mode: double 663s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 663s na.rm = FALSE 663s na.rm = FALSE 663s na.rm = TRUE 663s na.rm = TRUE 663s na.rm = FALSE 663s na.rm = FALSE 663s na.rm = TRUE 663s na.rm = TRUE 663s > 663s > 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # Special cases 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # Nx0 matrix 663s > x <- matrix(double(0L), nrow = 5L, ncol = 0L) 663s > r0 <- rowRanges_R(x) 663s > #r1 <- rowRanges(x) 663s > #r_truth <- matrix(c(Inf, -Inf), nrow = nrow(x), ncol = 2L, byrow = TRUE) 663s > #stopifnot(all.equal(r1, r_truth)) 663s > 663s > # 0xN matrix 663s > x <- t(x) 663s > #r1 <- colRanges(x) 663s > #stopifnot(all.equal(r1, r_truth)) 663s > 663s > # Nx1 matrix 663s > x <- matrix(1:5, nrow = 5L, ncol = 1L) 663s > # To check names attribute 663s > dimnames <- list(letters[1:5], "A") 663s > r1 <- rowRanges(x) 663s > r_truth <- matrix(1:5, nrow = nrow(x), ncol = 2L, byrow = FALSE) 663s > stopifnot(all.equal(r1, r_truth)) 663s > # Check names attribute 663s > dimnames(x) <- dimnames 663s > r0 <- rowRanges_R(x, useNames = TRUE) 663s > r1 <- rowRanges(x, useNames = TRUE) 663s > stopifnot(all.equal(r1, r0)) 663s > dimnames(x) <- NULL 663s > 663s > # 1xN matrix 663s > x <- t(x) 663s > r1 <- colRanges(x) 663s > stopifnot(all.equal(r1, r_truth)) 663s > # Check names attribute 663s > dimnames(x) <- list("a", LETTERS[1:5]) 663s > r1 <- colRanges(x, useNames = TRUE) 663s > stopifnot(identical(rownames(r1), colnames(x))) 663s > 663s > 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # Additional tests with NA_integer_, NA_real, NaN, -Inf, +Inf 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > x <- matrix(1:12, nrow = 4L, ncol = 3L) 663s > 663s > na_list <- list( 663s + "integer" = matrix(1:12, nrow = 4L, ncol = 3L), 663s + "integer w/ NA" = matrix(NA_integer_, nrow = 4L, ncol = 3L), 663s + "real" = matrix(as.double(1:12), nrow = 4L, ncol = 3L), 663s + "real w/ NA" = matrix(NA_real_, nrow = 4L, ncol = 3L) 663s + ) 663s > 663s > na <- na_list[["real"]] 663s > na[2, 2] <- NA 663s > na_list[["real + NA cell"]] <- na 663s > 663s > na <- na_list[["real"]] 663s > na[2, ] <- NA 663s > na_list[["real + NA row"]] <- na 663s > 663s > na <- na_list[["real"]] 663s > na[2, ] <- NaN 663s > na_list[["real + NaN row"]] <- na 663s > 663s > na <- na_list[["real"]] 663s > na[2, 2] <- Inf 663s > na_list[["real + Inf cell"]] <- na 663s > 663s > na <- na_list[["real"]] 663s > na[2, ] <- Inf 663s > na_list[["real + Inf row"]] <- na 663s > 663s > na <- na_list[["real"]] 663s > na[2, 2] <- NaN 663s > na_list[["real + NaN cell"]] <- na 663s > 663s > na <- na_list[["real w/ NA"]] 663s > na[2, 2] <- NaN 663s > na_list[["real w/ NA + NaN cell"]] <- na 663s > 663s > na <- na_list[["real w/ NA"]] 663s > na[2, ] <- NaN 663s > na_list[["real w/ NA + NaN row"]] <- na 663s > 663s > # To check names attribute 663s > dimnames <- list(letters[1:4], LETTERS[1:3]) 663s > 663s > # Test with and without dimnames on x 663s > for (setDimnames in c(TRUE, FALSE)) { 663s + if (setDimnames) dimnames(x) <- dimnames 663s + else dimnames(x) <- NULL 663s + for (na.rm in c(FALSE, TRUE)) { 663s + for (name in names(na_list)) { 663s + # Check names attribute 663s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 663s + na <- na_list[[name]] 663s + cat(sprintf("%s (%s) w/ na.rm = %s:\n", name, typeof(na), na.rm)) 663s + print(na) 663s + 663s + cat(" min:\n") 663s + y0 <- rowMins_R(na, na.rm = na.rm, useNames = useNames) 663s + str(y0) 663s + y1 <- rowMins(na, na.rm = na.rm, useNames = useNames) 663s + str(y1) 663s + stopifnot(all.equal(y1, y0)) 663s + y1c <- colMins(t(na), na.rm = na.rm, useNames = useNames) 663s + str(y1c) 663s + stopifnot(all.equal(y1c, y1)) 663s + 663s + cat(" max:\n") 663s + y0 <- rowMaxs_R(na, na.rm = na.rm, useNames = useNames) 663s + str(y0) 663s + y1 <- rowMaxs(na, na.rm = na.rm, useNames = useNames) 663s + str(y1) 663s + stopifnot(all.equal(y1, y0)) 663s + y1c <- colMaxs(t(na), na.rm = na.rm, useNames = useNames) 663s + str(y1c) 663s + stopifnot(all.equal(y1c, y1)) 663s + 663s + cat(" range:\n") 663s + y0 <- rowRanges_R(na, na.rm = na.rm, useNames = useNames) 663s + str(y0) 663s + y1 <- rowRanges(na, na.rm = na.rm, useNames = useNames) 663s + str(y1) 663s + stopifnot(all.equal(y1, y0)) 663s + y1c <- colRanges(t(na), na.rm = na.rm, useNames = useNames) 663s + str(y1c) 663s + stopifnot(all.equal(y1c, y1)) 663s + } 663s + } # for (name ...) 663s + } # for (na.rm ...) 663s + } 663s integer (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer w/ NA (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s max: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s range: 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s integer w/ NA (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s max: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s range: 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real + NA cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + Inf cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s max: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s range: 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s real w/ NA + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s max: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s range: 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s integer (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer w/ NA (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s integer w/ NA (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real + NA cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NA cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NA row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NA row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s integer (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer w/ NA (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s max: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s range: 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s integer w/ NA (integer) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s max: 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s int [1:4] NA NA NA NA 663s range: 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s int [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real + NA cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NA row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s num [1:4] 1 NA 3 4 663s max: 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s num [1:4] 9 NA 11 12 663s range: 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s num [1:4, 1:2] 1 NA 3 4 9 NA 11 12 663s real + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + Inf cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s num [1:4] 1 NaN 3 4 663s max: 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s num [1:4] 9 NaN 11 12 663s range: 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s num [1:4, 1:2] 1 NaN 3 4 9 NaN 11 12 663s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA + NaN cell (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s max: 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s num [1:4] NA NA NA NA 663s range: 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s num [1:4, 1:2] NA NA NA NA NA NA NA NA 663s real w/ NA + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s max: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s range: 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s real w/ NA + NaN row (double) w/ na.rm = FALSE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s max: 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s num [1:4] NA NaN NA NA 663s range: 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s num [1:4, 1:2] NA NaN NA NA NA NaN NA NA 663s integer (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s int [1:4] 1 2 3 4 663s max: 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s int [1:4] 9 10 11 12 663s range: 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s int [1:4, 1:2] 1 2 3 4 9 10 11 12 663s integer w/ NA (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s integer w/ NA (integer) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 6 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NA NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real + NA cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NA cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NA 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NA row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NA row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NA NA NA 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] NaN NaN NaN 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s num [1:4] 9 -Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 Inf 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s num [1:4, 1:2] 1 2 3 4 9 ... 663s real + Inf row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + Inf row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] Inf Inf Inf 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s num [1:4] 1 Inf 3 4 663s max: 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s num [1:4] 9 Inf 11 12 663s range: 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s num [1:4, 1:2] 1 Inf 3 4 9 ... 663s real + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] 1 5 9 663s [2,] 2 NaN 10 663s [3,] 3 7 11 663s [4,] 4 8 12 663s min: 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s num [1:4] 1 2 3 4 663s max: 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s num [1:4] 9 10 11 12 663s range: 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s num [1:4, 1:2] 1 2 3 4 9 10 11 12 663s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN cell (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NA NaN NA 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s real w/ NA + NaN row (double) w/ na.rm = TRUE: 663s [,1] [,2] [,3] 663s [1,] NA NA NA 663s [2,] NaN NaN NaN 663s [3,] NA NA NA 663s [4,] NA NA NA 663s min: 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s num [1:4] Inf Inf Inf Inf 663s max: 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s num [1:4] -Inf -Inf -Inf -Inf 663s range: 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s num [1:4, 1:2] Inf Inf Inf Inf -Inf ... 663s > 663s 663s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 663s Copyright (C) 2024 The R Foundation for Statistical Computing 663s Platform: aarch64-unknown-linux-gnu 663s 663s R is free software and comes with ABSOLUTELY NO WARRANTY. 663s You are welcome to redistribute it under certain conditions. 663s Type 'license()' or 'licence()' for distribution details. 663s 663s R is a collaborative project with many contributors. 663s Type 'contributors()' for more information and 663s 'citation()' on how to cite R or R packages in publications. 663s 663s Type 'demo()' for some demos, 'help()' for on-line help, or 663s 'help.start()' for an HTML browser interface to help. 663s Type 'q()' to quit R. 663s 663s > library("matrixStats") 663s > 663s > rowMins_R <- function(x, ..., useNames = NA) { 663s + suppressWarnings({ 663s + res <- apply(x, MARGIN = 1L, FUN = min, ...) 663s + }) 663s + if (is.na(useNames) || !useNames) names(res) <- NULL 663s + res 663s + } # rowMins_R() 663s > 663s > rowMaxs_R <- function(x, ..., useNames = NA) { 663s + suppressWarnings({ 663s + res <- apply(x, MARGIN = 1L, FUN = max, ...) 663s + }) 663s + if (is.na(useNames) || !useNames) names(res) <- NULL 663s + res 663s + } # rowMaxs_R() 663s > 663s > rowRanges_R <- function(x, ..., useNames = NA) { 663s + suppressWarnings({ 663s + ans <- t(apply(x, MARGIN = 1L, FUN = range, ...)) 663s + }) 663s + 663s + # Preserve rownames attribute 663s + dim <- c(dim(x)[1], 2L) 663s + if (!isTRUE(all.equal(dim(ans), dim))) { 663s + dim(ans) <- dim 663s + rownames <- rownames(x) 663s + if (!is.null(dimnames)) rownames(ans) <- rownames 663s + } 663s + if (is.na(useNames) || !useNames) dimnames(ans) <- NULL 663s + ans 663s + } # rowRanges_R() 663s > 663s > 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > # Subsetted tests 663s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 663s > source("utils/validateIndicesFramework.R") 663s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 663s > storage.mode(x) <- "integer" 663s > 663s > # To check rownames/names attributes 663s > dimnames <- list(letters[1:6], LETTERS[1:6]) 663s > 663s > # Test with and without dimnames on x 663s > for (setDimnames in c(TRUE, FALSE)) { 663s + if (setDimnames) dimnames(x) <- dimnames 663s + else dimnames(x) <- NULL 663s + 663s + count <- 0L 663s + for (rows in index_cases) { 663s + for (cols in index_cases) { 663s + count <- count + 1L 663s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 663s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 663s + useNames <- useNames[count %% length(useNames) + 1] 663s + 663s + validateIndicesTestMatrix(x, rows, cols, 663s + ftest = rowRanges, fsure = rowRanges_R, 663s + na.rm = na.rm, useNames = useNames) 663s + validateIndicesTestMatrix(x, rows, cols, 663s + ftest = rowMins, fsure = rowMins_R, 663s + na.rm = na.rm, useNames = useNames) 663s + validateIndicesTestMatrix(x, rows, cols, 663s + ftest = rowMaxs, fsure = rowMaxs_R, 663s + na.rm = na.rm, useNames = useNames) 663s + 663s + validateIndicesTestMatrix(x, rows, cols, 663s + fcoltest = colRanges, fsure = rowRanges_R, 663s + na.rm = na.rm, useNames = useNames) 663s + validateIndicesTestMatrix(x, rows, cols, 663s + fcoltest = colMins, fsure = rowMins_R, 663s + na.rm = na.rm, useNames = useNames) 663s + validateIndicesTestMatrix(x, rows, cols, 663s + fcoltest = colMaxs, fsure = rowMaxs_R, 663s + na.rm = na.rm, useNames = useNames) 663s + } 663s + } 663s + } 665s > 665s 665s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 665s Copyright (C) 2024 The R Foundation for Statistical Computing 665s Platform: aarch64-unknown-linux-gnu 665s 665s R is free software and comes with ABSOLUTELY NO WARRANTY. 665s You are welcome to redistribute it under certain conditions. 665s Type 'license()' or 'licence()' for distribution details. 665s 665s R is a collaborative project with many contributors. 665s Type 'contributors()' for more information and 665s 'citation()' on how to cite R or R packages in publications. 665s 665s Type 'demo()' for some demos, 'help()' for on-line help, or 665s 'help.start()' for an HTML browser interface to help. 665s Type 'q()' to quit R. 665s 665s > library("matrixStats") 665s > 665s > dense_rank <- function(x) match(x, table = sort(unique(x))) 665s > 665s > rowRanks_R <- function(x, ties.method, ..., useNames = NA) { 665s + if (ties.method == "dense") { 665s + res <- t(apply(x, MARGIN = 1L, FUN = dense_rank)) 665s + } else { 665s + res <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", ties.method = ties.method)) 665s + } 665s + 665s + # Preserve dimnames attribute? 665s + dim(res) <- dim(x) 665s + dimnames(res) <- if (isTRUE(useNames)) dimnames(x) else NULL 665s + 665s + res 665s + } 665s > 665s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 665s + if (ties.method == "dense") { 665s + res <- t(apply(x, MARGIN = 2L, FUN = dense_rank)) 665s + } else { 665s + res <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 665s + } 665s + 665s + # Preserve dimnames attribute? 665s + tx <- t(x) 665s + dim(res) <- dim(tx) 665s + dimnames(res) <- if (isTRUE(useNames)) dimnames(tx) else NULL 665s + 665s + if (preserveShape) res <- t(res) 665s + res 665s + } 665s > 665s > set.seed(1) 665s > 665s > cat("Consistency checks:\n") 665s Consistency checks: 665s > xs <- vector("list", length = 4L) 665s > for (kk in 1:4) { 665s + 665s + # Simulate data in a matrix of any shape 665s + dim <- sample(40:80, size = 2L) 665s + n <- prod(dim) 665s + x <- rnorm(n, sd = 10) 665s + dim(x) <- dim 665s + 665s + # Add NAs? 665s + if ((kk %% 4) %in% c(3, 0)) { 665s + cat("Adding NAs\n") 665s + nna <- sample(n, size = 1L) 665s + x[sample(length(x), size = nna)] <- NA_real_ 665s + } 665s + 665s + # Integer or double? 665s + if ((kk %% 4) %in% c(2, 0)) { 665s + cat("Coercing to integers\n") 665s + storage.mode(x) <- "integer" 665s + } 665s + 665s + xs[[kk]] <- x 665s + } # for (kk ...) 665s Coercing to integers 665s Adding NAs 665s Adding NAs 665s Coercing to integers 665s > str(xs) 665s List of 4 665s $ : num [1:43, 1:78] 13.3 12.72 4.15 -15.4 -9.29 ... 665s $ : int [1:46, 1:61] 2 11 -16 -5 19 5 26 -13 1 -9 ... 665s $ : num [1:42, 1:47] NA -22.3 NA NA NA ... 665s $ : int [1:42, 1:78] NA NA NA NA NA NA NA NA NA NA ... 665s > 665s > for (kk in 1:4) { 665s + cat("Random test #", kk, "\n", sep = "") 665s + x <- xs[[kk]] 665s + tx <- t(x) 665s + 665s + for (ties in c("max", "min", "average", "first", "last", "dense")) { 665s + cat(sprintf("ties.method = %s\n", ties)) 665s + # rowRanks(): 665s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 665s + if (ties != "last" || getRversion() >= "3.3.0") { 665s + y2 <- rowRanks_R(x, ties.method = ties) 665s + stopifnot(identical(y1, y2)) 665s + } 665s + 665s + y3 <- matrixStats::colRanks(tx, ties.method = ties) 665s + stopifnot(identical(y1, y3)) 665s + 665s + # colRanks(): 665s + y1 <- matrixStats::colRanks(x, ties.method = ties) 665s + if (ties != "last" || getRversion() >= "3.3.0") { 665s + y2 <- colRanks_R(x, ties.method = ties) 665s + stopifnot(identical(y1, y2)) 665s + } 665s + 665s + y3 <- matrixStats::rowRanks(tx, ties.method = ties) 665s + stopifnot(identical(y1, y3)) 665s + } 665s + } # for (kk ...) 665s Random test #1 665s ties.method = max 665s ties.method = min 665s ties.method = average 665s ties.method = first 665s ties.method = last 665s ties.method = dense 665s Random test #2 665s ties.method = max 665s ties.method = min 665s ties.method = average 665s ties.method = first 665s ties.method = last 665s ties.method = dense 665s Random test #3 665s ties.method = max 665s ties.method = min 665s ties.method = average 665s ties.method = first 665s ties.method = last 665s ties.method = dense 665s Random test #4 665s ties.method = max 665s ties.method = min 665s ties.method = average 665s ties.method = first 665s ties.method = last 665s ties.method = dense 665s > 665s > # Note, below we know ties.method %in% c("min", "max", "average") is correct 665s > 665s > cat("Consistency checks for random:\n") 665s Consistency checks for random: 665s > tolerance <- 0.1 665s > nsamples <- 10000 665s > for (kk in 1:4) { 665s + cat("Random test #", kk, "\n", sep = "") 665s + x <- xs[[kk]] 665s + tx <- t(x) 665s + 665s + for (ties in c("random")) { 665s + cat(sprintf("ties.method = %s\n", ties)) 665s + 665s + ## rowRanks(): 665s + y0 <- rowRanks_R(x, ties.method = ties) 665s + y1 <- matrixStats::rowRanks(x, ties.method = ties) 665s + 665s + ## Assert symmetric rank differences 665s + d <- y1 - y0 665s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 665s + 665s + ## Assert within [min, max] 665s + y2min <- matrixStats::rowRanks(x, ties.method = "min") 665s + y2max <- matrixStats::rowRanks(x, ties.method = "max") 665s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 665s + ## Assert near average 665s + y1list <- replicate(nsamples, matrixStats::rowRanks(x, ties.method = ties), simplify = FALSE) 665s + y1mean <- Reduce(`+`, y1list) / nsamples 665s + y2avg <- matrixStats::rowRanks(x, ties.method = "average") 665s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 665s + 665s + ## colRanks(): 665s + y0 <- colRanks_R(x, ties.method = ties) 665s + y1 <- matrixStats::colRanks(x, ties.method = ties) 665s + 665s + ## Assert symmetric rank differences 665s + d <- y1 - y0 665s + stopifnot(all(rowSums(d) == 0, na.rm = TRUE)) 665s + 665s + ## Assert within [min, max] 665s + y2min <- matrixStats::colRanks(x, ties.method = "min") 665s + y2max <- matrixStats::colRanks(x, ties.method = "max") 665s + stopifnot(all(y1 >= y2min, na.rm = TRUE) && all(y1 <= y2max, na.rm = TRUE)) 665s + y1list <- replicate(nsamples, matrixStats::colRanks(x, ties.method = ties), simplify = FALSE) 665s + y1mean <- Reduce(`+`, y1list) / nsamples 665s + ## Assert near average 665s + y2avg <- matrixStats::colRanks(x, ties.method = "average") 665s + stopifnot(all(abs(y1mean - y2avg) < tolerance, na.rm = TRUE)) 665s + } 665s + } # for (kk ...) 665s Random test #1 665s ties.method = random 668s Random test #2 668s ties.method = random 670s Random test #3 670s ties.method = random 671s Random test #4 671s ties.method = random 671s > 671s > 671s > ## Exception handling 671s > x <- matrix(1:12, nrow = 3L, ncol = 4L) 671s > y <- try(rowRanks(x, ties.method = "unknown"), silent = TRUE) 671s > stopifnot(inherits(y, "try-error")) 671s > 671s > y <- try(colRanks(x, ties.method = "unknown"), silent = TRUE) 671s > stopifnot(inherits(y, "try-error")) 671s > 671s > dimnames <- list(letters[1:3], LETTERS[1:4]) 671s > for (mode in c("integer", "double")){ 671s + storage.mode(x) <- mode 671s + # Test with and without dimnames on x 671s + for (setDimnames in c(TRUE, FALSE)) { 671s + if (setDimnames) dimnames(x) <- dimnames 671s + else dimnames(x) <- NULL 671s + # Check names attribute 671s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 671s + for (ties in c("max", "min", "average", "first", "last", "dense", "random")) { 671s + cat(sprintf("ties.method = %s\n", ties)) 671s + # rowRanks(): 671s + y1 <- matrixStats::rowRanks(x, ties.method = ties, useNames = useNames) 671s + if (ties != "last" || getRversion() >= "3.3.0") { 671s + y2 <- rowRanks_R(x, ties.method = ties, useNames = useNames) 671s + stopifnot(identical(y1, y2)) 671s + } 671s + 671s + y3 <- matrixStats::colRanks(t(x), ties.method = ties, useNames = useNames) 671s + stopifnot(identical(y1, y3)) 671s + 671s + # colRanks(): 671s + y1 <- matrixStats::colRanks(x, ties.method = ties, useNames = useNames) 671s + if (ties != "last" || getRversion() >= "3.3.0") { 671s + y2 <- colRanks_R(x, ties.method = ties, useNames = useNames) 671s + stopifnot(identical(y1, y2)) 671s + } 671s + 671s + y3 <- matrixStats::rowRanks(t(x), ties.method = ties, useNames = useNames) 671s + stopifnot(identical(y1, y3)) 671s + 671s + # Check preserveShape 671s + y1 <- matrixStats::colRanks(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 671s + if (ties != "last" || getRversion() >= "3.3.0") { 671s + y2 <- colRanks_R(x, ties.method = ties, preserveShape = TRUE, useNames = useNames) 671s + stopifnot(identical(y1, y2)) 671s + } 671s + } 671s + } 671s + } 671s + } 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s ties.method = max 671s ties.method = min 671s ties.method = average 671s ties.method = first 671s ties.method = last 671s ties.method = dense 671s ties.method = random 671s > 672s 672s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 672s Copyright (C) 2024 The R Foundation for Statistical Computing 672s Platform: aarch64-unknown-linux-gnu 672s 672s R is free software and comes with ABSOLUTELY NO WARRANTY. 672s You are welcome to redistribute it under certain conditions. 672s Type 'license()' or 'licence()' for distribution details. 672s 672s R is a collaborative project with many contributors. 672s Type 'contributors()' for more information and 672s 'citation()' on how to cite R or R packages in publications. 672s 672s Type 'demo()' for some demos, 'help()' for on-line help, or 672s 'help.start()' for an HTML browser interface to help. 672s Type 'q()' to quit R. 672s 672s > library("matrixStats") 672s > 672s > rowRanks_R <- function(x, ties.method = "average", ..., useNames = NA) { 672s + ans <- t(apply(x, MARGIN = 1L, FUN = rank, na.last = "keep", 672s + ties.method = ties.method)) 672s + 672s + # Preserve dimnames attribute? 672s + dim(ans) <- dim(x) 672s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(x) else NULL 672s + 672s + ans 672s + } 672s > 672s > colRanks_R <- function(x, ties.method, preserveShape = FALSE, ..., useNames = NA) { 672s + ans <- t(apply(x, MARGIN = 2L, FUN = rank, na.last = "keep", ties.method = ties.method)) 672s + 672s + # Preserve dimnames attribute? 672s + tx <- t(x) 672s + dim(ans) <- dim(tx) 672s + dimnames(ans) <- if (isTRUE(useNames)) dimnames(tx) else NULL 672s + 672s + if (preserveShape) ans <- t(ans) 672s + ans 672s + } 672s > 672s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 672s > # Subsetted tests 672s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 672s > source("utils/validateIndicesFramework.R") 672s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 672s > storage.mode(x) <- "integer" 672s > 672s > # To check dimnames attribute 672s > dimnames <- list(letters[1:6], LETTERS[1:6]) 672s > 672s > colRanks_R_t <- function(x, rows, cols, ..., useNames = NA) { 672s + t(colRanks(t(x), rows = cols, cols = rows, preserveShape = TRUE, ..., useNames = useNames)) 672s + } 672s > 672s > # Test with and without dimnames on x 672s > for (setDimnames in c(TRUE, FALSE)) { 672s + if (setDimnames) dimnames(x) <- dimnames 672s + else dimnames(x) <- NULL 672s + 672s + count <- 0L 672s + for (rows in index_cases) { 672s + for (cols in index_cases) { 672s + count <- count + 1L 672s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 672s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 672s + useNames <- useNames[count %% length(useNames) + 1] 672s + 672s + validateIndicesTestMatrix(x, rows, cols, 672s + ftest = rowRanks, fsure = rowRanks_R, 672s + ties.method = "average", useNames = useNames) 672s + 672s + validateIndicesTestMatrix(x, rows, cols, 672s + ftest = colRanks_R_t, fsure = rowRanks_R, 672s + ties.method = "average", useNames = useNames) 672s + 672s + for (perserveShape in c(TRUE, FALSE)) { 672s + validateIndicesTestMatrix(x, rows, cols, 672s + ftest = colRanks, fsure = colRanks_R, 672s + ties.method = "average", perserveShape = perserveShape, 672s + useNames = useNames) 672s + } 672s + } 672s + } 672s + } 673s > 673s 673s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 673s Copyright (C) 2024 The R Foundation for Statistical Computing 673s Platform: aarch64-unknown-linux-gnu 673s 673s R is free software and comes with ABSOLUTELY NO WARRANTY. 673s You are welcome to redistribute it under certain conditions. 673s Type 'license()' or 'licence()' for distribution details. 673s 673s R is a collaborative project with many contributors. 673s Type 'contributors()' for more information and 673s 'citation()' on how to cite R or R packages in publications. 673s 673s Type 'demo()' for some demos, 'help()' for on-line help, or 673s 'help.start()' for an HTML browser interface to help. 673s Type 'q()' to quit R. 673s 673s > library("matrixStats") 673s > 673s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 673s > options(matrixStats.center.onUse = "ignore") 673s > 673s > ## Create isFALSE() if running on an old version of R 673s > if (!exists("isFALSE", mode="function")) { 673s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 673s + } 673s > 673s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 673s + suppressWarnings({ 673s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 673s + }) 673s + stopifnot(!any(is.infinite(sigma))) 673s + 673s + # Keep naming support consistency same as rowSds() 673s + if (is.null(center) || ncol(x) <= 1L) { 673s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 673s + } 673s + else if (isFALSE(useNames)) names(sigma) <- NULL 673s + sigma 673s + } 673s > 673s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 673s + suppressWarnings({ 673s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 673s + }) 673s + stopifnot(!any(is.infinite(sigma))) 673s + 673s + # Keep naming support consistency same as colSds() 673s + if (is.null(center) || nrow(x) <= 1L) { 673s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 673s + } 673s + if (isFALSE(useNames)) names(sigma) <- NULL 673s + sigma 673s + } 673s > 673s > 673s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 673s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 673s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 673s + stopifnot(!any(is.infinite(sigma))) 673s + sigma 673s + } 673s > 673s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 673s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 673s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 673s + stopifnot(!any(is.infinite(sigma))) 673s + sigma 673s + } 673s > 673s > 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > # With and without some NAs 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > for (mode in c("integer", "double")) { 673s + for (add_na in c(FALSE, TRUE)) { 673s + cat("add_na = ", add_na, "\n", sep = "") 673s + 673s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 673s + if (add_na) { 673s + x[3:7, c(2, 4)] <- NA_real_ 673s + } 673s + cat("mode: ", mode, "\n", sep = "") 673s + storage.mode(x) <- mode 673s + str(x) 673s + 673s + # To check names attribute 673s + dimnames <- list(letters[1:10], LETTERS[1:5]) 673s + 673s + # Test with and without dimnames on x 673s + for (setDimnames in c(TRUE, FALSE)) { 673s + if (setDimnames) dimnames(x) <- dimnames 673s + else dimnames(x) <- NULL 673s + # Row/column ranges 673s + for (na.rm in c(FALSE, TRUE)) { 673s + # Check names attribute 673s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 673s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 673s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 673s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 673s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 673s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 673s + stopifnot(all.equal(r1, r2)) 673s + stopifnot(all.equal(r1, r0)) 673s + stopifnot(all.equal(r2, r0)) 673s + stopifnot(all.equal(r1b, r2b)) 673s + stopifnot( 673s + !any(is.infinite(r1)), 673s + !any(is.infinite(r2)), 673s + !any(is.infinite(r1b)), 673s + !any(is.infinite(r2b)) 673s + ) 673s + } 673s + } 673s + } 673s + } # for (add_na ...) 673s + } 673s add_na = FALSE 673s mode: integer 673s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 673s add_na = TRUE 673s mode: integer 673s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 673s add_na = FALSE 673s mode: double 673s 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 ... 673s add_na = TRUE 673s mode: double 673s 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 ... 673s > 673s > 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > # All NAs 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > for (mode in c("integer", "double")) { 673s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 673s + cat("mode: ", mode, "\n", sep = "") 673s + storage.mode(x) <- mode 673s + str(x) 673s + 673s + # Test with and without dimnames on x 673s + for (setDimnames in c(TRUE, FALSE)) { 673s + if (setDimnames) dimnames(x) <- dimnames 673s + else dimnames(x) <- NULL 673s + # Row/column ranges 673s + for (na.rm in c(FALSE, TRUE)) { 673s + # Check names attribute 673s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 673s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 673s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 673s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 673s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 673s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 673s + stopifnot(all.equal(r1, r2)) 673s + stopifnot(all.equal(r1, r0)) 673s + stopifnot(all.equal(r2, r0)) 673s + stopifnot(all.equal(r1b, r2b)) 673s + stopifnot( 673s + !any(is.infinite(r1)), 673s + !any(is.infinite(r2)), 673s + !any(is.infinite(r1b)), 673s + !any(is.infinite(r2b)) 673s + ) 673s + } 673s + } 673s + } 673s + } 673s mode: integer 673s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 673s mode: double 673s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 673s > 673s > 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > # A 1x1 matrix 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > x <- matrix(0, nrow = 1L, ncol = 1L) 673s > dimnames <- list("a", "A") 673s > for (na.rm in c(FALSE, TRUE)) { 673s + cat("na.rm = ", na.rm, "\n", sep = "") 673s + 673s + # Test with and without dimnames on x 673s + for (setDimnames in c(TRUE, FALSE)) { 673s + if (setDimnames) dimnames(x) <- dimnames 673s + else dimnames(x) <- NULL 673s + # Row/column ranges 673s + for (na.rm in c(FALSE, TRUE)) { 673s + # Check names attribute 673s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 673s + r0 <- rowSds_R(x, na.rm = na.rm, useNames = useNames) 673s + r1 <- rowSds(x, na.rm = na.rm, useNames = useNames) 673s + r1b <- rowSds_center(x, na.rm = na.rm, useNames = useNames) 673s + r2 <- colSds(t(x), na.rm = na.rm, useNames = useNames) 673s + r2b <- colSds_center(t(x), na.rm = na.rm, useNames = useNames) 673s + stopifnot(all.equal(r1, r2)) 673s + stopifnot(all.equal(r1, r0)) 673s + stopifnot(all.equal(r2, r0)) 673s + stopifnot(all.equal(r1b, r2b)) 673s + stopifnot( 673s + !any(is.infinite(r1)), 673s + !any(is.infinite(r2)), 673s + !any(is.infinite(r1b)), 673s + !any(is.infinite(r2b)) 673s + ) 673s + } 673s + } 673s + } 673s + } 673s na.rm = FALSE 673s na.rm = TRUE 673s > 673s 673s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 673s Copyright (C) 2024 The R Foundation for Statistical Computing 673s Platform: aarch64-unknown-linux-gnu 673s 673s R is free software and comes with ABSOLUTELY NO WARRANTY. 673s You are welcome to redistribute it under certain conditions. 673s Type 'license()' or 'licence()' for distribution details. 673s 673s R is a collaborative project with many contributors. 673s Type 'contributors()' for more information and 673s 'citation()' on how to cite R or R packages in publications. 673s 673s Type 'demo()' for some demos, 'help()' for on-line help, or 673s 'help.start()' for an HTML browser interface to help. 673s Type 'q()' to quit R. 673s 673s > library("matrixStats") 673s > 673s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 673s > options(matrixStats.center.onUse = "ignore") 673s > 673s > ## Create isFALSE() if running on an old version of R 673s > if (!exists("isFALSE", mode="function")) { 673s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 673s + } 673s > 673s > rowSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 673s + suppressWarnings({ 673s + sigma <- apply(x, MARGIN = 1L, FUN = sd, na.rm = na.rm) 673s + }) 673s + stopifnot(!any(is.infinite(sigma))) 673s + 673s + # Keep naming support consistency same as rowSds() 673s + if (is.null(center) || ncol(x) <= 1L) { 673s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 673s + } 673s + else if (isFALSE(useNames)) names(sigma) <- NULL 673s + sigma 673s + } 673s > 673s > colSds_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 673s + suppressWarnings({ 673s + sigma <- apply(x, MARGIN = 2L, FUN = sd, na.rm = na.rm) 673s + }) 673s + stopifnot(!any(is.infinite(sigma))) 673s + 673s + # Keep naming support consistency same as colSds() 673s + if (is.null(center) || nrow(x) <= 1L) { 673s + if (is.na(useNames) || isFALSE(useNames)) names(sigma) <- NULL 673s + } 673s + else if (isFALSE(useNames)) names(sigma) <- NULL 673s + sigma 673s + } 673s > 673s > 673s > rowSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 673s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 673s + sigma <- rowSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 673s + stopifnot(!any(is.infinite(sigma))) 673s + sigma 673s + } 673s > 673s > colSds_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 673s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 673s + sigma <- colSds(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 673s + stopifnot(!any(is.infinite(sigma))) 673s + sigma 673s + } 673s > 673s > 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > # Subsetted tests 673s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 673s > source("utils/validateIndicesFramework.R") 673s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 673s > storage.mode(x) <- "integer" 673s > 673s > # To check names attribute 673s > dimnames <- list(letters[1:6], LETTERS[1:6]) 673s > 673s > # Test with and without dimnames on x 673s > for (setDimnames in c(TRUE, FALSE)) { 673s + if (setDimnames) dimnames(x) <- dimnames 673s + else dimnames(x) <- NULL 673s + 673s + count <- 0L 673s + for (rows in index_cases) { 673s + for (cols in index_cases) { 673s + count <- count + 1L 673s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 673s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 673s + useNames <- useNames[count %% length(useNames) + 1] 673s + 673s + validateIndicesTestMatrix(x, rows, cols, 673s + ftest = rowSds, fsure = rowSds_R, 673s + na.rm = na.rm, useNames = useNames) 673s + validateIndicesTestMatrix(x, rows, cols, 673s + ftest = rowSds_center, fsure = rowSds_R, 673s + na.rm = na.rm, center = TRUE, useNames = useNames) 673s + 673s + validateIndicesTestMatrix(x, rows, cols, 673s + fcoltest = colSds, fsure = rowSds_R, 673s + na.rm = na.rm, useNames = useNames) 673s + validateIndicesTestMatrix(x, rows, cols, 673s + fcoltest = colSds_center, fsure = rowSds_R, 673s + na.rm = na.rm, center = TRUE, useNames = useNames) 673s + } 673s + } 673s + } 674s > 674s 674s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 674s Copyright (C) 2024 The R Foundation for Statistical Computing 674s Platform: aarch64-unknown-linux-gnu 674s 674s R is free software and comes with ABSOLUTELY NO WARRANTY. 674s You are welcome to redistribute it under certain conditions. 674s Type 'license()' or 'licence()' for distribution details. 674s 674s R is a collaborative project with many contributors. 674s Type 'contributors()' for more information and 674s 'citation()' on how to cite R or R packages in publications. 674s 674s Type 'demo()' for some demos, 'help()' for on-line help, or 674s 'help.start()' for an HTML browser interface to help. 674s Type 'q()' to quit R. 674s 674s > library("matrixStats") 674s > 674s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 674s + ## FIXME: sum() may overflow for integers, whereas 674s + ## base::rowSums() doesn't. What should rowSums2() do? 674s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 674s + res <- rowSums(x, na.rm = na.rm) 674s + if (is.na(useNames) || !useNames) names(res) <- NULL 674s + res 674s + } 674s > 674s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 674s + ## FIXME: sum() may overflow for integers, whereas 674s + ## base::colSums() doesn't. What should colSums2() do? 674s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 674s + res <- colSums(x, na.rm = na.rm) 674s + if (is.na(useNames) || !useNames) names(res) <- NULL 674s + res 674s + } 674s > 674s > for (mode in c("integer", "logical", "double")) { 674s + x <- matrix(-4:4, nrow = 3, ncol = 3) 674s + storage.mode(x) <- mode 674s + if (mode == "double") x <- x + 0.1 674s + 675s + # To check names attribute 675s + dimnames <- list(letters[1:3], LETTERS[1:3]) 675s + 675s + # Test with and without dimnames on x 675s + for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s + } 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: Single-element matrix 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: Single-element matrix:\n") 675s Special case: Single-element matrix: 675s > for (mode in c("integer", "logical", "double")) { 675s + x <- matrix(1, nrow = 1, ncol = 1) 675s + storage.mode(x) <- mode 675s + 675s + # To check names attribute 675s + dimnames <- list("a", "A") 675s + 675s + # Test with and without dimnames on x 675s + for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: Empty matrix 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: Empty matrix:\n") 675s Special case: Empty matrix: 675s > for (mode in c("integer", "logical", "double")) { 675s + x <- matrix(integer(0), nrow = 0, ncol = 0) 675s + storage.mode(x) <- mode 675s + 675s + y0 <- rowSums2_R(x, na.rm = FALSE) 675s + y1 <- rowSums2(x, na.rm = FALSE) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE) 675s + y1 <- colSums2(x, na.rm = FALSE) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: All NAs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: All NAs:\n") 675s Special case: All NAs: 675s > for (mode in c("integer", "logical", "double")) { 675s + x <- matrix(NA_integer_, nrow = 3, ncol = 3) 675s + storage.mode(x) <- mode 675s + 675s + # To check names attribute 675s + dimnames <- list(letters[1:3], LETTERS[1:3]) 675s + 675s + # Test with and without dimnames on x 675s + for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: All NaNs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: All NaNs:\n") 675s Special case: All NaNs: 675s > x <- matrix(NA_real_, nrow = 3, ncol = 3) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = TRUE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = TRUE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = TRUE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = TRUE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: All Infs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: All Infs:\n") 675s Special case: All Infs: 675s > x <- matrix(Inf, nrow = 3, ncol = 3) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: All -Infs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: All -Infs:\n") 675s Special case: All -Infs: 675s > x <- matrix(-Inf, nrow = 3, ncol = 3) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: Infs and -Infs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: Infs and -Infs:\n") 675s Special case: Infs and -Infs: 675s > x <- matrix(c(-Inf, +Inf), nrow = 4, ncol = 4) 675s > 675s > # To check names attribute 675s > dimnames <- list(letters[1:4], LETTERS[1:4]) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: NaNs and NAs 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: Infs and -Infs:\n") 675s Special case: Infs and -Infs: 675s > x <- matrix(c(NaN, NA_real_), nrow = 4, ncol = 4) 675s > 675s > y0 <- rowSums(x, na.rm = FALSE) 675s > str(y0) 675s num [1:4] NaN NA NaN NA 675s > stopifnot(all(is.na(y0)), length(unique(y0)) >= 1L) 675s > y1 <- rowSums2(x, na.rm = FALSE) 675s > str(y0) 675s num [1:4] NaN NA NaN NA 675s > stopifnot(all(is.na(y1)), length(unique(y1)) >= 1L) 675s > stopifnot(all.equal(y1, y0)) 675s > 675s > y0 <- colSums(x, na.rm = FALSE) 675s > stopifnot(all(is.na(y0)), length(unique(y0)) == 1L) 675s > y1 <- colSums2(x, na.rm = FALSE) 675s > stopifnot(all(is.na(y1)), length(unique(y1)) == 1L) 675s > ## NOTE, due to compiler optimization, it is not guaranteed that NA is 675s > ## returned here (as one would expect). NaN might very well be returned, 675s > ## when both NA and NaN are involved. This is an accepted feature in R, 675s > ## which is documented in help("is.nan"). See also 675s > ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 675s > ## Thus, we cannot guarantee that y1 is identical to y0. 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Special case: Integer overflow with ties 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > cat("Special case: Integer overflow with ties:\n") 675s Special case: Integer overflow with ties: 675s > x <- matrix(.Machine$integer.max, nrow = 4, ncol = 4) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + # Check names attribute 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + y0 <- rowSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- rowSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + 675s + y0 <- colSums2_R(x, na.rm = FALSE, useNames = useNames) 675s + y1 <- colSums2(x, na.rm = FALSE, useNames = useNames) 675s + stopifnot(all.equal(y1, y0)) 675s + } 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Consistency checks 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > set.seed(1) 675s > 675s > cat("Consistency checks:\n") 675s Consistency checks: 675s > n_sims <- if (Sys.getenv("_R_CHECK_USE_VALGRIND_") != "") 4L else 20L 675s > for (kk in seq_len(n_sims)) { 675s + cat("Random test #", kk, "\n", sep = "") 675s + 675s + # Simulate data in a matrix of any shape 675s + dim <- sample(50:200, size = 2) 675s + n <- prod(dim) 675s + x <- rnorm(n, sd = 100) 675s + dim(x) <- dim 675s + 675s + # Add NAs? 675s + if ((kk %% 4) %in% c(3, 0)) { 675s + cat("Adding NAs\n") 675s + nna <- sample(n, size = 1) 675s + na_values <- c(NA_real_, NaN) 675s + t <- sample(na_values, size = nna, replace = TRUE) 675s + x[sample(length(x), size = nna)] <- t 675s + } 675s + 675s + # Mode? 675s + modes <- "double" 675s + if ((kk %% 4) %in% c(2, 0)) { 675s + modes <- c("integer", "logical") 675s + } 675s + 675s + for (mode in modes) { 675s + if (mode != "double") { 675s + cat(sprintf("Coercing from %s to %s\n", storage.mode(x), mode)) 675s + storage.mode(x) <- mode 675s + } 675s + 675s + na.rm <- sample(c(TRUE, FALSE), size = 1) 675s + 675s + # rowSums2(): 675s + y0 <- rowSums2_R(x, na.rm = na.rm) 675s + y1 <- rowSums2(x, na.rm = na.rm) 675s + stopifnot(all.equal(y1, y0)) 675s + y2 <- colSums2(t(x), na.rm = na.rm) 675s + stopifnot(all.equal(y2, y0)) 675s + 675s + # colSums2(): 675s + y0 <- colSums2_R(x, na.rm = na.rm) 675s + y1 <- colSums2(x, na.rm = na.rm) 675s + stopifnot(all.equal(y1, y0)) 675s + y2 <- rowSums2(t(x), na.rm = na.rm) 675s + stopifnot(all.equal(y2, y0)) 675s + } 675s + } # for (kk ...) 675s Random test #1 675s Random test #2 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #3 675s Adding NAs 675s Random test #4 675s Adding NAs 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #5 675s Random test #6 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #7 675s Adding NAs 675s Random test #8 675s Adding NAs 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #9 675s Random test #10 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #11 675s Adding NAs 675s Random test #12 675s Adding NAs 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #13 675s Random test #14 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #15 675s Adding NAs 675s Random test #16 675s Adding NAs 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #17 675s Random test #18 675s Coercing from double to integer 675s Coercing from integer to logical 675s Random test #19 675s Adding NAs 675s Random test #20 675s Adding NAs 675s Coercing from double to integer 675s Coercing from integer to logical 675s > 675s 675s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 675s Copyright (C) 2024 The R Foundation for Statistical Computing 675s Platform: aarch64-unknown-linux-gnu 675s 675s R is free software and comes with ABSOLUTELY NO WARRANTY. 675s You are welcome to redistribute it under certain conditions. 675s Type 'license()' or 'licence()' for distribution details. 675s 675s R is a collaborative project with many contributors. 675s Type 'contributors()' for more information and 675s 'citation()' on how to cite R or R packages in publications. 675s 675s Type 'demo()' for some demos, 'help()' for on-line help, or 675s 'help.start()' for an HTML browser interface to help. 675s Type 'q()' to quit R. 675s 675s > library("matrixStats") 675s > 675s > rowSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 675s + ## FIXME: sum() may overflow for integers, whereas 675s + ## base::rowSums() doesn't. What should rowSums2() do? 675s + ## apply(x, MARGIN = 1L, FUN = sum, na.rm = na.rm) 675s + res <- rowSums(x, na.rm = na.rm) 675s + if (is.na(useNames) || !useNames) names(res) <- NULL 675s + res 675s + } 675s > 675s > colSums2_R <- function(x, na.rm = FALSE, ..., useNames = NA) { 675s + ## FIXME: sum() may overflow for integers, whereas 675s + ## base::colSums() doesn't. What should colSums2() do? 675s + ## apply(x, MARGIN = 2L, FUN = sum, na.rm = na.rm) 675s + res <- colSums(x, na.rm = na.rm) 675s + if (is.na(useNames) || !useNames) names(res) <- NULL 675s + res 675s + } 675s > 675s > 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > # Subsetted tests 675s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 675s > source("utils/validateIndicesFramework.R") 675s > x <- matrix(runif(6 * 6, min = -3, max = 3), nrow = 6, ncol = 6) 675s > storage.mode(x) <- "integer" 675s > 675s > # To check names attribute 675s > dimnames <- list(letters[1:6], LETTERS[1:6]) 675s > 675s > # Test with and without dimnames on x 675s > for (setDimnames in c(TRUE, FALSE)) { 675s + if (setDimnames) dimnames(x) <- dimnames 675s + else dimnames(x) <- NULL 675s + for (rows in index_cases) { 675s + for (cols in index_cases) { 675s + for (na.rm in c(TRUE, FALSE)) { 675s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 675s + validateIndicesTestMatrix(x, rows, cols, 675s + ftest = rowSums2, fsure = rowSums2_R, 675s + na.rm = na.rm, useNames = useNames) 675s + validateIndicesTestMatrix(x, rows, cols, 675s + fcoltest = colSums2, fsure = rowSums2_R, 675s + na.rm = na.rm, useNames = useNames) 675s + } 675s + } 675s + } 675s + } 675s + } 676s > 676s 676s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 676s Copyright (C) 2024 The R Foundation for Statistical Computing 676s Platform: aarch64-unknown-linux-gnu 676s 676s R is free software and comes with ABSOLUTELY NO WARRANTY. 676s You are welcome to redistribute it under certain conditions. 676s Type 'license()' or 'licence()' for distribution details. 676s 676s R is a collaborative project with many contributors. 676s Type 'contributors()' for more information and 676s 'citation()' on how to cite R or R packages in publications. 676s 676s Type 'demo()' for some demos, 'help()' for on-line help, or 676s 'help.start()' for an HTML browser interface to help. 676s Type 'q()' to quit R. 676s 676s > library("matrixStats") 676s > 676s > nrow <- 6L 676s > ncol <- 5L 676s > data <- matrix(0:4, nrow = nrow, ncol = ncol) 676s > 676s > # To check names attribute 676s > dimnames <- list(letters[1:6], LETTERS[1:5]) 676s > 676s > modes <- c("integer", "logical", "raw") 676s > for (mode in modes) { 676s + cat(sprintf("Mode: %s...\n", mode)) 676s + 676s + x <- data 676s + if (mode == "logical") x <- x - 2L 676s + if (mode != "raw") x[c(2,5,7)] <- NA_integer_ 676s + storage.mode(x) <- mode 676s + print(x) 676s + 676s + unique_values <- unique(as.vector(x)) 676s + nbr_of_unique_values <- length(unique_values) 676s + 676s + y <- rowTabulates(x) 676s + print(y) 676s + stopifnot( 676s + identical(dim(y), c(nrow, nbr_of_unique_values)), 676s + all(y >= 0) 676s + ) 676s + if (mode != "raw") { 676s + y0 <- t(table(x, row(x), useNA = "always")[, seq_len(nrow(x))]) 676s + stopifnot(all(y == y0)) 676s + } 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- rowTabulates(x, useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- rowTabulates(x, useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y <- rowTabulates(x, useNames = TRUE) 676s + stopifnot(identical(rownames(y), rownames(x))) 676s + dimnames(x) <- NULL 676s + 676s + y <- colTabulates(x) 676s + print(y) 676s + stopifnot( 676s + identical(dim(y), c(ncol, nbr_of_unique_values)), 676s + all(y >= 0) 676s + ) 676s + if (mode != "raw") { 676s + y0 <- t(table(x, col(x), useNA = "always")[, seq_len(ncol(x))]) 676s + stopifnot(all(y == y0)) 676s + } 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- colTabulates(x, useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- colTabulates(x, useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y <- colTabulates(x, useNames = TRUE) 676s + stopifnot(identical(rownames(y), colnames(x))) 676s + dimnames(x) <- NULL 676s + 676s + # Count only certain values 676s + if (mode == "integer") { 676s + subset <- c(0:2, NA_integer_) 676s + } else if (mode == "logical") { 676s + subset <- c(TRUE, FALSE, NA) 676s + } else { 676s + subset <- c(0:2) 676s + } 676s + y <- rowTabulates(x, values = subset) 676s + print(y) 676s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- rowTabulates(x, values = subset, useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- rowTabulates(x, values = subset, useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y <- rowTabulates(x, values = subset, useNames = TRUE) 676s + stopifnot(identical(rownames(y), rownames(x))) 676s + dimnames(x) <- NULL 676s + 676s + y <- colTabulates(x, values = subset) 676s + print(y) 676s + stopifnot(identical(dim(y), c(ncol, length(subset)))) 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- colTabulates(x, values = subset, useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- colTabulates(x, values = subset, useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y <- colTabulates(x, values = subset, useNames = TRUE) 676s + stopifnot(identical(rownames(y), colnames(x))) 676s + dimnames(x) <- NULL 676s + 676s + # Raw 676s + if (mode %in% c("integer", "raw")) { 676s + subset <- c(0:2) 676s + 676s + y <- rowTabulates(x, values = as.raw(subset)) 676s + print(y) 676s + stopifnot(identical(dim(y), c(nrow, length(subset)))) 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- rowTabulates(x, values = as.raw(subset), useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- rowTabulates(x, values = as.raw(subset), useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y3 <- rowTabulates(x, values = as.raw(subset), useNames = TRUE) 676s + stopifnot(identical(rownames(y3), rownames(x))) 676s + dimnames(x) <- NULL 676s + 676s + y2 <- colTabulates(t(x), values = as.raw(subset)) 676s + print(y2) 676s + stopifnot( 676s + identical(dim(y2), c(nrow, length(subset))), 676s + identical(y2, y) 676s + ) 676s + # Check names attribute 676s + dimnames(x) <- dimnames 676s + y1 <- colTabulates(t(x), values = as.raw(subset), useNames = FALSE) 676s + stopifnot(all.equal(y1, y)) 676s + if (!matrixStats:::isUseNamesNADefunct()) { 676s + y2 <- colTabulates(t(x), values = as.raw(subset), useNames = NA) 676s + stopifnot(all.equal(y2, y)) 676s + } 676s + y <- colTabulates(t(x), values = as.raw(subset), useNames = TRUE) 676s + stopifnot(identical(rownames(y), colnames(t(x)))) 676s + dimnames(x) <- NULL 676s + } 676s + 676s + cat(sprintf("Mode: %s...done\n", mode)) 676s + } # for (mode ...) 676s Mode: integer... 676s [,1] [,2] [,3] [,4] [,5] 676s [1,] 0 NA 2 3 4 676s [2,] NA 2 3 4 0 676s [3,] 2 3 4 0 1 676s [4,] 3 4 0 1 2 676s [5,] NA 0 1 2 3 676s [6,] 0 1 2 3 4 676s 0 1 2 3 4 676s [1,] 1 0 1 1 1 1 676s [2,] 1 0 1 1 1 1 676s [3,] 1 1 1 1 1 0 676s [4,] 1 1 1 1 1 0 676s [5,] 1 1 1 1 0 1 676s [6,] 1 1 1 1 1 0 676s 0 1 2 3 4 676s [1,] 2 0 1 1 0 2 676s [2,] 1 1 1 1 1 1 676s [3,] 1 1 2 1 1 0 676s [4,] 1 1 1 2 1 0 676s [5,] 1 1 1 1 2 0 676s 0 1 2 676s [1,] 1 0 1 1 676s [2,] 1 0 1 1 676s [3,] 1 1 1 0 676s [4,] 1 1 1 0 676s [5,] 1 1 1 1 676s [6,] 1 1 1 0 676s 0 1 2 676s [1,] 2 0 1 2 676s [2,] 1 1 1 1 676s [3,] 1 1 2 0 676s [4,] 1 1 1 0 676s [5,] 1 1 1 0 676s 0x0 0x1 0x2 676s [1,] 1 0 1 676s [2,] 1 0 1 676s [3,] 1 1 1 676s [4,] 1 1 1 676s [5,] 1 1 1 676s [6,] 1 1 1 676s 0x0 0x1 0x2 676s [1,] 1 0 1 676s [2,] 1 0 1 676s [3,] 1 1 1 676s [4,] 1 1 1 676s [5,] 1 1 1 676s [6,] 1 1 1 676s Mode: integer...done 676s Mode: logical... 676s [,1] [,2] [,3] [,4] [,5] 676s [1,] TRUE NA FALSE TRUE TRUE 676s [2,] NA FALSE TRUE TRUE TRUE 676s [3,] FALSE TRUE TRUE TRUE TRUE 676s [4,] TRUE TRUE TRUE TRUE FALSE 676s [5,] NA TRUE TRUE FALSE TRUE 676s [6,] TRUE TRUE FALSE TRUE TRUE 676s FALSE TRUE 676s [1,] 1 3 1 676s [2,] 1 3 1 676s [3,] 1 4 0 676s [4,] 1 4 0 676s [5,] 1 3 1 676s [6,] 1 4 0 676s FALSE TRUE 676s [1,] 1 3 2 676s [2,] 1 4 1 676s [3,] 2 4 0 676s [4,] 1 5 0 676s [5,] 1 5 0 676s TRUE FALSE 676s [1,] 3 1 1 676s [2,] 3 1 1 676s [3,] 4 1 0 676s [4,] 4 1 0 676s [5,] 3 1 1 676s [6,] 4 1 0 676s TRUE FALSE 676s [1,] 3 1 2 676s [2,] 4 1 1 676s [3,] 4 2 0 676s [4,] 5 1 0 676s [5,] 5 1 0 676s Mode: logical...done 676s Mode: raw... 676s [,1] [,2] [,3] [,4] [,5] 676s [1,] 00 01 02 03 04 676s [2,] 01 02 03 04 00 676s [3,] 02 03 04 00 01 676s [4,] 03 04 00 01 02 676s [5,] 04 00 01 02 03 676s [6,] 00 01 02 03 04 676s 0x0 0x1 0x2 0x3 0x4 676s [1,] 1 1 1 1 1 676s [2,] 1 1 1 1 1 676s [3,] 1 1 1 1 1 676s [4,] 1 1 1 1 1 676s [5,] 1 1 1 1 1 676s [6,] 1 1 1 1 1 676s 0x0 0x1 0x2 0x3 0x4 676s [1,] 2 1 1 1 1 676s [2,] 1 2 1 1 1 676s [3,] 1 1 2 1 1 676s [4,] 1 1 1 2 1 676s [5,] 1 1 1 1 2 676s 0 1 2 676s [1,] 1 1 1 676s [2,] 1 1 1 676s [3,] 1 1 1 676s [4,] 1 1 1 676s [5,] 1 1 1 676s [6,] 1 1 1 676s 0 1 2 676s [1,] 2 1 1 676s [2,] 1 2 1 676s [3,] 1 1 2 676s [4,] 1 1 1 676s [5,] 1 1 1 676s 0x0 0x1 0x2 676s [1,] 1 1 1 676s [2,] 1 1 1 676s [3,] 1 1 1 676s [4,] 1 1 1 676s [5,] 1 1 1 676s [6,] 1 1 1 676s 0x0 0x1 0x2 676s [1,] 1 1 1 676s [2,] 1 1 1 676s [3,] 1 1 1 676s [4,] 1 1 1 676s [5,] 1 1 1 676s [6,] 1 1 1 676s Mode: raw...done 676s > 676s 676s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 676s Copyright (C) 2024 The R Foundation for Statistical Computing 676s Platform: aarch64-unknown-linux-gnu 676s 676s R is free software and comes with ABSOLUTELY NO WARRANTY. 676s You are welcome to redistribute it under certain conditions. 676s Type 'license()' or 'licence()' for distribution details. 676s 676s R is a collaborative project with many contributors. 676s Type 'contributors()' for more information and 676s 'citation()' on how to cite R or R packages in publications. 676s 676s Type 'demo()' for some demos, 'help()' for on-line help, or 676s 'help.start()' for an HTML browser interface to help. 676s Type 'q()' to quit R. 676s 676s > library("matrixStats") 676s > 676s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 676s > # Subsetted tests 676s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 676s > source("utils/validateIndicesFramework.R") 676s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 676s > storage.mode(x) <- "integer" 676s > 676s > # To check names attribute 676s > dimnames <- list(letters[1:6], LETTERS[1:6]) 676s > 676s > # Test with and without dimnames on x 676s > for (setDimnames in c(TRUE, FALSE)) { 676s + if (setDimnames) dimnames(x) <- dimnames 676s + else dimnames(x) <- NULL 676s + 676s + count <- 0L 676s + for (rows in index_cases) { 676s + for (cols in index_cases) { 676s + count <- count + 1L 676s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 676s + useNames <- useNames[count %% length(useNames) + 1] 676s + 676s + validateIndicesTestMatrix(x, rows, cols, 676s + ftest = rowTabulates, fsure = rowTabulates, useNames = useNames) 676s + validateIndicesTestMatrix(x, rows, cols, 676s + ftest = rowTabulates, fsure = rowTabulates, 676s + values = 1:3, useNames = useNames) 676s + 676s + validateIndicesTestMatrix(x, rows, cols, 676s + ftest = colTabulates, fsure = colTabulates, useNames = useNames) 676s + validateIndicesTestMatrix(x, rows, cols, 676s + ftest = colTabulates, fsure = colTabulates, 676s + values = 1:3, useNames = useNames) 676s + } 676s + } 676s + } 677s > 678s 678s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 678s Copyright (C) 2024 The R Foundation for Statistical Computing 678s Platform: aarch64-unknown-linux-gnu 678s 678s R is free software and comes with ABSOLUTELY NO WARRANTY. 678s You are welcome to redistribute it under certain conditions. 678s Type 'license()' or 'licence()' for distribution details. 678s 678s R is a collaborative project with many contributors. 678s Type 'contributors()' for more information and 678s 'citation()' on how to cite R or R packages in publications. 678s 678s Type 'demo()' for some demos, 'help()' for on-line help, or 678s 'help.start()' for an HTML browser interface to help. 678s Type 'q()' to quit R. 678s 678s > library("matrixStats") 678s > 678s > fcns <- list( 678s + rowVarDiffs = list(rowVarDiffs, colVarDiffs), 678s + rowSdDiffs = list(rowSdDiffs, colSdDiffs), 678s + rowMadDiffs = list(rowMadDiffs, colMadDiffs), 678s + rowIQRDiffs = list(rowIQRDiffs, colIQRDiffs) 678s + ) 678s > 678s > for (fcn in names(fcns)) { 678s + cat(sprintf("%s()...\n", fcn)) 678s + row_fcn <- fcns[[fcn]][[1L]] 678s + col_fcn <- fcns[[fcn]][[2L]] 678s + 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + # With and without some NAs 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + for (mode in c("integer", "double")) { 678s + for (add_na in c(FALSE, TRUE)) { 678s + cat("add_na = ", add_na, "\n", sep = "") 678s + 678s + x <- matrix(1:50 + 0.1, nrow = 10L, ncol = 5L) 678s + if (add_na) { 678s + x[3:7, c(2, 4)] <- NA_real_ 678s + } 678s + cat("mode: ", mode, "\n", sep = "") 678s + storage.mode(x) <- mode 678s + str(x) 678s + 678s + # To check names attribute 678s + dimnames <- list(letters[1:10], LETTERS[1:5]) 678s + 678s + # Test with and without dimnames on x 678s + for (setDimnames in c(TRUE, FALSE)) { 678s + if (setDimnames) dimnames(x) <- dimnames 678s + else dimnames(x) <- NULL 678s + # Row/column ranges 678s + for (na.rm in c(FALSE, TRUE)) { 678s + # Check names attribute 678s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 678s + cat("na.rm = ", na.rm, "\n", sep = "") 678s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 678s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 678s + stopifnot(all.equal(r1, r2)) 678s + } 678s + } 678s + } 678s + } # for (add_na ...) 678s + } 678s + 678s + 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + # All NAs 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + for (mode in c("integer", "double")) { 678s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 678s + cat("mode: ", mode, "\n", sep = "") 678s + storage.mode(x) <- mode 678s + str(x) 678s + 678s + # Test with and without dimnames on x 678s + for (setDimnames in c(TRUE, FALSE)) { 678s + if (setDimnames) dimnames(x) <- dimnames 678s + else dimnames(x) <- NULL 678s + # Row/column ranges 678s + for (na.rm in c(FALSE, TRUE)) { 678s + # Check names attribute 678s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 678s + cat("na.rm = ", na.rm, "\n", sep = "") 678s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 678s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 678s + stopifnot(all.equal(r1, r2)) 678s + } 678s + } 678s + } 678s + } 678s + 678s + 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + # A 1x1 matrix 678s + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 678s + x <- matrix(0, nrow = 1L, ncol = 1L) 678s + dimnames <- list("a", "A") 678s + # Test with and without dimnames on x 678s + for (setDimnames in c(TRUE, FALSE)) { 678s + if (setDimnames) dimnames(x) <- dimnames 678s + else dimnames(x) <- NULL 678s + # Row/column ranges 678s + for (na.rm in c(FALSE, TRUE)) { 678s + # Check names attribute 678s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 678s + cat("na.rm = ", na.rm, "\n", sep = "") 678s + r1 <- row_fcn(x, na.rm = na.rm, useNames = useNames) 678s + r2 <- col_fcn(t(x), na.rm = na.rm, useNames = useNames) 678s + stopifnot(all.equal(r1, r2)) 678s + } 678s + } 678s + } 678s + 678s + cat(sprintf("%s()...DONE\n", fcn)) 678s + } # for (fcn ...) 678s rowVarDiffs()... 678s add_na = FALSE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = FALSE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s mode: integer 678s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s mode: double 678s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s rowVarDiffs()...DONE 678s rowSdDiffs()... 678s add_na = FALSE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = FALSE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s mode: integer 678s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s mode: double 678s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s rowSdDiffs()...DONE 678s rowMadDiffs()... 678s add_na = FALSE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: integer 678s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = FALSE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s add_na = TRUE 678s mode: double 678s 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 ... 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s na.rm = FALSE 678s na.rm = FALSE 678s na.rm = TRUE 678s na.rm = TRUE 678s mode: integer 678s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 678s na.rm = FALSE 678s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s mode: double 679s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s rowMadDiffs()...DONE 679s rowIQRDiffs()... 679s add_na = FALSE 679s mode: integer 679s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s add_na = TRUE 679s mode: integer 679s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s add_na = FALSE 679s mode: double 679s 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 ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s add_na = TRUE 679s mode: double 679s 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 ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s mode: integer 679s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s mode: double 679s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s na.rm = FALSE 679s na.rm = FALSE 679s na.rm = TRUE 679s na.rm = TRUE 679s rowIQRDiffs()...DONE 679s > 679s 679s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 679s Copyright (C) 2024 The R Foundation for Statistical Computing 679s Platform: aarch64-unknown-linux-gnu 679s 679s R is free software and comes with ABSOLUTELY NO WARRANTY. 679s You are welcome to redistribute it under certain conditions. 679s Type 'license()' or 'licence()' for distribution details. 679s 679s R is a collaborative project with many contributors. 679s Type 'contributors()' for more information and 679s 'citation()' on how to cite R or R packages in publications. 679s 679s Type 'demo()' for some demos, 'help()' for on-line help, or 679s 'help.start()' for an HTML browser interface to help. 679s Type 'q()' to quit R. 679s 679s > library("matrixStats") 679s > 679s > fcns <- list( 679s + madDiff = c(rowMadDiffs, colMadDiffs), 679s + iqrDiff = c(rowIQRDiffs, colIQRDiffs) 679s + ) 679s > 679s > 679s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 679s > # Subsetted tests 679s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 679s > source("utils/validateIndicesFramework.R") 679s > # To check names attribute 679s > dimnames <- list(letters[1:6], LETTERS[1:6]) 679s > trim <- runif(1, min = 0, max = 0.5) 679s > for (fcn in names(fcns)) { 679s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 679s + row_fcn <- fcns[[fcn]][[1L]] 679s + col_fcn <- fcns[[fcn]][[2L]] 679s + 679s + for (mode in c("numeric", "integer")) { 679s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 679s + storage.mode(x) <- mode 679s + if (mode == "numeric") x[1:2, 3:4] <- Inf 679s + 679s + # Test with and without dimnames on x 679s + for (setDimnames in c(TRUE, FALSE)) { 679s + if (setDimnames) dimnames(x) <- dimnames 679s + else dimnames(x) <- NULL 679s + 679s + count <- 0L 679s + for (diff in 1:2) { 679s + for (rows in index_cases) { 679s + for (cols in index_cases) { 679s + count <- count + 1L 679s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 679s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 679s + useNames <- useNames[count %% length(useNames) + 1] 679s + validateIndicesTestMatrix(x, rows, cols, 679s + ftest = row_fcn, fsure = row_fcn, 679s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 679s + validateIndicesTestMatrix(x, rows, cols, 679s + fcoltest = col_fcn, fsure = row_fcn, 679s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 679s + } 679s + } 679s + } 679s + } 679s + } 679s + cat(sprintf("%s()...DONE\n", fcn)) 679s + } 679s subsetted tests on madDiff()... 681s madDiff()...DONE 681s subsetted tests on iqrDiff()... 683s iqrDiff()...DONE 683s > 683s 683s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 683s Copyright (C) 2024 The R Foundation for Statistical Computing 683s Platform: aarch64-unknown-linux-gnu 683s 683s R is free software and comes with ABSOLUTELY NO WARRANTY. 683s You are welcome to redistribute it under certain conditions. 683s Type 'license()' or 'licence()' for distribution details. 683s 683s R is a collaborative project with many contributors. 683s Type 'contributors()' for more information and 683s 'citation()' on how to cite R or R packages in publications. 683s 683s Type 'demo()' for some demos, 'help()' for on-line help, or 683s 'help.start()' for an HTML browser interface to help. 683s Type 'q()' to quit R. 683s 683s > library("matrixStats") 683s > 683s > fcns <- list( 683s + varDiff = c(rowVarDiffs, colVarDiffs), 683s + sdDiff = c(rowSdDiffs, colSdDiffs) 683s + ) 683s > 683s > 683s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 683s > # Subsetted tests 683s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 683s > source("utils/validateIndicesFramework.R") 683s > # To check names attribute 683s > dimnames <- list(letters[1:6], LETTERS[1:6]) 683s > trim <- runif(1, min = 0, max = 0.5) 683s > for (fcn in names(fcns)) { 683s + cat(sprintf("subsetted tests on %s()...\n", fcn)) 683s + row_fcn <- fcns[[fcn]][[1L]] 683s + col_fcn <- fcns[[fcn]][[2L]] 683s + 683s + for (mode in c("numeric", "integer")) { 683s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 683s + storage.mode(x) <- mode 683s + if (mode == "numeric") x[1:2, 3:4] <- Inf 683s + 683s + # Test with and without dimnames on x 683s + for (setDimnames in c(TRUE, FALSE)) { 683s + if (setDimnames) dimnames(x) <- dimnames 683s + else dimnames(x) <- NULL 683s + 683s + count <- 0L 683s + for (diff in 1:2) { 683s + for (rows in index_cases) { 683s + for (cols in index_cases) { 683s + count <- count + 1L 683s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 683s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 683s + useNames <- useNames[count %% length(useNames) + 1] 683s + 683s + validateIndicesTestMatrix(x, rows, cols, 683s + ftest = row_fcn, fsure = row_fcn, 683s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 683s + validateIndicesTestMatrix(x, rows, cols, 683s + fcoltest = col_fcn, fsure = row_fcn, 683s + na.rm = na.rm, diff = diff, trim = trim, useNames = useNames) 683s + } 683s + } 683s + } 683s + } 683s + } 683s + cat(sprintf("%s()...DONE\n", fcn)) 683s + } 683s subsetted tests on varDiff()... 685s varDiff()...DONE 685s subsetted tests on sdDiff()... 687s sdDiff()...DONE 687s > 687s 687s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 687s Copyright (C) 2024 The R Foundation for Statistical Computing 687s Platform: aarch64-unknown-linux-gnu 687s 687s R is free software and comes with ABSOLUTELY NO WARRANTY. 687s You are welcome to redistribute it under certain conditions. 687s Type 'license()' or 'licence()' for distribution details. 687s 687s R is a collaborative project with many contributors. 687s Type 'contributors()' for more information and 687s 'citation()' on how to cite R or R packages in publications. 687s 687s Type 'demo()' for some demos, 'help()' for on-line help, or 687s 'help.start()' for an HTML browser interface to help. 687s Type 'q()' to quit R. 687s 687s > library("matrixStats") 687s > 687s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 687s > options(matrixStats.center.onUse = "ignore") 687s > options(matrixStats.vars.formula.freq = Inf) 687s > 687s > ## Create isFALSE() if running on an old version of R 687s > if (!exists("isFALSE", mode="function")) { 687s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 687s + } 687s > 687s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 687s + suppressWarnings({ 687s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 687s + }) 687s + stopifnot(!any(is.infinite(res))) 687s + 687s + # Keep naming support consistency same as rowVars() 687s + if (is.null(center) || ncol(x) <= 1L) { 687s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 687s + } 687s + else if (isFALSE(useNames)) names(res) <- NULL 687s + res 687s + } 687s > 687s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 687s + suppressWarnings({ 687s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 687s + }) 687s + stopifnot(!any(is.infinite(res))) 687s + 687s + # Keep naming support consistency same as colVars() 687s + if (is.null(center) || ncol(x) <= 1L) { 687s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 687s + } 687s + else if (isFALSE(useNames)) names(res) <- NULL 687s + res 687s + } 687s > 687s > 687s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 687s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 687s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 687s + stopifnot(!any(is.infinite(res))) 687s + res 687s + } 687s > 687s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 687s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 687s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 687s + stopifnot(!any(is.infinite(res))) 687s + res 687s + } 687s > 687s > rowVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 687s + x <- sweep(x, MARGIN = 1, STATS = as.array(center), FUN = "-") 687s + x[is.infinite(center), ] <- NaN 687s + res <- rowVars(x, rows = rows, cols = cols, center = rep(0, times = nrow(x)), na.rm = na.rm, useNames = useNames) 687s + stopifnot(!any(is.infinite(res))) 687s + res 687s + } 687s > 687s > colVars_center_naive <- function(x, rows = NULL, cols = NULL, center = NULL, na.rm = FALSE, ..., useNames = NA) { 687s + x <- sweep(x, MARGIN = 2, STATS = as.array(center), FUN = "-") 687s + x[, is.infinite(center)] <- NaN 687s + res <- colVars(x, rows = rows, cols = cols, center = rep(0, times = ncol(x)), na.rm = na.rm, useNames = useNames) 687s + stopifnot(!any(is.infinite(res))) 687s + res 687s + } 687s > 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > # With and without some NAs or Infs 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > for (mode in c("integer", "double")) { 687s + if (mode == "integer") { 687s + specials <- c(0L, NA_integer_) 687s + delta <- 0L 687s + } else { 687s + specials <- c(0, NA_real_, Inf) 687s + delta <- 0.1 687s + } 687s + 687s + for (special in specials) { 687s + cat("special = ", special, "\n", sep = "") 687s + x <- matrix(1:50 + delta, nrow = 10L, ncol = 5L) 687s + x[3:7, c(2, 4)] <- special 687s + cat("mode: ", mode, "\n", sep = "") 687s + str(x) 687s + stopifnot(storage.mode(x) == mode) 687s + 687s + # To check names attribute 687s + dimnames <- list(letters[1:10], LETTERS[1:5]) 687s + 687s + # Test with and without dimnames on x 687s + for (setDimnames in c(TRUE, FALSE)) { 687s + if (setDimnames) dimnames(x) <- dimnames 687s + else dimnames(x) <- NULL 687s + # Row/column variance 687s + for (na.rm in c(FALSE, TRUE)) { 687s + # Check names attribute 687s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 687s + cat("na.rm = ", na.rm, "\n", sep = "") 687s + center <- rowMeans(x, na.rm = na.rm) 687s + 687s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 687s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 687s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 687s + r1c <- rowVars(x, center = center, na.rm = na.rm, useNames = useNames) 687s + 687s + tx <- t(x) 687s + r2 <- colVars(tx, na.rm = na.rm, useNames = useNames) 687s + r2b <- colVars_center(tx, na.rm = na.rm, useNames = useNames) 687s + r2c <- colVars(tx, center = center, na.rm = na.rm, useNames = useNames) 687s + tx <- NULL 687s + 687s + stopifnot(all.equal(r1, r2)) 687s + stopifnot(all.equal(r1, r0)) 687s + stopifnot(all.equal(r1b, r1c)) 687s + stopifnot(all.equal(r2, r0)) 687s + stopifnot(all.equal(r2b, r2c)) 687s + 687s + center <- colMeans(x, na.rm = na.rm) 687s + 687s + r3 <- colVars(x, center = center, na.rm = na.rm, useNames = useNames) 687s + r3b <- colVars_center_naive(x, center = center, na.rm = na.rm, useNames = useNames) 687s + r3c <- rowVars(t(x), center = center, na.rm = na.rm, useNames = useNames) 687s + r3d <- rowVars_center_naive(t(x), center = center, na.rm = na.rm, useNames = useNames) 687s + stopifnot(all.equal(r3b, r3)) 687s + stopifnot(all.equal(r3c, r3)) 687s + stopifnot(all.equal(r3d, r3)) 687s + 687s + stopifnot( 687s + !any(is.infinite(r0)), 687s + !any(is.infinite(r1)), 687s + !any(is.infinite(r2)), 687s + !any(is.infinite(r3)), 687s + !any(is.infinite(r1b)), 687s + !any(is.infinite(r1c)), 687s + !any(is.infinite(r2b)), 687s + !any(is.infinite(r2c)), 687s + !any(is.infinite(r3b)), 687s + !any(is.infinite(r3c)), 687s + !any(is.infinite(r3d)) 687s + ) 687s + } 687s + } 687s + } 687s + } # for (special ...) 687s + } 687s special = 0 687s mode: integer 687s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s special = NA 687s mode: integer 687s int [1:10, 1:5] 1 2 3 4 5 6 7 8 9 10 ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s special = 0 687s mode: double 687s 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 ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s special = NA 687s mode: double 687s 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 ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s special = Inf 687s mode: double 687s 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 ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s > 687s > 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > # All NAs 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > for (mode in c("integer", "double")) { 687s + x <- matrix(NA_real_, nrow = 10L, ncol = 5L) 687s + cat("mode: ", mode, "\n", sep = "") 687s + storage.mode(x) <- mode 687s + str(x) 687s + 687s + # Test with and without dimnames on x 687s + for (setDimnames in c(TRUE, FALSE)) { 687s + if (setDimnames) dimnames(x) <- dimnames 687s + else dimnames(x) <- NULL 687s + # Row/column variance 687s + for (na.rm in c(FALSE, TRUE)) { 687s + # Check names attribute 687s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 687s + cat("na.rm = ", na.rm, "\n", sep = "") 687s + 687s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 687s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 687s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 687s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 687s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 687s + stopifnot(all.equal(r1, r2)) 687s + stopifnot(all.equal(r1, r0)) 687s + stopifnot(all.equal(r2, r0)) 687s + stopifnot(all.equal(r1b, r2b)) 687s + stopifnot( 687s + !any(is.infinite(r0)), 687s + !any(is.infinite(r1)), 687s + !any(is.infinite(r2)), 687s + !any(is.infinite(r1b)), 687s + !any(is.infinite(r2b)) 687s + ) 687s + } 687s + } 687s + } 687s + } 687s mode: integer 687s int [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s mode: double 687s num [1:10, 1:5] NA NA NA NA NA NA NA NA NA NA ... 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s > 687s > 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > # A 1x1 matrix 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > x <- matrix(0, nrow = 1L, ncol = 1L) 687s > dimnames <- list("a", "A") 687s > # Test with and without dimnames on x 687s > for (setDimnames in c(TRUE, FALSE)) { 687s + if (setDimnames) dimnames(x) <- dimnames 687s + else dimnames(x) <- NULL 687s + # Row/column variance 687s + for (na.rm in c(FALSE, TRUE)) { 687s + # Check names attribute 687s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 687s + cat("na.rm = ", na.rm, "\n", sep = "") 687s + 687s + r0 <- rowVars_R(x, na.rm = na.rm, useNames = useNames) 687s + r1 <- rowVars(x, na.rm = na.rm, useNames = useNames) 687s + r1b <- rowVars_center(x, na.rm = na.rm, useNames = useNames) 687s + r2 <- colVars(t(x), na.rm = na.rm, useNames = useNames) 687s + r2b <- colVars_center(t(x), na.rm = na.rm, useNames = useNames) 687s + stopifnot(all.equal(r1, r2)) 687s + stopifnot(all.equal(r1, r0)) 687s + stopifnot(all.equal(r2, r0)) 687s + stopifnot(all.equal(r1b, r2b)) 687s + stopifnot( 687s + !any(is.infinite(r0)), 687s + !any(is.infinite(r1)), 687s + !any(is.infinite(r2)), 687s + !any(is.infinite(r1b)), 687s + !any(is.infinite(r2b)) 687s + ) 687s + } 687s + } 687s + } 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s na.rm = FALSE 687s na.rm = FALSE 687s na.rm = TRUE 687s na.rm = TRUE 687s > 687s > 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > # center and .dim 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > m <- matrix(1:12, nrow = 3L, ncol = 4L) 687s > a <- array(m, dim = c(3, 2, 2)) 687s > stopifnot(prod(dim(a)) == prod(dim(m))) 687s > 687s > y0 <- rowVars(m, dim. = dim(m)) 687s > print(y0) 687s [1] 15 15 15 687s > y1 <- rowVars(a, dim. = dim(m)) 687s > print(y1) 687s [1] 15 15 15 687s > stopifnot(identical(y1, y0)) 687s > stopifnot( 687s + !any(is.infinite(y0)), 687s + !any(is.infinite(y1)) 687s + ) 687s > 687s > mu <- rowMeans(m) 687s > y0 <- rowVars(m, center = mu, dim. = dim(m)) 687s > print(y0) 687s [1] 15 15 15 687s > y1 <- rowVars(a, center = mu, dim. = dim(m)) 687s > print(y1) 687s [1] 15 15 15 687s > stopifnot(identical(y1, y0)) 687s > stopifnot( 687s + !any(is.infinite(y0)), 687s + !any(is.infinite(y1)) 687s + ) 687s > 687s > 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > # Corner cases 687s > # https://github.com/HenrikBengtsson/matrixStats/issues/195 687s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 687s > x <- matrix(c(1,2,3,4), nrow = 2L, ncol = 2L) 687s > x[1,1] <- NA_real_ 687s > x[1,2] <- Inf 687s > 687s > center <- colMeans2(x, na.rm = TRUE) 687s > y <- colVars(x, center = center, na.rm = TRUE) 687s > stopifnot(!any(is.infinite(y))) 687s > 687s > x <- t(x) 687s > center <- rowMeans2(x, na.rm = TRUE) 687s > y <- rowVars(x, center = center, na.rm = TRUE) 687s > stopifnot(!any(is.infinite(y))) 687s > 688s 688s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 688s Copyright (C) 2024 The R Foundation for Statistical Computing 688s Platform: aarch64-unknown-linux-gnu 688s 688s R is free software and comes with ABSOLUTELY NO WARRANTY. 688s You are welcome to redistribute it under certain conditions. 688s Type 'license()' or 'licence()' for distribution details. 688s 688s R is a collaborative project with many contributors. 688s Type 'contributors()' for more information and 688s 'citation()' on how to cite R or R packages in publications. 688s 688s Type 'demo()' for some demos, 'help()' for on-line help, or 688s 'help.start()' for an HTML browser interface to help. 688s Type 'q()' to quit R. 688s 688s > library("matrixStats") 688s > 688s > ## Always allow testing of the 'center' argument (as long as it's not defunct) 688s > options(matrixStats.center.onUse = "ignore") 688s > 688s > ## Create isFALSE() if running on an old version of R 688s > if (!exists("isFALSE", mode="function")) { 688s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 688s + } 688s > 688s > rowVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 688s + suppressWarnings({ 688s + res <- apply(x, MARGIN = 1L, FUN = var, na.rm = na.rm) 688s + }) 688s + stopifnot(!any(is.infinite(res))) 688s + 688s + # Keep naming support consistency same as rowVars() 688s + if (is.null(center) || ncol(x) <= 1L) { 688s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 688s + } 688s + else if (isFALSE(useNames)) names(res) <- NULL 688s + res 688s + } 688s > 688s > colVars_R <- function(x, na.rm = FALSE, center = NULL, ..., useNames = NA) { 688s + suppressWarnings({ 688s + res <- apply(x, MARGIN = 2L, FUN = var, na.rm = na.rm) 688s + }) 688s + stopifnot(!any(is.infinite(res))) 688s + 688s + # Keep naming support consistency same as colVars() 688s + if (is.null(center) || nrow(x) <= 1L) { 688s + if (is.na(useNames) || isFALSE(useNames)) names(res) <- NULL 688s + } 688s + else if (isFALSE(useNames)) names(res) <- NULL 688s + res 688s + } 688s > 688s > 688s > rowVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 688s + center <- rowWeightedMeans(x, cols = cols, na.rm = na.rm, useNames = FALSE) 688s + res <- rowVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 688s + stopifnot(!any(is.infinite(res))) 688s + res 688s + } 688s > 688s > colVars_center <- function(x, rows = NULL, cols = NULL, na.rm = FALSE, ..., useNames = NA) { 688s + center <- colWeightedMeans(x, rows = rows, na.rm = na.rm, useNames = FALSE) 688s + res <- colVars(x, rows = rows, cols = cols, center = center, na.rm = na.rm, useNames = useNames) 688s + stopifnot(!any(is.infinite(res))) 688s + res 688s + } 688s > 688s > 688s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 688s > # Subsetted tests 688s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 688s > source("utils/validateIndicesFramework.R") 688s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 688s > storage.mode(x) <- "integer" 688s > 688s > # To check names attribute 688s > dimnames <- list(letters[1:6], LETTERS[1:6]) 688s > 688s > # Test with and without dimnames on x 688s > for (setDimnames in c(TRUE, FALSE)) { 688s + if (setDimnames) dimnames(x) <- dimnames 688s + else dimnames(x) <- NULL 688s + 688s + count <- 0L 688s + for (rows in index_cases) { 688s + for (cols in index_cases) { 688s + count <- count + 1L 688s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 688s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 688s + useNames <- useNames[count %% length(useNames) + 1] 688s + 688s + validateIndicesTestMatrix(x, rows, cols, 688s + ftest = rowVars, fsure = rowVars_R, 688s + na.rm = na.rm, useNames = useNames) 688s + validateIndicesTestMatrix(x, rows, cols, 688s + ftest = rowVars_center, fsure = rowVars_R, 688s + na.rm = na.rm, center = TRUE, useNames = useNames) 688s + 688s + validateIndicesTestMatrix(x, rows, cols, 688s + fcoltest = colVars, fsure = rowVars_R, 688s + na.rm = na.rm, useNames = useNames) 688s + validateIndicesTestMatrix(x, rows, cols, 688s + fcoltest = colVars_center, fsure = rowVars_R, 688s + na.rm = na.rm, center = TRUE, useNames = useNames) 688s + } 688s + } 688s + } 688s > 688s 688s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 688s Copyright (C) 2024 The R Foundation for Statistical Computing 688s Platform: aarch64-unknown-linux-gnu 688s 688s R is free software and comes with ABSOLUTELY NO WARRANTY. 688s You are welcome to redistribute it under certain conditions. 688s Type 'license()' or 'licence()' for distribution details. 688s 688s R is a collaborative project with many contributors. 688s Type 'contributors()' for more information and 688s 'citation()' on how to cite R or R packages in publications. 688s 688s Type 'demo()' for some demos, 'help()' for on-line help, or 688s 'help.start()' for an HTML browser interface to help. 688s Type 'q()' to quit R. 688s 689s > library("matrixStats") 689s > 689s > ## Create isFALSE() if running on an old version of R 689s > if (!exists("isFALSE", mode="function")) { 689s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 689s + } 689s > 689s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 689s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 689s + 689s + # Keep naming support consistency same as rowWeightedMeans() 689s + idxs <- which(is.na(w) | w != 0) 689s + nw <- length(idxs) 689s + if (na.rm) na.rm <- anyMissing(x) 689s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 689s + if (is.na(useNames) || !useNames) names(res) <- NULL 689s + } 689s + else if (isFALSE(useNames)) names(res) <- NULL 689s + 689s + res 689s + } 689s > 689s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 689s + res <- apply(x, MARGIN = 2L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 689s + 689s + # Keep naming support consistency same as colWeightedMeans() 689s + idxs <- which(is.na(w) | w != 0) 689s + nw <- length(idxs) 689s + if (!is.null(w) && nw == 0L) { 689s + if (is.na(useNames) || !useNames) names(res) <- NULL 689s + } 689s + else if (isFALSE(useNames)) names(res) <- NULL 689s + 689s + res 689s + } 689s > 689s > set.seed(1) 689s > 689s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 689s > print(x) 689s [,1] [,2] [,3] [,4] 689s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 689s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 689s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 689s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 689s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 689s > 689s > # To check names attribute 689s > dimnames <- list(letters[1:5], LETTERS[1:4]) 689s > 689s > # Non-weighted row averages 689s > x_est0 <- rowMeans(x) 689s > x_est1 <- rowWeightedMeans(x) 689s > print(x_est1) 689s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x)) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Check names attribute 689s > dimnames(x) <- dimnames 689s > x_est1 <- rowWeightedMeans(x, useNames = FALSE) 689s > x_est2 <- colWeightedMeans(t(x), useNames = FALSE) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > x_est0 <- rowMeans(x) 689s > x_est1 <- rowWeightedMeans(x, useNames = TRUE) 689s > x_est2 <- colWeightedMeans(t(x), useNames = TRUE) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > dimnames(x) <- NULL 689s > 689s > 689s > # Weighted row averages (uniform weights) 689s > w <- rep(2.5, times = ncol(x)) 689s > x_est0 <- rowMeans(x) 689s > x_est1 <- rowWeightedMeans(x, w = w) 689s > print(x_est1) 689s [1] 0.004981341 0.261181337 0.056322931 0.194395865 0.435737906 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), w = w) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # Weighted row averages (excluding some columns) 689s > w <- c(1, 1, 0, 1) 689s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 689s > x_est1 <- rowWeightedMeans(x, w = w) 689s > print(x_est1) 689s [1] -0.4972853 0.2182940 0.2821774 0.9974278 0.2060069 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), w = w) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # Weighted row averages (excluding some columns) 689s > w <- c(0, 1, 0, 0) 689s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 689s > x_est1 <- rowWeightedMeans(x, w = w) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), w = w) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # Weighted row averages (all zero weights) 689s > w <- c(0, 0, 0, 0) 689s > x_est0 <- rowMeans(x[, (w == 1), drop = FALSE]) 689s > x_est1 <- rowWeightedMeans(x, w = w) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), w = w) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # Weighted averages by rows and columns 689s > w <- 1:4 689s > x_est1 <- rowWeightedMeans(x, w = w) 689s > print(x_est1) 689s [1] 0.20882185 0.22632701 0.25526439 -0.06123714 0.54691290 689s > x_est2 <- colWeightedMeans(t(x), w = w) 689s > stopifnot(all.equal(x_est2, x_est1)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > x[sample(length(x), size = 0.3 * length(x))] <- NA 689s > print(x) 689s [,1] [,2] [,3] [,4] 689s [1,] -0.6264538 NA 1.5117812 -0.04493361 689s [2,] 0.1836433 NA NA -0.01619026 689s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 689s [4,] 1.5952808 NA -2.2146999 0.82122120 689s [5,] 0.3295078 NA NA 0.59390132 689s > 689s > # Non-weighted row averages with missing values 689s > x_est0 <- rowMeans(x, na.rm = TRUE) 689s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE) 689s > print(x_est1) 689s [1] 0.28013125 0.08372653 0.05632293 0.06726737 0.46170455 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Check names attribute 689s > dimnames(x) <- dimnames 689s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = FALSE) 689s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = FALSE) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > x_est0 <- rowMeans(x, na.rm = TRUE) 689s > x_est1 <- rowWeightedMeans(x, na.rm = TRUE, useNames = TRUE) 689s > x_est2 <- colWeightedMeans(t(x), na.rm = TRUE, useNames = TRUE) 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > dimnames(x) <- NULL 689s > 689s > 689s > # Weighted row averages with missing values 689s > x_est0 <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = TRUE) 689s > print(x_est0) 689s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 689s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 689s > print(x_est1) 689s [1] 0.46614441 0.02377645 0.25526439 -0.22049176 0.54102261 689s > stopifnot(all.equal(x_est1, x_est0)) 689s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 689s > stopifnot(all.equal(x_est2, x_est0)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # Weighted averages by rows and columns 689s > w <- 1:4 689s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 689s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 689s > stopifnot(all.equal(x_est2, x_est1)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > 689s > # w contains missing value 689s > w[1] <- NA_integer_ 689s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE) 689s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = TRUE) 689s > stopifnot(all.equal(x_est2, x_est1)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = TRUE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s > x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE) 689s > x_est2 <- colWeightedMeans(t(x), w = w, na.rm = FALSE) 689s > stopifnot(all.equal(x_est2, x_est1)) 689s > # Test with and without dimnames on x 689s > for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + # Check names attribute 689s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 689s + x_est0 <- rowWeightedMeans_R(x, w = w, na.rm = FALSE, useNames = useNames) 689s + x_est1 <- rowWeightedMeans(x, w = w, na.rm = FALSE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + x_est0 <- colWeightedMeans_R(t(x), w = w, na.rm = FALSE, useNames = useNames) 689s + x_est1 <- colWeightedMeans(t(x), w = w, na.rm = FALSE, useNames = useNames) 689s + stopifnot(all.equal(x_est1, x_est0)) 689s + } 689s + } 689s > 689s 689s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 689s Copyright (C) 2024 The R Foundation for Statistical Computing 689s Platform: aarch64-unknown-linux-gnu 689s 689s R is free software and comes with ABSOLUTELY NO WARRANTY. 689s You are welcome to redistribute it under certain conditions. 689s Type 'license()' or 'licence()' for distribution details. 689s 689s R is a collaborative project with many contributors. 689s Type 'contributors()' for more information and 689s 'citation()' on how to cite R or R packages in publications. 689s 689s Type 'demo()' for some demos, 'help()' for on-line help, or 689s 'help.start()' for an HTML browser interface to help. 689s Type 'q()' to quit R. 689s 689s > library("matrixStats") 689s > 689s > ## Create isFALSE() if running on an old version of R 689s > if (!exists("isFALSE", mode="function")) { 689s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 689s + } 689s > 689s > rowWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 689s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 689s + 689s + # Keep naming support consistency same as rowWeightedMeans() 689s + idxs <- which(is.na(w) | w != 0) 689s + nw <- length(idxs) 689s + if (na.rm) na.rm <- anyMissing(x) 689s + if ((!is.null(w) && nw == 0L) || isFALSE(na.rm)) { 689s + if (is.na(useNames) || !useNames) names(res) <- NULL 689s + } 689s + else if (isFALSE(useNames)) names(res) <- NULL 689s + 689s + res 689s + } 689s > 689s > colWeightedMeans_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 689s + res <- apply(x, MARGIN = 1L, FUN = weighted.mean, w = w, na.rm = na.rm, ...) 689s + 689s + # Keep naming support consistency same as colWeightedMeans() 689s + idxs <- which(is.na(w) | w != 0) 689s + nw <- length(idxs) 689s + if (!is.null(w) && nw == 0L) { 689s + if (is.na(useNames) || !useNames) names(res) <- NULL 689s + } 689s + else if (isFALSE(useNames)) names(res) <- NULL 689s + 689s + res 689s + } 689s > 689s > 689s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 689s > # Subsetted tests 689s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 689s > source("utils/validateIndicesFramework.R") 689s > # To check names attribute 689s > dimnames <- list(letters[1:6], LETTERS[1:6]) 689s > for (mode in c("numeric", "integer", "logical")) { 689s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 689s + w <- runif(6, min = 0, max = 6) 689s + storage.mode(x) <- mode 689s + storage.mode(w) <- if (mode == "logical") "integer" else mode 689s + if (mode == "numeric") w[1] <- Inf 689s + 689s + # Test with and without dimnames on x 689s + for (setDimnames in c(TRUE, FALSE)) { 689s + if (setDimnames) dimnames(x) <- dimnames 689s + else dimnames(x) <- NULL 689s + 689s + count <- 0L 689s + for (rows in index_cases) { 689s + for (cols in index_cases) { 689s + count <- count + 1L 689s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 689s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 689s + useNames <- useNames[count %% length(useNames) + 1] 689s + 689s + validateIndicesTestMatrix_w(x, w, rows, cols, 689s + ftest = rowWeightedMeans, fsure = rowWeightedMeans_R, 689s + na.rm = na.rm, useNames = useNames) 689s + validateIndicesTestMatrix_w(x, w, rows, cols, 689s + fcoltest = colWeightedMeans, fsure = colWeightedMeans_R, 689s + na.rm = na.rm, useNames = useNames) 689s + } 689s + } 689s + } 689s + } 690s > 690s 690s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 690s Copyright (C) 2024 The R Foundation for Statistical Computing 690s Platform: aarch64-unknown-linux-gnu 690s 690s R is free software and comes with ABSOLUTELY NO WARRANTY. 690s You are welcome to redistribute it under certain conditions. 690s Type 'license()' or 'licence()' for distribution details. 690s 690s R is a collaborative project with many contributors. 690s Type 'contributors()' for more information and 690s 'citation()' on how to cite R or R packages in publications. 690s 690s Type 'demo()' for some demos, 'help()' for on-line help, or 690s 'help.start()' for an HTML browser interface to help. 690s Type 'q()' to quit R. 690s 690s > library("matrixStats") 690s > 690s > ## Create isFALSE() if running on an old version of R 690s > if (!exists("isFALSE", mode="function")) { 690s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 690s + } 690s > 690s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 690s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 690s + 690s + # Keep naming support consistency same as rowWeightedMedians() 690s + if (!is.null(w)) { 690s + if (isFALSE(useNames)) names(res) <- NULL 690s + } 690s + else if (is.na(useNames) || !useNames) names(res) <- NULL 690s + 690s + res 690s + } 690s > 690s > colWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 690s + res <- apply(x, MARGIN = 2L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 690s + 690s + # Keep naming support consistency same as colWeightedMedians() 690s + if (!is.null(w)) { 690s + if (isFALSE(useNames)) names(res) <- NULL 690s + } 690s + else if (is.na(useNames) || !useNames) names(res) <- NULL 690s + 690s + res 690s + } 690s > 690s > set.seed(1) 690s > 690s > x <- matrix(rnorm(20), nrow = 5, ncol = 4) 690s > print(x) 690s [,1] [,2] [,3] [,4] 690s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 690s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 690s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 690s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 690s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 690s > 690s > # To check names attribute 690s > dimnames <- list(letters[1:5], LETTERS[1:4]) 690s > 690s > # Non-weighted row medians 690s > x_est0 <- rowMedians(x) 690s > x_est1 <- rowWeightedMedians(x) 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x)) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowMedians(x, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, useNames = useNames) 690s + x_est2 <- colWeightedMedians(t(x), useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + stopifnot(all.equal(x_est2, x_est0)) 690s + } 690s + } 690s > 690s > 690s > # Weighted row medians (uniform weights) 690s > w <- rep(2.5, times = ncol(x)) 690s > x_est0 <- rowMedians(x) 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > 690s > # Weighted row medians (excluding some columns) 690s > w <- c(1, 1, 0, 1) 690s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > # Weighted row medians (excluding some columns) 690s > w <- c(0, 1, 0, 0) 690s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > # Weighted row medians (all zero weights) 690s > w <- c(0, 0, 0, 0) 690s > x_est0 <- rowMedians(x[, (w == 1), drop = FALSE]) 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > # Weighted medians by rows and columns 690s > w <- 1:4 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est1)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > 690s > # Weighted row medians with missing values 690s > x_est0 <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = TRUE) 690s > print(x_est0) 690s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 690s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 690s > print(x_est1) 690s [1] -0.04493361 0.23519330 0.73832471 0.65759463 0.59390132 690s > stopifnot(all.equal(x_est1, x_est0)) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(all.equal(x_est2, x_est0)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > # Weighted medians by rows and columns 690s > w <- 1:4 690s > x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE) 690s > x_est2 <- colWeightedMedians(t(x), w = w, na.rm = TRUE) 690s > stopifnot(all.equal(x_est2, x_est1)) 690s > # Test with and without dimnames on x 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, na.rm = TRUE, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, na.rm = TRUE, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, na.rm = TRUE, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, na.rm = TRUE, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s > 690s > # Inf weight 690s > x <- matrix(1:2, nrow = 1, ncol = 2) 690s > w <- c(7, Inf) 690s > x_est1 <- rowWeightedMedians(x, w = w) 690s > x_est2 <- colWeightedMedians(t(x), w = w) 690s > stopifnot(identical(2, x_est1)) 690s > stopifnot(identical(2, x_est2)) 690s > # Test with and without dimnames on x 690s > dimnames <- list("a", LETTERS[1:2]) 690s > for (setDimnames in c(TRUE, FALSE)) { 690s + if (setDimnames) dimnames(x) <- dimnames 690s + else dimnames(x) <- NULL 690s + # Check names attribute 690s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 690s + x_est0 <- rowWeightedMedians_R(x, w = w, useNames = useNames) 690s + x_est1 <- rowWeightedMedians(x, w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + x_est0 <- colWeightedMedians_R(t(x), w = w, useNames = useNames) 690s + x_est1 <- colWeightedMedians(t(x), w = w, useNames = useNames) 690s + stopifnot(all.equal(x_est1, x_est0)) 690s + } 690s + } 690s > 690s 690s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 690s Copyright (C) 2024 The R Foundation for Statistical Computing 690s Platform: aarch64-unknown-linux-gnu 690s 690s R is free software and comes with ABSOLUTELY NO WARRANTY. 690s You are welcome to redistribute it under certain conditions. 690s Type 'license()' or 'licence()' for distribution details. 690s 690s R is a collaborative project with many contributors. 690s Type 'contributors()' for more information and 690s 'citation()' on how to cite R or R packages in publications. 690s 690s Type 'demo()' for some demos, 'help()' for on-line help, or 690s 'help.start()' for an HTML browser interface to help. 690s Type 'q()' to quit R. 690s 691s > library("matrixStats") 691s > 691s > ## Create isFALSE() if running on an old version of R 691s > if (!exists("isFALSE", mode="function")) { 691s + isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x 691s + } 691s > 691s > rowWeightedMedians_R <- function(x, w, na.rm = FALSE, ..., useNames = NA) { 691s + res <- apply(x, MARGIN = 1L, FUN = weightedMedian, w = w, na.rm = na.rm, ...) 691s + 691s + # Keep naming support consistency same as rowWeightedMedians() 691s + if (!is.null(w)) { 691s + if (isFALSE(useNames)) names(res) <- NULL 691s + } 691s + else if (is.na(useNames) || !useNames) names(res) <- NULL 691s + 691s + res 691s + } 691s > 691s > 691s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 691s > # Subsetted tests 691s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 691s > source("utils/validateIndicesFramework.R") 691s > # To check names attribute 691s > dimnames <- list(letters[1:6], LETTERS[1:6]) 691s > for (mode in c("numeric", "integer", "logical")) { 691s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 691s + w <- runif(6, min = 0, max = 6) 691s + storage.mode(x) <- mode 691s + storage.mode(w) <- if (mode == "logical") "integer" else mode 691s + if (mode == "numeric") w[1] <- Inf 691s + 691s + # Test with and without dimnames on x 691s + for (setDimnames in c(TRUE, FALSE)) { 691s + if (setDimnames) dimnames(x) <- dimnames 691s + else dimnames(x) <- NULL 691s + 691s + count <- 0L 691s + for (rows in index_cases) { 691s + for (cols in index_cases) { 691s + count <- count + 1L 691s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 691s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 691s + useNames <- useNames[count %% length(useNames) + 1] 691s + 691s + validateIndicesTestMatrix_w(x, w, rows, cols, 691s + ftest = rowWeightedMedians, 691s + fsure = rowWeightedMedians_R, 691s + na.rm = na.rm, useNames = useNames) 691s + validateIndicesTestMatrix_w(x, w, rows, cols, 691s + fcoltest = colWeightedMedians, 691s + fsure = rowWeightedMedians_R, 691s + na.rm = na.rm, useNames = useNames) 691s + } 691s + } 691s + } 691s + } 692s > 692s 692s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 692s Copyright (C) 2024 The R Foundation for Statistical Computing 692s Platform: aarch64-unknown-linux-gnu 692s 692s R is free software and comes with ABSOLUTELY NO WARRANTY. 692s You are welcome to redistribute it under certain conditions. 692s Type 'license()' or 'licence()' for distribution details. 692s 692s R is a collaborative project with many contributors. 692s Type 'contributors()' for more information and 692s 'citation()' on how to cite R or R packages in publications. 692s 692s Type 'demo()' for some demos, 'help()' for on-line help, or 692s 'help.start()' for an HTML browser interface to help. 692s Type 'q()' to quit R. 692s 692s > library("matrixStats") 692s > 692s > set.seed(1) 692s > 692s > x <- matrix(rnorm(20), nrow = 5L, ncol = 4L) 692s > print(x) 692s [,1] [,2] [,3] [,4] 692s [1,] -0.6264538 -0.8204684 1.5117812 -0.04493361 692s [2,] 0.1836433 0.4874291 0.3898432 -0.01619026 692s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 692s [4,] 1.5952808 0.5757814 -2.2146999 0.82122120 692s [5,] 0.3295078 -0.3053884 1.1249309 0.59390132 692s > 692s > # To check names attribute 692s > dimnames <- list(letters[1:5], LETTERS[1:4]) 692s > 692s > # Weighted row variances (uniform weights - all w = 1) 692s > # Non-weighted row variances 692s > x_est0 <- rowVars(x) 692s > w <- rep(1, times = ncol(x)) 692s > x_est1 <- rowWeightedVars(x, w = w) 692s > print(x_est1) 692s [1] 1.11767161 0.05022969 0.83582537 2.76819528 0.35351857 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowVars(x, useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row variances (uniform weights - all w = 3) 692s > x3 <- cbind(x, x, x) 692s > x_est0 <- rowVars(x3) 692s > w <- rep(3, times = ncol(x)) 692s > x_est1 <- rowWeightedVars(x, w = w) 692s > print(x_est1) 692s [1] 0.91445859 0.04109702 0.68385712 2.26488705 0.28924246 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x3 <- cbind(x, x, x) 692s > x_est0 <- rowVars(x3, useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row variances (excluding some columns) 692s > w <- c(1, 1, 0, 1) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 692s > x_est1 <- rowWeightedVars(x, w = w) 692s > print(x_est1) 692s [1] 0.16287693 0.06430861 0.94767651 0.28313135 0.21361984 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row variances (excluding some columns) 692s > w <- c(0, 1, 0, 0) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 692s > x_est1 <- rowWeightedVars(x, w = w) 692s > #stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est1)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row variances (all zero weights) 692s > w <- c(0, 0, 0, 0) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE]) 692s > x_est1 <- rowWeightedVars(x, w = w) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowVars(x[, (w == 1), drop = FALSE], useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedVars(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > # Weighted variances by rows and columns 692s > w <- 1:4 692s > # Test with and without dimnames on x 692s > for (setDimnames in c(TRUE, FALSE)) { 692s + if (setDimnames) dimnames(x) <- dimnames 692s + else dimnames(x) <- NULL 692s + # Check names attribute 692s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 692s + x_est1 <- rowWeightedVars(x, w = w, useNames = useNames) 692s + print(x_est1) 692s + x_est2 <- colWeightedVars(t(x), w = w, useNames = useNames) 692s + stopifnot(all.equal(x_est2, x_est1)) 692s + } 692s + } 692s a b c d e 692s 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 692s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 692s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 692s [1] 0.90747094 0.05040463 0.65089440 2.28697479 0.27902734 692s > 692s > 692s > x[sample(length(x), size = 0.3 * length(x))] <- NA 692s > print(x) 692s [,1] [,2] [,3] [,4] 692s [1,] -0.6264538 NA 1.5117812 -0.04493361 692s [2,] 0.1836433 NA NA -0.01619026 692s [3,] -0.8356286 0.7383247 -0.6212406 0.94383621 692s [4,] 1.5952808 NA -2.2146999 0.82122120 692s [5,] 0.3295078 NA NA 0.59390132 692s > 692s > # Non-weighted row variances with missing values 692s > x_est0 <- rowVars(x, na.rm = TRUE) 692s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE) 692s > print(x_est1) 692s [1] 1.22226258 0.01996673 0.83582537 4.05532299 0.03495197 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 692s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowVars(x, na.rm = TRUE, useNames = TRUE) 692s > x_est1 <- rowWeightedVars(x, w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 692s > x_est2 <- colWeightedVars(t(x), w = rep(1, times = ncol(x)), na.rm = TRUE, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row variances with missing values 692s > # Test with and without dimnames on x 692s > for (setDimnames in c(TRUE, FALSE)) { 692s + if (setDimnames) dimnames(x) <- dimnames 692s + else dimnames(x) <- NULL 692s + # Check names attribute 692s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 692s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 692s + print(x_est1) 692s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 692s + stopifnot(all.equal(x_est2, x_est1)) 692s + } 692s + } 692s a b c d e 692s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s > 692s > 692s > # Weighted variances by rows and columns 692s > w <- 1:4 692s > # Test with and without dimnames on x 692s > for (setDimnames in c(TRUE, FALSE)) { 692s + if (setDimnames) dimnames(x) <- dimnames 692s + else dimnames(x) <- NULL 692s + # Check names attribute 692s + for (useNames in c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE)) { 692s + x_est1 <- rowWeightedVars(x, w = w, na.rm = TRUE, useNames = useNames) 692s + print(x_est1) 692s + x_est2 <- colWeightedVars(t(x), w = w, na.rm = TRUE, useNames = useNames) 692s + stopifnot(all.equal(x_est2, x_est1)) 692s + } 692s + } 692s a b c d e 692s 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s [1] 0.788377504 0.007986693 0.650894398 2.795470241 0.013980790 692s > 692s > 692s > # Weighted row standard deviation (excluding some columns) 692s > w <- c(1, 1, 0, 1) 692s > ## FIXME: rowVars()/rowSds() needs na.rm = FALSE (wrong default) 692s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE) 692s > x_est1 <- rowWeightedSds(x, w = w) 692s > print(x_est1) 692s [1] NA NA 0.9734868 NA NA 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = FALSE) 692s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowSds(x[, (w == 1), drop = FALSE], na.rm = FALSE, useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = NA) 692s + x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedSds(x, w = w, na.rm = FALSE, useNames = TRUE) 692s > x_est2 <- colWeightedSds(t(x), w = w, na.rm = FALSE, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s > 692s > # Weighted row MADs (excluding some columns) 692s > w <- c(1, 1, 0, 1) 692s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE]) 692s > x_est1 <- rowWeightedMads(x, w = w) 692s > print(x_est1) 692s [1] NA NA 0.3046914 NA NA 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > x_est2 <- colWeightedMads(t(x), w = w) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > # Check names attribute 692s > dimnames(x) <- dimnames 692s > x_est1 <- rowWeightedMads(x, w = w, useNames = FALSE) 692s > x_est2 <- colWeightedMads(t(x), w = w, useNames = FALSE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > x_est0 <- rowMads(x[, (w == 1), drop = FALSE], useNames = TRUE) 692s > if (!matrixStats:::isUseNamesNADefunct()) { 692s + x_est1 <- rowWeightedMads(x, w = w, useNames = NA) 692s + x_est2 <- colWeightedMads(t(x), w = w, useNames = NA) 692s + stopifnot(all.equal(x_est1, x_est0)) 692s + stopifnot(all.equal(x_est2, x_est0)) 692s + } 692s > x_est1 <- rowWeightedMads(x, w = w, useNames = TRUE) 692s > x_est2 <- colWeightedMads(t(x), w = w, useNames = TRUE) 692s > stopifnot(all.equal(x_est1, x_est0)) 692s > stopifnot(all.equal(x_est2, x_est0)) 692s > dimnames(x) <- NULL 692s > 692s 692s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 692s Copyright (C) 2024 The R Foundation for Statistical Computing 692s Platform: aarch64-unknown-linux-gnu 692s 692s R is free software and comes with ABSOLUTELY NO WARRANTY. 692s You are welcome to redistribute it under certain conditions. 692s Type 'license()' or 'licence()' for distribution details. 692s 692s R is a collaborative project with many contributors. 692s Type 'contributors()' for more information and 692s 'citation()' on how to cite R or R packages in publications. 692s 692s Type 'demo()' for some demos, 'help()' for on-line help, or 692s 'help.start()' for an HTML browser interface to help. 692s Type 'q()' to quit R. 692s 692s > library("matrixStats") 692s > 692s > fcns <- list( 692s + weightedVar = c(rowWeightedVars, colWeightedVars), 692s + weightedSd = c(rowWeightedSds, colWeightedSds), 692s + weightedMad = c(rowWeightedMads, colWeightedMads) 692s + ) 692s > 692s > 692s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 692s > # Subsetted tests 692s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 692s > source("utils/validateIndicesFramework.R") 692s > # To check names attribute 692s > dimnames <- list(letters[1:6], LETTERS[1:6]) 692s > for (fcn in names(fcns)) { 692s + cat(sprintf("subsetted tests on matrix %s()...\n", fcn)) 692s + row_fcn <- fcns[[fcn]][[1]] 692s + col_fcn <- fcns[[fcn]][[2]] 692s + 692s + for (mode in c("numeric", "integer")) { 692s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 692s + w <- runif(6, min = 0, max = 6) 692s + storage.mode(x) <- mode 692s + storage.mode(w) <- mode 692s + if (mode == "numeric") w[1] <- Inf 692s + 692s + # Test with and without dimnames on x 692s + for (setDimnames in c(TRUE, FALSE)) { 692s + if (setDimnames) dimnames(x) <- dimnames 692s + else dimnames(x) <- NULL 692s + 692s + count <- 0L 692s + for (rows in index_cases) { 692s + for (cols in index_cases) { 692s + count <- count + 1L 692s + na.rm <- c(TRUE, FALSE)[count %% 2 + 1] 692s + useNames <- c(if (!matrixStats:::isUseNamesNADefunct()) NA, TRUE, FALSE) 692s + useNames <- useNames[count %% length(useNames) + 1] 692s + 692s + validateIndicesTestMatrix_w(x, w, rows, cols, 692s + ftest = row_fcn, fsure = row_fcn, 692s + na.rm = na.rm, useNames = useNames) 692s + validateIndicesTestMatrix_w(x, w, rows, cols, 692s + fcoltest = col_fcn, fsure = row_fcn, 692s + na.rm = na.rm, useNames = useNames) 692s + } 692s + } 692s + } 692s + } 692s + cat(sprintf("%s()...DONE\n", fcn)) 692s + } 692s subsetted tests on matrix weightedVar()... 693s weightedVar()...DONE 693s subsetted tests on matrix weightedSd()... 694s weightedSd()...DONE 694s subsetted tests on matrix weightedMad()... 694s weightedMad()...DONE 694s > 694s 694s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 694s Copyright (C) 2024 The R Foundation for Statistical Computing 694s Platform: aarch64-unknown-linux-gnu 694s 694s R is free software and comes with ABSOLUTELY NO WARRANTY. 694s You are welcome to redistribute it under certain conditions. 694s Type 'license()' or 'licence()' for distribution details. 694s 694s R is a collaborative project with many contributors. 694s Type 'contributors()' for more information and 694s 'citation()' on how to cite R or R packages in publications. 694s 694s Type 'demo()' for some demos, 'help()' for on-line help, or 694s 'help.start()' for an HTML browser interface to help. 694s Type 'q()' to quit R. 694s 694s > library("matrixStats") 694s > 694s > signTabulate0 <- function(x, ...) { 694s + nneg <- sum(x < 0, na.rm = TRUE) 694s + nzero <- sum(x == 0, na.rm = TRUE) 694s + npos <- sum(x > 0, na.rm = TRUE) 694s + nna <- sum(is.na(x)) 694s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 694s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 694s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 694s + res <- as.double(res) 694s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 694s + if (is.integer(x)) res <- res[1:4] 694s + res 694s + } # signTabulate0() 694s > 694s > 694s > # Simulate data 694s > set.seed(0xBEEF) 694s > n <- 100L 694s > x <- runif(n) 694s > x[sample(n, size = 0.1 * n)] <- 0 694s > x[sample(n, size = 0.1 * n)] <- NA_real_ 694s Doubles: 694s Integers: 694s > x[sample(n, size = 0.1 * n)] <- -Inf 694s > x[sample(n, size = 0.1 * n)] <- +Inf 694s > 694s > # Doubles 694s > message("Doubles:") 694s > counts0 <- signTabulate0(x) 694s > print(counts0) 694s -1 0 +1 NA -Inf +Inf 694s 9 7 77 7 9 10 694s > counts1 <- signTabulate(x) 694s > print(counts1) 694s -1 0 +1 NA -Inf +Inf 694s 9 7 77 7 9 10 694s > stopifnot(identical(counts1, counts0)) 694s > 694s > # Integers 694s > message("Integers:") 694s > x <- suppressWarnings(as.integer(x)) 694s > counts0 <- signTabulate0(x) 694s > print(counts0) 694s -1 0 +1 NA 694s 0 74 0 26 694s > counts1 <- signTabulate(x) 694s > print(counts1) 694s -1 0 +1 NA 694s 0 74 0 26 694s > stopifnot(identical(counts1, counts0)) 694s > 694s 694s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 694s Copyright (C) 2024 The R Foundation for Statistical Computing 694s Platform: aarch64-unknown-linux-gnu 694s 694s R is free software and comes with ABSOLUTELY NO WARRANTY. 694s You are welcome to redistribute it under certain conditions. 694s Type 'license()' or 'licence()' for distribution details. 694s 694s R is a collaborative project with many contributors. 694s Type 'contributors()' for more information and 694s 'citation()' on how to cite R or R packages in publications. 694s 694s Type 'demo()' for some demos, 'help()' for on-line help, or 694s 'help.start()' for an HTML browser interface to help. 694s Type 'q()' to quit R. 694s 695s > library("matrixStats") 695s > 695s > signTabulate0 <- function(x, ...) { 695s + nneg <- sum(x < 0, na.rm = TRUE) 695s + nzero <- sum(x == 0, na.rm = TRUE) 695s + npos <- sum(x > 0, na.rm = TRUE) 695s + nna <- sum(is.na(x)) 695s + nneginf <- sum(is.infinite(x) & x < 0, na.rm = TRUE) 695s + nposinf <- sum(is.infinite(x) & x > 0, na.rm = TRUE) 695s + res <- c(nneg, nzero, npos, nna, nneginf, nposinf) 695s + res <- as.double(res) 695s + names(res) <- c("-1", "0", "+1", "NA", "-Inf", "+Inf") 695s + if (is.integer(x)) res <- res[1:4] 695s + res 695s + } # signTabulate0() 695s > 695s > 695s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 695s > # Subsetted tests 695s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 695s > source("utils/validateIndicesFramework.R") 695s > x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6, ncol = 6) 695s > x[2:3, 4:5] <- +Inf 695s > x[4:5, 1:2] <- -Inf 695s > for (idxs in index_cases) { 695s + validateIndicesTestVector(x, idxs, 695s + ftest = signTabulate, fsure = signTabulate0) 695s + } 695s > 695s 695s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 695s Copyright (C) 2024 The R Foundation for Statistical Computing 695s Platform: aarch64-unknown-linux-gnu 695s 695s R is free software and comes with ABSOLUTELY NO WARRANTY. 695s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > options(warn = 1) 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Consistency checks 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > set.seed(1) 704s > 704s > sum2_R <- function(x, na.rm = FALSE, idxs = NULL) { 704s + if (is.null(idxs)) { 704s + sum(x, na.rm = na.rm) 704s + } else { 704s + sum(x[idxs], na.rm = na.rm) 704s + } 704s + } # sum2_R() 704s > 704s > 704s > cat("Consistency checks:\n") 704s Consistency checks: 704s > for (kk in 1:20) { 704s + cat("Random test #", kk, "\n", sep = "") 704s + 704s + # Simulate data in a matrix of any shape 704s + n <- sample(1e3, size = 1L) 704s + x <- rnorm(n, sd = 100) 704s + 704s + # Add NAs? 704s + if ((kk %% 4) %in% c(3, 0)) { 704s + cat("Adding NAs\n") 704s + nna <- sample(n, size = 1L) 704s + na_values <- c(NA_real_, NaN) 704s + t <- sample(na_values, size = nna, replace = TRUE) 704s + x[sample(length(x), size = nna)] <- t 704s + } 704s + 704s + # Integer or double? 704s + if ((kk %% 4) %in% c(2, 0)) { 704s + cat("Coercing to integers\n") 704s + storage.mode(x) <- "integer" 704s + } 704s + 704s + na.rm <- sample(c(TRUE, FALSE), size = 1L) 704s + 704s + # Sum over all 704s + y0 <- sum2_R(x, na.rm = na.rm) 704s + y1 <- sum2(x, na.rm = na.rm) 704s + stopifnot(all.equal(y1, y0)) 704s + 704s + # Sum over subset 704s + nidxs <- sample(n, size = 1L) 704s + idxs <- sample(n, size = nidxs) 704s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 704s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 704s + stopifnot(all.equal(y1, y0)) 704s + 704s + if (storage.mode(x) == "integer") { 704s + storage.mode(x) <- "logical" 704s + 704s + y0 <- sum2_R(x, na.rm = na.rm) 704s + y1 <- sum2(x, na.rm = na.rm) 704s + stopifnot(all.equal(y1, y0)) 704s + 704s + y0 <- sum2_R(x, na.rm = na.rm, idxs = idxs) 704s + y1 <- sum2(x, na.rm = na.rm, idxs = idxs) 704s + stopifnot(all.equal(y1, y0)) 704s + } 704s + } # for (kk ...) 704s Random test #1 704s Random test #2 704s Coercing to integers 704s Random test #3 704s Adding NAs 704s Random test #4 704s Adding NAs 704s Coercing to integers 704s Random test #5 704s Random test #6 704s Coercing to integers 704s Random test #7 704s Adding NAs 704s Random test #8 704s Adding NAs 704s Coercing to integers 704s Random test #9 704s Random test #10 704s Coercing to integers 704s Random test #11 704s Adding NAs 704s Random test #12 704s Adding NAs 704s Coercing to integers 704s Random test #13 704s Random test #14 704s Coercing to integers 704s Random test #15 704s Adding NAs 704s Random test #16 704s Adding NAs 704s Coercing to integers 704s Random test #17 704s Random test #18 704s Coercing to integers 704s Random test #19 704s Adding NAs 704s Random test #20 704s Adding NAs 704s Coercing to integers 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # All missing values 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > for (n in 0:2) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + x <- rep(NA_real_, times = n) 704s + y0 <- sum(x, na.rm = na.rm) 704s + y <- sum2(x, na.rm = na.rm) 704s + stopifnot(all.equal(y, y0)) 704s + 704s + x <- rep(NA_integer_, times = n) 704s + y0 <- sum(x, na.rm = na.rm) 704s + y <- sum2(x, na.rm = na.rm) 704s + stopifnot(all.equal(y, y0)) 704s + 704s + x <- rep(NA, times = n) 704s + y0 <- sum(x, na.rm = na.rm) 704s + y <- sum2(x, na.rm = na.rm) 704s + stopifnot(all.equal(y, y0)) 704s + } 704s + } 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Special cases 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > for (na.rm in c(FALSE, TRUE)) { 704s + # Summing over zero elements (integers) 704s + x <- integer(0) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot(identical(s1, s2)) 704s + 704s + x <- 1:10 704s + idxs <- integer(0) 704s + s1 <- sum(x[idxs], na.rm = na.rm) 704s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 704s + stopifnot(identical(s1, s2)) 704s + 704s + # Summing over NA_integer_:s 704s + x <- rep(NA_integer_, times = 10L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot(identical(s1, s2)) 704s + 704s + x <- rep(NA_integer_, times = 10L) 704s + idxs <- 1:5 704s + s1 <- sum(x[idxs], na.rm = na.rm) 704s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 704s + stopifnot(identical(s1, s2)) 704s + 704s + 704s + # Summing over zero elements (doubles) 704s + x <- double(0) 704s + s1 <- sum(x) 704s + s2 <- sum2(x) 704s + stopifnot( 704s + identical(s1, 0), 704s + identical(s1, s2) 704s + ) 704s + 704s + x <- as.double(1:10) 704s + idxs <- integer(0) 704s + s1 <- sum(x[idxs]) 704s + s2 <- sum2(x, idxs = idxs) 704s + stopifnot( 704s + identical(s1, 0), 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over NA_real_:s 704s + x <- rep(NA_real_, times = 10L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot( 704s + !na.rm || s1 == 0, 704s + identical(s1, s2) 704s + ) 704s + 704s + x <- rep(NA_real_, times = 10L) 704s + idxs <- 1:5 704s + s1 <- sum(x[idxs], na.rm = na.rm) 704s + s2 <- sum2(x, idxs = idxs, na.rm = na.rm) 704s + stopifnot( 704s + !na.rm || s1 == 0, 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over -Inf:s 704s + x <- rep(-Inf, times = 3L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot( 704s + is.infinite(s1) && s1 < 0, 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over +Inf:s 704s + x <- rep(+Inf, times = 3L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot(identical(s1, s2)) 704s + stopifnot( 704s + is.infinite(s1) && s1 > 0, 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over mix of -Inf:s and +Inf:s 704s + x <- rep(c(-Inf, +Inf), times = 3L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot( 704s + is.nan(s1), 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over mix of -Inf:s and +Inf:s and numerics 704s + x <- rep(c(-Inf, +Inf, 3.14), times = 2L) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + stopifnot( 704s + is.nan(s1), 704s + identical(s1, s2) 704s + ) 704s + 704s + # Summing over mix of NaN, NA, +Inf, and numerics 704s + x <- c(NaN, NA, +Inf, 3.14) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + if (na.rm) { 704s + stopifnot( 704s + is.infinite(s1) && s1 > 0, 704s + identical(s2, s1) 704s + ) 704s + } else { 704s + stopifnot(is.na(s1), is.na(s2)) 704s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 704s + ## returned here (as one would expect). NaN might very well be returned, 704s + ## when both NA and NaN are involved. This is an accepted feature in R, 704s + ## which is documented in help("is.nan"). See also 704s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 704s + ## Thus, we cannot guarantee that s1 is identical to s0. 704s + } 704s + 704s + # Summing over mix of NaN, NA, +Inf, and numerics 704s + x <- c(NA, NaN, +Inf, 3.14) 704s + s1 <- sum(x, na.rm = na.rm) 704s + s2 <- sum2(x, na.rm = na.rm) 704s + if (na.rm) { 704s + stopifnot( 704s + is.infinite(s1) && s1 > 0, 704s + identical(s2, s1) 704s + ) 704s + } else { 704s + stopifnot(is.na(s1), is.na(s2)) 704s + ## NOTE, due to compiler optimization, it is not guaranteed that NA is 704s + ## returned here (as one would expect). NaN might very well be returned, 704s + ## when both NA and NaN are involved. This is an accepted feature in R, 704s + ## which is documented in help("is.nan"). See also 704s + ## https://stat.ethz.ch/pipermail/r-devel/2017-April/074009.html. 704s + ## Thus, we cannot guarantee that s1 is identical to s0. 704s + } 704s + } 704s Warning in sum2(x[1:2]) : 704s Integer overflow. Use sum2(..., mode = "double") to avoid this. 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Summing of large integers 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > x <- c(.Machine$integer.max, 1L, -.Machine$integer.max) 704s > 704s > # Total gives integer overflow 704s > s1 <- sum(x[1:2]) # NA_integer_ w/ warning 704s > s2 <- sum2(x[1:2]) # NA_integer_ w/ warning 704s > stopifnot( 704s + getRversion() >= "3.5.0" || identical(s1, NA_integer_), 704s + identical(s2, NA_integer_) 704s + ) 704s > 704s > ## Assert above warning 704s > res <- tryCatch({ 704s + s2 <- sum2(x[1:2]) 704s + }, warning = identity) 704s > stopifnot(inherits(res, "warning")) 704s > 704s > 704s > # Total gives integer overflow (coerce to numeric) 704s > s1 <- sum(as.numeric(x[1:2])) # 2147483648 704s > s2 <- sum2(as.numeric(x[1:2])) # 2147483648 704s > s3 <- sum2(x[1:2], mode = "double") # 2147483648 704s > stopifnot( 704s + identical(s1, 2147483648), 704s + identical(s1, s2), 704s + identical(s1, s3) 704s + ) 704s > 704s > # Cumulative sum would give integer overflow but not the total 704s > s1 <- sum(x) # 1L 704s > s2 <- sum2(x) # 1L 704s > stopifnot( 704s + identical(s1, 1L), 704s + identical(s1, s2) 704s + ) 704s > 704s > # Input is double but coersing result to integer 704s > x <- c(1, 2, 3.1) 704s > s1 <- sum2(x) 704s > s2 <- sum2(x, mode = "integer") 704s > stopifnot( 704s + identical(as.integer(s1), s2) 704s + ) 704s > 704s > ## Assert above warning 704s > res <- tryCatch({ 704s + s2 <- sum2(x, mode = "integer") 704s + }, warning = identity) 704s > stopifnot(inherits(res, "warning")) 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Summing of large doubles 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > ## Double overflow 704s > x <- rep(.Machine$double.xmax, times = 2L) 704s > y0 <- sum(x) 704s > print(y0) 704s [1] Inf 704s > y <- sum2(x) 704s > print(y) 704s [1] Inf 704s > stopifnot( 704s + is.infinite(y) && y > 0, 704s + identical(y, y0) 704s + ) 704s > 704s > x <- rep(-.Machine$double.xmax, times = 2L) 704s > y0 <- sum(x) 704s > print(y0) 704s [1] -Inf 704s > y <- sum2(x) 704s > print(y) 704s [1] -Inf 704s > stopifnot( 704s + is.infinite(y) && y < 0, 704s + identical(y, y0) 704s + ) 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Argument 'idxs' 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > x <- 1:10 704s > idxs_list <- list( 704s + integer = 1:5, 704s + double = as.double(1:5), 704s + logical = (x <= 5) 704s + ) 704s > 704s > for (idxs in idxs_list) { 704s + cat("idxs:\n") 704s + str(idxs) 704s + s1 <- sum(x[idxs], na.rm = TRUE) 704s + s2 <- sum2(x, idxs = idxs, na.rm = TRUE) 704s + stopifnot(identical(s1, s2)) 704s + } 704s idxs: 704s int [1:5] 1 2 3 4 5 704s idxs: 704s num [1:5] 1 2 3 4 5 704s idxs: 704s logi [1:10] TRUE TRUE TRUE TRUE TRUE FALSE ... 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > x <- runif(6, min = -6, max = 6) 704s > storage.mode(x) <- "integer" 704s > for (idxs in index_cases) { 704s + validateIndicesTestVector(x, idxs, 704s + ftest = sum2, fsure = sum, 704s + na.rm = FALSE) 704s + validateIndicesTestVector(x, idxs, 704s + ftest = sum2, fsure = sum, 704s + na.rm = TRUE) 704s + } 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library(matrixStats) 704s > source("utils/validateIndicesFramework.R") 704s > 704s > oopts <- options(matrixStats.validateIndices = "ignore") 704s > 704s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 704s > 704s > x <- 1:6 704s > for (idxs in index_cases) { 704s + for (mode in c("integer", "numeric", "logical")) { 704s + if (!is.null(idxs)) { 704s + suppressWarnings({storage.mode(idxs) <- mode}) 704s + } 704s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 704s + } 704s + } 704s > 704s > ftest <- function(x, idxs) validateIndices(idxs, length(x)) 704s > 704s > for (idxs in index_error_cases) { 704s + validateIndicesTestVector(x, idxs, ftest = ftest, fsure = identity) 704s + } 704s > 704s > 704s > ftest <- function(x, rows, cols) { 704s + vr <- validateIndices(rows, dim(x)[1], FALSE) 704s + vc <- validateIndices(cols, dim(x)[2], FALSE) 704s + 704s + stopifnot(all((vr > 0 & vr <= dim(x)[1]) | is.na(vr))) 704s + stopifnot(all((vc > 0 & vc <= dim(x)[2]) | is.na(vc))) 704s + suppressWarnings(x <- x[vr, vc, drop = FALSE]) 704s + x 704s + } 704s > 704s > x <- matrix(1:36, nrow = 6, ncol = 6) 704s > for (rows in index_cases) { 704s + for (cols in index_cases) { 704s + validateIndicesTestMatrix(x, rows, cols, ftest = ftest, fsure = identity) 704s + } 704s + } 704s > 704s > # Testing for 64-bit builds (64 bits = 8 bytes) 704s > if (.Machine$sizeof.pointer == 8L) { 704s + validateIndices(c(1.25*2^40, 3, 1*2^38, 1, 1.4*2^39), maxIdx = 1*2^41) 704s + } 704s [1] 1.374390e+12 3.000000e+00 2.748779e+11 1.000000e+00 7.696581e+11 704s > 704s > options(oopts) 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > set.seed(1) 704s > x <- rnorm(1e4) 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Variance estimators 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > sigma2_a <- var(x) 704s > cat(sprintf("var(x) = %g\n", sigma2_a)) 704s var(x) = 1.02487 704s > 704s > sigma2_b <- varDiff(x) 704s > cat(sprintf("varDiff(x) = %g\n", sigma2_b)) 704s varDiff(x) = 1.01224 704s > 704s > d <- abs(sigma2_b - sigma2_a) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 0.0126268 704s > stopifnot(d < 0.02) 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Standard deviation estimators 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > sigma_a <- sd(x) 704s > cat(sprintf("sd(x) = %g\n", sigma_a)) 704s sd(x) = 1.01236 704s > 704s > sigma_b <- sdDiff(x) 704s > cat(sprintf("sdDiff(x) = %g\n", sigma_b)) 704s sdDiff(x) = 1.0061 704s > 704s > d <- abs(sigma_b - sigma_a) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 0.00625567 704s > stopifnot(d < 0.01) 704s > 704s > # Sanity checks 704s > stopifnot(abs(sigma2_a - sigma_a ^ 2) < 1e-9) 704s > stopifnot(abs(sigma2_b - sigma_b ^ 2) < 1e-9) 704s > 704s > 704s > sigma_a2 <- mad(x) 704s > cat(sprintf("mad(x) = %g\n", sigma_a2)) 704s mad(x) = 0.998376 704s > 704s > sigma_b2 <- madDiff(x) 704s > cat(sprintf("madDiff(x) = %g\n", sigma_b2)) 704s madDiff(x) = 1.02513 704s > 704s > d <- abs(sigma_b2 - sigma_a2) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 0.0267497 704s > stopifnot(d < 0.05) 704s > 704s > 704s > sigma_a3 <- IQR(x) 704s > cat(sprintf("IQR(x) = %g\n", sigma_a3)) 704s IQR(x) = 1.35105 704s > 704s > sigma_b3 <- iqrDiff(x) 704s > cat(sprintf("iqrDiff(x) = %g\n", sigma_b3)) 704s iqrDiff(x) = 1.37797 704s > 704s > d <- abs(sigma_b3 - sigma_a3) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 0.0269152 704s > stopifnot(d < 0.05) 704s > 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Trimmed estimators 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > y <- x 704s > outliers <- sample(length(x), size = 0.1 * length(x)) 704s > y[outliers] <- 100 * y[outliers] 704s > 704s > sigma_ao <- sd(y[-outliers]) 704s > cat(sprintf("sd(y) = %g\n", sigma_ao)) 704s sd(y) = 1.01166 704s > 704s > sigma_bo <- sdDiff(y[-outliers]) 704s > cat(sprintf("sdDiff(y) = %g\n", sigma_bo)) 704s sdDiff(y) = 1.00743 704s > 704s > d <- abs(sigma_b - sigma_a) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 0.00625567 704s > stopifnot(d < 0.01) 704s > 704s > sigma_bot <- sdDiff(y, trim = 0.05) 704s > cat(sprintf("sdDiff(y, trim = 0.05) = %g\n", sigma_bot)) 704s sdDiff(y, trim = 0.05) = 7.74327 704s > 704s > d <- abs(sigma_bot - sigma_a) 704s > cat(sprintf("Absolute difference = %g\n", d)) 704s Absolute difference = 6.73091 704s > #stopifnot(d < 1e-3) 704s > 704s > sigma_cot <- madDiff(y, trim = 0.05) 704s > cat(sprintf("madDiff(y, trim = 0.05) = %g\n", sigma_cot)) 704s madDiff(y, trim = 0.05) = 1.15278 704s > 704s > sigma_dot <- iqrDiff(y, trim = 0.05) 704s > cat(sprintf("iqrDiff(y, trim = 0.05) = %g\n", sigma_dot)) 704s iqrDiff(y, trim = 0.05) = 1.55762 704s > 704s > 704s > fcns <- list( 704s + varDiff = varDiff, 704s + sdDiff = sdDiff, 704s + madDiff = madDiff, 704s + iqrDiff = iqrDiff 704s + ) 704s > 704s > for (name in names(fcns)) { 704s + cat(sprintf("%s()...\n", name)) 704s + fcn <- fcns[[name]] 704s + 704s + for (mode in c("integer", "double")) { 704s + cat("mode: ", mode, "", sep = "") 704s + for (n in 0:3) { 704s + x <- runif(n, min = -5, max = 5) 704s + storage.mode(x) <- mode 704s + str(x) 704s + 704s + y <- fcn(x) 704s + yt <- fcn(x, trim = 0.1) 704s + str(list("non-trimmed" = y, trimmed = yt)) 704s + } # for (mode ...) 704s + } 704s + 704s + cat(sprintf("%s()...DONE\n", name)) 704s + } # for (name ...) 704s varDiff()... 704s mode: integer int(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int -4 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:2] 3 2 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:3] 1 4 -1 704s List of 2 704s $ non-trimmed: num 16 704s $ trimmed : num 16 704s mode: double num(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num -0.794 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:2] 0.897 -3.728 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:3] 2.07 -1.13 1.94 704s List of 2 704s $ non-trimmed: num 9.83 704s $ trimmed : num 9.83 704s varDiff()...DONE 704s sdDiff()... 704s mode: integer int(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int 2 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:2] -4 1 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:3] -2 1 -1 704s List of 2 704s $ non-trimmed: num 2.5 704s $ trimmed : num 2.5 704s mode: double num(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num -3.78 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:2] -2.04 2.38 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:3] 1.42 -2.14 1.14 704s List of 2 704s $ non-trimmed: num 3.42 704s $ trimmed : num 3.42 704s sdDiff()...DONE 704s madDiff()... 704s mode: integer int(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int -1 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:2] -1 4 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int [1:3] -1 0 -3 704s List of 2 704s $ non-trimmed: num 2.1 704s $ trimmed : num 2.1 704s mode: double num(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num -1.13 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:2] -1.7 -1.21 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num [1:3] -2.39 -0.464 3.086 704s List of 2 704s $ non-trimmed: num 0.851 704s $ trimmed : num 0.851 704s madDiff()...DONE 704s iqrDiff()... 704s mode: integer int(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s int 3 704s List of 2 704s $ non-trimmed: num 0 704s $ trimmed : num 0 704s int [1:2] -3 4 704s List of 2 704s $ non-trimmed: num 0 704s $ trimmed : num 0 704s int [1:3] 0 -2 -2 704s List of 2 704s $ non-trimmed: num 0.707 704s $ trimmed : num 0.707 704s mode: double num(0) 704s List of 2 704s $ non-trimmed: num NA 704s $ trimmed : num NA 704s num -4.46 704s List of 2 704s $ non-trimmed: num 0 704s $ trimmed : num 0 704s num [1:2] 3.67 1.02 704s List of 2 704s $ non-trimmed: num 0 704s $ trimmed : num 0 704s num [1:3] -0.537 -2.733 2.857 704s List of 2 704s $ non-trimmed: num 2.75 704s $ trimmed : num 2.75 704s iqrDiff()...DONE 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > fcns <- list( 704s + varDiff = varDiff, 704s + sdDiff = sdDiff, 704s + madDiff = madDiff, 704s + iqrDiff = iqrDiff 704s + ) 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > for (name in names(fcns)) { 704s + cat(sprintf("subsetted tests on %s()...\n", name)) 704s + fcn <- fcns[[name]] 704s + 704s + for (mode in c("numeric", "integer")) { 704s + x <- runif(6, min = -6, max = 6) 704s + storage.mode(x) <- mode 704s + trim <- runif(1, min = 0, max = 0.5) 704s + if (mode == "numeric") x[1] <- Inf 704s + 704s + for (diff in 1:2) { 704s + for (idxs in index_cases) { 704s + validateIndicesTestVector(x, idxs, 704s + ftest = fcn, fsure = fcn, 704s + na.rm = TRUE, diff = diff, trim = trim) 704s + validateIndicesTestVector(x, idxs, 704s + ftest = fcn, fsure = fcn, 704s + na.rm = FALSE, diff = diff, trim = trim) 704s + } 704s + } 704s + } 704s + cat(sprintf("%s()...DONE\n", name)) 704s + } 704s subsetted tests on varDiff()... 704s varDiff()...DONE 704s subsetted tests on sdDiff()... 704s sdDiff()...DONE 704s subsetted tests on madDiff()... 704s madDiff()...DONE 704s subsetted tests on iqrDiff()... 704s iqrDiff()...DONE 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > for (mode in c("logical", "integer", "double")) { 704s + cat("mode: ", mode, "", sep = "") 704s + n <- 2L 704s + x <- runif(n, min = -5, max = 5) 704s + if (mode == "logical") { 704s + x <- x > 0 704s + } 704s + storage.mode(x) <- mode 704s + str(x) 704s + 704s + cat("All weights are 1\n") 704s + w <- rep(1, times = n) 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + 704s + cat("First weight is 5\n") 704s + # Pull the mean towards zero 704s + w[1] <- 5 704s + str(w) 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + 704s + cat("All weights are 0\n") 704s + # All weights set to zero 704s + w <- rep(0, times = n) 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + 704s + cat("First weight is 8.5\n") 704s + # Put even more weight on the zero 704s + w[1] <- 8.5 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + 704s + cat("First weight is Inf\n") 704s + # All weight on the first value 704s + w[1] <- Inf 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + 704s + cat("Last weight is Inf\n") 704s + # All weight on the last value 704s + w[1] <- 1 704s + w[n] <- Inf 704s + m0 <- weighted.mean(x, w) 704s + m1 <- weightedMean(x, w) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(identical(m1, m0)) 704s + } # for (mode ...) 704s mode: logical logi [1:2] TRUE TRUE 704s All weights are 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s First weight is 5 704s num [1:2] 5 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s All weights are 0 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s First weight is 8.5 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s First weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s Last weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s mode: integer int [1:2] -3 0 704s All weights are 1 704s List of 2 704s $ m0: num -1.5 704s $ m1: num -1.5 704s First weight is 5 704s num [1:2] 5 1 704s List of 2 704s $ m0: num -2.5 704s $ m1: num -2.5 704s All weights are 0 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s First weight is 8.5 704s List of 2 704s $ m0: num -3 704s $ m1: num -3 704s First weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s Last weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s mode: double num [1:2] 2.09 0.2 704s All weights are 1 704s List of 2 704s $ m0: num 1.15 704s $ m1: num 1.15 704s First weight is 5 704s num [1:2] 5 1 704s List of 2 704s $ m0: num 1.78 704s $ m1: num 1.78 704s All weights are 0 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s First weight is 8.5 704s List of 2 704s $ m0: num 2.09 704s $ m1: num 2.09 704s First weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s Last weight is Inf 704s List of 2 704s $ m0: num NaN 704s $ m1: num NaN 704s > 704s > 704s > message("*** Testing for missing values") 704s > # NA tests 704s > xs <- list(A = c(1, 2, 3), B = c(NA, 2, 3), C = c(NA, 2, 3)) 704s > ws <- list(A = c(1, 1, 1), B = c(NA, 1, 1), C = c(1, NA, 1)) 704s > ## NOTE: The (B, B) case with na.rm = TRUE is interesting because 704s > ## even if NAs in 'w' are not dropped by na.rm = TRUE, this one 704s > ## is because 'x' is dropped and therefore that first element 704s > ## is skipped in the computation. It basically does 704s > ## keep <- !is.na(x); x <- x[keep]; w <- w[keep] 704s > ## without looking at 'w'. 704s > for (x in xs) { 704s + for (mode in c("logical", "integer", "double")) { 704s + storage.mode(x) <- mode 704s + for (w in ws) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat(sprintf("mode: %s, na.rm = %s\n", mode, na.rm)) 704s + str(list(x = x, w = w)) 704s + m0 <- weighted.mean(x, w, na.rm = na.rm) 704s + m1 <- weightedMean(x, w, na.rm = na.rm) 704s + str(list(m0 = m0, m1 = m1)) 704s + stopifnot(all.equal(m1, m0)) 704s + } 704s + } 704s + } 704s + } 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] TRUE TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] 1 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] 1 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: logical, na.rm = FALSE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: logical, na.rm = TRUE 704s List of 2 704s $ x: logi [1:3] NA TRUE TRUE 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: integer, na.rm = FALSE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: integer, na.rm = TRUE 704s List of 2 704s $ x: int [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] NA 1 1 704s List of 2 704s $ m0: num 1 704s $ m1: num 1 704s mode: double, na.rm = FALSE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s mode: double, na.rm = TRUE 704s List of 2 704s $ x: num [1:3] NA 1 1 704s $ w: num [1:3] 1 NA 1 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > for (mode in c("numeric", "integer")) { 704s + x <- runif(6, min = -6, max = 6) 704s + w <- runif(6, min = 0, max = 6) 704s + storage.mode(x) <- mode 704s + storage.mode(w) <- mode 704s + if (mode == "numeric") w[1] <- Inf 704s + 704s + for (idxs in index_cases) { 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMean, fsure = weighted.mean, 704s + na.rm = TRUE, refine = TRUE) 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMean, fsure = weighted.mean, 704s + na.rm = FALSE, refine = TRUE) 704s + } 704s + } 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > x <- 1:5 704s > y <- weightedMedian(x) 704s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = TRUE) 704s > print(y) 704s [1] 3 704s > 704s > y <- weightedMedian(x, w = c(NA, Inf, NA, Inf, NA), na.rm = FALSE) 704s > print(y) 704s [1] NA 704s > stopifnot(is.na(y)) 704s > 704s > x <- 1:10 704s > n <- length(x) 704s > 704s > y1 <- median(x) # 5.5 704s > y2 <- weightedMedian(x) # 5.5 704s > stopifnot(all.equal(y1, y2)) 704s > 704s > 704s > w <- rep(1, times = n) 704s > y1 <- weightedMedian(x, w) # 5.5 (default) 704s > y2a <- weightedMedian(x, ties = "weighted") # 5.5 (default) 704s > y2b <- weightedMedian(x, ties = "min") # 5 704s > y2c <- weightedMedian(x, ties = "max") # 6 704s > stopifnot(all.equal(y2a, y1)) 704s > 704s > y3 <- weightedMedian(x, w) # 5.5 (default) 704s > 704s > 704s > # Pull the median towards zero 704s > w[1] <- 5 704s > y1 <- weightedMedian(x, w) # 3.5 704s > y <- c(rep(0, times = w[1]), x[-1]) # Only possible for integer weights 704s > y2 <- median(y) # 3.5 704s > stopifnot(all.equal(y1, y2)) 704s > 704s > # Put even more weight on the zero 704s > w[1] <- 8.5 704s > y <- weightedMedian(x, w) # 2 704s > 704s > # All weight on the first value 704s > w[1] <- Inf 704s > y <- weightedMedian(x, w) # 1 704s > 704s > # All weight on the last value 704s > w[1] <- 1 704s > w[n] <- Inf 704s > y <- weightedMedian(x, w) # 10 704s > 704s > # All weights set to zero 704s > w <- rep(0, times = n) 704s > y <- weightedMedian(x, w) # NA 704s > 704s > x <- 1:4 704s > w <- rep(1, times = 4) 704s > for (mode in c("integer", "double")) { 704s + storage.mode(x) <- mode 704s + for (ties in c("weighted", "mean", "min", "max")) { 704s + cat(sprintf("ties = %s\n", ties)) 704s + y <- weightedMedian(x, w, ties = ties) 704s + } 704s + } 704s ties = weighted 704s ties = mean 704s ties = min 704s ties = max 704s ties = weighted 704s ties = mean 704s ties = min 704s ties = max 704s > 704s > set.seed(0x42) 704s > 704s > y <- weightedMedian(x = double(0L)) 704s > print(y) 704s [1] NA 704s > stopifnot(length(y) == 1L) 704s > stopifnot(is.na(y)) 704s > 704s > y <- weightedMedian(x = x[1]) 704s > print(y) 704s [1] 1 704s > stopifnot(length(y) == 1L) 704s > stopifnot(all.equal(y, x[1])) 704s > 704s > 704s > n <- 1e3 704s > x <- runif(n) 704s > w <- runif(n, min = 0, max = 1) 704s > for (mode in c("integer", "double")) { 704s + storage.mode(x) <- mode 704s + for (ties in c("weighted", "mean", "min", "max")) { 704s + y <- weightedMedian(x, w, ties = ties) 704s + cat(sprintf("mode = %s, ties = %s, result = %g\n", mode, ties, y)) 704s + } 704s + } 704s mode = integer, ties = weighted, result = 0 704s mode = integer, ties = mean, result = 0 704s mode = integer, ties = min, result = 0 704s mode = integer, ties = max, result = 0 704s mode = double, ties = weighted, result = 0 704s mode = double, ties = mean, result = 0 704s mode = double, ties = min, result = 0 704s mode = double, ties = max, result = 0 704s > 704s > 704s > # A large vector 704s > n <- 1e5 704s > x <- runif(n) 704s > w <- runif(n, min = 0, max = 1) 704s > y <- weightedMedian(x, w) 704s > 704s > y <- weightedMedian(x, w, ties = "min") 704s > 704s > 704s > # Single Number 704s > xs <- c(1, NA_integer_) 704s > ws <- c(1, NA_integer_) 704s > for (x in xs) { 704s + for (w in ws) { 704s + y <- weightedMedian(x = x, w = w) 704s + if (is.na(w)) z <- NA_real_ 704s + else z <- x[1] 704s + stopifnot(all.equal(y, z)) 704s + } 704s + } 704s > 704s > ## Logical 704s > x1 <- c(TRUE, FALSE, TRUE) 704s > w0 <- c(0, 0, 0) 704s > stopifnot(!is.finite(weightedMedian(x1, w0)), 704s + !is.infinite(weightedMedian(x1, w0))) 704s > 704s > w1 <- c(1, 1, 1) 704s > stopifnot(weightedMedian(x1, w1) == 1) 704s > 704s > w2 <- c(1, 2, 3) 704s > stopifnot(weightedMedian(x1, w2) == 1) 704s > 704s > ### NA 704s > stopifnot(is.na(weightedMedian(c(TRUE, FALSE, NA), 704s + c(1, 2, 3))), 704s + all.equal(weightedMedian(c(TRUE, FALSE, NA), 704s + c(1, 2, 3), 704s + na.rm = TRUE), 704s + weightedMedian(c(TRUE, FALSE), 704s + c(1, 2)))) 704s > ### Identical to as.integer() 704s > x <- rcauchy(100) 704s > w <- abs(rcauchy(100)) 704s > stopifnot(all.equal(weightedMedian(x > 0, w), 704s + weightedMedian(as.integer(x > 0), w))) 704s > 704s > 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > for (mode in c("numeric", "integer")) { 704s + x <- runif(6, min = -6, max = 6) 704s + w <- runif(6, min = 0, max = 6) 704s + storage.mode(x) <- mode 704s + storage.mode(w) <- mode 704s + if (mode == "numeric") w[1] <- Inf 704s + 704s + for (idxs in index_cases) { 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMedian, 704s + fsure = weightedMedian, 704s + na.rm = TRUE) 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMedian, 704s + fsure = weightedMedian, 704s + na.rm = FALSE) 704s + Warning in sum2(x, mode = "integer") : 704s sum2(x, mode = "integer") called with typeof(x) == "double"; did you mean to use as.integer(sum2(x))? 704s *** Testing for missing values 704s *** weightedVar() ... 704s - Zero elements 704s - One elements 704s - Uniform weights (all w = 1) 704s - Uniform weights (all w = 3) 704s - Uniform weights on the first five elements 704s - Uniform weights on every second elements 704s - All weights are zero 704s - Infinite weight on first element 704s - Missing-value weight on first element 704s - Frequency weights 704s *** weightedVar() ... DONE 704s 704s + for (ties in c("weighted", "mean", "min", "max")) { 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMedian, 704s + fsure = weightedMedian, 704s + na.rm = TRUE, ties = ties) 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = weightedMedian, 704s + fsure = weightedMedian, 704s + na.rm = FALSE, ties = ties) 704s + } 704s + } 704s + } 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > weightedVar_R <- function(x, w) { 704s + mu <- weighted.mean(x, w = w) 704s + sum(w * (x - mu) ^ 2) / (sum(w) - 1) 704s + } 704s > 704s > 704s > n <- 10 704s > x <- as.double(1:n) 704s > 704s > message("*** weightedVar() ...") 704s > 704s > message("- Zero elements") 704s > m0 <- var(integer(0)) 704s > m1 <- weightedVar(integer(0), w = integer(0)) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num NA 704s $ m1: int NA 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- One elements") 704s > m0 <- var(1) 704s > m1 <- weightedVar(1) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- Uniform weights (all w = 1)") 704s > m0 <- var(x) 704s > w <- rep(1, times = n) 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num 9.17 704s $ m1: num 9.17 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- Uniform weights (all w = 3)") 704s > m0 <- var(rep(x, each = 3)) 704s > w <- rep(3, times = n) 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num 8.53 704s $ m1: num 8.53 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- Uniform weights on the first five elements") 704s > idxs <- 1:5 704s > m0 <- var(x[1:5]) 704s > w <- rep(0, times = n) 704s > w[idxs] <- 1 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num 2.5 704s $ m1: num 2.5 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- Uniform weights on every second elements") 704s > idxs <- seq(from = 1, to = n, by = 2) 704s > m0 <- var(x[idxs]) 704s > w <- rep(0, times = n) 704s > w[idxs] <- 1 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num 10 704s $ m1: num 10 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > 704s > message("- All weights are zero") 704s > idxs <- integer(0L) 704s > m0 <- var(x[idxs]) 704s > w <- rep(0, times = n) 704s > w[idxs] <- 1 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > message("- Infinite weight on first element") 704s > idxs <- 1L 704s > m0 <- var(x[idxs]) 704s > w <- rep(0, times = n) 704s > w[idxs] <- Inf 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num NA 704s $ m1: num NA 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > message("- Missing-value weight on first element") 704s > idxs <- 1L 704s > w <- rep(1, times = n) 704s > w[idxs] <- NA_real_ 704s > m1 <- weightedVar(x, w = w) 704s > str(list(m1 = m1)) 704s List of 1 704s $ m1: num NA 704s > stopifnot(identical(m1, NA_real_)) 704s > 704s > 704s > message("- Frequency weights") 704s > 704s > ## From https://en.wikipedia.org/wiki/Weighted_arithmetic_mean 704s > y <- c(2, 2, 4, 5, 5, 5) 704s > x <- unique(y) 704s > w <- table(y) 704s > stopifnot(names(w) == x) 704s > 704s > m0 <- weightedVar(x, w = w) 704s > m1 <- var(y) 704s > stopifnot(all.equal(m1, m0)) 704s > m2 <- weightedVar(x, w = w) 704s > str(list(m0 = m0, m1 = m1, m2 = m2)) 704s List of 3 704s $ m0: num 2.17 704s $ m1: num 2.17 704s $ m2: num 2.17 704s > stopifnot(all.equal(m2, m0)) 704s > 704s > ## From https://github.com/HenrikBengtsson/matrixStats/issues/72 704s > large <- c(21, 8, 26, 1, 15, 33, 12, 25, 0, 84) 704s > years <- c(41706, 9301, 33678, 3082, 27040, 44188, 10049, 30591, 2275, 109831) 704s > 704s > m0 <- weightedVar(large, w = years) 704s > m1 <- weightedVar(large, w = years) 704s > str(list(m0 = m0, m1 = m1)) 704s List of 2 704s $ m0: num 899 704s $ m1: num 899 704s > stopifnot(all.equal(m1, m0)) 704s > 704s > message("*** weightedVar() ... DONE") 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > fcns <- list( 704s + weightedVar = weightedVar, 704s + weightedSd = weightedSd, 704s + weightedMad = weightedMad 704s + ) 704s > 704s > for (name in names(fcns)) { 704s + cat(sprintf("%s()...\n", name)) 704s + fcn <- fcns[[name]] 704s + 704s + for (mode in c("integer", "double")) { 704s + cat("mode: ", mode, "\n", sep = "") 704s + n <- 15L 704s + x <- runif(n, min = -5, max = 5) 704s + storage.mode(x) <- mode 704s + str(x) 704s + 704s + for (add_na in c(FALSE, TRUE)) { 704s + cat("add_na: ", add_na, "\n", sep = "") 704s + if (add_na) { 704s + x[c(5, 7)] <- NA 704s + } 704s + str(x) 704s + 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat("na.rm: ", na.rm, "\n", sep = "") 704s + 704s + cat("Weights are not specified (all are 1)\n") 704s + m1 <- fcn(x, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("All weights are 1\n") 704s + w <- rep(1, times = n) 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("First weight is 5\n") 704s + # Pull the mean towards zero 704s + w[1] <- 5 704s + str(w) 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("All weights are 0\n") 704s + # All weights set to zero 704s + w <- rep(0, times = n) 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("First weight is 8.5\n") 704s + # Put even more weight on the zero 704s + w[1] <- 8.5 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("First weight is Inf\n") 704s + # All weight on the first value 704s + w[1] <- Inf 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("Last weight is Inf\n") 704s + # All weight on the last value 704s + w[1] <- 1 704s + w[n] <- Inf 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + 704s + cat("Last weight is NA\n") 704s + # All weight on the last value 704s + w[1] <- 1 704s + w[n] <- NA_real_ 704s + m1 <- fcn(x, w, na.rm = na.rm) 704s + str(list(m1 = m1)) 704s + } # for (na.rm ...) 704s + } # for (add_na ...) 704s + } # for (mode ...) 704s + 704s + cat(sprintf("%s()...DONE\n", name)) 704s + } # for (name ...) 704s weightedVar()... 704s mode: integer 704s int [1:15] 2 3 -1 -2 2 0 -2 0 1 4 ... 704s add_na: FALSE 704s int [1:15] 2 3 -1 -2 2 0 -2 0 1 4 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 5.71 704s All weights are 1 704s List of 1 704s $ m1: num 5.71 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 5.15 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int NA 704s First weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 5.71 704s All weights are 1 704s List of 1 704s $ m1: num 5.71 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 5.15 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int NA 704s First weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s add_na: TRUE 704s int [1:15] 2 3 -1 -2 NA 0 NA 0 1 4 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: int NA 704s All weights are 1 704s List of 1 704s $ m1: int NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: int NA 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int NA 704s First weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 6 704s All weights are 1 704s List of 1 704s $ m1: num 6 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 5.26 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int NA 704s First weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is Inf 704s List of 1 704s $ m1: int NA 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s mode: double 704s num [1:15] 4.32 2.6 3.9 4.89 4.42 ... 704s add_na: FALSE 704s num [1:15] 4.32 2.6 3.9 4.89 4.42 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 7.59 704s All weights are 1 704s List of 1 704s $ m1: num 7.59 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 7.52 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 7.59 704s All weights are 1 704s List of 1 704s $ m1: num 7.59 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 7.52 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s add_na: TRUE 704s num [1:15] 4.32 2.6 3.9 4.89 NA ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num NA 704s All weights are 1 704s List of 1 704s $ m1: num NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num NA 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 7.8 704s All weights are 1 704s List of 1 704s $ m1: num 7.8 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 8.02 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s weightedVar()...DONE 704s weightedSd()... 704s mode: integer 704s int [1:15] 1 0 -2 3 0 0 3 2 -2 1 ... 704s add_na: FALSE 704s int [1:15] 1 0 -2 3 0 0 3 2 -2 1 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.44 704s All weights are 1 704s List of 1 704s $ m1: num 2.44 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.26 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.44 704s All weights are 1 704s List of 1 704s $ m1: num 2.44 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.26 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s add_na: TRUE 704s int [1:15] 1 0 -2 3 NA 0 NA 2 -2 1 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num NA 704s All weights are 1 704s List of 1 704s $ m1: num NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num NA 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.4 704s All weights are 1 704s List of 1 704s $ m1: num 2.4 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.24 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s mode: double 704s num [1:15] 1.98 4.06 2.61 -3.62 -2.68 ... 704s add_na: FALSE 704s num [1:15] 1.98 4.06 2.61 -3.62 -2.68 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.74 704s All weights are 1 704s List of 1 704s $ m1: num 2.74 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.54 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.74 704s All weights are 1 704s List of 1 704s $ m1: num 2.74 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.54 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s add_na: TRUE 704s num [1:15] 1.98 4.06 2.61 -3.62 NA ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num NA 704s All weights are 1 704s List of 1 704s $ m1: num NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num NA 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 2.77 704s All weights are 1 704s List of 1 704s $ m1: num 2.77 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.52 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num NA 704s First weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is Inf 704s List of 1 704s $ m1: num NA 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s weightedSd()...DONE 704s weightedMad()... 704s mode: integer 704s int [1:15] -4 4 -1 -2 2 0 1 -2 -4 -3 ... 704s add_na: FALSE 704s int [1:15] -4 4 -1 -2 2 0 1 -2 -4 -3 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 1.48 704s All weights are 1 704s List of 1 704s $ m1: num 1.48 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.97 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int 0 704s First weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 1.48 704s All weights are 1 704s List of 1 704s $ m1: num 1.48 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.97 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int 0 704s First weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s add_na: TRUE 704s int [1:15] -4 4 -1 -2 NA 0 NA -2 -4 -3 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num NA 704s All weights are 1 704s List of 1 704s $ m1: int NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: int NA 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int 0 704s First weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 1.48 704s All weights are 1 704s List of 1 704s $ m1: num 1.48 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 2.97 704s All weights are 0 704s List of 1 704s $ m1: int NA 704s First weight is 8.5 704s List of 1 704s $ m1: int 0 704s First weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is Inf 704s List of 1 704s $ m1: int 0 704s Last weight is NA 704s List of 1 704s $ m1: int NA 704s mode: double 704s num [1:15] 0.569 0.132 -0.437 -1.037 3.055 ... 704s add_na: FALSE 704s num [1:15] 0.569 0.132 -0.437 -1.037 3.055 ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 3.06 704s All weights are 1 704s List of 1 704s $ m1: num 3.06 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 1.99 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num 0 704s First weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 3.06 704s All weights are 1 704s List of 1 704s $ m1: num 3.06 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 1.99 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num 0 704s First weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s add_na: TRUE 704s num [1:15] 0.569 0.132 -0.437 -1.037 NA ... 704s na.rm: FALSE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num NA 704s All weights are 1 704s List of 1 704s $ m1: num NA 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num NA 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num 0 704s First weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s na.rm: TRUE 704s Weights are not specified (all are 1) 704s List of 1 704s $ m1: num 1.73 704s All weights are 1 704s List of 1 704s $ m1: num 1.73 704s First weight is 5 704s num [1:15] 5 1 1 1 1 1 1 1 1 1 ... 704s List of 1 704s $ m1: num 1.28 704s All weights are 0 704s List of 1 704s $ m1: num NA 704s First weight is 8.5 704s List of 1 704s $ m1: num 0 704s First weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is Inf 704s List of 1 704s $ m1: num 0 704s Last weight is NA 704s List of 1 704s $ m1: num NA 704s weightedMad()...DONE 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > fcns <- list( 704s + weightedVar = weightedVar, 704s + weightedSd = weightedSd, 704s + weightedMad = weightedMad 704s + ) 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > for (name in names(fcns)) { 704s + cat(sprintf("subsetted tests on %s()...\n", name)) 704s + fcn <- fcns[[name]] 704s + 704s + for (mode in c("numeric", "integer")) { 704s + x <- runif(6, min = -6, max = 6) 704s + w <- runif(6, min = 0, max = 6) 704s + storage.mode(x) <- mode 704s + storage.mode(w) <- mode 704s + if (mode == "numeric") w[1] <- Inf 704s + 704s + for (idxs in index_cases) { 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = fcn, fsure = fcn, 704s + na.rm = TRUE) 704s + validateIndicesTestVector_w(x, w, idxs, 704s + ftest = fcn, fsure = fcn, 704s + na.rm = FALSE) 704s + } 704s + } 704s + cat(sprintf("%s()...DONE\n", name)) 704s + } 704s subsetted tests on weightedVar()... 704s weightedVar()...DONE 704s subsetted tests on weightedSd()... 704s weightedSd()...DONE 704s subsetted tests on weightedMad()... 704s weightedMad()...DONE 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 704s + if (na.rm) { 704s + xnok <- is.na(x) 704s + ynok <- is.na(y) 704s + anok <- xnok & ynok 704s + unit <- switch(OP, 704s + "+" = 0, 704s + "-" = NA_real_, 704s + "*" = 1, 704s + "/" = NA_real_, 704s + stop("Unknown 'OP' operator: ", OP) 704s + ) 704s + x[xnok] <- unit 704s + y[ynok] <- unit 704s + } 704s + 704s + ans <- switch(OP, 704s + "+" = x + y, 704s + "-" = x - y, 704s + "*" = x * y, 704s + "/" = x / y, 704s + stop("Unknown 'OP' operator: ", OP) 704s + ) 704s + 704s + if (na.rm) { 704s + ans[anok] <- NA_real_ 704s + } 704s + 704s + ans 704s + } # x_OP_y_R() 704s > 704s > 704s > 704s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 704s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 704s + } 704s > 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # No missing values 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > x <- matrix(1:16, nrow = 4, ncol = 4) 704s > y <- 1:nrow(x) 704s > storage.mode(y) <- storage.mode(x) 704s > 704s > for (OP in c("+", "-", "*", "/")) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 704s + 704s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 704s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 704s + str(a1) 704s + stopifnot(all.equal(a1, a0)) 704s + 704s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 704s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 704s + str(b1) 704s + stopifnot(all.equal(b1, b0)) 704s + } 704s + } 704s OP = '+', na.rm = FALSE 704s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 704s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 704s OP = '+', na.rm = TRUE 704s int [1:4, 1:4] 2 4 6 8 6 8 10 12 10 12 ... 704s int [1:4, 1:4] 2 3 4 5 7 8 9 10 12 13 ... 704s OP = '-', na.rm = FALSE 704s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 704s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 704s OP = '-', na.rm = TRUE 704s int [1:4, 1:4] 0 0 0 0 4 4 4 4 8 8 ... 704s int [1:4, 1:4] 0 1 2 3 3 4 5 6 6 7 ... 704s OP = '*', na.rm = FALSE 704s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 704s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 704s OP = '*', na.rm = TRUE 704s int [1:4, 1:4] 1 4 9 16 5 12 21 32 9 20 ... 704s int [1:4, 1:4] 1 2 3 4 10 12 14 16 27 30 ... 704s OP = '/', na.rm = FALSE 704s num [1:4, 1:4] 1 1 1 1 5 ... 704s num [1:4, 1:4] 1 2 3 4 2.5 ... 704s OP = '/', na.rm = TRUE 704s num [1:4, 1:4] 1 1 1 1 5 ... 704s num [1:4, 1:4] 1 2 3 4 2.5 ... 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Missing values in x, y, or both. 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > for (which in c("x", "y", "both")) { 704s + x <- matrix(1:16, nrow = 4, ncol = 4) 704s + y <- 1:nrow(x) 704s + storage.mode(y) <- storage.mode(x) 704s + 704s + if (which == "x") { 704s + x[3:6] <- NA_real_ 704s + } else if (which == "y") { 704s + y[c(1, 3)] <- NA_real_ 704s + } else if (which == "both") { 704s + x[3:6] <- NA_real_ 704s + y[c(1, 3)] <- NA_real_ 704s + } 704s + 704s + for (OP in c("+", "-", "*", "/")) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 704s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 704s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 704s + str(a1) 704s + stopifnot(all.equal(a1, a0)) 704s + 704s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 704s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 704s + str(b1) 704s + stopifnot(all.equal(b1, b0)) 704s + } 704s + } 704s + } 704s OP = '+', na.rm = FALSE 704s num [1:4, 1:4] 2 4 NA NA NA NA 10 12 10 12 ... 704s num [1:4, 1:4] 2 3 NA NA NA NA 9 10 12 13 ... 704s OP = '+', na.rm = TRUE 704s num [1:4, 1:4] 2 4 3 4 1 2 10 12 10 12 ... 704s num [1:4, 1:4] 2 3 1 1 2 2 9 10 12 13 ... 704s OP = '-', na.rm = FALSE 704s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 704s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 704s OP = '-', na.rm = TRUE 704s num [1:4, 1:4] 0 0 NA NA NA NA 4 4 8 8 ... 704s num [1:4, 1:4] 0 1 NA NA NA NA 5 6 6 7 ... 704s OP = '*', na.rm = FALSE 704s num [1:4, 1:4] 1 4 NA NA NA NA 21 32 9 20 ... 704s num [1:4, 1:4] 1 2 NA NA NA NA 14 16 27 30 ... 704s OP = '*', na.rm = TRUE 704s num [1:4, 1:4] 1 4 3 4 1 2 21 32 9 20 ... 704s num [1:4, 1:4] 1 2 1 1 2 2 14 16 27 30 ... 704s OP = '/', na.rm = FALSE 704s num [1:4, 1:4] 1 1 NA NA NA ... 704s num [1:4, 1:4] 1 2 NA NA NA ... 704s OP = '/', na.rm = TRUE 704s num [1:4, 1:4] 1 1 NA NA NA ... 704s num [1:4, 1:4] 1 2 NA NA NA ... 704s OP = '+', na.rm = FALSE 704s num [1:4, 1:4] NA 4 NA 8 NA 8 NA 12 NA 12 ... 704s num [1:4, 1:4] NA NA NA NA 7 8 9 10 NA NA ... 704s OP = '+', na.rm = TRUE 704s num [1:4, 1:4] 1 4 3 8 5 8 7 12 9 12 ... 704s num [1:4, 1:4] 1 2 3 4 7 8 9 10 9 10 ... 704s OP = '-', na.rm = FALSE 704s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 704s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 704s OP = '-', na.rm = TRUE 704s num [1:4, 1:4] NA 0 NA 0 NA 4 NA 4 NA 8 ... 704s num [1:4, 1:4] NA NA NA NA 3 4 5 6 NA NA ... 704s OP = '*', na.rm = FALSE 704s num [1:4, 1:4] NA 4 NA 16 NA 12 NA 32 NA 20 ... 704s num [1:4, 1:4] NA NA NA NA 10 12 14 16 NA NA ... 704s OP = '*', na.rm = TRUE 704s num [1:4, 1:4] 1 4 3 16 5 12 7 32 9 20 ... 704s num [1:4, 1:4] 1 2 3 4 10 12 14 16 9 10 ... 704s OP = '/', na.rm = FALSE 704s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 704s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 704s OP = '/', na.rm = TRUE 704s num [1:4, 1:4] NA 1 NA 1 NA 3 NA 2 NA 5 ... 704s num [1:4, 1:4] NA NA NA NA 2.5 3 3.5 4 NA NA ... 704s OP = '+', na.rm = FALSE 704s num [1:4, 1:4] NA 4 NA NA NA NA NA 12 NA 12 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 9 10 NA NA ... 704s OP = '+', na.rm = TRUE 704s num [1:4, 1:4] 1 4 NA 4 NA 2 7 12 9 12 ... 704s num [1:4, 1:4] 1 2 NA NA 2 2 9 10 9 10 ... 704s OP = '-', na.rm = FALSE 704s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 704s OP = '-', na.rm = TRUE 704s num [1:4, 1:4] NA 0 NA NA NA NA NA 4 NA 8 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 5 6 NA NA ... 704s OP = '*', na.rm = FALSE 704s num [1:4, 1:4] NA 4 NA NA NA NA NA 32 NA 20 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 14 16 NA NA ... 704s OP = '*', na.rm = TRUE 704s num [1:4, 1:4] 1 4 NA 4 NA 2 7 32 9 20 ... 704s num [1:4, 1:4] 1 2 NA NA 2 2 14 16 9 10 ... 704s OP = '/', na.rm = FALSE 704s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 704s OP = '/', na.rm = TRUE 704s num [1:4, 1:4] NA 1 NA NA NA NA NA 2 NA 5 ... 704s num [1:4, 1:4] NA NA NA NA NA NA 3.5 4 NA NA ... 704s > 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Length differences 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > x <- matrix(1:8, nrow = 2, ncol = 4) 704s > y <- 1:ncol(x) 704s > storage.mode(y) <- storage.mode(x) 704s > 704s > for (OP in c("+", "-", "*", "/")) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat(sprintf("OP = '%s', na.rm = %s\n", OP, na.rm)) 704s + 704s + a0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 704s + a1 <- x_OP_y(x, y, OP, na.rm = na.rm) 704s + str(a1) 704s + stopifnot(all.equal(a1, a0)) 704s + 704s + b0 <- t_tx_OP_y_R(x, y, OP, na.rm = na.rm) 704s + b1 <- t_tx_OP_y(x, y, OP, na.rm = na.rm) 704s + str(b1) 704s + stopifnot(all.equal(b1, b0)) 704s + } 704s + } 704s OP = '+', na.rm = FALSE 704s int [1:2, 1:4] 2 4 6 8 6 8 10 12 704s int [1:2, 1:4] 2 3 5 6 8 9 11 12 704s OP = '+', na.rm = TRUE 704s int [1:2, 1:4] 2 4 6 8 6 8 10 12 704s int [1:2, 1:4] 2 3 5 6 8 9 11 12 704s OP = '-', na.rm = FALSE 704s int [1:2, 1:4] 0 0 0 0 4 4 4 4 704s int [1:2, 1:4] 0 1 1 2 2 3 3 4 704s OP = '-', na.rm = TRUE 704s int [1:2, 1:4] 0 0 0 0 4 4 4 4 704s int [1:2, 1:4] 0 1 1 2 2 3 3 4 704s OP = '*', na.rm = FALSE 704s int [1:2, 1:4] 1 4 9 16 5 12 21 32 704s int [1:2, 1:4] 1 2 6 8 15 18 28 32 704s OP = '*', na.rm = TRUE 704s int [1:2, 1:4] 1 4 9 16 5 12 21 32 704s int [1:2, 1:4] 1 2 6 8 15 18 28 32 704s OP = '/', na.rm = FALSE 704s num [1:2, 1:4] 1 1 1 1 5 ... 704s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 704s OP = '/', na.rm = TRUE 704s num [1:2, 1:4] 1 1 1 1 5 ... 704s num [1:2, 1:4] 1 2 1.5 2 1.67 ... 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # All missing values 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > xs <- list( 704s + A = matrix(1:2, nrow = 2, ncol = 2), 704s + B = matrix(NA_integer_, nrow = 2, ncol = 2) 704s + ) 704s > ys <- list( 704s + A = 1L, 704s + B = NA_integer_ 704s + ) 704s > 704s > for (x in xs) { 704s + for (y in ys) { 704s + for (mode in c("logical", "integer", "double")) { 704s + storage.mode(x) <- mode 704s + storage.mode(y) <- mode 704s + str(list(x = x, y = y)) 704s + 704s + for (OP in c("+", "-", "*", "/")) { 704s + for (na.rm in c(FALSE, TRUE)) { 704s + cat(sprintf("mode = '%s', OP = '%s', na.rm = %s\n", mode, OP, na.rm)) 704s + suppressWarnings({ 704s + z0 <- x_OP_y_R(x, y, OP, na.rm = na.rm) 704s + z <- x_OP_y(x, y, OP, na.rm = na.rm) 704s + }) 704s + str(z) 704s + stopifnot(all.equal(z, z0)) 704s + } 704s + } 704s + } # for (mode ...) 704s + } # for (y ...) 704s + } # for (x ...) 704s List of 2 704s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 704s $ y: logi TRUE 704s mode = 'logical', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] 2 2 2 2 704s mode = 'logical', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 2 2 2 2 704s mode = 'logical', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] 0 0 0 0 704s mode = 'logical', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] 0 0 0 0 704s mode = 'logical', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s List of 2 704s $ x: int [1:2, 1:2] 1 1 1 1 704s $ y: int 1 704s mode = 'integer', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] 2 2 2 2 704s mode = 'integer', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 2 2 2 2 704s mode = 'integer', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] 0 0 0 0 704s mode = 'integer', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] 0 0 0 0 704s mode = 'integer', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s List of 2 704s $ x: num [1:2, 1:2] 1 1 1 1 704s $ y: num 1 704s mode = 'double', OP = '+', na.rm = FALSE 704s num [1:2, 1:2] 2 2 2 2 704s mode = 'double', OP = '+', na.rm = TRUE 704s num [1:2, 1:2] 2 2 2 2 704s mode = 'double', OP = '-', na.rm = FALSE 704s num [1:2, 1:2] 0 0 0 0 704s mode = 'double', OP = '-', na.rm = TRUE 704s num [1:2, 1:2] 0 0 0 0 704s mode = 'double', OP = '*', na.rm = FALSE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '*', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s List of 2 704s $ x: logi [1:2, 1:2] TRUE TRUE TRUE TRUE 704s $ y: logi NA 704s mode = 'logical', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: int [1:2, 1:2] 1 1 1 1 704s $ y: int NA 704s mode = 'integer', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: num [1:2, 1:2] 1 1 1 1 704s $ y: num NA 704s mode = 'double', OP = '+', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '+', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '-', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '-', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: logi [1:2, 1:2] NA NA NA NA 704s $ y: logi TRUE 704s mode = 'logical', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'logical', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: int [1:2, 1:2] NA NA NA NA 704s $ y: int 1 704s mode = 'integer', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] 1 1 1 1 704s mode = 'integer', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: num [1:2, 1:2] NA NA NA NA 704s $ y: num 1 704s mode = 'double', OP = '+', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '+', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '-', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '-', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = TRUE 704s num [1:2, 1:2] 1 1 1 1 704s mode = 'double', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: logi [1:2, 1:2] NA NA NA NA 704s $ y: logi NA 704s mode = 'logical', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'logical', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: int [1:2, 1:2] NA NA NA NA 704s $ y: int NA 704s mode = 'integer', OP = '+', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '+', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '-', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '-', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = FALSE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '*', na.rm = TRUE 704s int [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'integer', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s List of 2 704s $ x: num [1:2, 1:2] NA NA NA NA 704s $ y: num NA 704s mode = 'double', OP = '+', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '+', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '-', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '-', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '*', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '/', na.rm = FALSE 704s num [1:2, 1:2] NA NA NA NA 704s mode = 'double', OP = '/', na.rm = TRUE 704s num [1:2, 1:2] NA NA NA NA 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > library("matrixStats") 704s > 704s > x_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 704s + if (na.rm) { 704s + xnok <- is.na(x) 704s + ynok <- is.na(y) 704s + anok <- xnok & ynok 704s + unit <- switch(OP, 704s + "+" = 0, 704s + "-" = NA_real_, 704s + "*" = 1, 704s + "/" = NA_real_, 704s + stop("Unknown 'OP' operator: ", OP) 704s + ) 704s + x[xnok] <- unit 704s + y[ynok] <- unit 704s + } 704s + 704s + ans <- switch(OP, 704s + "+" = x + y, 704s + "-" = x - y, 704s + "*" = x * y, 704s + "/" = x / y, 704s + stop("Unknown 'OP' operator: ", OP) 704s + ) 704s + 704s + if (na.rm) { 704s + ans[anok] <- NA_real_ 704s + } 704s + 704s + ans 704s + } # x_OP_y_R() 704s > 704s > 704s > t_tx_OP_y_R <- function(x, y, OP, na.rm = FALSE) { 704s + t(x_OP_y_R(x = t(x), y = y, OP = OP, na.rm = na.rm)) 704s + } 704s > 704s > 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > # Subsetted tests 704s > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 704s > source("utils/validateIndicesFramework.R") 704s > for (OP in c("+", "-", "*", "/")) { 704s + for (mode in c("numeric", "integer", "logical")) { 704s + x <- matrix(runif(6 * 6, min = -6, max = 6), nrow = 6L, ncol = 6L) 704s + y <- runif(6, min = 0, max = 6) 704s + storage.mode(x) <- mode 704s + storage.mode(y) <- mode 704s + if (mode == "numeric") y[1] <- Inf 704s + 704s + for (xrows in index_cases) { 704s + for (xcols in index_cases) { 704s + if (is.null(xrows)) xrows <- seq_len(nrow(x)) 704s + if (is.null(xcols)) xcols <- seq_len(ncol(x)) 704s + 704s + for (yidxs in list(xrows, xcols)) { 704s + for (na.rm in c(TRUE, FALSE)) { 704s + 704s + suppressWarnings({ 704s + actual <- tryCatch( 704s + x_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 704s + na.rm = na.rm), 704s + error = function(c) "error" 704s + ) 704s + 704s + expect <- tryCatch( 704s + x_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 704s + na.rm = na.rm), 704s + error = function(c) "error" 704s + ) 704s + }) 704s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 704s + 704s + suppressWarnings({ 704s + actual <- tryCatch( 704s + t_tx_OP_y(x, y, OP, xrows = xrows, xcols = xcols, yidxs = yidxs, 704s + na.rm = na.rm), 704s + error = function(c) "error" 704s + ) 704s + 704s + expect <- tryCatch( 704s + t_tx_OP_y_R(x[xrows, xcols, drop = FALSE], y[yidxs], OP, 704s + na.rm = na.rm), 704s + error = function(c) "error" 704s + ) 704s + }) 704s + stopifnot(all.equal(as.vector(actual), as.vector(expect))) 704s + } 704s + } 704s + } 704s + } 704s + } 704s + } 704s > 704s 704s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 704s Copyright (C) 2024 The R Foundation for Statistical Computing 704s Platform: aarch64-unknown-linux-gnu 704s 704s R is free software and comes with ABSOLUTELY NO WARRANTY. 704s You are welcome to redistribute it under certain conditions. 704s Type 'license()' or 'licence()' for distribution details. 704s 704s R is a collaborative project with many contributors. 704s Type 'contributors()' for more information and 704s 'citation()' on how to cite R or R packages in publications. 704s 704s Type 'demo()' for some demos, 'help()' for on-line help, or 704s 'help.start()' for an HTML browser interface to help. 704s Type 'q()' to quit R. 704s 704s > ## These tests need to be last of all tests, otherwise 704s > ## covr::package_coverage() gives an error. 704s > cat("1. Loading package\n") 704s 1. Loading package 704s > loadNamespace("matrixStats") 704s 704s > stopifnot("matrixStats" %in% loadedNamespaces()) 704s > 704s > cat("2. Unloading package\n") 704s 2. Unloading package 704s > unloadNamespace("matrixStats") 704s > stopifnot(!"matrixStats" %in% loadedNamespaces()) 704s > 704s > if (FALSE) { 704s + ## 'covr' gives "Error in library("matrixStats") : 704s + ## there is no package called 'matrixStats'" here, cf. 704s + ## https://travis-ci.org/HenrikBengtsson/matrixStats/builds/48015577 704s + 704s + cat("3. Attaching package\n") 704s + library("matrixStats") 704s + stopifnot("package:matrixStats" %in% search()) 704s + 704s + cat("4. Detaching package\n") 704s + detach("package:matrixStats") 704s + stopifnot(!"package:matrixStats" %in% search()) 704s + stopifnot("matrixStats" %in% loadedNamespaces()) 704s + 704s + cat("5. Unloading package\n") 704s + unloadNamespace("matrixStats") 704s + stopifnot(!"matrixStats" %in% loadedNamespaces()) 704s + 704s + cat("6. Attaching package (again)\n") 704s + library("matrixStats") 704s + stopifnot("package:matrixStats" %in% search()) 704s + 704s + cat("7. Detaching package (again)\n") 704s + detach("package:matrixStats") 704s + stopifnot(!"package:matrixStats" %in% search()) 704s + stopifnot("matrixStats" %in% loadedNamespaces()) 704s + } 704s > 704s > cat("7. DONE\n") 704s 7. DONE 704s > 705s autopkgtest [09:55:39]: test run-unit-test: -----------------------] 705s autopkgtest [09:55:39]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 705s run-unit-test PASS 706s autopkgtest [09:55:40]: test pkg-r-autopkgtest: preparing testbed 1100s Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin", "region_id": "prodstack6", "url": "https://glance-admin.ps6.canonical.com:9292", "region": "prodstack6"}], "id": "49de724549524bd78e9cd46a4477226f", "type": "image", "name": "glance"}, {"endpoints": [{"id": "a1a41e9a1e2d42e5b6cd5380cd1e21bf", "interface": "admin", "region_id": "prodstack6", "url": "https://cinder-admin.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "d2309a99724b4111827482c68a832c0c", "interface": "public", "region_id": "prodstack6", "url": "https://cinder.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "f8a02e3949ff42afa772eb5e74dbef9f", "interface": "internal", "region_id": "prodstack6", "url": "https://cinder-internal.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "5bf6578a631349e3af4bf36d7adb18e1", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "01d84128f36444e9b01549b86bd69116", "interface": "admin", "region_id": "prodstack6", "url": "https://barbican-admin.ps6.canonical.com:9312", "region": "prodstack6"}, {"id": "0ce4a8777e0b40a88f7fc0f77e34a605", "interface": "public", "region_id": "prodstack6", "url": "https://barbican.ps6.canonical.com:9311", "region": "prodstack6"}, {"id": "f507ba49e4a7435cb330234217c92449", "interface": "internal", "region_id": "prodstack6", "url": "https://barbican-internal.ps6.canonical.com:9311", "region": "prodstack6"}], "id": "62cb1c3d9f6c45979c13516a6b3ff114", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "3cb6121bd8f14da8aa2fba7be823a2b4", "interface": "internal", "region_id": "prodstack6", "url": "https://neutron-internal.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "46ba11d133fe4e8f9e8f9097ba737682", "interface": "admin", "region_id": "prodstack6", "url": "https://neutron-admin.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "d872eb6aa23d40009165aa3dcdce3948", "interface": "public", "region_id": "prodstack6", "url": "https://neutron.ps6.canonical.com:9696", "region": "prodstack6"}], "id": "759cb6fdfbc146dd8b9d1ba444c4b9db", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "4349d565f72446da9699269f85df5e8b", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "a483dcc58f5e415e9ec739c94474e609", "interface": "public", "region_id": "prodstack6", "url": "https://manila.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "c1f14236723e42878562d8dd63d5a6a0", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "93fc4008035946deb1f433c2dd905a5d", "type": "sharev2", "name": "manilav2"}, {"endpoints": [{"id": "0fa148793c7249c8b187b6b4ff425731", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "555ade266a6b4bcc81b6e5abf607aec5", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "7dad1a7b1552465686424fc014463173", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/swift/simplestreams/data", "region": "prodstack6"}], "id": "977dd359af1a4fcc91a9daf4dc33b0f3", "type": "product-streams", "name": "image-stream"}, {"endpoints": [{"id": "12d30eabcdec4831bd15273d55b1cbab", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "29d35b2b483346479f1ff1a13604d50e", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "4aa1422bCreating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin", "region_id": "prodstack6", "url": "https://glance-admin.ps6.canonical.com:9292", "region": "prodstack6"}], "id": "49de724549524bd78e9cd46a4477226f", "type": "image", "name": "glance"}, {"endpoints": [{"id": "a1a41e9a1e2d42e5b6cd5380cd1e21bf", "interface": "admin", "region_id": "prodstack6", "url": "https://cinder-admin.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "d2309a99724b4111827482c68a832c0c", "interface": "public", "region_id": "prodstack6", "url": "https://cinder.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "f8a02e3949ff42afa772eb5e74dbef9f", "interface": "internal", "region_id": "prodstack6", "url": "https://cinder-internal.ps6.canonical.com:8776/v3/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "5bf6578a631349e3af4bf36d7adb18e1", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "01d84128f36444e9b01549b86bd69116", "interface": "admin", "region_id": "prodstack6", "url": "https://barbican-admin.ps6.canonical.com:9312", "region": "prodstack6"}, {"id": "0ce4a8777e0b40a88f7fc0f77e34a605", "interface": "public", "region_id": "prodstack6", "url": "https://barbican.ps6.canonical.com:9311", "region": "prodstack6"}, {"id": "f507ba49e4a7435cb330234217c92449", "interface": "internal", "region_id": "prodstack6", "url": "https://barbican-internal.ps6.canonical.com:9311", "region": "prodstack6"}], "id": "62cb1c3d9f6c45979c13516a6b3ff114", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "3cb6121bd8f14da8aa2fba7be823a2b4", "interface": "internal", "region_id": "prodstack6", "url": "https://neutron-internal.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "46ba11d133fe4e8f9e8f9097ba737682", "interface": "admin", "region_id": "prodstack6", "url": "https://neutron-admin.ps6.canonical.com:9696", "region": "prodstack6"}, {"id": "d872eb6aa23d40009165aa3dcdce3948", "interface": "public", "region_id": "prodstack6", "url": "https://neutron.ps6.canonical.com:9696", "region": "prodstack6"}], "id": "759cb6fdfbc146dd8b9d1ba444c4b9db", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "4349d565f72446da9699269f85df5e8b", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "a483dcc58f5e415e9ec739c94474e609", "interface": "public", "region_id": "prodstack6", "url": "https://manila.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "c1f14236723e42878562d8dd63d5a6a0", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v2/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "93fc4008035946deb1f433c2dd905a5d", "type": "sharev2", "name": "manilav2"}, {"endpoints": [{"id": "0fa148793c7249c8b187b6b4ff425731", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "555ade266a6b4bcc81b6e5abf607aec5", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/swift/v1/AUTH_e4b04ca58d734ed0aa29e306adad4f79/simplestreams/data", "region": "prodstack6"}, {"id": "7dad1a7b1552465686424fc014463173", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/swift/simplestreams/data", "region": "prodstack6"}], "id": "977dd359af1a4fcc91a9daf4dc33b0f3", "type": "product-streams", "name": "image-stream"}, {"endpoints": [{"id": "12d30eabcdec4831bd15273d55b1cbab", "interface": "internal", "region_id": "prodstack6", "url": "https://manila-internal.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "29d35b2b483346479f1ff1a13604d50e", "interface": "admin", "region_id": "prodstack6", "url": "https://manila-admin.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "4aa1422b8f5945d8aed9ba6a8d670e5c", "interface": "public", "region_id": "prodstack6", "url": "https://manila.ps6.canonical.com:8786/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "ac5e4f28fa794cde99f1d7ffc1b664e5", "type": "share", "name": "manila"}, {"endpoints": [{"id": "c7db93d54a684d8caeae1d9e18a59118", "interface": "admin", "region_id": "prodstack6", "url": "https://nova-admin.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}, {"id": "dd7a796f401b477f9f1b5bbc05747d8d", "interface": "public", "region_id": "prodstack6", "url": "https://nova.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}, {"id": "e7ecb038d830462ea67b0b463af5e013", "interface": "internal", "region_id": "prodstack6", "url": "https://nova-internal.ps6.canonical.com:8774/v2.1", "region": "prodstack6"}], "id": "b4519af08e174d4a8333a2d14ac3ba3b", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "02ef5b6154934ffd97d8b5b8e4d70d2a", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/swift/v1/AUTH_bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "2741abe526e94842a4fa801423ba1ef0", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/swift/v1/AUTH_bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "3742f9406c604516933d6fd8c29e0880", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/swift", "region": "prodstack6"}], "id": "c7f07a7b3b3c408c96200dfd1d1a0f6f", "type": "object-store", "name": "swift"}, {"endpoints": [{"id": "06d4ed6c160a43f2b7fa7f80ad1dc709", "interface": "internal", "region_id": "prodstack6", "url": "https://designate-internal.ps6.canonical.com:9001", "region": "prodstack6"}, {"id": "1e240624a50c4ca0aaa6ef63cbc94f1b", "interface": "admin", "region_id": "prodstack6", "url": "https://designate-admin.ps6.canonical.com:9001", "region": "prodstack6"}, {"id": "f94d7d17997a43fd9c63b34c43301c6e", "interface": "public", "region_id": "prodstack6", "url": "https://designate.ps6.canonical.com:9001", "region": "prodstack6"}], "id": "cf82013d63844fedbe96bcacb6bd1fef", "type": "dns", "name": "designate"}, {"endpoints": [{"id": "4a688340be464710bfa60bf3f88f41c4", "interface": "admin", "region_id": "prodstack6", "url": "https://gnocchi-admin.ps6.canonical.com:8041", "region": "prodstack6"}, {"id": "a5a95506c96d4716adb4efc3ac9051be", "interface": "public", "region_id": "prodstack6", "url": "https://gnocchi.ps6.canonical.com:8041", "region": "prodstack6"}, {"id": "eebc17a086834f8fa8bb6b35c8061a8c", "interface": "internal", "region_id": "prodstack6", "url": "https://gnocchi-internal.ps6.canonical.com:8041", "region": "prodstack6"}], "id": "d10589e854a446a5b852593f33f170a7", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "08f66df28d0f47f3bec12f29e06d85ac", "interface": "admin", "region_id": "prodstack6", "url": "https://keystone-admin.ps6.canonical.com:35357/v3", "region": "prodstack6"}, {"id": "46d270b45ceb42db902f4d241afa6a70", "interface": "public", "region_id": "prodstack6", "url": "https://keystone.ps6.canonical.com:5000/v3", "region": "prodstack6"}, {"id": "a4addee11d9349cfa46ec6660dbad947", "interface": "internal", "region_id": "prodstack6", "url": "https://keystone-internal.ps6.canonical.com:5000/v3", "region": "prodstack6"}], "id": "deb38a775a9b4e87a8de9e3eed779882", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "18b4af5f40664babb94e884c6a53ccf3", "interface": "admin", "region_id": "prodstack6", "url": "https://octavia-admin.ps6.canonical.com:9876", "region": "prodstack6"}, {"id": "2b6f7ba7f9944ee1aebd6dccc5223b2d", "interface": "internal", "region_id": "prodstack6", "url": "https://octavia-internal.ps6.canonical.com:9876", "region": "prodstack6"}, {"id": "5e3012e9c79e4890be4d964b6208f5c6", "interface": "public", "region_id": "prodstack6", "url": "https://octavia.ps6.canonical.com:9876", "region": "prodstack6"}], "id": "e00337be20d54948b66a1c3109b885c6", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1100s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1100s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1100s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1100s nova boot failed (attempt #1): 1100s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1100s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1100s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1100s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1100s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1100s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1100s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1101s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1101s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1101s nova boot failed (attempt #1): 1101s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1101s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1101s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1101s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1101s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1101s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1101s nova boot failed (attempt #1): 1101s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1101s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1101s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1101s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1101s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1101s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1101s nova boot failed (attempt #1): 1101s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1101s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1101s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1101s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1101s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1101s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1101s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"Creating nova instance adt-oracular-arm64-r-cran-matrixstats-20240524-092630-juju-7f2275-prod-proposed-migration-environment-3-22de1f0a-f0d5-4d9a-add4-9099df192789 from image adt/ubuntu-oracular-arm64-server-20240523.img (UUID ff48658f-96e6-43b8-b68b-32e64925c2cf)... 1101s nova boot failed (attempt #1): 1101s DEBUG (extension:189) found extension EntryPoint.parse('v1password = swiftclient.authv1:PasswordLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('noauth = cinderclient.contrib.noauth:CinderNoAuthLoader') 1101s DEBUG (extension:189) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('none = keystoneauth1.loading._plugins.noauth:NoAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3adfspassword = keystoneauth1.extras._saml2._loading:ADFSPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3applicationcredential = keystoneauth1.loading._plugins.identity.v3:ApplicationCredential') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3fedkerb = keystoneauth1.extras.kerberos._loading:MappedKerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3kerberos = keystoneauth1.extras.kerberos._loading:Kerberos') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3multifactor = keystoneauth1.loading._plugins.identity.v3:MultiFactor') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oauth1 = keystoneauth1.extras.oauth1._loading:V3OAuth1') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcaccesstoken = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAccessToken') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcclientcredentials = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectClientCredentials') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3samlpassword = keystoneauth1.extras._saml2._loading:Saml2Password') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3tokenlessauth = keystoneauth1.loading._plugins.identity.v3:TokenlessAuth') 1101s DEBUG (extension:189) found extension EntryPoint.parse('v3totp = keystoneauth1.loading._plugins.identity.v3:TOTP') 1101s DEBUG (session:517) REQ: curl -g -i -X GET https://keystone.ps6.canonical.com:5000/v3 -H "Accept: application/json" -H "User-Agent: nova keystoneauth1/4.0.0 python-requests/2.22.0 CPython/3.8.10" 1101s DEBUG (connectionpool:962) Starting new HTTPS connection (1): keystone.ps6.canonical.com:5000 1101s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "GET /v3 HTTP/1.1" 200 267 1101s DEBUG (session:548) RESP: [200] Connection: Keep-Alive Content-Length: 267 Content-Type: application/json Date: Fri, 24 May 2024 09:56:13 GMT Keep-Alive: timeout=75, max=1000 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1157s DEBUG (session:580) RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://keystone.ps6.canonical.com:5000/v3/"}], "media-types": [{autopkgtest [10:03:11]: testbed dpkg architecture: arm64 1170s autopkgtest [10:03:24]: testbed apt version: 2.9.3 1170s autopkgtest [10:03:24]: @@@@@@@@@@@@@@@@@@@@ test bed setup 1170s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [73.9 kB] 1171s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [3388 B] 1171s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [507 kB] 1171s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [1964 B] 1171s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [57.4 kB] 1171s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main arm64 Packages [177 kB] 1171s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/restricted arm64 Packages [12.3 kB] 1171s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 Packages [505 kB] 1171s Get:9 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse arm64 Packages [2532 B] 1172s Fetched 1341 kB in 1s (1045 kB/s) 1172s Reading package lists... 1191s Reading package lists... 1191s Building dependency tree... 1191s Reading state information... 1192s Calculating upgrade... 1192s The following packages will be upgraded: 1192s gir1.2-glib-2.0 klibc-utils libclang-cpp18 libclang1-18 libglib2.0-0t64 1192s libglib2.0-data libklibc libllvm18 libuv1t64 1193s 9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1193s Need to get 49.1 MB of archives. 1193s After this operation, 1121 kB of additional disk space will be used. 1193s Get:1 http://ftpmaster.internal/ubuntu oracular/main arm64 gir1.2-glib-2.0 arm64 2.80.2-1ubuntu1 [182 kB] 1193s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 libglib2.0-0t64 arm64 2.80.2-1ubuntu1 [1533 kB] 1193s Get:3 http://ftpmaster.internal/ubuntu oracular/main arm64 libglib2.0-data all 2.80.2-1ubuntu1 [49.3 kB] 1194s Get:4 http://ftpmaster.internal/ubuntu oracular/main arm64 libuv1t64 arm64 1.48.0-4 [95.4 kB] 1194s Get:5 http://ftpmaster.internal/ubuntu oracular/main arm64 klibc-utils arm64 2.0.13-4ubuntu1 [114 kB] 1194s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 libklibc arm64 2.0.13-4ubuntu1 [51.8 kB] 1194s Get:7 http://ftpmaster.internal/ubuntu oracular/main arm64 libclang-cpp18 arm64 1:18.1.6-1 [13.2 MB] 1195s Get:8 http://ftpmaster.internal/ubuntu oracular/main arm64 libllvm18 arm64 1:18.1.6-1 [26.3 MB] 1196s Get:9 http://ftpmaster.internal/ubuntu oracular/main arm64 libclang1-18 arm64 1:18.1.6-1 [7531 kB] 1197s Fetched 49.1 MB in 4s (11.5 MB/s) 1198s (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 ... 78193 files and directories currently installed.) 1198s Preparing to unpack .../0-gir1.2-glib-2.0_2.80.2-1ubuntu1_arm64.deb ... 1198s Unpacking gir1.2-glib-2.0:arm64 (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 1198s Preparing to unpack .../1-libglib2.0-0t64_2.80.2-1ubuntu1_arm64.deb ... 1198s Unpacking libglib2.0-0t64:arm64 (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 1198s Preparing to unpack .../2-libglib2.0-data_2.80.2-1ubuntu1_all.deb ... 1198s Unpacking libglib2.0-data (2.80.2-1ubuntu1) over (2.80.1-0ubuntu2) ... 1198s Preparing to unpack .../3-libuv1t64_1.48.0-4_arm64.deb ... 1198s Unpacking libuv1t64:arm64 (1.48.0-4) over (1.48.0-1.1build1) ... 1199s Preparing to unpack .../4-klibc-utils_2.0.13-4ubuntu1_arm64.deb ... 1199s Unpacking klibc-utils (2.0.13-4ubuntu1) over (2.0.13-4) ... 1199s Preparing to unpack .../5-libklibc_2.0.13-4ubuntu1_arm64.deb ... 1199s Unpacking libklibc:arm64 (2.0.13-4ubuntu1) over (2.0.13-4) ... 1199s Preparing to unpack .../6-libclang-cpp18_1%3a18.1.6-1_arm64.deb ... 1199s Unpacking libclang-cpp18 (1:18.1.6-1) over (1:18.1.3-1) ... 1200s Preparing to unpack .../7-libllvm18_1%3a18.1.6-1_arm64.deb ... 1200s Unpacking libllvm18:arm64 (1:18.1.6-1) over (1:18.1.3-1) ... 1201s Preparing to unpack .../8-libclang1-18_1%3a18.1.6-1_arm64.deb ... 1201s Unpacking libclang1-18 (1:18.1.6-1) over (1:18.1.3-1) ... 1201s Setting up libuv1t64:arm64 (1.48.0-4) ... 1201s Setting up libklibc:arm64 (2.0.13-4ubuntu1) ... 1201s Setting up libglib2.0-0t64:arm64 (2.80.2-1ubuntu1) ... 1201s No schema files found: doing nothing. 1201s Setting up libglib2.0-data (2.80.2-1ubuntu1) ... 1201s Setting up gir1.2-glib-2.0:arm64 (2.80.2-1ubuntu1) ... 1201s Setting up klibc-utils (2.0.13-4ubuntu1) ... 1201s Setting up libllvm18:arm64 (1:18.1.6-1) ... 1201s Setting up libclang1-18 (1:18.1.6-1) ... 1201s Setting up libclang-cpp18 (1:18.1.6-1) ... 1201s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 1201s Processing triggers for initramfs-tools (0.142ubuntu27) ... 1202s update-initramfs: Generating /boot/initrd.img-6.8.0-31-generic 1202s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 1222s System running in EFI mode, skipping. 1223s Reading package lists... 1224s Building dependency tree... 1224s Reading state information... 1224s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1259s Hit:1 http://ftpmaster.internal/ubuntu oracular InRelease 1259s Hit:2 http://ftpmaster.internal/ubuntu oracular-updates InRelease 1259s Hit:3 http://ftpmaster.internal/ubuntu oracular-security InRelease 1259s Hit:4 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 1263s Reading package lists... 1263s Reading package lists... 1263s Building dependency tree... 1263s Reading state information... 1263s Calculating upgrade... 1263s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1263s Reading package lists... 1263s Building dependency tree... 1263s Reading state information... 1263s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1263s autopkgtest [10:04:56]: rebooting testbed after setup commands that affected boot 1400s "base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}} 1400s DEBUG (session:946) GET call to https://keystone.ps6.canonical.com:5000/v3 used request id req-d44c2e84-6b53-42cf-8d17-60d26996f14f 1400s DEBUG (base:182) Making authentication request to https://keystone.ps6.canonical.com:5000/v3/auth/tokens 1400s DEBUG (connectionpool:429) https://keystone.ps6.canonical.com:5000 "POST /v3/auth/tokens HTTP/1.1" 201 12445 1400s DEBUG (base:187) {"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "369f50a481564a2c9433776a4ebd224d", "name": "prod-proposed-migration-arm64", "password_expires_at": null}, "audit_ids": ["jg4nfMhdTraJWa4AagF_QQ"], "expires_at": "2024-05-25T09:56:13.000000Z", "issued_at": "2024-05-24T09:56:13.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "bd8b3df3f03d43a0a9303b7c0434fdab", "name": "prod-proposed-migration-arm64_project"}, "is_domain": false, "roles": [{"id": "15cf997650e345b7b21c02b5cdb7d84a", "name": "member"}, {"id": "86bf3043974746c2bf52c2a9f362f986", "name": "reader"}], "is_admin_project": false, "catalog": [{"endpoints": [{"id": "213cdf38198c4581bd5b7d6d0836923b", "interface": "internal", "region_id": "prodstack6", "url": "https://radosgw-internal.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "67061eee26944a1a8009f9d07be19738", "interface": "public", "region_id": "prodstack6", "url": "https://radosgw.ps6.canonical.com:443/", "region": "prodstack6"}, {"id": "fc88c52c749a47d08a24a2c7efbde01b", "interface": "admin", "region_id": "prodstack6", "url": "https://radosgw-admin.ps6.canonical.com:443/", "region": "prodstack6"}], "id": "06e4714942634054bf9aa11715312b4e", "type": "s3", "name": "s3"}, {"endpoints": [{"id": "8aa44c94b63746bd9b37f1008ad55fa8", "interface": "admin", "region_id": "prodstack6", "url": "https://aodh-admin.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "92cf08a80a0242ebbca8ec893cf332b1", "interface": "public", "region_id": "prodstack6", "url": "https://aodh.ps6.canonical.com:8042", "region": "prodstack6"}, {"id": "d8139c6e11ae4edcb78981c12bd53212", "interface": "internal", "region_id": "prodstack6", "url": "https://aodh-internal.ps6.canonical.com:8042", "region": "prodstack6"}], "id": "2fb939b0b969435c8f0c5fa4edb4de94", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a49fcc80e658411885f88cdd8432a571", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "b23866fddba8415885b06c064c34b94b", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8000/v1", "region": "prodstack6"}, {"id": "f84ae55197f94b8392a678f35c82ca26", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8000/v1", "region": "prodstack6"}], "id": "3d4b59f7dab644b2b527e8e96b697545", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "2e0143334c6241169f45f1c11970c6bc", "interface": "public", "region_id": "prodstack6", "url": "https://heat.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "5e19c32243c04a3faf1e5f9ab900c260", "interface": "internal", "region_id": "prodstack6", "url": "https://heat-internal.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}, {"id": "b3fc5c88ec8543a691fec75726b86967", "interface": "admin", "region_id": "prodstack6", "url": "https://heat-admin.ps6.canonical.com:8004/v1/bd8b3df3f03d43a0a9303b7c0434fdab", "region": "prodstack6"}], "id": "43b926205044476b8093b18d8ce0a9e4", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "a47569b96e5b4146a312e4673504557c", "interface": "public", "region_id": "prodstack6", "url": "https://glance.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "bba35c4ab04f4114a2a34e65568537bd", "interface": "internal", "region_id": "prodstack6", "url": "https://glance-internal.ps6.canonical.com:9292", "region": "prodstack6"}, {"id": "ef769f1117c74a62a279131486c89628", "interface": "admin"autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1400s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1466s Reading package lists... 1466s Building dependency tree... 1466s Reading state information... 1466s Starting pkgProblemResolver with broken count: 0 1467s Starting 2 pkgProblemResolver with broken count: 0 1467s Done 1467s The following additional packages will be installed: 1467s build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu cpp-aarch64-linux-gnu 1467s dctrl-tools fontconfig fonts-glyphicons-halflings fonts-mathjax g++ g++-13 1467s g++-13-aarch64-linux-gnu g++-aarch64-linux-gnu gcc gcc-13 1467s gcc-13-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-13 1467s gfortran-13-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 1467s libasan8 libatomic1 libblas-dev libblas3 libbz2-dev libcairo2 libcc1-0 1467s libdatrie1 libdeflate-dev libgcc-13-dev libgfortran-13-dev libgfortran5 1467s libgomp1 libgraphite2-3 libharfbuzz0b libhwasan0 libice6 libicu-dev libisl23 1467s libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-bootstrap 1467s libjs-highlight.js libjs-jquery libjs-jquery-datatables libjs-mathjax 1467s liblapack-dev liblapack3 liblsan0 liblzma-dev libmpc3 libncurses-dev 1467s libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils 1467s libpaper1 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 1467s libpixman-1-0 libpkgconf3 libpng-dev libreadline-dev libsm6 libstdc++-13-dev 1467s libtcl8.6 libthai-data libthai0 libtirpc-dev libtk8.6 libtsan2 libubsan1 1467s libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 1467s node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin r-base-core 1467s r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 1467s r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 r-cran-glue 1467s r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr r-cran-labeling 1467s r-cran-lattice r-cran-lifecycle r-cran-magrittr r-cran-markdown r-cran-mass 1467s r-cran-matrix r-cran-matrixstats r-cran-mgcv r-cran-munsell r-cran-nlme 1467s r-cran-pillar r-cran-pkgconfig r-cran-r6 r-cran-rcolorbrewer r-cran-rlang 1467s r-cran-scales r-cran-tibble r-cran-utf8 r-cran-vctrs r-cran-viridislite 1467s r-cran-withr r-cran-xfun r-cran-yaml unzip x11-common xdg-utils zip 1467s zlib1g-dev 1467s Suggested packages: 1467s cpp-doc gcc-13-locales cpp-13-doc debtags gcc-13-doc gcc-multilib 1467s manpages-dev autoconf automake libtool flex bison gdb gcc-doc 1467s gdb-aarch64-linux-gnu gfortran-doc gfortran-13-doc libcoarrays-dev 1467s liblapack-doc icu-doc fonts-mathjax-extras fonts-stix libjs-mathjax-doc 1467s liblzma-doc ncurses-doc readline-doc libstdc++-13-doc tcl8.6 tk8.6 1467s libjs-html5shiv elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html 1467s texlive-base texlive-latex-base texlive-plain-generic 1467s texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils 1467s texlive-latex-recommended texlive-latex-extra texinfo r-cran-kernsmooth 1467s r-cran-kernlab r-cran-mvtnorm r-cran-vcd r-cran-shiny r-cran-shinyjs 1467s r-cran-dplyr r-cran-png r-cran-jpeg r-cran-rmarkdown r-cran-viridis 1467s r-cran-covr r-cran-magick r-cran-sf r-cran-bit64 r-cran-dbi 1467s r-cran-formattable r-cran-nanotime r-cran-palmerpenguins r-cran-stringi 1467s r-cran-survival r-cran-units r-cran-vdiffr r-cran-testthat r-cran-bench 1467s r-cran-blob r-cran-brio r-cran-callr r-cran-crayon r-cran-here r-cran-hms 1467s r-cran-htmltools r-cran-pkgbuild r-cran-pkgload r-cran-purrr r-cran-tidyr 1467s Recommended packages: 1467s bzip2-doc javascript-common libpng-tools r-recommended r-doc-html 1467s r-cran-callr r-cran-covr r-cran-crayon r-cran-digest r-cran-htmltools 1467s r-cran-htmlwidgets r-cran-mockery r-cran-processx r-cran-ps r-cran-rmarkdown 1467s r-cran-rprojroot r-cran-rstudioapi r-cran-testthat r-cran-whoami r-cran-curl 1467s r-cran-xml2 r-cran-unitizer r-cran-dplyr r-cran-hexbin r-cran-hmisc 1467s r-cran-mapproj r-cran-maps r-cran-multcomp r-cran-profvis r-cran-quantreg 1467s r-cran-ragg r-cran-rpart r-cran-sf r-cran-svglite r-cran-vdiffr r-cran-dbi 1467s r-cran-rsqlite r-cran-waldo r-cran-testit r-cran-bslib r-cran-codetools 1467s r-cran-formatr r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png 1467s r-cran-reticulate r-cran-rgl r-cran-sass r-cran-tikzdevice r-cran-tinytex 1467s r-cran-webshot node-highlight.js r-cran-lintr r-cran-tidyverse r-cran-rcurl 1467s r-cran-r.devices r-cran-r.rsp r-cran-lubridate r-cran-fs r-cran-usethis 1467s r-cran-bit64 r-cran-dichromat r-cran-hms r-cran-stringi r-cran-data.table 1467s r-cran-mockr r-cran-formattable r-cran-generics r-cran-pkgdown 1467s r-cran-zeallot r-cran-mime r-cran-remotes r-cran-renv r-cran-jsonlite 1467s r-cran-runit libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl 1467s x11-utils x11-xserver-utils 1467s The following NEW packages will be installed: 1467s autopkgtest-satdep build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu 1467s cpp-aarch64-linux-gnu dctrl-tools fontconfig fonts-glyphicons-halflings 1467s fonts-mathjax g++ g++-13 g++-13-aarch64-linux-gnu g++-aarch64-linux-gnu gcc 1467s gcc-13 gcc-13-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-13 1467s gfortran-13-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 1467s libasan8 libatomic1 libblas-dev libblas3 libbz2-dev libcairo2 libcc1-0 1467s libdatrie1 libdeflate-dev libgcc-13-dev libgfortran-13-dev libgfortran5 1467s libgomp1 libgraphite2-3 libharfbuzz0b libhwasan0 libice6 libicu-dev libisl23 1467s libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-bootstrap 1467s libjs-highlight.js libjs-jquery libjs-jquery-datatables libjs-mathjax 1467s liblapack-dev liblapack3 liblsan0 liblzma-dev libmpc3 libncurses-dev 1467s libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils 1467s libpaper1 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 1467s libpixman-1-0 libpkgconf3 libpng-dev libreadline-dev libsm6 libstdc++-13-dev 1467s libtcl8.6 libthai-data libthai0 libtirpc-dev libtk8.6 libtsan2 libubsan1 1467s libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 1467s node-normalize.css pkg-r-autopkgtest pkgconf pkgconf-bin r-base-core 1467s r-base-dev r-cran-base64enc r-cran-cli r-cran-colorspace r-cran-commonmark 1467s r-cran-evaluate r-cran-fansi r-cran-farver r-cran-ggplot2 r-cran-glue 1467s r-cran-gtable r-cran-highr r-cran-isoband r-cran-knitr r-cran-labeling 1467s r-cran-lattice r-cran-lifecycle r-cran-magrittr r-cran-markdown r-cran-mass 1467s r-cran-matrix r-cran-matrixstats r-cran-mgcv r-cran-munsell r-cran-nlme 1467s r-cran-pillar r-cran-pkgconfig r-cran-r6 r-cran-rcolorbrewer r-cran-rlang 1467s r-cran-scales r-cran-tibble r-cran-utf8 r-cran-vctrs r-cran-viridislite 1467s r-cran-withr r-cran-xfun r-cran-yaml unzip x11-common xdg-utils zip 1467s zlib1g-dev 1467s 0 upgraded, 133 newly installed, 0 to remove and 0 not upgraded. 1467s Need to get 166 MB/166 MB of archives. 1467s After this operation, 500 MB of additional disk space will be used. 1467s Get:1 /tmp/autopkgtest.ROsdPH/2-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [752 B] 1468s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 libisl23 arm64 0.26-3build1 [669 kB] 1468s Get:3 http://ftpmaster.internal/ubuntu oracular/main arm64 libmpc3 arm64 1.3.1-1build1 [56.4 kB] 1468s Get:4 http://ftpmaster.internal/ubuntu oracular/main arm64 cpp-13-aarch64-linux-gnu arm64 13.2.0-23ubuntu4 [10.3 MB] 1469s Get:5 http://ftpmaster.internal/ubuntu oracular/main arm64 cpp-13 arm64 13.2.0-23ubuntu4 [1032 B] 1469s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 cpp-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [5316 B] 1469s Get:7 http://ftpmaster.internal/ubuntu oracular/main arm64 cpp arm64 4:13.2.0-7ubuntu1 [22.4 kB] 1469s Get:8 http://ftpmaster.internal/ubuntu oracular/main arm64 libcc1-0 arm64 14.1.0-1ubuntu1 [49.4 kB] 1469s Get:9 http://ftpmaster.internal/ubuntu oracular/main arm64 libgomp1 arm64 14.1.0-1ubuntu1 [144 kB] 1469s Get:10 http://ftpmaster.internal/ubuntu oracular/main arm64 libitm1 arm64 14.1.0-1ubuntu1 [27.9 kB] 1469s Get:11 http://ftpmaster.internal/ubuntu oracular/main arm64 libatomic1 arm64 14.1.0-1ubuntu1 [11.4 kB] 1469s Get:12 http://ftpmaster.internal/ubuntu oracular/main arm64 libasan8 arm64 14.1.0-1ubuntu1 [2922 kB] 1469s Get:13 http://ftpmaster.internal/ubuntu oracular/main arm64 liblsan0 arm64 14.1.0-1ubuntu1 [1286 kB] 1469s Get:14 http://ftpmaster.internal/ubuntu oracular/main arm64 libtsan2 arm64 14.1.0-1ubuntu1 [2692 kB] 1469s Get:15 http://ftpmaster.internal/ubuntu oracular/main arm64 libubsan1 arm64 14.1.0-1ubuntu1 [1155 kB] 1469s Get:16 http://ftpmaster.internal/ubuntu oracular/main arm64 libhwasan0 arm64 14.1.0-1ubuntu1 [1604 kB] 1469s Get:17 http://ftpmaster.internal/ubuntu oracular/main arm64 libgcc-13-dev arm64 13.2.0-23ubuntu4 [2470 kB] 1469s Get:18 http://ftpmaster.internal/ubuntu oracular/main arm64 gcc-13-aarch64-linux-gnu arm64 13.2.0-23ubuntu4 [20.1 MB] 1469s Get:19 http://ftpmaster.internal/ubuntu oracular/main arm64 gcc-13 arm64 13.2.0-23ubuntu4 [472 kB] 1470s Get:20 http://ftpmaster.internal/ubuntu oracular/main arm64 gcc-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1198 B] 1470s Get:21 http://ftpmaster.internal/ubuntu oracular/main arm64 gcc arm64 4:13.2.0-7ubuntu1 [5018 B] 1470s Get:22 http://ftpmaster.internal/ubuntu oracular/main arm64 libstdc++-13-dev arm64 13.2.0-23ubuntu4 [2379 kB] 1470s Get:23 http://ftpmaster.internal/ubuntu oracular/main arm64 g++-13-aarch64-linux-gnu arm64 13.2.0-23ubuntu4 [11.7 MB] 1470s Get:24 http://ftpmaster.internal/ubuntu oracular/main arm64 g++-13 arm64 13.2.0-23ubuntu4 [14.5 kB] 1470s Get:25 http://ftpmaster.internal/ubuntu oracular/main arm64 g++-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [962 B] 1470s Get:26 http://ftpmaster.internal/ubuntu oracular/main arm64 g++ arm64 4:13.2.0-7ubuntu1 [1082 B] 1470s Get:27 http://ftpmaster.internal/ubuntu oracular/main arm64 build-essential arm64 12.10ubuntu1 [4932 B] 1470s Get:28 http://ftpmaster.internal/ubuntu oracular/main arm64 dctrl-tools arm64 2.24-3build3 [103 kB] 1470s Get:29 http://ftpmaster.internal/ubuntu oracular/main arm64 fontconfig arm64 2.15.0-1.1ubuntu2 [190 kB] 1470s Get:30 http://ftpmaster.internal/ubuntu oracular/universe arm64 fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 1470s Get:31 http://ftpmaster.internal/ubuntu oracular/main arm64 fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 1470s Get:32 http://ftpmaster.internal/ubuntu oracular/main arm64 libgfortran5 arm64 14.1.0-1ubuntu1 [443 kB] 1470s Get:33 http://ftpmaster.internal/ubuntu oracular/main arm64 libgfortran-13-dev arm64 13.2.0-23ubuntu4 [478 kB] 1470s Get:34 http://ftpmaster.internal/ubuntu oracular/main arm64 gfortran-13-aarch64-linux-gnu arm64 13.2.0-23ubuntu4 [10.8 MB] 1470s Get:35 http://ftpmaster.internal/ubuntu oracular/main arm64 gfortran-13 arm64 13.2.0-23ubuntu4 [11.7 kB] 1470s Get:36 http://ftpmaster.internal/ubuntu oracular/main arm64 gfortran-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1022 B] 1470s Get:37 http://ftpmaster.internal/ubuntu oracular/main arm64 gfortran arm64 4:13.2.0-7ubuntu1 [1164 B] 1470s Get:38 http://ftpmaster.internal/ubuntu oracular/main arm64 icu-devtools arm64 74.2-1ubuntu3 [209 kB] 1470s Get:39 http://ftpmaster.internal/ubuntu oracular/main arm64 libblas3 arm64 3.12.0-3build1 [143 kB] 1470s Get:40 http://ftpmaster.internal/ubuntu oracular/main arm64 libblas-dev arm64 3.12.0-3build1 [111 kB] 1470s Get:41 http://ftpmaster.internal/ubuntu oracular/main arm64 libbz2-dev arm64 1.0.8-5.1 [35.8 kB] 1470s Get:42 http://ftpmaster.internal/ubuntu oracular/main arm64 libpixman-1-0 arm64 0.42.2-1build1 [204 kB] 1470s Get:43 http://ftpmaster.internal/ubuntu oracular/main arm64 libxcb-render0 arm64 1.17.0-2 [16.6 kB] 1470s Get:44 http://ftpmaster.internal/ubuntu oracular/main arm64 libxcb-shm0 arm64 1.17.0-2 [5884 B] 1470s Get:45 http://ftpmaster.internal/ubuntu oracular/main arm64 libxrender1 arm64 1:0.9.10-1.1build1 [18.8 kB] 1470s Get:46 http://ftpmaster.internal/ubuntu oracular/main arm64 libcairo2 arm64 1.18.0-3build1 [555 kB] 1470s Get:47 http://ftpmaster.internal/ubuntu oracular/main arm64 libdatrie1 arm64 0.2.13-3build1 [19.2 kB] 1470s Get:48 http://ftpmaster.internal/ubuntu oracular/main arm64 libdeflate-dev arm64 1.20-1 [53.2 kB] 1470s Get:49 http://ftpmaster.internal/ubuntu oracular/main arm64 libgraphite2-3 arm64 1.3.14-2build1 [70.8 kB] 1470s Get:50 http://ftpmaster.internal/ubuntu oracular/main arm64 libharfbuzz0b arm64 8.3.0-2build2 [463 kB] 1470s Get:51 http://ftpmaster.internal/ubuntu oracular/main arm64 x11-common all 1:7.7+23ubuntu3 [21.7 kB] 1470s Get:52 http://ftpmaster.internal/ubuntu oracular/main arm64 libice6 arm64 2:1.0.10-1build3 [41.1 kB] 1470s Get:53 http://ftpmaster.internal/ubuntu oracular/main arm64 libicu-dev arm64 74.2-1ubuntu3 [11.9 MB] 1471s Get:54 http://ftpmaster.internal/ubuntu oracular/main arm64 libjpeg-turbo8-dev arm64 2.1.5-2ubuntu2 [305 kB] 1471s Get:55 http://ftpmaster.internal/ubuntu oracular/main arm64 libjpeg8-dev arm64 8c-2ubuntu11 [1484 B] 1471s Get:56 http://ftpmaster.internal/ubuntu oracular/main arm64 libjpeg-dev arm64 8c-2ubuntu11 [1482 B] 1471s Get:57 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 1471s Get:58 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 1471s Get:59 http://ftpmaster.internal/ubuntu oracular/main arm64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 1471s Get:60 http://ftpmaster.internal/ubuntu oracular/universe arm64 libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 1471s Get:61 http://ftpmaster.internal/ubuntu oracular/main arm64 liblapack3 arm64 3.12.0-3build1 [2241 kB] 1471s Get:62 http://ftpmaster.internal/ubuntu oracular/main arm64 liblapack-dev arm64 3.12.0-3build1 [4293 kB] 1471s Get:63 http://ftpmaster.internal/ubuntu oracular/main arm64 libncurses-dev arm64 6.4+20240113-1ubuntu2 [385 kB] 1471s Get:64 http://ftpmaster.internal/ubuntu oracular/main arm64 libthai-data all 0.1.29-2build1 [158 kB] 1471s Get:65 http://ftpmaster.internal/ubuntu oracular/main arm64 libthai0 arm64 0.1.29-2build1 [18.2 kB] 1471s Get:66 http://ftpmaster.internal/ubuntu oracular/main arm64 libpango-1.0-0 arm64 1.52.2+ds-1 [230 kB] 1471s Get:67 http://ftpmaster.internal/ubuntu oracular/main arm64 libpangoft2-1.0-0 arm64 1.52.2+ds-1 [41.9 kB] 1471s Get:68 http://ftpmaster.internal/ubuntu oracular/main arm64 libpangocairo-1.0-0 arm64 1.52.2+ds-1 [27.2 kB] 1471s Get:69 http://ftpmaster.internal/ubuntu oracular/main arm64 libpaper1 arm64 1.1.29build1 [13.4 kB] 1471s Get:70 http://ftpmaster.internal/ubuntu oracular/main arm64 libpaper-utils arm64 1.1.29build1 [8490 B] 1471s Get:71 http://ftpmaster.internal/ubuntu oracular/main arm64 libpcre2-16-0 arm64 10.42-4ubuntu2 [196 kB] 1471s Get:72 http://ftpmaster.internal/ubuntu oracular/main arm64 libpcre2-32-0 arm64 10.42-4ubuntu2 [184 kB] 1471s Get:73 http://ftpmaster.internal/ubuntu oracular/main arm64 libpcre2-posix3 arm64 10.42-4ubuntu2 [6642 B] 1471s Get:74 http://ftpmaster.internal/ubuntu oracular/main arm64 libpcre2-dev arm64 10.42-4ubuntu2 [680 kB] 1471s Get:75 http://ftpmaster.internal/ubuntu oracular/main arm64 libpkgconf3 arm64 1.8.1-2build1 [31.2 kB] 1471s Get:76 http://ftpmaster.internal/ubuntu oracular/main arm64 zlib1g-dev arm64 1:1.3.dfsg-3.1ubuntu2 [894 kB] 1471s Get:77 http://ftpmaster.internal/ubuntu oracular/main arm64 libpng-dev arm64 1.6.43-5build1 [266 kB] 1471s Get:78 http://ftpmaster.internal/ubuntu oracular/main arm64 libreadline-dev arm64 8.2-4build1 [177 kB] 1471s Get:79 http://ftpmaster.internal/ubuntu oracular/main arm64 libsm6 arm64 2:1.2.3-1build3 [15.6 kB] 1471s Get:80 http://ftpmaster.internal/ubuntu oracular/main arm64 libtcl8.6 arm64 8.6.14+dfsg-1build1 [978 kB] 1471s Get:81 http://ftpmaster.internal/ubuntu oracular/main arm64 libxft2 arm64 2.3.6-1build1 [44.1 kB] 1471s Get:82 http://ftpmaster.internal/ubuntu oracular/main arm64 libxss1 arm64 1:1.2.3-1build3 [7244 B] 1471s Get:83 http://ftpmaster.internal/ubuntu oracular/main arm64 libtk8.6 arm64 8.6.14-1build1 [767 kB] 1471s Get:84 http://ftpmaster.internal/ubuntu oracular/main arm64 libxt6t64 arm64 1:1.2.1-1.2build1 [168 kB] 1471s Get:85 http://ftpmaster.internal/ubuntu oracular/universe arm64 node-normalize.css all 8.0.1-5 [10.8 kB] 1471s Get:86 http://ftpmaster.internal/ubuntu oracular/main arm64 zip arm64 3.0-13build1 [171 kB] 1471s Get:87 http://ftpmaster.internal/ubuntu oracular/main arm64 unzip arm64 6.0-28ubuntu4 [171 kB] 1471s Get:88 http://ftpmaster.internal/ubuntu oracular/main arm64 xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 1471s Get:89 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-base-core arm64 4.4.0-2 [28.3 MB] 1472s Get:90 http://ftpmaster.internal/ubuntu oracular/main arm64 liblzma-dev arm64 5.6.1+really5.4.5-1 [178 kB] 1472s Get:91 http://ftpmaster.internal/ubuntu oracular/main arm64 pkgconf-bin arm64 1.8.1-2build1 [20.5 kB] 1472s Get:92 http://ftpmaster.internal/ubuntu oracular/main arm64 pkgconf arm64 1.8.1-2build1 [16.8 kB] 1472s Get:93 http://ftpmaster.internal/ubuntu oracular/main arm64 libtirpc-dev arm64 1.3.4+ds-1.3 [201 kB] 1472s Get:94 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-base-dev all 4.4.0-2 [4340 B] 1472s Get:95 http://ftpmaster.internal/ubuntu oracular/universe arm64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 1472s Get:96 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-base64enc arm64 0.1-3-3 [27.4 kB] 1472s Get:97 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-cli arm64 3.6.2-1 [1377 kB] 1472s Get:98 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-colorspace arm64 2.1-0+dfsg-1 [1540 kB] 1472s Get:99 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-commonmark arm64 1.9.1-1 [127 kB] 1472s Get:100 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-evaluate all 0.23-1 [90.2 kB] 1472s Get:101 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-fansi arm64 1.0.5-1 [616 kB] 1472s Get:102 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-farver arm64 2.1.1-2 [1340 kB] 1472s Get:103 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-glue arm64 1.7.0-1 [154 kB] 1472s Get:104 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-rlang arm64 1.1.3-1 [1663 kB] 1472s Get:105 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 1472s Get:106 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-gtable all 0.3.4+dfsg-1 [191 kB] 1472s Get:107 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-isoband arm64 0.2.7-1 [1481 kB] 1473s Get:108 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-mass arm64 7.3-60.2-1 [1109 kB] 1473s Get:109 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-lattice arm64 0.22-6-1 [1363 kB] 1473s Get:110 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-nlme arm64 3.1.164-1build1 [2264 kB] 1473s Get:111 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-matrix arm64 1.6-5-1 [3776 kB] 1473s Get:112 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-mgcv arm64 1.9-1-1 [3248 kB] 1473s Get:113 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-labeling all 0.4.3-1 [62.1 kB] 1473s Get:114 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-munsell all 0.5.0-2build1 [208 kB] 1473s Get:115 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-r6 all 2.5.1-1 [99.0 kB] 1473s Get:116 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-rcolorbrewer all 1.1-3-1build1 [55.4 kB] 1473s Get:117 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-viridislite all 0.4.2-2 [1088 kB] 1473s Get:118 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-scales all 1.3.0-1 [603 kB] 1473s Get:119 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-magrittr arm64 2.0.3-1 [154 kB] 1473s Get:120 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-utf8 arm64 1.2.4-1 [140 kB] 1473s Get:121 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-vctrs arm64 0.6.5-1 [1327 kB] 1473s Get:122 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-pillar all 1.9.0+dfsg-1 [464 kB] 1473s Get:123 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-pkgconfig all 2.0.3-2build1 [19.7 kB] 1473s Get:124 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-tibble arm64 3.2.1+dfsg-2 [415 kB] 1473s Get:125 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-withr all 2.5.0-1 [225 kB] 1473s Get:126 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 r-cran-ggplot2 all 3.5.1+dfsg-1 [3940 kB] 1474s Get:127 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-xfun arm64 0.44+dfsg-1 [517 kB] 1474s Get:128 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-highr all 0.10+dfsg-2 [38.5 kB] 1474s Get:129 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-yaml arm64 2.3.8-2 [108 kB] 1474s Get:130 http://ftpmaster.internal/ubuntu oracular/main arm64 libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 1474s Get:131 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-knitr all 1.46+dfsg-1 [911 kB] 1474s Get:132 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-markdown all 1.12+dfsg-2 [179 kB] 1474s Get:133 http://ftpmaster.internal/ubuntu oracular/universe arm64 r-cran-matrixstats arm64 1.2.0-1 [475 kB] 1476s Preconfiguring packages ... 1476s Fetched 166 MB in 6s (25.5 MB/s) 1477s Selecting previously unselected package libisl23:arm64. 1477s (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 ... 78194 files and directories currently installed.) 1477s Preparing to unpack .../000-libisl23_0.26-3build1_arm64.deb ... 1477s Unpacking libisl23:arm64 (0.26-3build1) ... 1477s Selecting previously unselected package libmpc3:arm64. 1477s Preparing to unpack .../001-libmpc3_1.3.1-1build1_arm64.deb ... 1477s Unpacking libmpc3:arm64 (1.3.1-1build1) ... 1477s Selecting previously unselected package cpp-13-aarch64-linux-gnu. 1477s Preparing to unpack .../002-cpp-13-aarch64-linux-gnu_13.2.0-23ubuntu4_arm64.deb ... 1477s Unpacking cpp-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1477s Selecting previously unselected package cpp-13. 1478s Preparing to unpack .../003-cpp-13_13.2.0-23ubuntu4_arm64.deb ... 1478s Unpacking cpp-13 (13.2.0-23ubuntu4) ... 1478s Selecting previously unselected package cpp-aarch64-linux-gnu. 1478s Preparing to unpack .../004-cpp-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 1478s Unpacking cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1478s Selecting previously unselected package cpp. 1478s Preparing to unpack .../005-cpp_4%3a13.2.0-7ubuntu1_arm64.deb ... 1478s Unpacking cpp (4:13.2.0-7ubuntu1) ... 1478s Selecting previously unselected package libcc1-0:arm64. 1478s Preparing to unpack .../006-libcc1-0_14.1.0-1ubuntu1_arm64.deb ... 1478s Unpacking libcc1-0:arm64 (14.1.0-1ubuntu1) ... 1478s Selecting previously unselected package libgomp1:arm64. 1478s Preparing to unpack .../007-libgomp1_14.1.0-1ubuntu1_arm64.deb ... 1478s Unpacking libgomp1:arm64 (14.1.0-1ubuntu1) ... 1478s Selecting previously unselected package libitm1:arm64. 1479s Preparing to unpack .../008-libitm1_14.1.0-1ubuntu1_arm64.deb ... 1479s Unpacking libitm1:arm64 (14.1.0-1ubuntu1) ... 1479s Selecting previously unselected package libatomic1:arm64. 1479s Preparing to unpack .../009-libatomic1_14.1.0-1ubuntu1_arm64.deb ... 1479s Unpacking libatomic1:arm64 (14.1.0-1ubuntu1) ... 1479s Selecting previously unselected package libasan8:arm64. 1479s Preparing to unpack .../010-libasan8_14.1.0-1ubuntu1_arm64.deb ... 1479s Unpacking libasan8:arm64 (14.1.0-1ubuntu1) ... 1480s Selecting previously unselected package liblsan0:arm64. 1480s Preparing to unpack .../011-liblsan0_14.1.0-1ubuntu1_arm64.deb ... 1480s Unpacking liblsan0:arm64 (14.1.0-1ubuntu1) ... 1480s Selecting previously unselected package libtsan2:arm64. 1480s Preparing to unpack .../012-libtsan2_14.1.0-1ubuntu1_arm64.deb ... 1480s Unpacking libtsan2:arm64 (14.1.0-1ubuntu1) ... 1480s Selecting previously unselected package libubsan1:arm64. 1481s Preparing to unpack .../013-libubsan1_14.1.0-1ubuntu1_arm64.deb ... 1481s Unpacking libubsan1:arm64 (14.1.0-1ubuntu1) ... 1481s Selecting previously unselected package libhwasan0:arm64. 1481s Preparing to unpack .../014-libhwasan0_14.1.0-1ubuntu1_arm64.deb ... 1481s Unpacking libhwasan0:arm64 (14.1.0-1ubuntu1) ... 1481s Selecting previously unselected package libgcc-13-dev:arm64. 1481s Preparing to unpack .../015-libgcc-13-dev_13.2.0-23ubuntu4_arm64.deb ... 1481s Unpacking libgcc-13-dev:arm64 (13.2.0-23ubuntu4) ... 1481s Selecting previously unselected package gcc-13-aarch64-linux-gnu. 1481s Preparing to unpack .../016-gcc-13-aarch64-linux-gnu_13.2.0-23ubuntu4_arm64.deb ... 1481s Unpacking gcc-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1482s Selecting previously unselected package gcc-13. 1482s Preparing to unpack .../017-gcc-13_13.2.0-23ubuntu4_arm64.deb ... 1482s Unpacking gcc-13 (13.2.0-23ubuntu4) ... 1482s Selecting previously unselected package gcc-aarch64-linux-gnu. 1482s Preparing to unpack .../018-gcc-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 1482s Unpacking gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1482s Selecting previously unselected package gcc. 1482s Preparing to unpack .../019-gcc_4%3a13.2.0-7ubuntu1_arm64.deb ... 1482s Unpacking gcc (4:13.2.0-7ubuntu1) ... 1482s Selecting previously unselected package libstdc++-13-dev:arm64. 1482s Preparing to unpack .../020-libstdc++-13-dev_13.2.0-23ubuntu4_arm64.deb ... 1482s Unpacking libstdc++-13-dev:arm64 (13.2.0-23ubuntu4) ... 1482s Selecting previously unselected package g++-13-aarch64-linux-gnu. 1482s Preparing to unpack .../021-g++-13-aarch64-linux-gnu_13.2.0-23ubuntu4_arm64.deb ... 1482s Unpacking g++-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1483s Selecting previously unselected package g++-13. 1483s Preparing to unpack .../022-g++-13_13.2.0-23ubuntu4_arm64.deb ... 1483s Unpacking g++-13 (13.2.0-23ubuntu4) ... 1483s Selecting previously unselected package g++-aarch64-linux-gnu. 1483s Preparing to unpack .../023-g++-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 1483s Unpacking g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1483s Selecting previously unselected package g++. 1483s Preparing to unpack .../024-g++_4%3a13.2.0-7ubuntu1_arm64.deb ... 1483s Unpacking g++ (4:13.2.0-7ubuntu1) ... 1483s Selecting previously unselected package build-essential. 1483s Preparing to unpack .../025-build-essential_12.10ubuntu1_arm64.deb ... 1483s Unpacking build-essential (12.10ubuntu1) ... 1483s Selecting previously unselected package dctrl-tools. 1483s Preparing to unpack .../026-dctrl-tools_2.24-3build3_arm64.deb ... 1483s Unpacking dctrl-tools (2.24-3build3) ... 1483s Selecting previously unselected package fontconfig. 1483s Preparing to unpack .../027-fontconfig_2.15.0-1.1ubuntu2_arm64.deb ... 1483s Unpacking fontconfig (2.15.0-1.1ubuntu2) ... 1483s Selecting previously unselected package fonts-glyphicons-halflings. 1483s Preparing to unpack .../028-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 1483s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1483s Selecting previously unselected package fonts-mathjax. 1483s Preparing to unpack .../029-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 1483s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 1483s Selecting previously unselected package libgfortran5:arm64. 1483s Preparing to unpack .../030-libgfortran5_14.1.0-1ubuntu1_arm64.deb ... 1483s Unpacking libgfortran5:arm64 (14.1.0-1ubuntu1) ... 1483s Selecting previously unselected package libgfortran-13-dev:arm64. 1483s Preparing to unpack .../031-libgfortran-13-dev_13.2.0-23ubuntu4_arm64.deb ... 1483s Unpacking libgfortran-13-dev:arm64 (13.2.0-23ubuntu4) ... 1483s Selecting previously unselected package gfortran-13-aarch64-linux-gnu. 1483s Preparing to unpack .../032-gfortran-13-aarch64-linux-gnu_13.2.0-23ubuntu4_arm64.deb ... 1483s Unpacking gfortran-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1484s Selecting previously unselected package gfortran-13. 1484s Preparing to unpack .../033-gfortran-13_13.2.0-23ubuntu4_arm64.deb ... 1484s Unpacking gfortran-13 (13.2.0-23ubuntu4) ... 1484s Selecting previously unselected package gfortran-aarch64-linux-gnu. 1484s Preparing to unpack .../034-gfortran-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 1484s Unpacking gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1484s Selecting previously unselected package gfortran. 1484s Preparing to unpack .../035-gfortran_4%3a13.2.0-7ubuntu1_arm64.deb ... 1484s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 1484s Selecting previously unselected package icu-devtools. 1484s Preparing to unpack .../036-icu-devtools_74.2-1ubuntu3_arm64.deb ... 1484s Unpacking icu-devtools (74.2-1ubuntu3) ... 1484s Selecting previously unselected package libblas3:arm64. 1484s Preparing to unpack .../037-libblas3_3.12.0-3build1_arm64.deb ... 1484s Unpacking libblas3:arm64 (3.12.0-3build1) ... 1484s Selecting previously unselected package libblas-dev:arm64. 1484s Preparing to unpack .../038-libblas-dev_3.12.0-3build1_arm64.deb ... 1484s Unpacking libblas-dev:arm64 (3.12.0-3build1) ... 1484s Selecting previously unselected package libbz2-dev:arm64. 1484s Preparing to unpack .../039-libbz2-dev_1.0.8-5.1_arm64.deb ... 1484s Unpacking libbz2-dev:arm64 (1.0.8-5.1) ... 1484s Selecting previously unselected package libpixman-1-0:arm64. 1484s Preparing to unpack .../040-libpixman-1-0_0.42.2-1build1_arm64.deb ... 1484s Unpacking libpixman-1-0:arm64 (0.42.2-1build1) ... 1484s Selecting previously unselected package libxcb-render0:arm64. 1485s Preparing to unpack .../041-libxcb-render0_1.17.0-2_arm64.deb ... 1485s Unpacking libxcb-render0:arm64 (1.17.0-2) ... 1485s Selecting previously unselected package libxcb-shm0:arm64. 1485s Preparing to unpack .../042-libxcb-shm0_1.17.0-2_arm64.deb ... 1485s Unpacking libxcb-shm0:arm64 (1.17.0-2) ... 1485s Selecting previously unselected package libxrender1:arm64. 1485s Preparing to unpack .../043-libxrender1_1%3a0.9.10-1.1build1_arm64.deb ... 1485s Unpacking libxrender1:arm64 (1:0.9.10-1.1build1) ... 1485s Selecting previously unselected package libcairo2:arm64. 1485s Preparing to unpack .../044-libcairo2_1.18.0-3build1_arm64.deb ... 1485s Unpacking libcairo2:arm64 (1.18.0-3build1) ... 1485s Selecting previously unselected package libdatrie1:arm64. 1485s Preparing to unpack .../045-libdatrie1_0.2.13-3build1_arm64.deb ... 1485s Unpacking libdatrie1:arm64 (0.2.13-3build1) ... 1486s Selecting previously unselected package libdeflate-dev:arm64. 1486s Preparing to unpack .../046-libdeflate-dev_1.20-1_arm64.deb ... 1486s Unpacking libdeflate-dev:arm64 (1.20-1) ... 1486s Selecting previously unselected package libgraphite2-3:arm64. 1486s Preparing to unpack .../047-libgraphite2-3_1.3.14-2build1_arm64.deb ... 1486s Unpacking libgraphite2-3:arm64 (1.3.14-2build1) ... 1486s Selecting previously unselected package libharfbuzz0b:arm64. 1486s Preparing to unpack .../048-libharfbuzz0b_8.3.0-2build2_arm64.deb ... 1486s Unpacking libharfbuzz0b:arm64 (8.3.0-2build2) ... 1486s Selecting previously unselected package x11-common. 1487s Preparing to unpack .../049-x11-common_1%3a7.7+23ubuntu3_all.deb ... 1487s Unpacking x11-common (1:7.7+23ubuntu3) ... 1487s Selecting previously unselected package libice6:arm64. 1488s Preparing to unpack .../050-libice6_2%3a1.0.10-1build3_arm64.deb ... 1488s Unpacking libice6:arm64 (2:1.0.10-1build3) ... 1488s Selecting previously unselected package libicu-dev:arm64. 1488s Preparing to unpack .../051-libicu-dev_74.2-1ubuntu3_arm64.deb ... 1488s Unpacking libicu-dev:arm64 (74.2-1ubuntu3) ... 1488s Selecting previously unselected package libjpeg-turbo8-dev:arm64. 1489s Preparing to unpack .../052-libjpeg-turbo8-dev_2.1.5-2ubuntu2_arm64.deb ... 1489s Unpacking libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu2) ... 1489s Selecting previously unselected package libjpeg8-dev:arm64. 1489s Preparing to unpack .../053-libjpeg8-dev_8c-2ubuntu11_arm64.deb ... 1489s Unpacking libjpeg8-dev:arm64 (8c-2ubuntu11) ... 1489s Selecting previously unselected package libjpeg-dev:arm64. 1490s Preparing to unpack .../054-libjpeg-dev_8c-2ubuntu11_arm64.deb ... 1490s Unpacking libjpeg-dev:arm64 (8c-2ubuntu11) ... 1490s Selecting previously unselected package libjs-bootstrap. 1491s Preparing to unpack .../055-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 1491s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 1491s Selecting previously unselected package libjs-highlight.js. 1491s Preparing to unpack .../056-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 1491s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 1491s Selecting previously unselected package libjs-jquery. 1491s Preparing to unpack .../057-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 1491s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1491s Selecting previously unselected package libjs-jquery-datatables. 1491s Preparing to unpack .../058-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 1491s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 1491s Selecting previously unselected package liblapack3:arm64. 1491s Preparing to unpack .../059-liblapack3_3.12.0-3build1_arm64.deb ... 1491s Unpacking liblapack3:arm64 (3.12.0-3build1) ... 1492s Selecting previously unselected package liblapack-dev:arm64. 1492s Preparing to unpack .../060-liblapack-dev_3.12.0-3build1_arm64.deb ... 1492s Unpacking liblapack-dev:arm64 (3.12.0-3build1) ... 1492s Selecting previously unselected package libncurses-dev:arm64. 1492s Preparing to unpack .../061-libncurses-dev_6.4+20240113-1ubuntu2_arm64.deb ... 1492s Unpacking libncurses-dev:arm64 (6.4+20240113-1ubuntu2) ... 1492s Selecting previously unselected package libthai-data. 1492s Preparing to unpack .../062-libthai-data_0.1.29-2build1_all.deb ... 1492s Unpacking libthai-data (0.1.29-2build1) ... 1492s Selecting previously unselected package libthai0:arm64. 1492s Preparing to unpack .../063-libthai0_0.1.29-2build1_arm64.deb ... 1492s Unpacking libthai0:arm64 (0.1.29-2build1) ... 1492s Selecting previously unselected package libpango-1.0-0:arm64. 1492s Preparing to unpack .../064-libpango-1.0-0_1.52.2+ds-1_arm64.deb ... 1492s Unpacking libpango-1.0-0:arm64 (1.52.2+ds-1) ... 1492s Selecting previously unselected package libpangoft2-1.0-0:arm64. 1492s Preparing to unpack .../065-libpangoft2-1.0-0_1.52.2+ds-1_arm64.deb ... 1492s Unpacking libpangoft2-1.0-0:arm64 (1.52.2+ds-1) ... 1492s Selecting previously unselected package libpangocairo-1.0-0:arm64. 1492s Preparing to unpack .../066-libpangocairo-1.0-0_1.52.2+ds-1_arm64.deb ... 1492s Unpacking libpangocairo-1.0-0:arm64 (1.52.2+ds-1) ... 1492s Selecting previously unselected package libpaper1:arm64. 1492s Preparing to unpack .../067-libpaper1_1.1.29build1_arm64.deb ... 1492s Unpacking libpaper1:arm64 (1.1.29build1) ... 1492s Selecting previously unselected package libpaper-utils. 1492s Preparing to unpack .../068-libpaper-utils_1.1.29build1_arm64.deb ... 1492s Unpacking libpaper-utils (1.1.29build1) ... 1493s Selecting previously unselected package libpcre2-16-0:arm64. 1493s Preparing to unpack .../069-libpcre2-16-0_10.42-4ubuntu2_arm64.deb ... 1493s Unpacking libpcre2-16-0:arm64 (10.42-4ubuntu2) ... 1493s Selecting previously unselected package libpcre2-32-0:arm64. 1493s Preparing to unpack .../070-libpcre2-32-0_10.42-4ubuntu2_arm64.deb ... 1493s Unpacking libpcre2-32-0:arm64 (10.42-4ubuntu2) ... 1493s Selecting previously unselected package libpcre2-posix3:arm64. 1493s Preparing to unpack .../071-libpcre2-posix3_10.42-4ubuntu2_arm64.deb ... 1493s Unpacking libpcre2-posix3:arm64 (10.42-4ubuntu2) ... 1494s Selecting previously unselected package libpcre2-dev:arm64. 1494s Preparing to unpack .../072-libpcre2-dev_10.42-4ubuntu2_arm64.deb ... 1494s Unpacking libpcre2-dev:arm64 (10.42-4ubuntu2) ... 1494s Selecting previously unselected package libpkgconf3:arm64. 1494s Preparing to unpack .../073-libpkgconf3_1.8.1-2build1_arm64.deb ... 1494s Unpacking libpkgconf3:arm64 (1.8.1-2build1) ... 1494s Selecting previously unselected package zlib1g-dev:arm64. 1494s Preparing to unpack .../074-zlib1g-dev_1%3a1.3.dfsg-3.1ubuntu2_arm64.deb ... 1494s Unpacking zlib1g-dev:arm64 (1:1.3.dfsg-3.1ubuntu2) ... 1494s Selecting previously unselected package libpng-dev:arm64. 1495s Preparing to unpack .../075-libpng-dev_1.6.43-5build1_arm64.deb ... 1495s Unpacking libpng-dev:arm64 (1.6.43-5build1) ... 1495s Selecting previously unselected package libreadline-dev:arm64. 1495s Preparing to unpack .../076-libreadline-dev_8.2-4build1_arm64.deb ... 1495s Unpacking libreadline-dev:arm64 (8.2-4build1) ... 1495s Selecting previously unselected package libsm6:arm64. 1495s Preparing to unpack .../077-libsm6_2%3a1.2.3-1build3_arm64.deb ... 1495s Unpacking libsm6:arm64 (2:1.2.3-1build3) ... 1495s Selecting previously unselected package libtcl8.6:arm64. 1495s Preparing to unpack .../078-libtcl8.6_8.6.14+dfsg-1build1_arm64.deb ... 1495s Unpacking libtcl8.6:arm64 (8.6.14+dfsg-1build1) ... 1495s Selecting previously unselected package libxft2:arm64. 1496s Preparing to unpack .../079-libxft2_2.3.6-1build1_arm64.deb ... 1496s Unpacking libxft2:arm64 (2.3.6-1build1) ... 1496s Selecting previously unselected package libxss1:arm64. 1496s Preparing to unpack .../080-libxss1_1%3a1.2.3-1build3_arm64.deb ... 1496s Unpacking libxss1:arm64 (1:1.2.3-1build3) ... 1496s Selecting previously unselected package libtk8.6:arm64. 1496s Preparing to unpack .../081-libtk8.6_8.6.14-1build1_arm64.deb ... 1496s Unpacking libtk8.6:arm64 (8.6.14-1build1) ... 1496s Selecting previously unselected package libxt6t64:arm64. 1496s Preparing to unpack .../082-libxt6t64_1%3a1.2.1-1.2build1_arm64.deb ... 1496s Unpacking libxt6t64:arm64 (1:1.2.1-1.2build1) ... 1496s Selecting previously unselected package node-normalize.css. 1496s Preparing to unpack .../083-node-normalize.css_8.0.1-5_all.deb ... 1496s Unpacking node-normalize.css (8.0.1-5) ... 1496s Selecting previously unselected package zip. 1496s Preparing to unpack .../084-zip_3.0-13build1_arm64.deb ... 1496s Unpacking zip (3.0-13build1) ... 1496s Selecting previously unselected package unzip. 1496s Preparing to unpack .../085-unzip_6.0-28ubuntu4_arm64.deb ... 1496s Unpacking unzip (6.0-28ubuntu4) ... 1496s Selecting previously unselected package xdg-utils. 1496s Preparing to unpack .../086-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 1496s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 1496s Selecting previously unselected package r-base-core. 1497s Preparing to unpack .../087-r-base-core_4.4.0-2_arm64.deb ... 1497s Unpacking r-base-core (4.4.0-2) ... 1497s Selecting previously unselected package liblzma-dev:arm64. 1497s Preparing to unpack .../088-liblzma-dev_5.6.1+really5.4.5-1_arm64.deb ... 1497s Unpacking liblzma-dev:arm64 (5.6.1+really5.4.5-1) ... 1497s Selecting previously unselected package pkgconf-bin. 1497s Preparing to unpack .../089-pkgconf-bin_1.8.1-2build1_arm64.deb ... 1497s Unpacking pkgconf-bin (1.8.1-2build1) ... 1497s Selecting previously unselected package pkgconf:arm64. 1498s Preparing to unpack .../090-pkgconf_1.8.1-2build1_arm64.deb ... 1498s Unpacking pkgconf:arm64 (1.8.1-2build1) ... 1498s Selecting previously unselected package libtirpc-dev:arm64. 1498s Preparing to unpack .../091-libtirpc-dev_1.3.4+ds-1.3_arm64.deb ... 1498s Unpacking libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 1498s Selecting previously unselected package r-base-dev. 1498s Preparing to unpack .../092-r-base-dev_4.4.0-2_all.deb ... 1498s Unpacking r-base-dev (4.4.0-2) ... 1498s Selecting previously unselected package pkg-r-autopkgtest. 1498s Preparing to unpack .../093-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 1498s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 1498s Selecting previously unselected package r-cran-base64enc. 1498s Preparing to unpack .../094-r-cran-base64enc_0.1-3-3_arm64.deb ... 1498s Unpacking r-cran-base64enc (0.1-3-3) ... 1498s Selecting previously unselected package r-cran-cli. 1498s Preparing to unpack .../095-r-cran-cli_3.6.2-1_arm64.deb ... 1498s Unpacking r-cran-cli (3.6.2-1) ... 1498s Selecting previously unselected package r-cran-colorspace. 1498s Preparing to unpack .../096-r-cran-colorspace_2.1-0+dfsg-1_arm64.deb ... 1498s Unpacking r-cran-colorspace (2.1-0+dfsg-1) ... 1498s Selecting previously unselected package r-cran-commonmark. 1498s Preparing to unpack .../097-r-cran-commonmark_1.9.1-1_arm64.deb ... 1498s Unpacking r-cran-commonmark (1.9.1-1) ... 1498s Selecting previously unselected package r-cran-evaluate. 1498s Preparing to unpack .../098-r-cran-evaluate_0.23-1_all.deb ... 1498s Unpacking r-cran-evaluate (0.23-1) ... 1498s Selecting previously unselected package r-cran-fansi. 1498s Preparing to unpack .../099-r-cran-fansi_1.0.5-1_arm64.deb ... 1498s Unpacking r-cran-fansi (1.0.5-1) ... 1498s Selecting previously unselected package r-cran-farver. 1498s Preparing to unpack .../100-r-cran-farver_2.1.1-2_arm64.deb ... 1498s Unpacking r-cran-farver (2.1.1-2) ... 1498s Selecting previously unselected package r-cran-glue. 1498s Preparing to unpack .../101-r-cran-glue_1.7.0-1_arm64.deb ... 1498s Unpacking r-cran-glue (1.7.0-1) ... 1498s Selecting previously unselected package r-cran-rlang. 1498s Preparing to unpack .../102-r-cran-rlang_1.1.3-1_arm64.deb ... 1498s Unpacking r-cran-rlang (1.1.3-1) ... 1498s Selecting previously unselected package r-cran-lifecycle. 1499s Preparing to unpack .../103-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 1499s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 1499s Selecting previously unselected package r-cran-gtable. 1499s Preparing to unpack .../104-r-cran-gtable_0.3.4+dfsg-1_all.deb ... 1499s Unpacking r-cran-gtable (0.3.4+dfsg-1) ... 1499s Selecting previously unselected package r-cran-isoband. 1499s Preparing to unpack .../105-r-cran-isoband_0.2.7-1_arm64.deb ... 1499s Unpacking r-cran-isoband (0.2.7-1) ... 1499s Selecting previously unselected package r-cran-mass. 1499s Preparing to unpack .../106-r-cran-mass_7.3-60.2-1_arm64.deb ... 1499s Unpacking r-cran-mass (7.3-60.2-1) ... 1500s Selecting previously unselected package r-cran-lattice. 1501s Preparing to unpack .../107-r-cran-lattice_0.22-6-1_arm64.deb ... 1501s Unpacking r-cran-lattice (0.22-6-1) ... 1501s Selecting previously unselected package r-cran-nlme. 1501s Preparing to unpack .../108-r-cran-nlme_3.1.164-1build1_arm64.deb ... 1501s Unpacking r-cran-nlme (3.1.164-1build1) ... 1501s Selecting previously unselected package r-cran-matrix. 1502s Preparing to unpack .../109-r-cran-matrix_1.6-5-1_arm64.deb ... 1502s Unpacking r-cran-matrix (1.6-5-1) ... 1502s Selecting previously unselected package r-cran-mgcv. 1502s Preparing to unpack .../110-r-cran-mgcv_1.9-1-1_arm64.deb ... 1502s Unpacking r-cran-mgcv (1.9-1-1) ... 1502s Selecting previously unselected package r-cran-labeling. 1502s Preparing to unpack .../111-r-cran-labeling_0.4.3-1_all.deb ... 1502s Unpacking r-cran-labeling (0.4.3-1) ... 1502s Selecting previously unselected package r-cran-munsell. 1502s Preparing to unpack .../112-r-cran-munsell_0.5.0-2build1_all.deb ... 1502s Unpacking r-cran-munsell (0.5.0-2build1) ... 1502s Selecting previously unselected package r-cran-r6. 1502s Preparing to unpack .../113-r-cran-r6_2.5.1-1_all.deb ... 1502s Unpacking r-cran-r6 (2.5.1-1) ... 1502s Selecting previously unselected package r-cran-rcolorbrewer. 1502s Preparing to unpack .../114-r-cran-rcolorbrewer_1.1-3-1build1_all.deb ... 1502s Unpacking r-cran-rcolorbrewer (1.1-3-1build1) ... 1502s Selecting previously unselected package r-cran-viridislite. 1502s Preparing to unpack .../115-r-cran-viridislite_0.4.2-2_all.deb ... 1502s Unpacking r-cran-viridislite (0.4.2-2) ... 1502s Selecting previously unselected package r-cran-scales. 1502s Preparing to unpack .../116-r-cran-scales_1.3.0-1_all.deb ... 1502s Unpacking r-cran-scales (1.3.0-1) ... 1502s Selecting previously unselected package r-cran-magrittr. 1502s Preparing to unpack .../117-r-cran-magrittr_2.0.3-1_arm64.deb ... 1502s Unpacking r-cran-magrittr (2.0.3-1) ... 1502s Selecting previously unselected package r-cran-utf8. 1502s Preparing to unpack .../118-r-cran-utf8_1.2.4-1_arm64.deb ... 1502s Unpacking r-cran-utf8 (1.2.4-1) ... 1503s Selecting previously unselected package r-cran-vctrs. 1503s Preparing to unpack .../119-r-cran-vctrs_0.6.5-1_arm64.deb ... 1503s Unpacking r-cran-vctrs (0.6.5-1) ... 1503s Selecting previously unselected package r-cran-pillar. 1503s Preparing to unpack .../120-r-cran-pillar_1.9.0+dfsg-1_all.deb ... 1503s Unpacking r-cran-pillar (1.9.0+dfsg-1) ... 1503s Selecting previously unselected package r-cran-pkgconfig. 1503s Preparing to unpack .../121-r-cran-pkgconfig_2.0.3-2build1_all.deb ... 1503s Unpacking r-cran-pkgconfig (2.0.3-2build1) ... 1503s Selecting previously unselected package r-cran-tibble. 1503s Preparing to unpack .../122-r-cran-tibble_3.2.1+dfsg-2_arm64.deb ... 1503s Unpacking r-cran-tibble (3.2.1+dfsg-2) ... 1503s Selecting previously unselected package r-cran-withr. 1503s Preparing to unpack .../123-r-cran-withr_2.5.0-1_all.deb ... 1503s Unpacking r-cran-withr (2.5.0-1) ... 1503s Selecting previously unselected package r-cran-ggplot2. 1504s Preparing to unpack .../124-r-cran-ggplot2_3.5.1+dfsg-1_all.deb ... 1504s Unpacking r-cran-ggplot2 (3.5.1+dfsg-1) ... 1504s Selecting previously unselected package r-cran-xfun. 1504s Preparing to unpack .../125-r-cran-xfun_0.44+dfsg-1_arm64.deb ... 1504s Unpacking r-cran-xfun (0.44+dfsg-1) ... 1504s Selecting previously unselected package r-cran-highr. 1504s Preparing to unpack .../126-r-cran-highr_0.10+dfsg-2_all.deb ... 1504s Unpacking r-cran-highr (0.10+dfsg-2) ... 1504s Selecting previously unselected package r-cran-yaml. 1504s Preparing to unpack .../127-r-cran-yaml_2.3.8-2_arm64.deb ... 1504s Unpacking r-cran-yaml (2.3.8-2) ... 1504s Selecting previously unselected package libjs-mathjax. 1504s Preparing to unpack .../128-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 1504s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 1505s Selecting previously unselected package r-cran-knitr. 1506s Preparing to unpack .../129-r-cran-knitr_1.46+dfsg-1_all.deb ... 1506s Unpacking r-cran-knitr (1.46+dfsg-1) ... 1506s Selecting previously unselected package r-cran-markdown. 1506s Preparing to unpack .../130-r-cran-markdown_1.12+dfsg-2_all.deb ... 1506s Unpacking r-cran-markdown (1.12+dfsg-2) ... 1506s Selecting previously unselected package r-cran-matrixstats. 1507s Preparing to unpack .../131-r-cran-matrixstats_1.2.0-1_arm64.deb ... 1507s Unpacking r-cran-matrixstats (1.2.0-1) ... 1507s Selecting previously unselected package autopkgtest-satdep. 1508s Preparing to unpack .../132-2-autopkgtest-satdep.deb ... 1508s Unpacking autopkgtest-satdep (0) ... 1509s Setting up libgraphite2-3:arm64 (1.3.14-2build1) ... 1509s Setting up libpixman-1-0:arm64 (0.42.2-1build1) ... 1509s Setting up libpaper1:arm64 (1.1.29build1) ... 1511s 1511s Creating config file /etc/papersize with new version 1512s Setting up fontconfig (2.15.0-1.1ubuntu2) ... 1515s Regenerating fonts cache... done. 1515s Setting up libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu2) ... 1515s Setting up libncurses-dev:arm64 (6.4+20240113-1ubuntu2) ... 1515s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 1515s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 1515s Setting up libxrender1:arm64 (1:0.9.10-1.1build1) ... 1515s Setting up libdatrie1:arm64 (0.2.13-3build1) ... 1515s Setting up libxcb-render0:arm64 (1.17.0-2) ... 1515s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1515s Setting up unzip (6.0-28ubuntu4) ... 1515s Setting up x11-common (1:7.7+23ubuntu3) ... 1518s Setting up libxcb-shm0:arm64 (1.17.0-2) ... 1518s Setting up libpaper-utils (1.1.29build1) ... 1518s Setting up libreadline-dev:arm64 (8.2-4build1) ... 1518s Setting up libgomp1:arm64 (14.1.0-1ubuntu1) ... 1518s Setting up libcairo2:arm64 (1.18.0-3build1) ... 1518s Setting up libpcre2-16-0:arm64 (10.42-4ubuntu2) ... 1518s Setting up zip (3.0-13build1) ... 1518s Setting up libpcre2-32-0:arm64 (10.42-4ubuntu2) ... 1518s Setting up libblas3:arm64 (3.12.0-3build1) ... 1518s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 1518s Setting up libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 1518s Setting up libpkgconf3:arm64 (1.8.1-2build1) ... 1518s Setting up libmpc3:arm64 (1.3.1-1build1) ... 1518s Setting up libatomic1:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libtcl8.6:arm64 (8.6.14+dfsg-1build1) ... 1519s Setting up icu-devtools (74.2-1ubuntu3) ... 1519s Setting up pkgconf-bin (1.8.1-2build1) ... 1519s Setting up libgfortran5:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up liblzma-dev:arm64 (5.6.1+really5.4.5-1) ... 1519s Setting up libubsan1:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up zlib1g-dev:arm64 (1:1.3.dfsg-3.1ubuntu2) ... 1519s Setting up libpcre2-posix3:arm64 (10.42-4ubuntu2) ... 1519s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 1519s Setting up libhwasan0:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libasan8:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libharfbuzz0b:arm64 (8.3.0-2build2) ... 1519s Setting up libthai-data (0.1.29-2build1) ... 1519s Setting up libxss1:arm64 (1:1.2.3-1build3) ... 1519s Setting up libtsan2:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1519s Setting up libjpeg8-dev:arm64 (8c-2ubuntu11) ... 1519s Setting up libisl23:arm64 (0.26-3build1) ... 1519s Setting up libdeflate-dev:arm64 (1.20-1) ... 1519s Setting up node-normalize.css (8.0.1-5) ... 1519s Setting up libicu-dev:arm64 (74.2-1ubuntu3) ... 1519s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 1519s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 1519s Setting up libcc1-0:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up liblsan0:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libblas-dev:arm64 (3.12.0-3build1) ... 1519s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so to provide /usr/lib/aarch64-linux-gnu/libblas.so (libblas.so-aarch64-linux-gnu) in auto mode 1519s Setting up dctrl-tools (2.24-3build3) ... 1519s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 1519s Setting up libitm1:arm64 (14.1.0-1ubuntu1) ... 1519s Setting up libbz2-dev:arm64 (1.0.8-5.1) ... 1519s Setting up libice6:arm64 (2:1.0.10-1build3) ... 1519s Setting up liblapack3:arm64 (3.12.0-3build1) ... 1519s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 1519s Setting up libxft2:arm64 (2.3.6-1build1) ... 1519s Setting up libpcre2-dev:arm64 (10.42-4ubuntu2) ... 1519s Setting up cpp-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1519s Setting up libtk8.6:arm64 (8.6.14-1build1) ... 1519s Setting up libpng-dev:arm64 (1.6.43-5build1) ... 1519s Setting up libjpeg-dev:arm64 (8c-2ubuntu11) ... 1519s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 1519s Setting up pkgconf:arm64 (1.8.1-2build1) ... 1519s Setting up libthai0:arm64 (0.1.29-2build1) ... 1519s Setting up cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1519s Setting up liblapack-dev:arm64 (3.12.0-3build1) ... 1519s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so to provide /usr/lib/aarch64-linux-gnu/liblapack.so (liblapack.so-aarch64-linux-gnu) in auto mode 1519s Setting up libgcc-13-dev:arm64 (13.2.0-23ubuntu4) ... 1519s Setting up libgfortran-13-dev:arm64 (13.2.0-23ubuntu4) ... 1519s Setting up libsm6:arm64 (2:1.2.3-1build3) ... 1519s Setting up libstdc++-13-dev:arm64 (13.2.0-23ubuntu4) ... 1519s Setting up cpp-13 (13.2.0-23ubuntu4) ... 1519s Setting up libpango-1.0-0:arm64 (1.52.2+ds-1) ... 1519s Setting up gcc-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1519s Setting up libxt6t64:arm64 (1:1.2.1-1.2build1) ... 1519s Setting up gcc-13 (13.2.0-23ubuntu4) ... 1519s Setting up cpp (4:13.2.0-7ubuntu1) ... 1519s Setting up libpangoft2-1.0-0:arm64 (1.52.2+ds-1) ... 1519s Setting up libpangocairo-1.0-0:arm64 (1.52.2+ds-1) ... 1519s Setting up g++-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1519s Setting up gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1519s Setting up g++-13 (13.2.0-23ubuntu4) ... 1519s Setting up gfortran-13-aarch64-linux-gnu (13.2.0-23ubuntu4) ... 1519s Setting up gcc (4:13.2.0-7ubuntu1) ... 1519s Setting up gfortran-13 (13.2.0-23ubuntu4) ... 1519s Setting up r-base-core (4.4.0-2) ... 1519s 1519s Creating config file /etc/R/Renviron with new version 1519s Setting up r-cran-labeling (0.4.3-1) ... 1519s Setting up r-cran-lattice (0.22-6-1) ... 1519s Setting up r-cran-nlme (3.1.164-1build1) ... 1519s Setting up r-cran-farver (2.1.1-2) ... 1519s Setting up r-cran-viridislite (0.4.2-2) ... 1519s Setting up g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1519s Setting up gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 1519s Setting up r-cran-commonmark (1.9.1-1) ... 1519s Setting up r-cran-r6 (2.5.1-1) ... 1519s Setting up r-cran-magrittr (2.0.3-1) ... 1519s Setting up r-cran-rlang (1.1.3-1) ... 1519s Setting up r-cran-matrixstats (1.2.0-1) ... 1519s Setting up r-cran-xfun (0.44+dfsg-1) ... 1519s Setting up r-cran-withr (2.5.0-1) ... 1519s Setting up r-cran-base64enc (0.1-3-3) ... 1519s Setting up r-cran-yaml (2.3.8-2) ... 1519s Setting up r-cran-evaluate (0.23-1) ... 1519s Setting up r-cran-highr (0.10+dfsg-2) ... 1519s Setting up r-cran-fansi (1.0.5-1) ... 1519s Setting up r-cran-mass (7.3-60.2-1) ... 1519s Setting up r-cran-glue (1.7.0-1) ... 1519s Setting up r-cran-cli (3.6.2-1) ... 1519s Setting up gfortran (4:13.2.0-7ubuntu1) ... 1519s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 1519s 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 1519s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 1519s 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 1519s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 1519s Setting up r-cran-pkgconfig (2.0.3-2build1) ... 1519s Setting up r-cran-utf8 (1.2.4-1) ... 1519s Setting up r-cran-colorspace (2.1-0+dfsg-1) ... 1519s Setting up r-cran-markdown (1.12+dfsg-2) ... 1519s Setting up r-cran-rcolorbrewer (1.1-3-1build1) ... 1519s Setting up r-cran-isoband (0.2.7-1) ... 1519s Setting up r-cran-gtable (0.3.4+dfsg-1) ... 1519s Setting up r-cran-matrix (1.6-5-1) ... 1519s Setting up r-cran-knitr (1.46+dfsg-1) ... 1519s Setting up r-cran-mgcv (1.9-1-1) ... 1519s Setting up g++ (4:13.2.0-7ubuntu1) ... 1519s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 1519s Setting up build-essential (12.10ubuntu1) ... 1519s Setting up r-cran-vctrs (0.6.5-1) ... 1519s Setting up r-cran-pillar (1.9.0+dfsg-1) ... 1519s Setting up r-base-dev (4.4.0-2) ... 1519s Setting up r-cran-munsell (0.5.0-2build1) ... 1519s Setting up r-cran-tibble (3.2.1+dfsg-2) ... 1519s Setting up r-cran-scales (1.3.0-1) ... 1519s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 1519s Setting up r-cran-ggplot2 (3.5.1+dfsg-1) ... 1519s Setting up autopkgtest-satdep (0) ... 1519s Processing triggers for man-db (2.12.1-1) ... 1521s Processing triggers for install-info (7.1-3build2) ... 1521s Processing triggers for libc-bin (2.39-0ubuntu8.1) ... 1535s (Reading database ... 90574 files and directories currently installed.) 1535s Removing autopkgtest-satdep (0) ... 1560s autopkgtest [10:09:54]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 1560s autopkgtest [10:09:54]: test pkg-r-autopkgtest: [----------------------- 1561s Test: Try to load the R library matrixStats 1561s 1561s R version 4.4.0 (2024-04-24) -- "Puppy Cup" 1561s Copyright (C) 2024 The R Foundation for Statistical Computing 1561s Platform: aarch64-unknown-linux-gnu 1561s 1561s R is free software and comes with ABSOLUTELY NO WARRANTY. 1561s You are welcome to redistribute it under certain conditions. 1561s Type 'license()' or 'licence()' for distribution details. 1561s 1561s R is a collaborative project with many contributors. 1561s Type 'contributors()' for more information and 1561s 'citation()' on how to cite R or R packages in publications. 1561s 1561s Type 'demo()' for some demos, 'help()' for on-line help, or 1561s 'help.start()' for an HTML browser interface to help. 1561s Type 'q()' to quit R. 1561s 1561s > library('matrixStats') 1561s > 1561s > 1561s Other tests are currently unsupported! 1561s They will be progressively added. 1562s autopkgtest [10:09:56]: test pkg-r-autopkgtest: -----------------------] 1562s autopkgtest [10:09:56]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 1562s pkg-r-autopkgtest PASS 1563s autopkgtest [10:09:57]: @@@@@@@@@@@@@@@@@@@@ summary 1563s run-unit-test PASS 1563s pkg-r-autopkgtest PASS