| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-06 11:34 -0500 (Sat, 06 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4869 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4576 |
| 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 253/2331 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
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. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-12-05 21:36:25 -0500 (Fri, 05 Dec 2025) |
| EndedAt: 2025-12-05 21:36:51 -0500 (Fri, 05 Dec 2025) |
| EllapsedTime: 26.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --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-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/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){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/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-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.249 0.045 0.284
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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 478818 25.6 1048392 56 639317 34.2
Vcells 885623 6.8 8388608 64 2082728 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 Dec 5 21:36:41 2025"
> 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 Dec 5 21:36:41 2025"
>
>
> 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: 0x56a29c74d5e0>
>
>
>
> 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 Dec 5 21:36:41 2025"
> 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 Dec 5 21:36:42 2025"
>
> ColMode(tmp2)
<pointer: 0x56a29c74d5e0>
>
>
>
> ### 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,] 99.0108002 -0.4521794 1.2229412 1.1793369
[2,] -1.6450453 -1.2297850 -0.6163208 -1.3538927
[3,] 0.7345269 0.5326655 -2.4847845 0.1528424
[4,] -2.1165113 0.5748781 0.1796276 0.9817372
> 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,] 99.0108002 0.4521794 1.2229412 1.1793369
[2,] 1.6450453 1.2297850 0.6163208 1.3538927
[3,] 0.7345269 0.5326655 2.4847845 0.1528424
[4,] 2.1165113 0.5748781 0.1796276 0.9817372
> 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,] 9.9504171 0.6724429 1.105867 1.0859728
[2,] 1.2825932 1.1089567 0.785061 1.1635690
[3,] 0.8570454 0.7298394 1.576320 0.3909506
[4,] 1.4548235 0.7582072 0.423825 0.9908265
>
> 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,] 223.51497 32.17661 37.28161 37.03906
[2,] 39.47098 37.31935 33.46693 37.98958
[3,] 34.30498 32.83106 43.24798 29.06235
[4,] 41.66475 33.15695 29.41788 35.89000
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56a29c2d8840>
> exp(tmp5)
<pointer: 0x56a29c2d8840>
> log(tmp5,2)
<pointer: 0x56a29c2d8840>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.2171
> Min(tmp5)
[1] 53.62357
> mean(tmp5)
[1] 72.58122
> Sum(tmp5)
[1] 14516.24
> Var(tmp5)
[1] 847.1962
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.48592 72.22754 69.92361 73.85574 73.19926 70.12635 66.92332 66.82117
[9] 71.76958 70.47967
> rowSums(tmp5)
[1] 1809.718 1444.551 1398.472 1477.115 1463.985 1402.527 1338.466 1336.423
[9] 1435.392 1409.593
> rowVars(tmp5)
[1] 7814.26551 58.97128 70.60435 55.14850 82.16574 79.02520
[7] 48.82123 53.47675 105.96215 77.38883
> rowSd(tmp5)
[1] 88.398334 7.679276 8.402639 7.426204 9.064532 8.889612 6.987219
[8] 7.312780 10.293792 8.797092
> rowMax(tmp5)
[1] 465.21713 84.45541 90.01501 89.72389 90.85315 90.35925 79.77726
[8] 79.29825 88.81531 86.69722
> rowMin(tmp5)
[1] 59.40591 57.82277 56.22596 59.75196 54.12564 57.81397 56.19926 57.51361
[9] 53.62357 56.05492
>
> colMeans(tmp5)
[1] 107.87696 70.22696 74.74191 67.27388 69.18620 70.16401 72.62874
[8] 66.26628 72.92643 71.16820 70.64872 69.82399 71.89792 69.59786
[15] 74.15582 71.66105 69.31950 67.77147 71.01771 73.27071
> colSums(tmp5)
[1] 1078.7696 702.2696 747.4191 672.7388 691.8620 701.6401 726.2874
[8] 662.6628 729.2643 711.6820 706.4872 698.2399 718.9792 695.9786
[15] 741.5582 716.6105 693.1950 677.7147 710.1771 732.7071
> colVars(tmp5)
[1] 15870.20566 68.44435 130.13847 76.26954 75.67034 96.44776
[7] 79.41845 34.16659 31.50721 97.85653 49.91881 48.68485
[13] 79.29385 43.37321 53.83036 68.36909 45.78290 97.64757
[19] 42.60883 82.53039
> colSd(tmp5)
[1] 125.977005 8.273110 11.407825 8.733243 8.698870 9.820782
[7] 8.911703 5.845220 5.613128 9.892246 7.065324 6.977453
[13] 8.904709 6.585834 7.336918 8.268561 6.766306 9.881678
[19] 6.527544 9.084624
> colMax(tmp5)
[1] 465.21713 85.19562 90.85315 79.07034 84.73307 86.69722 84.45541
[8] 76.87516 82.54574 90.35925 82.88440 82.49931 88.81531 78.42813
[15] 81.65931 81.69068 79.77726 86.68456 80.50846 89.72389
> colMin(tmp5)
[1] 54.99977 58.09646 60.42522 53.62357 54.12564 56.19926 59.40591 56.05492
[9] 63.52097 57.51361 60.16251 60.11002 57.81397 57.58436 60.31189 57.82277
[17] 60.83092 56.22596 61.15712 64.75495
>
>
> ### 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.48592 NA 69.92361 73.85574 73.19926 70.12635 66.92332 66.82117
[9] 71.76958 70.47967
> rowSums(tmp5)
[1] 1809.718 NA 1398.472 1477.115 1463.985 1402.527 1338.466 1336.423
[9] 1435.392 1409.593
> rowVars(tmp5)
[1] 7814.26551 53.50355 70.60435 55.14850 82.16574 79.02520
[7] 48.82123 53.47675 105.96215 77.38883
> rowSd(tmp5)
[1] 88.398334 7.314612 8.402639 7.426204 9.064532 8.889612 6.987219
[8] 7.312780 10.293792 8.797092
> rowMax(tmp5)
[1] 465.21713 NA 90.01501 89.72389 90.85315 90.35925 79.77726
[8] 79.29825 88.81531 86.69722
> rowMin(tmp5)
[1] 59.40591 NA 56.22596 59.75196 54.12564 57.81397 56.19926 57.51361
[9] 53.62357 56.05492
>
> colMeans(tmp5)
[1] 107.87696 70.22696 74.74191 67.27388 69.18620 70.16401 NA
[8] 66.26628 72.92643 71.16820 70.64872 69.82399 71.89792 69.59786
[15] 74.15582 71.66105 69.31950 67.77147 71.01771 73.27071
> colSums(tmp5)
[1] 1078.7696 702.2696 747.4191 672.7388 691.8620 701.6401 NA
[8] 662.6628 729.2643 711.6820 706.4872 698.2399 718.9792 695.9786
[15] 741.5582 716.6105 693.1950 677.7147 710.1771 732.7071
> colVars(tmp5)
[1] 15870.20566 68.44435 130.13847 76.26954 75.67034 96.44776
[7] NA 34.16659 31.50721 97.85653 49.91881 48.68485
[13] 79.29385 43.37321 53.83036 68.36909 45.78290 97.64757
[19] 42.60883 82.53039
> colSd(tmp5)
[1] 125.977005 8.273110 11.407825 8.733243 8.698870 9.820782
[7] NA 5.845220 5.613128 9.892246 7.065324 6.977453
[13] 8.904709 6.585834 7.336918 8.268561 6.766306 9.881678
[19] 6.527544 9.084624
> colMax(tmp5)
[1] 465.21713 85.19562 90.85315 79.07034 84.73307 86.69722 NA
[8] 76.87516 82.54574 90.35925 82.88440 82.49931 88.81531 78.42813
[15] 81.65931 81.69068 79.77726 86.68456 80.50846 89.72389
> colMin(tmp5)
[1] 54.99977 58.09646 60.42522 53.62357 54.12564 56.19926 NA 56.05492
[9] 63.52097 57.51361 60.16251 60.11002 57.81397 57.58436 60.31189 57.82277
[17] 60.83092 56.22596 61.15712 64.75495
>
> Max(tmp5,na.rm=TRUE)
[1] 465.2171
> Min(tmp5,na.rm=TRUE)
[1] 53.62357
> mean(tmp5,na.rm=TRUE)
[1] 72.52155
> Sum(tmp5,na.rm=TRUE)
[1] 14431.79
> Var(tmp5,na.rm=TRUE)
[1] 850.7593
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.48592 71.58396 69.92361 73.85574 73.19926 70.12635 66.92332 66.82117
[9] 71.76958 70.47967
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.718 1360.095 1398.472 1477.115 1463.985 1402.527 1338.466 1336.423
[9] 1435.392 1409.593
> rowVars(tmp5,na.rm=TRUE)
[1] 7814.26551 53.50355 70.60435 55.14850 82.16574 79.02520
[7] 48.82123 53.47675 105.96215 77.38883
> rowSd(tmp5,na.rm=TRUE)
[1] 88.398334 7.314612 8.402639 7.426204 9.064532 8.889612 6.987219
[8] 7.312780 10.293792 8.797092
> rowMax(tmp5,na.rm=TRUE)
[1] 465.21713 82.49931 90.01501 89.72389 90.85315 90.35925 79.77726
[8] 79.29825 88.81531 86.69722
> rowMin(tmp5,na.rm=TRUE)
[1] 59.40591 57.82277 56.22596 59.75196 54.12564 57.81397 56.19926 57.51361
[9] 53.62357 56.05492
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.87696 70.22696 74.74191 67.27388 69.18620 70.16401 71.31467
[8] 66.26628 72.92643 71.16820 70.64872 69.82399 71.89792 69.59786
[15] 74.15582 71.66105 69.31950 67.77147 71.01771 73.27071
> colSums(tmp5,na.rm=TRUE)
[1] 1078.7696 702.2696 747.4191 672.7388 691.8620 701.6401 641.8320
[8] 662.6628 729.2643 711.6820 706.4872 698.2399 718.9792 695.9786
[15] 741.5582 716.6105 693.1950 677.7147 710.1771 732.7071
> colVars(tmp5,na.rm=TRUE)
[1] 15870.20566 68.44435 130.13847 76.26954 75.67034 96.44776
[7] 69.91935 34.16659 31.50721 97.85653 49.91881 48.68485
[13] 79.29385 43.37321 53.83036 68.36909 45.78290 97.64757
[19] 42.60883 82.53039
> colSd(tmp5,na.rm=TRUE)
[1] 125.977005 8.273110 11.407825 8.733243 8.698870 9.820782
[7] 8.361779 5.845220 5.613128 9.892246 7.065324 6.977453
[13] 8.904709 6.585834 7.336918 8.268561 6.766306 9.881678
[19] 6.527544 9.084624
> colMax(tmp5,na.rm=TRUE)
[1] 465.21713 85.19562 90.85315 79.07034 84.73307 86.69722 80.31605
[8] 76.87516 82.54574 90.35925 82.88440 82.49931 88.81531 78.42813
[15] 81.65931 81.69068 79.77726 86.68456 80.50846 89.72389
> colMin(tmp5,na.rm=TRUE)
[1] 54.99977 58.09646 60.42522 53.62357 54.12564 56.19926 59.40591 56.05492
[9] 63.52097 57.51361 60.16251 60.11002 57.81397 57.58436 60.31189 57.82277
[17] 60.83092 56.22596 61.15712 64.75495
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.48592 NaN 69.92361 73.85574 73.19926 70.12635 66.92332 66.82117
[9] 71.76958 70.47967
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.718 0.000 1398.472 1477.115 1463.985 1402.527 1338.466 1336.423
[9] 1435.392 1409.593
> rowVars(tmp5,na.rm=TRUE)
[1] 7814.26551 NA 70.60435 55.14850 82.16574 79.02520
[7] 48.82123 53.47675 105.96215 77.38883
> rowSd(tmp5,na.rm=TRUE)
[1] 88.398334 NA 8.402639 7.426204 9.064532 8.889612 6.987219
[8] 7.312780 10.293792 8.797092
> rowMax(tmp5,na.rm=TRUE)
[1] 465.21713 NA 90.01501 89.72389 90.85315 90.35925 79.77726
[8] 79.29825 88.81531 86.69722
> rowMin(tmp5,na.rm=TRUE)
[1] 59.40591 NA 56.22596 59.75196 54.12564 57.81397 56.19926 57.51361
[9] 53.62357 56.05492
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 110.73510 69.39936 75.30690 65.96316 69.53617 70.45890 NaN
[8] 66.26691 72.59260 72.09345 71.27531 68.41562 71.82543 69.14184
[15] 73.97932 73.19863 69.11880 68.59042 69.96318 73.23449
> colSums(tmp5,na.rm=TRUE)
[1] 996.6159 624.5943 677.7621 593.6684 625.8255 634.1301 0.0000 596.4022
[9] 653.3334 648.8410 641.4778 615.7406 646.4289 622.2766 665.8138 658.7877
[17] 622.0692 617.3137 629.6686 659.1104
> colVars(tmp5,na.rm=TRUE)
[1] 17762.08029 69.29456 142.81467 66.47594 83.75120 107.52547
[7] NA 38.43741 34.19191 100.45753 51.74175 32.45606
[13] 89.14647 46.45540 60.20869 50.31829 51.05261 102.30845
[19] 35.42461 92.83193
> colSd(tmp5,na.rm=TRUE)
[1] 133.274455 8.324335 11.950509 8.153278 9.151568 10.369449
[7] NA 6.199791 5.847385 10.022850 7.193174 5.697022
[13] 9.441741 6.815820 7.759426 7.093538 7.145111 10.114764
[19] 5.951858 9.634933
> colMax(tmp5,na.rm=TRUE)
[1] 465.21713 85.19562 90.85315 77.09196 84.73307 86.69722 -Inf
[8] 76.87516 82.54574 90.35925 82.88440 77.63045 88.81531 78.42813
[15] 81.65931 81.69068 79.77726 86.68456 78.77043 89.72389
> colMin(tmp5,na.rm=TRUE)
[1] 54.99977 58.09646 60.42522 53.62357 54.12564 56.19926 Inf 56.05492
[9] 63.52097 57.51361 60.16251 60.11002 57.81397 57.58436 60.31189 58.28009
[17] 60.83092 56.22596 61.15712 64.75495
>
>
>
>
> 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] 195.9510 174.4024 164.2385 238.9725 113.8238 104.2407 126.3246 287.8871
[9] 137.6265 160.1742
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 195.9510 174.4024 164.2385 238.9725 113.8238 104.2407 126.3246 287.8871
[9] 137.6265 160.1742
>
>
>
> 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] 8.526513e-14 -5.684342e-13 1.705303e-13 0.000000e+00 1.136868e-13
[6] 2.842171e-13 5.684342e-14 1.136868e-13 -1.136868e-13 0.000000e+00
[11] -2.842171e-14 -1.421085e-14 1.421085e-14 -3.694822e-13 -1.136868e-13
[16] 0.000000e+00 0.000000e+00 8.526513e-14 -5.684342e-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)
+ }
9 18
7 12
7 7
9 1
10 8
10 6
8 2
1 16
10 3
9 10
2 2
9 9
5 14
1 14
1 5
8 17
10 9
9 12
6 19
8 18
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] 2.974112
> Min(tmp)
[1] -2.474911
> mean(tmp)
[1] 0.1226792
> Sum(tmp)
[1] 12.26792
> Var(tmp)
[1] 1.049153
>
> rowMeans(tmp)
[1] 0.1226792
> rowSums(tmp)
[1] 12.26792
> rowVars(tmp)
[1] 1.049153
> rowSd(tmp)
[1] 1.024282
> rowMax(tmp)
[1] 2.974112
> rowMin(tmp)
[1] -2.474911
>
> colMeans(tmp)
[1] 1.37424136 -0.57317964 0.17670741 -0.12198097 0.42629753 0.80784831
[7] -0.29698911 -0.48639655 0.12711192 0.81518508 1.78001443 0.43187837
[13] -0.52188098 -1.42321869 0.80806327 0.46778045 0.63922835 0.60457835
[19] -0.32355556 0.76825045 -1.25661599 -1.26816292 -0.73863444 -0.23811666
[25] 2.36558978 -1.52553705 1.02259443 1.22594738 -2.47491118 0.36912010
[31] 1.72654694 -1.27892333 1.39298164 0.33414201 0.50547476 1.31455827
[37] -0.04089945 2.22723829 1.27061680 0.50121623 1.63311964 -0.76167040
[43] -0.76583563 -1.05396542 -1.12815954 -0.86658999 0.34064484 0.88137814
[49] -0.08858544 0.08345041 -1.89567558 -0.28176210 -0.60630166 0.20365603
[55] 0.78141044 1.04263629 2.05236045 0.45386129 0.23141976 0.43665844
[61] -0.11500299 -0.94905751 0.18221791 -0.44576854 0.79958318 0.35241658
[67] 0.65011842 2.97411200 0.17350419 1.36657956 -1.91565183 -1.71182458
[73] -1.34107603 1.36992806 0.16310229 -0.81399665 -0.61054741 1.13763592
[79] 1.39086329 -0.42377043 1.00690783 -0.31760082 -1.24218459 -0.97008857
[85] 0.51992884 1.11674050 0.37684312 0.20963411 1.14170418 -0.52384574
[91] -0.50650126 0.82866884 -0.57045822 0.15051919 0.19563667 -0.89432508
[97] -0.05213775 -1.31971787 -0.60419191 -0.11723898
> colSums(tmp)
[1] 1.37424136 -0.57317964 0.17670741 -0.12198097 0.42629753 0.80784831
[7] -0.29698911 -0.48639655 0.12711192 0.81518508 1.78001443 0.43187837
[13] -0.52188098 -1.42321869 0.80806327 0.46778045 0.63922835 0.60457835
[19] -0.32355556 0.76825045 -1.25661599 -1.26816292 -0.73863444 -0.23811666
[25] 2.36558978 -1.52553705 1.02259443 1.22594738 -2.47491118 0.36912010
[31] 1.72654694 -1.27892333 1.39298164 0.33414201 0.50547476 1.31455827
[37] -0.04089945 2.22723829 1.27061680 0.50121623 1.63311964 -0.76167040
[43] -0.76583563 -1.05396542 -1.12815954 -0.86658999 0.34064484 0.88137814
[49] -0.08858544 0.08345041 -1.89567558 -0.28176210 -0.60630166 0.20365603
[55] 0.78141044 1.04263629 2.05236045 0.45386129 0.23141976 0.43665844
[61] -0.11500299 -0.94905751 0.18221791 -0.44576854 0.79958318 0.35241658
[67] 0.65011842 2.97411200 0.17350419 1.36657956 -1.91565183 -1.71182458
[73] -1.34107603 1.36992806 0.16310229 -0.81399665 -0.61054741 1.13763592
[79] 1.39086329 -0.42377043 1.00690783 -0.31760082 -1.24218459 -0.97008857
[85] 0.51992884 1.11674050 0.37684312 0.20963411 1.14170418 -0.52384574
[91] -0.50650126 0.82866884 -0.57045822 0.15051919 0.19563667 -0.89432508
[97] -0.05213775 -1.31971787 -0.60419191 -0.11723898
> 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] 1.37424136 -0.57317964 0.17670741 -0.12198097 0.42629753 0.80784831
[7] -0.29698911 -0.48639655 0.12711192 0.81518508 1.78001443 0.43187837
[13] -0.52188098 -1.42321869 0.80806327 0.46778045 0.63922835 0.60457835
[19] -0.32355556 0.76825045 -1.25661599 -1.26816292 -0.73863444 -0.23811666
[25] 2.36558978 -1.52553705 1.02259443 1.22594738 -2.47491118 0.36912010
[31] 1.72654694 -1.27892333 1.39298164 0.33414201 0.50547476 1.31455827
[37] -0.04089945 2.22723829 1.27061680 0.50121623 1.63311964 -0.76167040
[43] -0.76583563 -1.05396542 -1.12815954 -0.86658999 0.34064484 0.88137814
[49] -0.08858544 0.08345041 -1.89567558 -0.28176210 -0.60630166 0.20365603
[55] 0.78141044 1.04263629 2.05236045 0.45386129 0.23141976 0.43665844
[61] -0.11500299 -0.94905751 0.18221791 -0.44576854 0.79958318 0.35241658
[67] 0.65011842 2.97411200 0.17350419 1.36657956 -1.91565183 -1.71182458
[73] -1.34107603 1.36992806 0.16310229 -0.81399665 -0.61054741 1.13763592
[79] 1.39086329 -0.42377043 1.00690783 -0.31760082 -1.24218459 -0.97008857
[85] 0.51992884 1.11674050 0.37684312 0.20963411 1.14170418 -0.52384574
[91] -0.50650126 0.82866884 -0.57045822 0.15051919 0.19563667 -0.89432508
[97] -0.05213775 -1.31971787 -0.60419191 -0.11723898
> colMin(tmp)
[1] 1.37424136 -0.57317964 0.17670741 -0.12198097 0.42629753 0.80784831
[7] -0.29698911 -0.48639655 0.12711192 0.81518508 1.78001443 0.43187837
[13] -0.52188098 -1.42321869 0.80806327 0.46778045 0.63922835 0.60457835
[19] -0.32355556 0.76825045 -1.25661599 -1.26816292 -0.73863444 -0.23811666
[25] 2.36558978 -1.52553705 1.02259443 1.22594738 -2.47491118 0.36912010
[31] 1.72654694 -1.27892333 1.39298164 0.33414201 0.50547476 1.31455827
[37] -0.04089945 2.22723829 1.27061680 0.50121623 1.63311964 -0.76167040
[43] -0.76583563 -1.05396542 -1.12815954 -0.86658999 0.34064484 0.88137814
[49] -0.08858544 0.08345041 -1.89567558 -0.28176210 -0.60630166 0.20365603
[55] 0.78141044 1.04263629 2.05236045 0.45386129 0.23141976 0.43665844
[61] -0.11500299 -0.94905751 0.18221791 -0.44576854 0.79958318 0.35241658
[67] 0.65011842 2.97411200 0.17350419 1.36657956 -1.91565183 -1.71182458
[73] -1.34107603 1.36992806 0.16310229 -0.81399665 -0.61054741 1.13763592
[79] 1.39086329 -0.42377043 1.00690783 -0.31760082 -1.24218459 -0.97008857
[85] 0.51992884 1.11674050 0.37684312 0.20963411 1.14170418 -0.52384574
[91] -0.50650126 0.82866884 -0.57045822 0.15051919 0.19563667 -0.89432508
[97] -0.05213775 -1.31971787 -0.60419191 -0.11723898
> colMedians(tmp)
[1] 1.37424136 -0.57317964 0.17670741 -0.12198097 0.42629753 0.80784831
[7] -0.29698911 -0.48639655 0.12711192 0.81518508 1.78001443 0.43187837
[13] -0.52188098 -1.42321869 0.80806327 0.46778045 0.63922835 0.60457835
[19] -0.32355556 0.76825045 -1.25661599 -1.26816292 -0.73863444 -0.23811666
[25] 2.36558978 -1.52553705 1.02259443 1.22594738 -2.47491118 0.36912010
[31] 1.72654694 -1.27892333 1.39298164 0.33414201 0.50547476 1.31455827
[37] -0.04089945 2.22723829 1.27061680 0.50121623 1.63311964 -0.76167040
[43] -0.76583563 -1.05396542 -1.12815954 -0.86658999 0.34064484 0.88137814
[49] -0.08858544 0.08345041 -1.89567558 -0.28176210 -0.60630166 0.20365603
[55] 0.78141044 1.04263629 2.05236045 0.45386129 0.23141976 0.43665844
[61] -0.11500299 -0.94905751 0.18221791 -0.44576854 0.79958318 0.35241658
[67] 0.65011842 2.97411200 0.17350419 1.36657956 -1.91565183 -1.71182458
[73] -1.34107603 1.36992806 0.16310229 -0.81399665 -0.61054741 1.13763592
[79] 1.39086329 -0.42377043 1.00690783 -0.31760082 -1.24218459 -0.97008857
[85] 0.51992884 1.11674050 0.37684312 0.20963411 1.14170418 -0.52384574
[91] -0.50650126 0.82866884 -0.57045822 0.15051919 0.19563667 -0.89432508
[97] -0.05213775 -1.31971787 -0.60419191 -0.11723898
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.374241 -0.5731796 0.1767074 -0.121981 0.4262975 0.8078483 -0.2969891
[2,] 1.374241 -0.5731796 0.1767074 -0.121981 0.4262975 0.8078483 -0.2969891
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.4863966 0.1271119 0.8151851 1.780014 0.4318784 -0.521881 -1.423219
[2,] -0.4863966 0.1271119 0.8151851 1.780014 0.4318784 -0.521881 -1.423219
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.8080633 0.4677805 0.6392284 0.6045784 -0.3235556 0.7682504 -1.256616
[2,] 0.8080633 0.4677805 0.6392284 0.6045784 -0.3235556 0.7682504 -1.256616
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.268163 -0.7386344 -0.2381167 2.36559 -1.525537 1.022594 1.225947
[2,] -1.268163 -0.7386344 -0.2381167 2.36559 -1.525537 1.022594 1.225947
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -2.474911 0.3691201 1.726547 -1.278923 1.392982 0.334142 0.5054748
[2,] -2.474911 0.3691201 1.726547 -1.278923 1.392982 0.334142 0.5054748
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.314558 -0.04089945 2.227238 1.270617 0.5012162 1.63312 -0.7616704
[2,] 1.314558 -0.04089945 2.227238 1.270617 0.5012162 1.63312 -0.7616704
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.7658356 -1.053965 -1.12816 -0.86659 0.3406448 0.8813781 -0.08858544
[2,] -0.7658356 -1.053965 -1.12816 -0.86659 0.3406448 0.8813781 -0.08858544
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.08345041 -1.895676 -0.2817621 -0.6063017 0.203656 0.7814104 1.042636
[2,] 0.08345041 -1.895676 -0.2817621 -0.6063017 0.203656 0.7814104 1.042636
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 2.05236 0.4538613 0.2314198 0.4366584 -0.115003 -0.9490575 0.1822179
[2,] 2.05236 0.4538613 0.2314198 0.4366584 -0.115003 -0.9490575 0.1822179
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.4457685 0.7995832 0.3524166 0.6501184 2.974112 0.1735042 1.36658
[2,] -0.4457685 0.7995832 0.3524166 0.6501184 2.974112 0.1735042 1.36658
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.915652 -1.711825 -1.341076 1.369928 0.1631023 -0.8139967 -0.6105474
[2,] -1.915652 -1.711825 -1.341076 1.369928 0.1631023 -0.8139967 -0.6105474
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.137636 1.390863 -0.4237704 1.006908 -0.3176008 -1.242185 -0.9700886
[2,] 1.137636 1.390863 -0.4237704 1.006908 -0.3176008 -1.242185 -0.9700886
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.5199288 1.11674 0.3768431 0.2096341 1.141704 -0.5238457 -0.5065013
[2,] 0.5199288 1.11674 0.3768431 0.2096341 1.141704 -0.5238457 -0.5065013
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.8286688 -0.5704582 0.1505192 0.1956367 -0.8943251 -0.05213775 -1.319718
[2,] 0.8286688 -0.5704582 0.1505192 0.1956367 -0.8943251 -0.05213775 -1.319718
[,99] [,100]
[1,] -0.6041919 -0.117239
[2,] -0.6041919 -0.117239
>
>
> Max(tmp2)
[1] 1.853349
> Min(tmp2)
[1] -2.794547
> mean(tmp2)
[1] -0.07441024
> Sum(tmp2)
[1] -7.441024
> Var(tmp2)
[1] 0.8690527
>
> rowMeans(tmp2)
[1] -0.77075251 0.90735708 -0.26092548 -1.16757271 -0.14784236 -0.82593143
[7] -1.64093780 0.77782036 -0.12017277 -2.79454745 1.03888404 1.09859929
[13] -0.51701224 0.40998418 -0.68055639 1.48625219 1.40307374 -1.05700323
[19] 1.85334929 0.35480645 -1.23193818 -0.29641795 0.84021020 -0.66095187
[25] -0.06867751 0.69064540 -0.39277924 -1.24270696 -0.63119090 0.35864406
[31] -2.07429619 -1.83394128 0.63969445 0.69019861 0.10021832 0.19436768
[37] 1.53966888 -0.29652375 -1.11828505 -1.54657170 0.81037789 0.38254872
[43] -0.77517005 -0.24340245 0.74754821 -0.24559807 0.10604051 -0.20076253
[49] 0.64539729 -0.07248475 1.37040637 -1.61364957 -0.70986897 -0.29076018
[55] -0.12782578 0.97940829 -0.93056986 -0.32066492 0.34352247 0.02924972
[61] 0.73610710 0.23416394 -0.60349971 -2.58738860 -0.18206594 1.13612570
[67] 0.62326596 0.03610851 0.59927638 0.50310656 0.33794308 -0.79254711
[73] 0.66885310 -0.60417168 -2.04033826 -0.31072752 -0.38652491 0.28107889
[79] -0.52997815 1.83625655 0.45660515 -0.97398045 0.18178104 0.44329798
[85] -0.39044909 -0.51236821 1.41774843 -1.25011914 1.23833655 0.71318911
[91] -0.45548680 -0.07641549 -0.03914129 -0.76098215 -0.47061199 -0.27432770
[97] -0.16267708 0.59435182 1.19963697 -0.16443714
> rowSums(tmp2)
[1] -0.77075251 0.90735708 -0.26092548 -1.16757271 -0.14784236 -0.82593143
[7] -1.64093780 0.77782036 -0.12017277 -2.79454745 1.03888404 1.09859929
[13] -0.51701224 0.40998418 -0.68055639 1.48625219 1.40307374 -1.05700323
[19] 1.85334929 0.35480645 -1.23193818 -0.29641795 0.84021020 -0.66095187
[25] -0.06867751 0.69064540 -0.39277924 -1.24270696 -0.63119090 0.35864406
[31] -2.07429619 -1.83394128 0.63969445 0.69019861 0.10021832 0.19436768
[37] 1.53966888 -0.29652375 -1.11828505 -1.54657170 0.81037789 0.38254872
[43] -0.77517005 -0.24340245 0.74754821 -0.24559807 0.10604051 -0.20076253
[49] 0.64539729 -0.07248475 1.37040637 -1.61364957 -0.70986897 -0.29076018
[55] -0.12782578 0.97940829 -0.93056986 -0.32066492 0.34352247 0.02924972
[61] 0.73610710 0.23416394 -0.60349971 -2.58738860 -0.18206594 1.13612570
[67] 0.62326596 0.03610851 0.59927638 0.50310656 0.33794308 -0.79254711
[73] 0.66885310 -0.60417168 -2.04033826 -0.31072752 -0.38652491 0.28107889
[79] -0.52997815 1.83625655 0.45660515 -0.97398045 0.18178104 0.44329798
[85] -0.39044909 -0.51236821 1.41774843 -1.25011914 1.23833655 0.71318911
[91] -0.45548680 -0.07641549 -0.03914129 -0.76098215 -0.47061199 -0.27432770
[97] -0.16267708 0.59435182 1.19963697 -0.16443714
> 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] -0.77075251 0.90735708 -0.26092548 -1.16757271 -0.14784236 -0.82593143
[7] -1.64093780 0.77782036 -0.12017277 -2.79454745 1.03888404 1.09859929
[13] -0.51701224 0.40998418 -0.68055639 1.48625219 1.40307374 -1.05700323
[19] 1.85334929 0.35480645 -1.23193818 -0.29641795 0.84021020 -0.66095187
[25] -0.06867751 0.69064540 -0.39277924 -1.24270696 -0.63119090 0.35864406
[31] -2.07429619 -1.83394128 0.63969445 0.69019861 0.10021832 0.19436768
[37] 1.53966888 -0.29652375 -1.11828505 -1.54657170 0.81037789 0.38254872
[43] -0.77517005 -0.24340245 0.74754821 -0.24559807 0.10604051 -0.20076253
[49] 0.64539729 -0.07248475 1.37040637 -1.61364957 -0.70986897 -0.29076018
[55] -0.12782578 0.97940829 -0.93056986 -0.32066492 0.34352247 0.02924972
[61] 0.73610710 0.23416394 -0.60349971 -2.58738860 -0.18206594 1.13612570
[67] 0.62326596 0.03610851 0.59927638 0.50310656 0.33794308 -0.79254711
[73] 0.66885310 -0.60417168 -2.04033826 -0.31072752 -0.38652491 0.28107889
[79] -0.52997815 1.83625655 0.45660515 -0.97398045 0.18178104 0.44329798
[85] -0.39044909 -0.51236821 1.41774843 -1.25011914 1.23833655 0.71318911
[91] -0.45548680 -0.07641549 -0.03914129 -0.76098215 -0.47061199 -0.27432770
[97] -0.16267708 0.59435182 1.19963697 -0.16443714
> rowMin(tmp2)
[1] -0.77075251 0.90735708 -0.26092548 -1.16757271 -0.14784236 -0.82593143
[7] -1.64093780 0.77782036 -0.12017277 -2.79454745 1.03888404 1.09859929
[13] -0.51701224 0.40998418 -0.68055639 1.48625219 1.40307374 -1.05700323
[19] 1.85334929 0.35480645 -1.23193818 -0.29641795 0.84021020 -0.66095187
[25] -0.06867751 0.69064540 -0.39277924 -1.24270696 -0.63119090 0.35864406
[31] -2.07429619 -1.83394128 0.63969445 0.69019861 0.10021832 0.19436768
[37] 1.53966888 -0.29652375 -1.11828505 -1.54657170 0.81037789 0.38254872
[43] -0.77517005 -0.24340245 0.74754821 -0.24559807 0.10604051 -0.20076253
[49] 0.64539729 -0.07248475 1.37040637 -1.61364957 -0.70986897 -0.29076018
[55] -0.12782578 0.97940829 -0.93056986 -0.32066492 0.34352247 0.02924972
[61] 0.73610710 0.23416394 -0.60349971 -2.58738860 -0.18206594 1.13612570
[67] 0.62326596 0.03610851 0.59927638 0.50310656 0.33794308 -0.79254711
[73] 0.66885310 -0.60417168 -2.04033826 -0.31072752 -0.38652491 0.28107889
[79] -0.52997815 1.83625655 0.45660515 -0.97398045 0.18178104 0.44329798
[85] -0.39044909 -0.51236821 1.41774843 -1.25011914 1.23833655 0.71318911
[91] -0.45548680 -0.07641549 -0.03914129 -0.76098215 -0.47061199 -0.27432770
[97] -0.16267708 0.59435182 1.19963697 -0.16443714
>
> colMeans(tmp2)
[1] -0.07441024
> colSums(tmp2)
[1] -7.441024
> colVars(tmp2)
[1] 0.8690527
> colSd(tmp2)
[1] 0.93223
> colMax(tmp2)
[1] 1.853349
> colMin(tmp2)
[1] -2.794547
> colMedians(tmp2)
[1] -0.1239993
> colRanges(tmp2)
[,1]
[1,] -2.794547
[2,] 1.853349
>
> 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.8851037 -0.2340569 1.1197309 2.0687202 -3.9969404 0.8983475
[7] 3.8169885 2.1927908 -6.3157628 -3.2157818
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8085615
[2,] -0.7505212
[3,] -0.5018257
[4,] 0.5200942
[5,] 1.4171090
>
> rowApply(tmp,sum)
[1] -2.86884952 0.07077657 3.07523868 0.99426995 -0.11129742 0.56611307
[7] -2.36375269 -4.16897193 1.15286117 -1.89745555
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 9 1 3 4 10 9 3 9 5
[2,] 3 2 4 5 7 9 7 8 10 1
[3,] 9 8 7 2 3 4 4 7 7 7
[4,] 1 7 8 10 2 8 8 9 3 10
[5,] 5 3 5 8 1 1 5 10 1 2
[6,] 8 10 2 9 10 5 3 2 2 8
[7,] 10 5 10 7 9 3 6 6 4 3
[8,] 7 4 9 4 8 6 2 5 6 9
[9,] 2 1 6 1 5 7 1 4 8 6
[10,] 6 6 3 6 6 2 10 1 5 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.84808393 1.70821476 2.26610800 -0.58045503 0.84316214 4.09070313
[7] -0.18897371 0.08495683 1.88846791 -3.40449508 1.79253800 5.51255749
[13] -0.98716404 -1.64383348 0.94728208 0.07599110 0.43886417 1.74676171
[19] 5.07354824 1.10830118
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7622816
[2,] -0.4652576
[3,] 0.2040228
[4,] 0.8792818
[5,] 1.9923184
>
> rowApply(tmp,sum)
[1] 5.6650145 2.8007216 0.3755529 6.1718008 6.6075294
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 15 10 1 3 19
[2,] 3 3 20 13 14
[3,] 19 15 7 5 12
[4,] 4 5 8 11 15
[5,] 17 1 18 18 3
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.8792818 -0.8851393 1.6790857 -0.8267653 1.4429890 1.89518793
[2,] 0.2040228 -1.3318807 0.6459555 -0.7267961 -1.6772717 1.45625005
[3,] -1.7622816 2.6446644 -0.3446225 -0.2255187 0.5271754 -0.43020414
[4,] -0.4652576 0.5654126 -0.1761800 0.4522788 1.3293341 1.24965756
[5,] 1.9923184 0.7151578 0.4618694 0.7463462 -0.7790647 -0.08018826
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.4938337 0.80958772 -0.9093710 -0.2402664 0.003919379 1.6589365
[2,] 1.7429902 -0.06546029 -0.1046416 -1.5632650 1.098500483 0.3116836
[3,] 0.4400387 0.28680019 0.4555059 -1.3186325 -1.334671584 0.1921478
[4,] -1.2213684 0.21474226 -0.3072962 -0.1415586 0.668407262 1.6899276
[5,] -1.6444679 -1.16071304 2.7542709 -0.1407726 1.356382461 1.6598620
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.6397533 -0.5946938 1.08208558 -0.3631857 -1.9173579 0.66490547
[2,] 0.6073060 -0.3134108 0.61517757 -0.8532490 0.9019955 -0.53454228
[3,] -0.8914307 -1.1010944 -0.15138870 0.2188580 0.4275002 2.16938616
[4,] 0.5227344 0.1434241 0.01392819 1.7006917 0.6341273 -0.08801731
[5,] -0.5860204 0.2219414 -0.61252056 -0.6271238 0.3925991 -0.46497034
[,19] [,20]
[1,] 0.6515733 0.7801611
[2,] 1.8740941 0.5132632
[3,] 0.1312614 0.4420596
[4,] 0.5663313 -1.1795181
[5,] 1.8502881 0.5523353
>
>
> 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 : 653 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 : 566 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.07404239 -0.5965813 -0.7716112 -0.3489371 -1.439512 -0.263537 0.104134
col8 col9 col10 col11 col12 col13 col14
row1 1.580727 0.8411347 0.2449366 1.828469 0.7319651 -0.8383324 1.26627
col15 col16 col17 col18 col19 col20
row1 0.787327 0.9094839 2.118534 -1.300752 0.1441986 0.7012196
> tmp[,"col10"]
col10
row1 0.2449366
row2 -0.6606057
row3 0.8339346
row4 0.4388920
row5 0.3828417
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.07404239 -0.5965813 -0.77161125 -0.3489371 -1.439512 -0.2635370 0.104134
row5 0.35528922 0.0889269 0.04987343 1.1651536 -1.061556 0.7074845 1.682997
col8 col9 col10 col11 col12 col13 col14
row1 1.580727 0.8411347 0.2449366 1.8284691 0.7319651 -0.8383324 1.266270
row5 -1.377579 0.9681235 0.3828417 -0.6477223 1.1012605 -0.6747369 -1.063867
col15 col16 col17 col18 col19 col20
row1 0.787327 0.9094839 2.1185344 -1.300752 0.1441986 0.7012196
row5 -1.416252 1.4148483 -0.2001887 1.119572 -1.3466375 1.2428140
> tmp[,c("col6","col20")]
col6 col20
row1 -0.2635370 0.7012196
row2 1.3639899 -0.2074170
row3 -1.5025670 -0.3732095
row4 -1.6777349 0.6173552
row5 0.7074845 1.2428140
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.2635370 0.7012196
row5 0.7074845 1.2428140
>
>
>
>
> 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.28672 50.87142 49.46565 49.39268 50.73605 106.2111 50.46238 48.21341
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.06765 48.31649 48.3243 50.24371 48.91888 50.63448 50.64734 49.29779
col17 col18 col19 col20
row1 50.44203 49.68585 49.84449 105.7766
> tmp[,"col10"]
col10
row1 48.31649
row2 27.87526
row3 31.96003
row4 30.39913
row5 47.92063
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.28672 50.87142 49.46565 49.39268 50.73605 106.2111 50.46238 48.21341
row5 51.13185 52.32793 49.47207 47.76621 49.85362 105.0840 50.68210 49.32452
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.06765 48.31649 48.32430 50.24371 48.91888 50.63448 50.64734 49.29779
row5 47.93544 47.92063 48.71713 50.00796 49.25462 48.95563 47.74903 49.86296
col17 col18 col19 col20
row1 50.44203 49.68585 49.84449 105.7766
row5 51.92345 49.37847 49.72512 103.5652
> tmp[,c("col6","col20")]
col6 col20
row1 106.21108 105.77656
row2 74.12087 74.73328
row3 76.54793 74.72852
row4 75.98614 76.04684
row5 105.08398 103.56519
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.2111 105.7766
row5 105.0840 103.5652
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.2111 105.7766
row5 105.0840 103.5652
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.7783332
[2,] 0.4997780
[3,] 1.9074390
[4,] 2.3328578
[5,] -0.5103051
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.80783760 -0.1745530
[2,] 0.02573267 -0.7039068
[3,] 0.50061623 0.5988229
[4,] 0.06723769 -1.1712399
[5,] 0.96619651 -0.9349860
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -2.286670639 -0.5107970
[2,] -1.136605363 -0.7764720
[3,] 1.005702783 0.3539632
[4,] 0.002252275 0.3309376
[5,] 0.945245026 -0.4993827
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -2.286671
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -2.286671
[2,] -1.136605
>
>
>
> 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]
row3 -0.2693212 0.1251094 0.6349343 -0.9997153 -0.08246965 -0.3719265
row1 -0.4899732 -0.6434716 -0.6719741 0.2802245 1.01909364 0.4376454
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 2.163740 0.8443781 0.5143179 1.991744 2.1099117 -1.484419 -0.4040942
row1 -1.862185 0.6109375 1.1677628 1.018560 0.3266346 -1.008053 -0.8083293
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.0273890 -1.90989712 -1.2344229 -1.394711 0.6730348 1.2529790 -1.3279085
row1 -0.2027525 0.01109989 -0.7848665 1.069670 0.1596727 0.5318622 -0.9849987
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.5926452 0.1130167 -0.1278379 -0.4847839 1.182059 0.1910865 1.761991
[,8] [,9] [,10]
row2 -0.6023399 -0.3653055 -0.6964771
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 2.592091 -0.7828213 -0.2603831 1.555325 -0.7590883 0.1000439 -0.4523725
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.153169 1.025138 -0.04691441 -1.058666 0.2985119 0.6690234 2.228992
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.2856388 -0.01939593 0.550705 -0.06268788 -0.5378173 -1.713978
>
>
> 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: 0x56a29dc5f7e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f685259d1db"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6848290eba"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f68b0b692e"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f68694bf2cf"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6876c5351b"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6820234502"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f686e65f95f"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6843aa0059"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f68782a4ca2"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f681cc7e360"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6875fe7ff2"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6842a18c6c"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6820f15cf0"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f6861bb8b5a"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1b6f68549099eb"
>
>
> ### 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: 0x56a29d1da8e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x56a29d1da8e0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x56a29d1da8e0>
> rowMedians(tmp)
[1] 0.025778365 -0.007424149 0.353242557 0.417472160 0.056776321
[6] -0.341990555 0.512273261 -0.245804703 -0.127085747 -0.188643283
[11] 0.400698936 -0.089600727 0.531529317 -0.391136342 -0.080350290
[16] 0.185615591 -0.222940234 0.130763175 -0.083627120 0.681836397
[21] -0.087999055 -0.155012421 -0.426023025 -0.372339575 -0.606485996
[26] 0.100214685 0.216294846 0.395002146 0.428401016 0.039958053
[31] -0.280475531 0.304560851 -0.113053924 0.006518503 0.342027061
[36] 0.163183219 -0.129745222 0.233268507 -0.285461180 -0.077116894
[41] -0.574030505 -0.168125162 0.413784656 -0.652705291 -0.470817464
[46] -0.595857506 -0.037353125 -0.056835987 -0.043117503 -0.339843276
[51] -0.028029249 0.117563485 -0.528639347 0.566791519 -0.135514438
[56] 0.436081144 -0.035905096 0.003031965 -0.487713838 0.050113036
[61] -0.397357771 0.256942431 0.528997331 -0.109920976 -0.139223553
[66] -0.045571484 -0.120855675 0.251421139 0.286463992 -0.158328256
[71] -0.629544428 -0.142577030 0.495410037 -0.100296798 -0.561533034
[76] 0.165506772 -0.056438105 -0.126497407 -0.064114406 0.051084027
[81] -0.190275469 -0.008966819 -0.155059047 -0.213240174 0.111828523
[86] 0.503308258 -0.031455375 -0.580442637 0.273408838 -0.265363065
[91] -0.512228972 0.538832681 0.415780851 -0.882354846 0.066073078
[96] 0.003077713 0.061074614 -0.268512456 0.070617744 0.399994222
[101] 0.258542968 0.022116120 0.267606740 -0.061960053 -0.640367791
[106] 0.234020710 0.217815669 0.191109076 0.250988395 -0.016106362
[111] -0.165967497 0.041177566 -0.230376903 0.076924772 -0.274066399
[116] -0.237295658 -0.432437531 -0.312895485 0.365919350 0.280154453
[121] -0.647749800 0.085454516 -0.377556932 -0.289829809 -0.350191479
[126] 0.217883193 -0.334388986 0.810062331 0.110532320 -0.502570585
[131] -0.151707142 0.208202576 0.300773034 -0.589872311 0.021803761
[136] 0.152294828 -0.093051595 0.397071490 0.198660567 0.718965392
[141] -0.007416452 -0.185824932 -0.358102757 -0.025098394 0.438600020
[146] 0.049439833 -0.314568442 0.098368795 -0.102517064 0.051587755
[151] -0.283696109 -0.108142403 -0.074971290 0.636847452 0.255775344
[156] 0.089929941 -0.068646991 0.036693690 0.110818397 0.140138976
[161] -0.061764812 0.361164343 0.161553124 -0.172154467 -0.059699549
[166] -0.113842506 0.032725933 -0.184344292 -0.449028308 -0.274267739
[171] -0.211969062 0.012235395 -0.458186782 0.375664021 0.258907569
[176] 0.372898387 -0.571987311 -0.040645923 -0.177746241 0.026005092
[181] 0.468329308 -0.079240328 -0.261861905 -0.414771611 -0.449527514
[186] -0.385892946 0.262312008 0.241077380 -0.104544641 -0.205710580
[191] -0.073148286 -0.624247443 -0.339194217 0.575724694 0.074312968
[196] 0.141880201 0.689760050 0.070377173 -0.827478880 0.196030126
[201] -0.664001175 0.225068664 0.230531052 0.014050656 0.086684558
[206] -0.259290486 0.169183336 -0.052566076 -0.317802429 -0.535810526
[211] -0.271014465 0.017977470 -0.109769282 0.024573523 0.098362895
[216] 0.509028222 0.313351642 -0.025437007 0.032404836 -0.363191529
[221] -0.069452655 -0.029095767 0.022311455 -0.401946417 0.196551295
[226] -0.395479678 0.268985780 0.169489632 -0.296392215 -0.111979598
>
> proc.time()
user system elapsed
1.351 1.406 2.747
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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: 0x55b3a762bb20>
> .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: 0x55b3a762bb20>
> .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: 0x55b3a762bb20>
> .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: 0x55b3a762bb20>
> 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: 0x55b3a760c410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a760c410>
> .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: 0x55b3a760c410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a760c410>
> .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: 0x55b3a760c410>
> 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: 0x55b3a5eb97a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a5eb97a0>
> .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: 0x55b3a5eb97a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55b3a5eb97a0>
> .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: 0x55b3a5eb97a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x55b3a5eb97a0>
> .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: 0x55b3a5eb97a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x55b3a5eb97a0>
> .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: 0x55b3a5eb97a0>
> 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: 0x55b3a6e8b680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55b3a6e8b680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a6e8b680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a6e8b680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b72801c8fcc53" "BufferedMatrixFile1b7280a896ee3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b72801c8fcc53" "BufferedMatrixFile1b7280a896ee3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a6c1f490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a6c1f490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55b3a6c1f490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55b3a6c1f490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55b3a6c1f490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55b3a6c1f490>
> .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: 0x55b3a827b110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55b3a827b110>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55b3a827b110>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55b3a827b110>
> 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: 0x55b3a831e5e0>
> .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: 0x55b3a831e5e0>
> rm(P)
>
> proc.time()
user system elapsed
0.263 0.061 0.309
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.251 0.043 0.283