| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-18 11:37 -0400 (Sat, 18 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 alpha (2026-04-05 r89794) | 4957 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-04-08 r89818) | 4686 |
| kunpeng2 | Linux (openEuler 24.03 LTS) | aarch64 | R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" | 4627 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 259/2404 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| kunpeng2 | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. - See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-04-17 03:08:54 -0000 (Fri, 17 Apr 2026) |
| EndedAt: 2026-04-17 03:09:30 -0000 (Fri, 17 Apr 2026) |
| EllapsedTime: 36.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-02-19 r87757)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS-SP1)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 2 NOTEs
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/R/R-devel_2025-02-19/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R/lib -lR
installing to /home/biocbuild/R/R-devel_2025-02-19/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.323 0.043 0.353
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 477833 25.6 1045337 55.9 639800 34.2
Vcells 884297 6.8 8388608 64.0 2080696 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Apr 17 03:09:25 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Apr 17 03:09:25 2026"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x3db506e0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Apr 17 03:09:25 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Apr 17 03:09:25 2026"
>
> ColMode(tmp2)
<pointer: 0x3db506e0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.2767804 0.3978958 0.1453471 -0.05330845
[2,] -0.5473780 -1.9659994 0.2098934 -0.38849820
[3,] 1.1730334 -0.5966537 0.2089724 -1.54500879
[4,] 0.4274613 -1.0406929 0.5636316 -1.44435812
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.2767804 0.3978958 0.1453471 0.05330845
[2,] 0.5473780 1.9659994 0.2098934 0.38849820
[3,] 1.1730334 0.5966537 0.2089724 1.54500879
[4,] 0.4274613 1.0406929 0.5636316 1.44435812
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0138295 0.6307898 0.3812441 0.2308862
[2,] 0.7398500 1.4021410 0.4581413 0.6232962
[3,] 1.0830667 0.7724336 0.4571350 1.2429838
[4,] 0.6538053 1.0201436 0.7507540 1.2018145
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.41508 31.70579 28.95779 27.36217
[2,] 32.94588 40.98741 29.79131 31.62146
[3,] 37.00370 33.32099 29.78032 38.97485
[4,] 31.96551 36.24213 33.07117 38.46250
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3eca6b20>
> exp(tmp5)
<pointer: 0x3eca6b20>
> log(tmp5,2)
<pointer: 0x3eca6b20>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.1719
> Min(tmp5)
[1] 53.1363
> mean(tmp5)
[1] 73.25442
> Sum(tmp5)
[1] 14650.88
> Var(tmp5)
[1] 863.9367
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.33796 74.36085 68.64403 71.07887 72.20942 71.75928 69.88934 72.17982
[9] 70.91321 71.17145
> rowSums(tmp5)
[1] 1806.759 1487.217 1372.881 1421.577 1444.188 1435.186 1397.787 1443.596
[9] 1418.264 1423.429
> rowVars(tmp5)
[1] 8061.08274 68.17418 42.74335 63.59067 38.79525 65.81885
[7] 55.13826 89.58721 83.01559 117.82624
> rowSd(tmp5)
[1] 89.783533 8.256766 6.537840 7.974376 6.228584 8.112882 7.425514
[8] 9.465052 9.111289 10.854780
> rowMax(tmp5)
[1] 469.17194 86.80271 81.12104 86.19210 82.83985 82.99270 86.68295
[8] 87.95861 92.20960 102.02880
> rowMin(tmp5)
[1] 56.95077 61.65252 54.90858 59.99489 58.45256 56.38479 55.08306 53.13630
[9] 58.02887 57.38978
>
> colMeans(tmp5)
[1] 114.61100 73.46561 70.68922 69.56351 70.68133 69.44311 73.34015
[8] 73.31839 66.69328 74.78001 74.08294 71.57428 73.20272 67.00594
[15] 71.85173 72.05126 64.73186 74.06745 69.07545 70.85922
> colSums(tmp5)
[1] 1146.1100 734.6561 706.8922 695.6351 706.8133 694.4311 733.4015
[8] 733.1839 666.9328 747.8001 740.8294 715.7428 732.0272 670.0594
[15] 718.5173 720.5126 647.3186 740.6745 690.7545 708.5922
> colVars(tmp5)
[1] 15557.97008 65.39951 74.07829 90.81051 37.07636 91.85477
[7] 70.53719 50.37042 47.90358 185.39329 121.95352 35.15475
[13] 105.36270 80.52497 48.16705 47.91270 49.96578 75.63752
[19] 26.67238 84.72623
> colSd(tmp5)
[1] 124.731592 8.086996 8.606875 9.529455 6.089036 9.584089
[7] 8.398642 7.097212 6.921241 13.615920 11.043257 5.929144
[13] 10.264634 8.973571 6.940249 6.921900 7.068648 8.696983
[19] 5.164531 9.204685
> colMax(tmp5)
[1] 469.17194 85.30992 85.99541 81.12104 79.11028 82.72440 86.80271
[8] 82.09977 83.37346 102.02880 92.20960 85.53881 92.61262 86.68295
[15] 80.66388 81.98793 77.19483 86.19210 77.30640 87.95861
> colMin(tmp5)
[1] 66.53203 57.38978 60.27184 56.95077 62.18053 56.38479 62.35083 61.48322
[9] 60.60527 55.08306 60.06050 64.70976 58.60666 54.90858 61.37879 61.04745
[17] 53.13630 59.68305 61.21803 59.40079
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.33796 74.36085 68.64403 71.07887 72.20942 71.75928 NA 72.17982
[9] 70.91321 71.17145
> rowSums(tmp5)
[1] 1806.759 1487.217 1372.881 1421.577 1444.188 1435.186 NA 1443.596
[9] 1418.264 1423.429
> rowVars(tmp5)
[1] 8061.08274 68.17418 42.74335 63.59067 38.79525 65.81885
[7] 56.31647 89.58721 83.01559 117.82624
> rowSd(tmp5)
[1] 89.783533 8.256766 6.537840 7.974376 6.228584 8.112882 7.504430
[8] 9.465052 9.111289 10.854780
> rowMax(tmp5)
[1] 469.17194 86.80271 81.12104 86.19210 82.83985 82.99270 NA
[8] 87.95861 92.20960 102.02880
> rowMin(tmp5)
[1] 56.95077 61.65252 54.90858 59.99489 58.45256 56.38479 NA 53.13630
[9] 58.02887 57.38978
>
> colMeans(tmp5)
[1] 114.61100 73.46561 70.68922 69.56351 70.68133 69.44311 73.34015
[8] 73.31839 66.69328 74.78001 74.08294 71.57428 73.20272 67.00594
[15] 71.85173 72.05126 64.73186 74.06745 NA 70.85922
> colSums(tmp5)
[1] 1146.1100 734.6561 706.8922 695.6351 706.8133 694.4311 733.4015
[8] 733.1839 666.9328 747.8001 740.8294 715.7428 732.0272 670.0594
[15] 718.5173 720.5126 647.3186 740.6745 NA 708.5922
> colVars(tmp5)
[1] 15557.97008 65.39951 74.07829 90.81051 37.07636 91.85477
[7] 70.53719 50.37042 47.90358 185.39329 121.95352 35.15475
[13] 105.36270 80.52497 48.16705 47.91270 49.96578 75.63752
[19] NA 84.72623
> colSd(tmp5)
[1] 124.731592 8.086996 8.606875 9.529455 6.089036 9.584089
[7] 8.398642 7.097212 6.921241 13.615920 11.043257 5.929144
[13] 10.264634 8.973571 6.940249 6.921900 7.068648 8.696983
[19] NA 9.204685
> colMax(tmp5)
[1] 469.17194 85.30992 85.99541 81.12104 79.11028 82.72440 86.80271
[8] 82.09977 83.37346 102.02880 92.20960 85.53881 92.61262 86.68295
[15] 80.66388 81.98793 77.19483 86.19210 NA 87.95861
> colMin(tmp5)
[1] 66.53203 57.38978 60.27184 56.95077 62.18053 56.38479 62.35083 61.48322
[9] 60.60527 55.08306 60.06050 64.70976 58.60666 54.90858 61.37879 61.04745
[17] 53.13630 59.68305 NA 59.40079
>
> Max(tmp5,na.rm=TRUE)
[1] 469.1719
> Min(tmp5,na.rm=TRUE)
[1] 53.1363
> mean(tmp5,na.rm=TRUE)
[1] 73.29986
> Sum(tmp5,na.rm=TRUE)
[1] 14586.67
> Var(tmp5,na.rm=TRUE)
[1] 867.885
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.33796 74.36085 68.64403 71.07887 72.20942 71.75928 70.18815 72.17982
[9] 70.91321 71.17145
> rowSums(tmp5,na.rm=TRUE)
[1] 1806.759 1487.217 1372.881 1421.577 1444.188 1435.186 1333.575 1443.596
[9] 1418.264 1423.429
> rowVars(tmp5,na.rm=TRUE)
[1] 8061.08274 68.17418 42.74335 63.59067 38.79525 65.81885
[7] 56.31647 89.58721 83.01559 117.82624
> rowSd(tmp5,na.rm=TRUE)
[1] 89.783533 8.256766 6.537840 7.974376 6.228584 8.112882 7.504430
[8] 9.465052 9.111289 10.854780
> rowMax(tmp5,na.rm=TRUE)
[1] 469.17194 86.80271 81.12104 86.19210 82.83985 82.99270 86.68295
[8] 87.95861 92.20960 102.02880
> rowMin(tmp5,na.rm=TRUE)
[1] 56.95077 61.65252 54.90858 59.99489 58.45256 56.38479 55.08306 53.13630
[9] 58.02887 57.38978
>
> colMeans(tmp5,na.rm=TRUE)
[1] 114.61100 73.46561 70.68922 69.56351 70.68133 69.44311 73.34015
[8] 73.31839 66.69328 74.78001 74.08294 71.57428 73.20272 67.00594
[15] 71.85173 72.05126 64.73186 74.06745 69.61586 70.85922
> colSums(tmp5,na.rm=TRUE)
[1] 1146.1100 734.6561 706.8922 695.6351 706.8133 694.4311 733.4015
[8] 733.1839 666.9328 747.8001 740.8294 715.7428 732.0272 670.0594
[15] 718.5173 720.5126 647.3186 740.6745 626.5427 708.5922
> colVars(tmp5,na.rm=TRUE)
[1] 15557.97008 65.39951 74.07829 90.81051 37.07636 91.85477
[7] 70.53719 50.37042 47.90358 185.39329 121.95352 35.15475
[13] 105.36270 80.52497 48.16705 47.91270 49.96578 75.63752
[19] 26.72103 84.72623
> colSd(tmp5,na.rm=TRUE)
[1] 124.731592 8.086996 8.606875 9.529455 6.089036 9.584089
[7] 8.398642 7.097212 6.921241 13.615920 11.043257 5.929144
[13] 10.264634 8.973571 6.940249 6.921900 7.068648 8.696983
[19] 5.169239 9.204685
> colMax(tmp5,na.rm=TRUE)
[1] 469.17194 85.30992 85.99541 81.12104 79.11028 82.72440 86.80271
[8] 82.09977 83.37346 102.02880 92.20960 85.53881 92.61262 86.68295
[15] 80.66388 81.98793 77.19483 86.19210 77.30640 87.95861
> colMin(tmp5,na.rm=TRUE)
[1] 66.53203 57.38978 60.27184 56.95077 62.18053 56.38479 62.35083 61.48322
[9] 60.60527 55.08306 60.06050 64.70976 58.60666 54.90858 61.37879 61.04745
[17] 53.13630 59.68305 61.21803 59.40079
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.33796 74.36085 68.64403 71.07887 72.20942 71.75928 NaN 72.17982
[9] 70.91321 71.17145
> rowSums(tmp5,na.rm=TRUE)
[1] 1806.759 1487.217 1372.881 1421.577 1444.188 1435.186 0.000 1443.596
[9] 1418.264 1423.429
> rowVars(tmp5,na.rm=TRUE)
[1] 8061.08274 68.17418 42.74335 63.59067 38.79525 65.81885
[7] NA 89.58721 83.01559 117.82624
> rowSd(tmp5,na.rm=TRUE)
[1] 89.783533 8.256766 6.537840 7.974376 6.228584 8.112882 NA
[8] 9.465052 9.111289 10.854780
> rowMax(tmp5,na.rm=TRUE)
[1] 469.17194 86.80271 81.12104 86.19210 82.83985 82.99270 NA
[8] 87.95861 92.20960 102.02880
> rowMin(tmp5,na.rm=TRUE)
[1] 56.95077 61.65252 54.90858 59.99489 58.45256 56.38479 NA 53.13630
[9] 58.02887 57.38978
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 118.69680 73.13013 70.78681 69.90839 70.87223 69.90134 74.17177
[8] 74.13443 67.12208 76.96856 74.93084 71.51360 72.76198 64.81961
[15] 71.28313 71.49933 64.27007 75.66572 NaN 70.51377
> colSums(tmp5,na.rm=TRUE)
[1] 1068.2712 658.1712 637.0813 629.1755 637.8501 629.1120 667.5459
[8] 667.2098 604.0987 692.7170 674.3776 643.6224 654.8578 583.3765
[15] 641.5482 643.4940 578.4307 680.9915 0.0000 634.6239
> colVars(tmp5,na.rm=TRUE)
[1] 17314.91230 72.30825 83.23093 100.82371 41.30092 100.97438
[7] 71.57405 49.17523 51.82299 154.68274 129.10964 39.50768
[13] 116.34765 36.81493 50.55074 50.47480 53.81249 56.35456
[19] NA 93.97450
> colSd(tmp5,na.rm=TRUE)
[1] 131.586140 8.503426 9.123099 10.041101 6.426579 10.048601
[7] 8.460145 7.012505 7.198818 12.437152 11.362642 6.285513
[13] 10.786457 6.067531 7.109905 7.104562 7.335700 7.506967
[19] NA 9.694044
> colMax(tmp5,na.rm=TRUE)
[1] 469.17194 85.30992 85.99541 81.12104 79.11028 82.72440 86.80271
[8] 82.09977 83.37346 102.02880 92.20960 85.53881 92.61262 74.78364
[15] 80.66388 81.98793 77.19483 86.19210 -Inf 87.95861
> colMin(tmp5,na.rm=TRUE)
[1] 66.53203 57.38978 60.27184 56.95077 62.18053 56.38479 62.35083 61.48322
[9] 60.60527 58.41894 60.06050 64.70976 58.60666 54.90858 61.37879 61.04745
[17] 53.13630 64.81822 Inf 59.40079
>
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col <- 1
> cat(which.row," ",which.col,"\n")
3 1
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> rowVars(tmp5,na.rm=TRUE)
[1] 266.4854 423.9038 152.5244 253.1490 347.9722 165.2504 293.7849 259.3932
[9] 369.7627 166.8000
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 266.4854 423.9038 152.5244 253.1490 347.9722 165.2504 293.7849 259.3932
[9] 369.7627 166.8000
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -1.705303e-13 2.273737e-13 0.000000e+00 5.684342e-14 -2.842171e-14
[6] 1.421085e-14 5.684342e-14 1.421085e-13 3.410605e-13 -8.526513e-14
[11] -5.684342e-14 -2.842171e-14 2.842171e-14 -5.684342e-14 5.684342e-14
[16] 0.000000e+00 5.684342e-14 -5.684342e-14 -2.842171e-14 -1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 11
3 2
6 12
10 20
1 6
10 19
7 6
9 8
7 15
10 11
8 14
5 8
3 5
10 8
2 11
10 12
7 4
2 18
6 7
7 15
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 1.854303
> Min(tmp)
[1] -1.734629
> mean(tmp)
[1] -0.0001718263
> Sum(tmp)
[1] -0.01718263
> Var(tmp)
[1] 0.7514307
>
> rowMeans(tmp)
[1] -0.0001718263
> rowSums(tmp)
[1] -0.01718263
> rowVars(tmp)
[1] 0.7514307
> rowSd(tmp)
[1] 0.866851
> rowMax(tmp)
[1] 1.854303
> rowMin(tmp)
[1] -1.734629
>
> colMeans(tmp)
[1] 0.613471122 0.001698407 -0.778713908 0.319672381 0.353995501
[6] -0.573013431 0.690837940 0.614788746 0.561829577 -0.892856010
[11] -0.321586718 -0.523487612 0.262445545 -1.279737771 1.350918005
[16] 1.016313128 0.214316783 -1.734628534 -1.156146756 1.752233375
[21] 0.055325285 -1.585639886 0.863706518 -0.168996526 0.811422344
[26] 0.179863963 -0.602540272 1.216463895 0.306994894 -0.008822418
[31] 0.714873970 -0.351287713 -0.827601744 1.358037369 -0.146060160
[36] -1.080692221 -0.288661486 -0.663110552 0.214276025 0.026377125
[41] 1.227788356 0.608903001 0.862820765 -0.775258879 -1.724240915
[46] 1.288108617 -0.260304697 -1.571084501 -0.559922946 -1.388490896
[51] 1.838969590 0.074031556 -0.813790434 -0.912672987 -0.791662418
[56] -0.535117887 -0.098226010 -1.238524465 -0.427525209 1.188656435
[61] -1.527912688 -0.977102468 -0.256972790 -0.462352864 0.447133636
[66] 0.149996341 1.207866161 -0.819385269 0.209800225 -0.075356819
[71] -0.771414253 0.998419895 -1.117741375 0.549033638 0.532293358
[76] 0.609442166 0.139308186 -0.030600035 0.771011475 -0.380659989
[81] -0.171561298 0.627152469 0.899984418 0.385160281 -1.007804982
[86] 0.308124112 -1.057320225 -0.175883100 -1.200749118 1.000421704
[91] 1.854303491 1.267835567 -0.806592729 -0.080309895 1.559650112
[96] -0.129007230 0.423659220 0.920248341 -0.503080997 0.165046440
> colSums(tmp)
[1] 0.613471122 0.001698407 -0.778713908 0.319672381 0.353995501
[6] -0.573013431 0.690837940 0.614788746 0.561829577 -0.892856010
[11] -0.321586718 -0.523487612 0.262445545 -1.279737771 1.350918005
[16] 1.016313128 0.214316783 -1.734628534 -1.156146756 1.752233375
[21] 0.055325285 -1.585639886 0.863706518 -0.168996526 0.811422344
[26] 0.179863963 -0.602540272 1.216463895 0.306994894 -0.008822418
[31] 0.714873970 -0.351287713 -0.827601744 1.358037369 -0.146060160
[36] -1.080692221 -0.288661486 -0.663110552 0.214276025 0.026377125
[41] 1.227788356 0.608903001 0.862820765 -0.775258879 -1.724240915
[46] 1.288108617 -0.260304697 -1.571084501 -0.559922946 -1.388490896
[51] 1.838969590 0.074031556 -0.813790434 -0.912672987 -0.791662418
[56] -0.535117887 -0.098226010 -1.238524465 -0.427525209 1.188656435
[61] -1.527912688 -0.977102468 -0.256972790 -0.462352864 0.447133636
[66] 0.149996341 1.207866161 -0.819385269 0.209800225 -0.075356819
[71] -0.771414253 0.998419895 -1.117741375 0.549033638 0.532293358
[76] 0.609442166 0.139308186 -0.030600035 0.771011475 -0.380659989
[81] -0.171561298 0.627152469 0.899984418 0.385160281 -1.007804982
[86] 0.308124112 -1.057320225 -0.175883100 -1.200749118 1.000421704
[91] 1.854303491 1.267835567 -0.806592729 -0.080309895 1.559650112
[96] -0.129007230 0.423659220 0.920248341 -0.503080997 0.165046440
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 0.613471122 0.001698407 -0.778713908 0.319672381 0.353995501
[6] -0.573013431 0.690837940 0.614788746 0.561829577 -0.892856010
[11] -0.321586718 -0.523487612 0.262445545 -1.279737771 1.350918005
[16] 1.016313128 0.214316783 -1.734628534 -1.156146756 1.752233375
[21] 0.055325285 -1.585639886 0.863706518 -0.168996526 0.811422344
[26] 0.179863963 -0.602540272 1.216463895 0.306994894 -0.008822418
[31] 0.714873970 -0.351287713 -0.827601744 1.358037369 -0.146060160
[36] -1.080692221 -0.288661486 -0.663110552 0.214276025 0.026377125
[41] 1.227788356 0.608903001 0.862820765 -0.775258879 -1.724240915
[46] 1.288108617 -0.260304697 -1.571084501 -0.559922946 -1.388490896
[51] 1.838969590 0.074031556 -0.813790434 -0.912672987 -0.791662418
[56] -0.535117887 -0.098226010 -1.238524465 -0.427525209 1.188656435
[61] -1.527912688 -0.977102468 -0.256972790 -0.462352864 0.447133636
[66] 0.149996341 1.207866161 -0.819385269 0.209800225 -0.075356819
[71] -0.771414253 0.998419895 -1.117741375 0.549033638 0.532293358
[76] 0.609442166 0.139308186 -0.030600035 0.771011475 -0.380659989
[81] -0.171561298 0.627152469 0.899984418 0.385160281 -1.007804982
[86] 0.308124112 -1.057320225 -0.175883100 -1.200749118 1.000421704
[91] 1.854303491 1.267835567 -0.806592729 -0.080309895 1.559650112
[96] -0.129007230 0.423659220 0.920248341 -0.503080997 0.165046440
> colMin(tmp)
[1] 0.613471122 0.001698407 -0.778713908 0.319672381 0.353995501
[6] -0.573013431 0.690837940 0.614788746 0.561829577 -0.892856010
[11] -0.321586718 -0.523487612 0.262445545 -1.279737771 1.350918005
[16] 1.016313128 0.214316783 -1.734628534 -1.156146756 1.752233375
[21] 0.055325285 -1.585639886 0.863706518 -0.168996526 0.811422344
[26] 0.179863963 -0.602540272 1.216463895 0.306994894 -0.008822418
[31] 0.714873970 -0.351287713 -0.827601744 1.358037369 -0.146060160
[36] -1.080692221 -0.288661486 -0.663110552 0.214276025 0.026377125
[41] 1.227788356 0.608903001 0.862820765 -0.775258879 -1.724240915
[46] 1.288108617 -0.260304697 -1.571084501 -0.559922946 -1.388490896
[51] 1.838969590 0.074031556 -0.813790434 -0.912672987 -0.791662418
[56] -0.535117887 -0.098226010 -1.238524465 -0.427525209 1.188656435
[61] -1.527912688 -0.977102468 -0.256972790 -0.462352864 0.447133636
[66] 0.149996341 1.207866161 -0.819385269 0.209800225 -0.075356819
[71] -0.771414253 0.998419895 -1.117741375 0.549033638 0.532293358
[76] 0.609442166 0.139308186 -0.030600035 0.771011475 -0.380659989
[81] -0.171561298 0.627152469 0.899984418 0.385160281 -1.007804982
[86] 0.308124112 -1.057320225 -0.175883100 -1.200749118 1.000421704
[91] 1.854303491 1.267835567 -0.806592729 -0.080309895 1.559650112
[96] -0.129007230 0.423659220 0.920248341 -0.503080997 0.165046440
> colMedians(tmp)
[1] 0.613471122 0.001698407 -0.778713908 0.319672381 0.353995501
[6] -0.573013431 0.690837940 0.614788746 0.561829577 -0.892856010
[11] -0.321586718 -0.523487612 0.262445545 -1.279737771 1.350918005
[16] 1.016313128 0.214316783 -1.734628534 -1.156146756 1.752233375
[21] 0.055325285 -1.585639886 0.863706518 -0.168996526 0.811422344
[26] 0.179863963 -0.602540272 1.216463895 0.306994894 -0.008822418
[31] 0.714873970 -0.351287713 -0.827601744 1.358037369 -0.146060160
[36] -1.080692221 -0.288661486 -0.663110552 0.214276025 0.026377125
[41] 1.227788356 0.608903001 0.862820765 -0.775258879 -1.724240915
[46] 1.288108617 -0.260304697 -1.571084501 -0.559922946 -1.388490896
[51] 1.838969590 0.074031556 -0.813790434 -0.912672987 -0.791662418
[56] -0.535117887 -0.098226010 -1.238524465 -0.427525209 1.188656435
[61] -1.527912688 -0.977102468 -0.256972790 -0.462352864 0.447133636
[66] 0.149996341 1.207866161 -0.819385269 0.209800225 -0.075356819
[71] -0.771414253 0.998419895 -1.117741375 0.549033638 0.532293358
[76] 0.609442166 0.139308186 -0.030600035 0.771011475 -0.380659989
[81] -0.171561298 0.627152469 0.899984418 0.385160281 -1.007804982
[86] 0.308124112 -1.057320225 -0.175883100 -1.200749118 1.000421704
[91] 1.854303491 1.267835567 -0.806592729 -0.080309895 1.559650112
[96] -0.129007230 0.423659220 0.920248341 -0.503080997 0.165046440
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.6134711 0.001698407 -0.7787139 0.3196724 0.3539955 -0.5730134 0.6908379
[2,] 0.6134711 0.001698407 -0.7787139 0.3196724 0.3539955 -0.5730134 0.6908379
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.6147887 0.5618296 -0.892856 -0.3215867 -0.5234876 0.2624455 -1.279738
[2,] 0.6147887 0.5618296 -0.892856 -0.3215867 -0.5234876 0.2624455 -1.279738
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.350918 1.016313 0.2143168 -1.734629 -1.156147 1.752233 0.05532528
[2,] 1.350918 1.016313 0.2143168 -1.734629 -1.156147 1.752233 0.05532528
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.58564 0.8637065 -0.1689965 0.8114223 0.179864 -0.6025403 1.216464
[2,] -1.58564 0.8637065 -0.1689965 0.8114223 0.179864 -0.6025403 1.216464
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.3069949 -0.008822418 0.714874 -0.3512877 -0.8276017 1.358037 -0.1460602
[2,] 0.3069949 -0.008822418 0.714874 -0.3512877 -0.8276017 1.358037 -0.1460602
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.080692 -0.2886615 -0.6631106 0.214276 0.02637712 1.227788 0.608903
[2,] -1.080692 -0.2886615 -0.6631106 0.214276 0.02637712 1.227788 0.608903
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.8628208 -0.7752589 -1.724241 1.288109 -0.2603047 -1.571085 -0.5599229
[2,] 0.8628208 -0.7752589 -1.724241 1.288109 -0.2603047 -1.571085 -0.5599229
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.388491 1.83897 0.07403156 -0.8137904 -0.912673 -0.7916624 -0.5351179
[2,] -1.388491 1.83897 0.07403156 -0.8137904 -0.912673 -0.7916624 -0.5351179
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.09822601 -1.238524 -0.4275252 1.188656 -1.527913 -0.9771025 -0.2569728
[2,] -0.09822601 -1.238524 -0.4275252 1.188656 -1.527913 -0.9771025 -0.2569728
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.4623529 0.4471336 0.1499963 1.207866 -0.8193853 0.2098002 -0.07535682
[2,] -0.4623529 0.4471336 0.1499963 1.207866 -0.8193853 0.2098002 -0.07535682
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.7714143 0.9984199 -1.117741 0.5490336 0.5322934 0.6094422 0.1393082
[2,] -0.7714143 0.9984199 -1.117741 0.5490336 0.5322934 0.6094422 0.1393082
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.03060003 0.7710115 -0.38066 -0.1715613 0.6271525 0.8999844 0.3851603
[2,] -0.03060003 0.7710115 -0.38066 -0.1715613 0.6271525 0.8999844 0.3851603
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.007805 0.3081241 -1.05732 -0.1758831 -1.200749 1.000422 1.854303
[2,] -1.007805 0.3081241 -1.05732 -0.1758831 -1.200749 1.000422 1.854303
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.267836 -0.8065927 -0.0803099 1.55965 -0.1290072 0.4236592 0.9202483
[2,] 1.267836 -0.8065927 -0.0803099 1.55965 -0.1290072 0.4236592 0.9202483
[,99] [,100]
[1,] -0.503081 0.1650464
[2,] -0.503081 0.1650464
>
>
> Max(tmp2)
[1] 2.240335
> Min(tmp2)
[1] -2.991734
> mean(tmp2)
[1] 0.1629589
> Sum(tmp2)
[1] 16.29589
> Var(tmp2)
[1] 0.8922505
>
> rowMeans(tmp2)
[1] 1.394332038 0.239803073 1.671549788 -0.179791117 -0.002149951
[6] 1.287478933 0.245947965 -0.962861345 -0.170766612 -1.610624200
[11] -0.114736139 2.240335173 0.391522167 0.588442900 1.810012144
[16] -0.678636358 0.137217195 0.697179204 0.594530147 -1.891971415
[21] 0.402104618 -0.395383661 -0.539896180 1.643611835 -2.129844058
[26] 1.247945762 0.523043822 0.270622510 0.416456857 -0.320608879
[31] -0.741837538 0.678810990 -0.492686937 -0.299412376 0.958670032
[36] 0.326843116 -0.814521705 -0.321662037 -0.343687932 0.201261405
[41] 0.340580866 0.346569381 -0.044373119 -0.831152656 -0.779140409
[46] -0.731792751 0.825688224 -0.074279774 1.621392264 -0.984718556
[51] -0.116770425 0.470971262 1.398115182 -1.318155710 0.512833497
[56] 0.096301115 -1.690971951 -0.104534341 0.009154385 -0.567220055
[61] -0.638083203 -0.101766152 0.969785009 -0.537345441 0.103617677
[66] 0.795301666 -0.405374944 0.112854408 -2.991733505 0.739264955
[71] -0.003796149 -0.238530070 0.395741231 1.792288187 -0.887804042
[76] -0.612707339 1.623548964 1.653572173 0.214035281 1.462550601
[81] -0.761187059 0.299265030 1.140580825 0.275784560 1.271731273
[86] 1.442064469 1.426041243 -0.305212655 1.750094809 1.236875532
[91] 0.420147946 0.103207641 0.184689892 -0.220192525 -0.526336226
[96] 0.203385476 -1.192591621 0.395618008 0.219105914 1.152261940
> rowSums(tmp2)
[1] 1.394332038 0.239803073 1.671549788 -0.179791117 -0.002149951
[6] 1.287478933 0.245947965 -0.962861345 -0.170766612 -1.610624200
[11] -0.114736139 2.240335173 0.391522167 0.588442900 1.810012144
[16] -0.678636358 0.137217195 0.697179204 0.594530147 -1.891971415
[21] 0.402104618 -0.395383661 -0.539896180 1.643611835 -2.129844058
[26] 1.247945762 0.523043822 0.270622510 0.416456857 -0.320608879
[31] -0.741837538 0.678810990 -0.492686937 -0.299412376 0.958670032
[36] 0.326843116 -0.814521705 -0.321662037 -0.343687932 0.201261405
[41] 0.340580866 0.346569381 -0.044373119 -0.831152656 -0.779140409
[46] -0.731792751 0.825688224 -0.074279774 1.621392264 -0.984718556
[51] -0.116770425 0.470971262 1.398115182 -1.318155710 0.512833497
[56] 0.096301115 -1.690971951 -0.104534341 0.009154385 -0.567220055
[61] -0.638083203 -0.101766152 0.969785009 -0.537345441 0.103617677
[66] 0.795301666 -0.405374944 0.112854408 -2.991733505 0.739264955
[71] -0.003796149 -0.238530070 0.395741231 1.792288187 -0.887804042
[76] -0.612707339 1.623548964 1.653572173 0.214035281 1.462550601
[81] -0.761187059 0.299265030 1.140580825 0.275784560 1.271731273
[86] 1.442064469 1.426041243 -0.305212655 1.750094809 1.236875532
[91] 0.420147946 0.103207641 0.184689892 -0.220192525 -0.526336226
[96] 0.203385476 -1.192591621 0.395618008 0.219105914 1.152261940
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] 1.394332038 0.239803073 1.671549788 -0.179791117 -0.002149951
[6] 1.287478933 0.245947965 -0.962861345 -0.170766612 -1.610624200
[11] -0.114736139 2.240335173 0.391522167 0.588442900 1.810012144
[16] -0.678636358 0.137217195 0.697179204 0.594530147 -1.891971415
[21] 0.402104618 -0.395383661 -0.539896180 1.643611835 -2.129844058
[26] 1.247945762 0.523043822 0.270622510 0.416456857 -0.320608879
[31] -0.741837538 0.678810990 -0.492686937 -0.299412376 0.958670032
[36] 0.326843116 -0.814521705 -0.321662037 -0.343687932 0.201261405
[41] 0.340580866 0.346569381 -0.044373119 -0.831152656 -0.779140409
[46] -0.731792751 0.825688224 -0.074279774 1.621392264 -0.984718556
[51] -0.116770425 0.470971262 1.398115182 -1.318155710 0.512833497
[56] 0.096301115 -1.690971951 -0.104534341 0.009154385 -0.567220055
[61] -0.638083203 -0.101766152 0.969785009 -0.537345441 0.103617677
[66] 0.795301666 -0.405374944 0.112854408 -2.991733505 0.739264955
[71] -0.003796149 -0.238530070 0.395741231 1.792288187 -0.887804042
[76] -0.612707339 1.623548964 1.653572173 0.214035281 1.462550601
[81] -0.761187059 0.299265030 1.140580825 0.275784560 1.271731273
[86] 1.442064469 1.426041243 -0.305212655 1.750094809 1.236875532
[91] 0.420147946 0.103207641 0.184689892 -0.220192525 -0.526336226
[96] 0.203385476 -1.192591621 0.395618008 0.219105914 1.152261940
> rowMin(tmp2)
[1] 1.394332038 0.239803073 1.671549788 -0.179791117 -0.002149951
[6] 1.287478933 0.245947965 -0.962861345 -0.170766612 -1.610624200
[11] -0.114736139 2.240335173 0.391522167 0.588442900 1.810012144
[16] -0.678636358 0.137217195 0.697179204 0.594530147 -1.891971415
[21] 0.402104618 -0.395383661 -0.539896180 1.643611835 -2.129844058
[26] 1.247945762 0.523043822 0.270622510 0.416456857 -0.320608879
[31] -0.741837538 0.678810990 -0.492686937 -0.299412376 0.958670032
[36] 0.326843116 -0.814521705 -0.321662037 -0.343687932 0.201261405
[41] 0.340580866 0.346569381 -0.044373119 -0.831152656 -0.779140409
[46] -0.731792751 0.825688224 -0.074279774 1.621392264 -0.984718556
[51] -0.116770425 0.470971262 1.398115182 -1.318155710 0.512833497
[56] 0.096301115 -1.690971951 -0.104534341 0.009154385 -0.567220055
[61] -0.638083203 -0.101766152 0.969785009 -0.537345441 0.103617677
[66] 0.795301666 -0.405374944 0.112854408 -2.991733505 0.739264955
[71] -0.003796149 -0.238530070 0.395741231 1.792288187 -0.887804042
[76] -0.612707339 1.623548964 1.653572173 0.214035281 1.462550601
[81] -0.761187059 0.299265030 1.140580825 0.275784560 1.271731273
[86] 1.442064469 1.426041243 -0.305212655 1.750094809 1.236875532
[91] 0.420147946 0.103207641 0.184689892 -0.220192525 -0.526336226
[96] 0.203385476 -1.192591621 0.395618008 0.219105914 1.152261940
>
> colMeans(tmp2)
[1] 0.1629589
> colSums(tmp2)
[1] 16.29589
> colVars(tmp2)
[1] 0.8922505
> colSd(tmp2)
[1] 0.9445901
> colMax(tmp2)
[1] 2.240335
> colMin(tmp2)
[1] -2.991734
> colMedians(tmp2)
[1] 0.1929756
> colRanges(tmp2)
[,1]
[1,] -2.991734
[2,] 2.240335
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.8069255 2.7876346 -1.9257343 -3.0120550 -2.5583862 1.6445180
[7] -0.2184623 -2.5256625 3.5462789 4.5270522
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7353503
[2,] -1.3631153
[3,] -0.3211700
[4,] 0.7399084
[5,] 1.7581482
>
> rowApply(tmp,sum)
[1] -1.0305894 0.6647386 -1.7008195 -5.0560822 0.4155798 -0.5361644
[7] 1.8644843 -3.9472019 1.5605213 8.2237912
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 10 2 10 1 1 8 2 4 2
[2,] 10 9 3 5 9 6 9 5 6 3
[3,] 6 4 1 6 8 4 5 6 1 7
[4,] 4 6 5 1 6 3 2 1 10 8
[5,] 1 5 6 2 2 8 7 4 8 5
[6,] 2 2 9 7 7 7 3 9 5 4
[7,] 3 1 10 9 3 2 4 10 9 1
[8,] 7 3 8 3 5 10 1 3 7 6
[9,] 5 7 7 8 4 9 6 8 3 9
[10,] 8 8 4 4 10 5 10 7 2 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -3.26965717 -2.87543032 -0.38111973 3.82018464 2.73967025 -0.35745745
[7] 1.48842286 -0.70204696 0.39968842 1.07462168 0.29651134 -2.53184504
[13] -0.62424332 -0.07062798 -1.66000689 0.62760914 -0.82678933 1.82289940
[19] -2.09305132 0.39423642
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2067639
[2,] -0.7049504
[3,] -0.6470654
[4,] -0.5375642
[5,] -0.1733133
>
> rowApply(tmp,sum)
[1] 1.863911 -2.413898 -1.357575 -1.874630 1.053761
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 7 5 3 7
[2,] 12 2 3 2 12
[3,] 16 8 17 9 2
[4,] 20 18 11 18 8
[5,] 19 3 20 11 14
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.1733133 0.4387356 0.7221239 2.4946399 1.35728797 -1.6156574
[2,] -0.5375642 -0.9520682 -0.4828808 0.8593563 -0.91343884 0.1757542
[3,] -0.7049504 -1.1946113 1.0448920 -0.2253140 1.67595386 1.6230851
[4,] -1.2067639 -1.3571348 -0.5191970 1.1581823 0.01070591 -1.0733520
[5,] -0.6470654 0.1896483 -1.1460578 -0.4666799 0.60916135 0.5327126
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.6415512 -0.4329009 0.6042865 -1.39455281 0.19281199 -2.3118293
[2,] 0.4139376 -0.5791584 1.1717047 0.80556120 0.87791443 -0.7896995
[3,] -0.9894201 0.6646663 -0.1821253 -0.27848680 -0.06130391 0.3112572
[4,] 0.6009711 -1.5300081 -0.5307005 -0.07182113 0.18345830 1.3952085
[5,] 0.8213831 1.1753541 -0.6634771 2.01392122 -0.89636946 -1.1367821
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4630579 0.04612793 -0.7257159 0.5807075 1.2985838 1.10104669
[2,] -0.4503820 -0.17592959 -0.1748731 -0.2935072 -1.5679666 0.05182338
[3,] 1.3134746 0.16326139 -0.3632655 -0.4933784 -0.3634361 -1.43828133
[4,] 0.1584262 0.26489301 -0.5292682 -0.6229402 -1.1806917 2.31398083
[5,] -1.1827042 -0.36898072 0.1331158 1.4567275 0.9867212 -0.20567017
[,19] [,20]
[1,] -0.5683183 0.07135346
[2,] -0.5763967 0.72391501
[3,] -0.4293023 -1.43029015
[4,] 0.3437260 0.31769568
[5,] -0.8627600 0.71156241
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 565 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6412688 -0.2688592 -1.247382 -0.7780402 -0.02785774 0.5116235 -1.066168
col8 col9 col10 col11 col12 col13 col14 col15
row1 0.531393 -0.4018847 -1.065764 0.516191 -1.013034 1.188793 -1.5052 -2.12364
col16 col17 col18 col19 col20
row1 -0.3160152 0.1062812 0.09267306 1.56125 -0.5811814
> tmp[,"col10"]
col10
row1 -1.0657643
row2 -0.4300966
row3 0.4821995
row4 -1.7196344
row5 -0.5734832
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.6412688 -0.2688592 -1.2473822 -0.7780402 -0.02785774 0.5116235
row5 1.3980814 1.2696853 -0.5385985 1.0113518 0.75522058 -0.9475399
col7 col8 col9 col10 col11 col12 col13
row1 -1.0661680 0.5313930 -0.4018847 -1.0657643 0.5161910 -1.0130337 1.1887933
row5 0.9206168 0.8725066 -0.6132720 -0.5734832 -0.6693646 0.5962026 0.9766753
col14 col15 col16 col17 col18 col19
row1 -1.5052001 -2.1236398 -0.3160152 0.1062812 0.09267306 1.5612505
row5 -0.6009628 -0.4594323 -1.3862472 -0.8249107 -1.22024424 0.2416934
col20
row1 -0.5811814
row5 0.1704765
> tmp[,c("col6","col20")]
col6 col20
row1 0.5116235 -0.5811814
row2 0.4747768 0.1339857
row3 -1.2625977 -1.4505668
row4 -0.9452064 0.9561655
row5 -0.9475399 0.1704765
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.5116235 -0.5811814
row5 -0.9475399 0.1704765
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.66246 48.33376 50.94505 50.20776 49.56011 105.0908 49.65166 49.03177
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63471 49.19185 49.48998 53.0208 50.80401 48.50244 49.88899 47.34075
col17 col18 col19 col20
row1 48.12095 49.72598 49.89626 106.8223
> tmp[,"col10"]
col10
row1 49.19185
row2 28.16703
row3 29.84119
row4 29.31680
row5 50.64009
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.66246 48.33376 50.94505 50.20776 49.56011 105.0908 49.65166 49.03177
row5 48.15729 50.32200 48.67598 49.25421 50.71405 104.8083 50.39702 49.51803
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63471 49.19185 49.48998 53.02080 50.80401 48.50244 49.88899 47.34075
row5 51.31153 50.64009 51.11520 51.52213 48.51303 49.50134 51.32985 50.39332
col17 col18 col19 col20
row1 48.12095 49.72598 49.89626 106.8223
row5 48.78433 49.15781 50.03419 104.7947
> tmp[,c("col6","col20")]
col6 col20
row1 105.09077 106.82225
row2 76.47597 74.03795
row3 75.59044 73.87614
row4 78.27480 74.32501
row5 104.80828 104.79472
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.0908 106.8223
row5 104.8083 104.7947
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.0908 106.8223
row5 104.8083 104.7947
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6013864
[2,] -0.4071233
[3,] -0.4810237
[4,] -1.6502569
[5,] -1.0644024
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.05502784 -0.8400261
[2,] 0.02358828 1.6420130
[3,] 0.24940361 1.4982503
[4,] 0.57709151 0.5597652
[5,] 0.57846501 -3.1402740
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.8397060 -0.6385289
[2,] 0.1645492 0.6462769
[3,] -2.0565523 -0.5575121
[4,] -0.5217217 -1.0324318
[5,] -1.1383104 1.2551391
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.839706
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.8397060
[2,] 0.1645492
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -1.177818 -0.9859182 0.3131087 0.2194435 0.0257735 0.9491183 -1.5629683
row1 1.223810 -0.5711506 0.2705461 -1.3877964 -0.8520401 1.8233243 0.3241005
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.7852138 1.356813 0.4884971 -0.1414633 0.398783 1.323174 -0.8607739
row1 1.2048963 -1.151454 0.3536510 -0.8468048 1.845132 0.899656 0.7026635
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.3993180 -1.2942086 0.161431 0.9499451 -0.1212618 0.07189646
row1 -0.1865397 0.1556196 -0.616148 -0.4343043 -0.1380335 -0.28621634
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.3794381 0.2549164 -1.40597 0.4548706 -0.3411391 1.373603 -1.359056
[,8] [,9] [,10]
row2 -0.0287334 0.6207547 1.38761
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.052644 0.9049761 -0.1577294 0.5714192 -1.078146 1.467072 -1.265721
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3408311 0.915562 1.003896 -1.800907 0.1443657 -1.420456 1.850843
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.2536909 -1.487462 -0.1542171 0.02883466 0.03051228 -1.032054
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
> dimnames(tmp) <- NULL
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
NULL
>
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
>
> ###
> ### Testing logical indexing
> ###
> ###
>
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]
>
> for (rep in 1:10){
+ which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+ which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+
+ if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+ stop("No agreement when logical indexing\n")
+ }
+
+ if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+ }
+ if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+ }
+
+
+ if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+ }
+ }
>
>
> ##
> ## Test the ReadOnlyMode
> ##
>
> ReadOnlyMode(tmp)
<pointer: 0x3e633510>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b14b99d260"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b11c86919c"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b1314d1a39"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b169b5c908"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b15195be34"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b13fe5c06a"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b147abecc2"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b135fe4dce"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b13ed71fc1"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b11bae692a"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b1875cddf"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b16de78c2a"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b17dce0032"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b1a568daa"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1645b1261fe090"
>
>
> ### testing coercion functions
> ###
>
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
>
>
>
> ### testing whether can move storage from one location to another
>
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x3e365980>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x3e365980>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x3e365980>
> rowMedians(tmp)
[1] -0.1769358096 -0.3641166849 -0.0751153174 -0.5363596995 -0.2545293652
[6] 0.4469016555 0.1292694822 -0.3359893184 0.0018508281 0.1280431801
[11] 0.3777807921 0.4581504851 0.2509074820 0.3909088568 0.1136923804
[16] 0.2169661197 -0.6237374961 0.4058141977 0.5265694391 -0.3860578461
[21] 0.3940244139 -0.1135104458 -0.2227111995 -0.1323351062 0.3636547070
[26] -0.1543925886 -0.0922247026 0.0738178960 -0.2587434939 0.2897146091
[31] -0.3444322185 -0.0783272881 -0.0007143366 0.1240697194 -0.0641196761
[36] -0.0514824107 0.2244223074 0.6711484404 -0.1132037998 -0.3782193469
[41] -0.1778521978 0.4330319742 0.0098756271 0.0100622350 0.0627726251
[46] 0.3436522763 0.4900409717 0.2548230495 0.4762115697 0.0543156170
[51] -0.3657628254 0.0924785642 -0.5131814489 -0.1697359091 0.0139415878
[56] 0.1823115616 0.1431263715 -0.2999770890 0.1216636390 0.0196392989
[61] 0.0484075657 -0.3230303598 0.0121863542 0.4068372856 -0.0464959802
[66] 0.0678485284 -0.3376674184 0.0806303212 -0.5066399299 -0.2630745909
[71] -0.1360233397 0.1895700141 0.4054550694 0.1134079299 -0.4365343288
[76] 0.5431110809 0.6672211880 -0.4183344603 0.1576008234 -0.7552806488
[81] -0.0862099076 -0.0307751267 0.0543296748 0.2503739418 -0.3121438647
[86] -0.2386572013 -0.3018936252 -0.6085258110 -0.4893266723 -0.2288748438
[91] 0.5193275158 0.0929687276 -0.2303112673 0.1770238950 0.2836816471
[96] 0.2394330526 -0.2222885596 0.4548407930 -0.3374013115 -0.4503062081
[101] 0.0282532332 -0.5880924808 -0.2744178328 -0.3239621085 0.1770887957
[106] 0.4746641518 0.1602005791 0.3383807516 -0.4236909797 0.6435110958
[111] -0.3842036498 0.3670491770 -0.0816179984 -0.1222530702 0.4509196418
[116] -0.0792526707 0.1343624153 -0.1068418627 -0.0065026085 0.1386150148
[121] -0.0167446776 0.1060643434 0.2551312815 -0.1226631208 -0.2589091572
[126] 0.3084506689 0.1411626490 -0.2009212263 0.3849621302 0.1780795118
[131] -0.2408773439 0.3835505871 0.0583251082 0.4661565803 0.3572433737
[136] 0.5506826012 -0.1732129041 0.4733973846 -0.2884150221 -0.1242019512
[141] 0.2333029730 0.6093701346 0.0713684055 -0.2490046122 0.5444796683
[146] -0.4168699430 -0.0712521129 -0.2388231157 0.6810432732 0.1043853698
[151] -0.2627953856 0.0738085254 0.7158059025 -0.3647495367 -0.4501059369
[156] 0.3683799727 -0.0109627319 -0.0298623191 0.0358053601 -0.5006783666
[161] 0.9876178129 -0.1312018772 -0.3611186501 -0.1713938533 -0.1644005477
[166] -0.2478379968 -0.3132895298 0.0124569685 -0.1247269286 0.2225578782
[171] 0.7133278479 0.1968579051 -0.0609288853 -0.3652612318 0.0265550605
[176] -0.0986145014 -0.3418579833 -0.3790795622 0.0017312018 -0.2692369122
[181] -0.3066070511 -0.2805395111 -0.2534234996 0.3527320060 -0.3264024993
[186] 0.3592601755 -0.1657508407 -0.0874987524 0.0015044588 0.1092348248
[191] 0.2034489874 -0.0150782011 -0.3308924826 0.1769716371 0.4529112790
[196] -0.1308555736 -0.8696528714 -0.1738945605 -0.2980384010 0.1333915449
[201] 0.1296191625 0.0284082606 0.6469138252 -0.2815922748 -0.3046251471
[206] -0.1567923219 -0.2055939541 -0.1008474595 0.5007951439 -0.3069378379
[211] 0.0712110192 0.2297967382 0.2601901737 0.2359105131 -0.2156843948
[216] 0.3898312099 0.0111653271 0.0039123006 0.1499835301 0.3535341796
[221] -0.0380381410 -0.0795218610 0.0920919793 -0.0245304486 0.0089631207
[226] 0.0501527515 0.6122913624 0.1341777184 -0.1364439715 0.4979332003
>
> proc.time()
user system elapsed
1.840 0.838 2.705
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x2e37e6e0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x2e37e6e0>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x2e37e6e0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000
<pointer: 0x2e37e6e0>
> rm(P)
>
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1
Printing Values
<pointer: 0x2e3c66a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e3c66a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000
0.000000
0.000000
0.000000
0.000000
<pointer: 0x2e3c66a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e3c66a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x2e3c66a0>
> rm(P)
>
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2d5827d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2d5827d0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x2d5827d0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2d5827d0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x2d5827d0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x2d5827d0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x2d5827d0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x2d5827d0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x2d5827d0>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e0e1d70>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2e0e1d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e0e1d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2e0e1d70>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1646391a8e9f9e" "BufferedMatrixFile1646391f67e3ea"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1646391a8e9f9e" "BufferedMatrixFile1646391f67e3ea"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x2dc84cd0>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2cbf3a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2cbf3a10>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2cbf3a10>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2cbf3a10>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x2eb0dcd0>
> .Call("R_bm_getValue",P,3,3)
[1] 6
>
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 12345.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x2eb0dcd0>
> rm(P)
>
> proc.time()
user system elapsed
0.331 0.041 0.360
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.331 0.038 0.355