| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-12 11:33 -0400 (Thu, 12 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" | 4806 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-03-01 r89506) -- "Unsuffered Consequences" | 4049 |
| 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 256/2360 | 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 | ERROR | ERROR | skipped | skipped | |||||||||
| 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. |
| 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: 2026-03-11 21:40:05 -0400 (Wed, 11 Mar 2026) |
| EndedAt: 2026-03-11 21:40:30 -0400 (Wed, 11 Mar 2026) |
| EllapsedTime: 25.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) (2026-03-05 r89546)
* 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.4 LTS
* using session charset: UTF-8
* current time: 2026-03-12 01:40:06 UTC
* 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.1) 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.1) 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) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 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.271 0.062 0.315
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 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 479482 25.7 1050322 56.1 639251 34.2
Vcells 886403 6.8 8388608 64.0 2083267 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] "Wed Mar 11 21:40:20 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] "Wed Mar 11 21:40:20 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: 0x59c5bc12a4f0>
>
>
>
> 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] "Wed Mar 11 21:40:21 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] "Wed Mar 11 21:40:21 2026"
>
> ColMode(tmp2)
<pointer: 0x59c5bc12a4f0>
>
>
>
> ### 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,] 101.193875841 0.1886256 -1.6276392 0.51692409
[2,] -1.342389828 -0.3364350 -0.9903565 -0.50129919
[3,] 0.005973232 0.3343089 -1.1383232 -0.03241382
[4,] -0.276103979 0.9340769 1.5380529 -0.29554525
> 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,] 1.011939e+02 0.1886256 1.6276392 0.51692409
[2,] 1.342390e+00 0.3364350 0.9903565 0.50129919
[3,] 5.973232e-03 0.3343089 1.1383232 0.03241382
[4,] 2.761040e-01 0.9340769 1.5380529 0.29554525
> 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.05951668 0.4343105 1.2757896 0.7189743
[2,] 1.15861548 0.5800302 0.9951665 0.7080249
[3,] 0.07728669 0.5781945 1.0669223 0.1800384
[4,] 0.52545597 0.9664765 1.2401826 0.5436407
>
> 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,] 226.78904 29.53173 39.38554 32.70667
[2,] 37.92854 31.13674 35.94202 32.58155
[3,] 25.77884 31.11625 36.80755 26.83280
[4,] 30.53066 35.59884 38.93988 30.73195
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x59c5bcadaaa0>
> exp(tmp5)
<pointer: 0x59c5bcadaaa0>
> log(tmp5,2)
<pointer: 0x59c5bcadaaa0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.0317
> Min(tmp5)
[1] 52.50392
> mean(tmp5)
[1] 73.02296
> Sum(tmp5)
[1] 14604.59
> Var(tmp5)
[1] 874.2174
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.08334 71.72549 70.75515 71.97509 74.43004 68.50680 70.17719 72.27204
[9] 71.55443 68.75006
> rowSums(tmp5)
[1] 1801.667 1434.510 1415.103 1439.502 1488.601 1370.136 1403.544 1445.441
[9] 1431.089 1375.001
> rowVars(tmp5)
[1] 8150.73630 77.68003 82.16946 52.81487 45.23481 78.91035
[7] 76.55604 79.49740 97.37092 46.42989
> rowSd(tmp5)
[1] 90.281428 8.813628 9.064737 7.267384 6.725683 8.883150 8.749631
[8] 8.916131 9.867671 6.813948
> rowMax(tmp5)
[1] 472.03168 86.20459 85.53856 90.24324 84.14605 84.96928 86.74714
[8] 89.10687 92.50321 86.37339
> rowMin(tmp5)
[1] 55.27082 56.79584 53.65528 63.54558 62.46839 52.50392 53.48154 56.85507
[9] 56.79771 58.92062
>
> colMeans(tmp5)
[1] 108.46851 70.89801 71.90067 66.17609 69.97695 73.15788 67.40808
[8] 66.88918 70.32140 65.89601 73.06910 71.67023 71.23159 74.31885
[15] 74.67821 78.96186 71.77773 66.31909 75.99436 71.34547
> colSums(tmp5)
[1] 1084.6851 708.9801 719.0067 661.7609 699.7695 731.5788 674.0808
[8] 668.8918 703.2140 658.9601 730.6910 716.7023 712.3159 743.1885
[15] 746.7821 789.6186 717.7773 663.1909 759.9436 713.4547
> colVars(tmp5)
[1] 16381.34353 66.42118 72.27901 60.20051 30.36545 59.37824
[7] 45.76471 71.96622 31.81243 25.97499 65.83088 57.81618
[13] 79.56585 47.18129 97.66796 34.71871 145.81893 73.65067
[19] 90.37049 71.29555
> colSd(tmp5)
[1] 127.989623 8.149919 8.501706 7.758899 5.510486 7.705728
[7] 6.764962 8.483291 5.640251 5.096566 8.113623 7.603695
[13] 8.919969 6.868864 9.882710 5.892259 12.075551 8.581997
[19] 9.506339 8.443669
> colMax(tmp5)
[1] 472.03168 82.26859 81.97583 83.72044 79.82406 86.37339 75.29159
[8] 81.95096 79.87709 73.03666 83.62519 86.57843 84.14605 82.95806
[15] 89.10687 86.30099 90.24324 81.91499 92.50321 84.96928
> colMin(tmp5)
[1] 53.65528 59.59965 58.73107 55.84895 63.40244 57.58145 52.50392 54.91941
[9] 62.43514 56.79584 61.30880 62.26745 55.27082 63.60399 59.29491 69.15060
[17] 53.48154 56.79771 62.04611 60.01900
>
>
> ### 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.08334 71.72549 70.75515 71.97509 74.43004 68.50680 NA 72.27204
[9] 71.55443 68.75006
> rowSums(tmp5)
[1] 1801.667 1434.510 1415.103 1439.502 1488.601 1370.136 NA 1445.441
[9] 1431.089 1375.001
> rowVars(tmp5)
[1] 8150.73630 77.68003 82.16946 52.81487 45.23481 78.91035
[7] 67.19512 79.49740 97.37092 46.42989
> rowSd(tmp5)
[1] 90.281428 8.813628 9.064737 7.267384 6.725683 8.883150 8.197263
[8] 8.916131 9.867671 6.813948
> rowMax(tmp5)
[1] 472.03168 86.20459 85.53856 90.24324 84.14605 84.96928 NA
[8] 89.10687 92.50321 86.37339
> rowMin(tmp5)
[1] 55.27082 56.79584 53.65528 63.54558 62.46839 52.50392 NA 56.85507
[9] 56.79771 58.92062
>
> colMeans(tmp5)
[1] 108.46851 70.89801 71.90067 66.17609 69.97695 73.15788 67.40808
[8] NA 70.32140 65.89601 73.06910 71.67023 71.23159 74.31885
[15] 74.67821 78.96186 71.77773 66.31909 75.99436 71.34547
> colSums(tmp5)
[1] 1084.6851 708.9801 719.0067 661.7609 699.7695 731.5788 674.0808
[8] NA 703.2140 658.9601 730.6910 716.7023 712.3159 743.1885
[15] 746.7821 789.6186 717.7773 663.1909 759.9436 713.4547
> colVars(tmp5)
[1] 16381.34353 66.42118 72.27901 60.20051 30.36545 59.37824
[7] 45.76471 NA 31.81243 25.97499 65.83088 57.81618
[13] 79.56585 47.18129 97.66796 34.71871 145.81893 73.65067
[19] 90.37049 71.29555
> colSd(tmp5)
[1] 127.989623 8.149919 8.501706 7.758899 5.510486 7.705728
[7] 6.764962 NA 5.640251 5.096566 8.113623 7.603695
[13] 8.919969 6.868864 9.882710 5.892259 12.075551 8.581997
[19] 9.506339 8.443669
> colMax(tmp5)
[1] 472.03168 82.26859 81.97583 83.72044 79.82406 86.37339 75.29159
[8] NA 79.87709 73.03666 83.62519 86.57843 84.14605 82.95806
[15] 89.10687 86.30099 90.24324 81.91499 92.50321 84.96928
> colMin(tmp5)
[1] 53.65528 59.59965 58.73107 55.84895 63.40244 57.58145 52.50392 NA
[9] 62.43514 56.79584 61.30880 62.26745 55.27082 63.60399 59.29491 69.15060
[17] 53.48154 56.79771 62.04611 60.01900
>
> Max(tmp5,na.rm=TRUE)
[1] 472.0317
> Min(tmp5,na.rm=TRUE)
[1] 52.50392
> mean(tmp5,na.rm=TRUE)
[1] 73.11394
> Sum(tmp5,na.rm=TRUE)
[1] 14549.67
> Var(tmp5,na.rm=TRUE)
[1] 876.9691
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.08334 71.72549 70.75515 71.97509 74.43004 68.50680 70.98023 72.27204
[9] 71.55443 68.75006
> rowSums(tmp5,na.rm=TRUE)
[1] 1801.667 1434.510 1415.103 1439.502 1488.601 1370.136 1348.624 1445.441
[9] 1431.089 1375.001
> rowVars(tmp5,na.rm=TRUE)
[1] 8150.73630 77.68003 82.16946 52.81487 45.23481 78.91035
[7] 67.19512 79.49740 97.37092 46.42989
> rowSd(tmp5,na.rm=TRUE)
[1] 90.281428 8.813628 9.064737 7.267384 6.725683 8.883150 8.197263
[8] 8.916131 9.867671 6.813948
> rowMax(tmp5,na.rm=TRUE)
[1] 472.03168 86.20459 85.53856 90.24324 84.14605 84.96928 86.74714
[8] 89.10687 92.50321 86.37339
> rowMin(tmp5,na.rm=TRUE)
[1] 55.27082 56.79584 53.65528 63.54558 62.46839 52.50392 53.48154 56.85507
[9] 56.79771 58.92062
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.46851 70.89801 71.90067 66.17609 69.97695 73.15788 67.40808
[8] 68.21915 70.32140 65.89601 73.06910 71.67023 71.23159 74.31885
[15] 74.67821 78.96186 71.77773 66.31909 75.99436 71.34547
> colSums(tmp5,na.rm=TRUE)
[1] 1084.6851 708.9801 719.0067 661.7609 699.7695 731.5788 674.0808
[8] 613.9723 703.2140 658.9601 730.6910 716.7023 712.3159 743.1885
[15] 746.7821 789.6186 717.7773 663.1909 759.9436 713.4547
> colVars(tmp5,na.rm=TRUE)
[1] 16381.34353 66.42118 72.27901 60.20051 30.36545 59.37824
[7] 45.76471 61.06265 31.81243 25.97499 65.83088 57.81618
[13] 79.56585 47.18129 97.66796 34.71871 145.81893 73.65067
[19] 90.37049 71.29555
> colSd(tmp5,na.rm=TRUE)
[1] 127.989623 8.149919 8.501706 7.758899 5.510486 7.705728
[7] 6.764962 7.814260 5.640251 5.096566 8.113623 7.603695
[13] 8.919969 6.868864 9.882710 5.892259 12.075551 8.581997
[19] 9.506339 8.443669
> colMax(tmp5,na.rm=TRUE)
[1] 472.03168 82.26859 81.97583 83.72044 79.82406 86.37339 75.29159
[8] 81.95096 79.87709 73.03666 83.62519 86.57843 84.14605 82.95806
[15] 89.10687 86.30099 90.24324 81.91499 92.50321 84.96928
> colMin(tmp5,na.rm=TRUE)
[1] 53.65528 59.59965 58.73107 55.84895 63.40244 57.58145 52.50392 60.94495
[9] 62.43514 56.79584 61.30880 62.26745 55.27082 63.60399 59.29491 69.15060
[17] 53.48154 56.79771 62.04611 60.01900
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.08334 71.72549 70.75515 71.97509 74.43004 68.50680 NaN 72.27204
[9] 71.55443 68.75006
> rowSums(tmp5,na.rm=TRUE)
[1] 1801.667 1434.510 1415.103 1439.502 1488.601 1370.136 0.000 1445.441
[9] 1431.089 1375.001
> rowVars(tmp5,na.rm=TRUE)
[1] 8150.73630 77.68003 82.16946 52.81487 45.23481 78.91035
[7] NA 79.49740 97.37092 46.42989
> rowSd(tmp5,na.rm=TRUE)
[1] 90.281428 8.813628 9.064737 7.267384 6.725683 8.883150 NA
[8] 8.916131 9.867671 6.813948
> rowMax(tmp5,na.rm=TRUE)
[1] 472.03168 86.20459 85.53856 90.24324 84.14605 84.96928 NA
[8] 89.10687 92.50321 86.37339
> rowMin(tmp5,na.rm=TRUE)
[1] 55.27082 56.79584 53.65528 63.54558 62.46839 52.50392 NA 56.85507
[9] 56.79771 58.92062
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.56647 71.20631 72.74206 66.22637 70.31370 72.55358 66.54208
[8] NaN 70.92787 65.18511 72.34939 70.01377 71.00736 75.20463
[15] 73.33722 80.05200 73.81064 65.28317 76.63280 71.60950
> colSums(tmp5,na.rm=TRUE)
[1] 1022.0982 640.8568 654.6786 596.0374 632.8233 652.9822 598.8787
[8] 0.0000 638.3508 586.6660 651.1445 630.1239 639.0662 676.8417
[15] 660.0350 720.4680 664.2958 587.5486 689.6952 644.4855
> colVars(tmp5,na.rm=TRUE)
[1] 18136.63292 73.65451 73.34959 67.69713 32.88533 62.69226
[7] 43.04824 NA 31.65117 23.53630 68.23246 34.17456
[13] 88.94597 44.25196 89.64604 25.68901 117.55312 70.78429
[19] 97.08128 79.42322
> colSd(tmp5,na.rm=TRUE)
[1] 134.672317 8.582221 8.564437 8.227826 5.734573 7.917844
[7] 6.561116 NA 5.625937 4.851422 8.260294 5.845901
[13] 9.431117 6.652215 9.468159 5.068432 10.842192 8.413340
[19] 9.852984 8.911971
> colMax(tmp5,na.rm=TRUE)
[1] 472.03168 82.26859 81.97583 83.72044 79.82406 86.37339 75.29159
[8] -Inf 79.87709 73.03666 83.62519 82.25892 84.14605 82.95806
[15] 89.10687 86.30099 90.24324 81.91499 92.50321 84.96928
> colMin(tmp5,na.rm=TRUE)
[1] 53.65528 59.59965 58.73107 55.84895 63.40244 57.58145 52.50392 Inf
[9] 62.43514 56.79584 61.30880 62.26745 55.27082 63.60399 59.29491 73.17172
[17] 58.68714 56.79771 62.04611 60.01900
>
>
>
>
> 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] 182.8079 116.7827 321.0277 250.2283 269.7628 290.5539 282.4456 185.7601
[9] 307.7566 261.4105
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 182.8079 116.7827 321.0277 250.2283 269.7628 290.5539 282.4456 185.7601
[9] 307.7566 261.4105
>
>
>
> 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.421085e-14 -5.684342e-14 4.263256e-14 -2.842171e-14 -5.684342e-14
[6] 0.000000e+00 -2.842171e-14 -8.526513e-14 2.842171e-14 -5.684342e-14
[11] -2.273737e-13 5.684342e-14 5.684342e-14 -8.526513e-14 -1.136868e-13
[16] -5.684342e-14 5.684342e-14 5.684342e-14 1.136868e-13 1.989520e-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)
+ }
1 3
1 8
6 11
4 5
3 13
3 12
5 7
3 16
4 14
4 12
5 2
7 8
4 12
6 20
3 18
9 4
8 5
6 1
2 19
6 16
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.444149
> Min(tmp)
[1] -2.530638
> mean(tmp)
[1] 0.03861073
> Sum(tmp)
[1] 3.861073
> Var(tmp)
[1] 1.144152
>
> rowMeans(tmp)
[1] 0.03861073
> rowSums(tmp)
[1] 3.861073
> rowVars(tmp)
[1] 1.144152
> rowSd(tmp)
[1] 1.06965
> rowMax(tmp)
[1] 2.444149
> rowMin(tmp)
[1] -2.530638
>
> colMeans(tmp)
[1] 0.67302571 -0.82856820 0.92619495 0.32011281 0.78714502 -1.08824270
[7] 1.03102796 -0.98415845 1.79967059 -0.02067598 -0.12675714 0.96812649
[13] 1.97884040 -0.48869333 -0.64648533 -0.59309670 -1.16958796 0.17422954
[19] 0.32149280 1.43754112 -0.32218866 1.85969793 -0.65348271 0.28271110
[25] -0.88101874 0.02854157 -1.18115387 -1.23601047 0.64170479 -0.07242627
[31] 0.50005460 -1.86039690 1.02953007 -1.39670435 0.76741002 -1.76475133
[37] 1.24296791 1.72913565 1.19793937 -1.00301387 -2.53063754 -1.09973467
[43] -1.57609090 0.99198252 -0.03791410 -0.81098805 0.62788667 0.49354733
[49] 0.97301576 0.53669994 -0.23876772 1.31684236 0.75934714 1.47829880
[55] -1.37025759 0.86978546 0.15842281 -0.25570756 1.64558491 -0.80935585
[61] -1.84325765 0.46691272 0.27797165 1.56379433 -1.87622097 0.78731850
[67] 2.44414935 -0.11096641 -0.01516279 0.12541022 0.96304204 -0.94337702
[73] -0.14476632 -1.52526400 -0.44382828 0.17461595 -0.86719402 -0.59617996
[79] -1.41887333 1.04282574 -0.31587642 -0.75231148 -1.72355381 -0.62423769
[85] 0.48483802 -0.27388968 -1.12168933 1.30703643 -0.27367008 -0.35141355
[91] 1.81773078 -0.02555604 2.07666377 -0.67390067 -0.78873596 1.34169880
[97] 0.45602106 -0.61920289 0.14610008 1.21242458
> colSums(tmp)
[1] 0.67302571 -0.82856820 0.92619495 0.32011281 0.78714502 -1.08824270
[7] 1.03102796 -0.98415845 1.79967059 -0.02067598 -0.12675714 0.96812649
[13] 1.97884040 -0.48869333 -0.64648533 -0.59309670 -1.16958796 0.17422954
[19] 0.32149280 1.43754112 -0.32218866 1.85969793 -0.65348271 0.28271110
[25] -0.88101874 0.02854157 -1.18115387 -1.23601047 0.64170479 -0.07242627
[31] 0.50005460 -1.86039690 1.02953007 -1.39670435 0.76741002 -1.76475133
[37] 1.24296791 1.72913565 1.19793937 -1.00301387 -2.53063754 -1.09973467
[43] -1.57609090 0.99198252 -0.03791410 -0.81098805 0.62788667 0.49354733
[49] 0.97301576 0.53669994 -0.23876772 1.31684236 0.75934714 1.47829880
[55] -1.37025759 0.86978546 0.15842281 -0.25570756 1.64558491 -0.80935585
[61] -1.84325765 0.46691272 0.27797165 1.56379433 -1.87622097 0.78731850
[67] 2.44414935 -0.11096641 -0.01516279 0.12541022 0.96304204 -0.94337702
[73] -0.14476632 -1.52526400 -0.44382828 0.17461595 -0.86719402 -0.59617996
[79] -1.41887333 1.04282574 -0.31587642 -0.75231148 -1.72355381 -0.62423769
[85] 0.48483802 -0.27388968 -1.12168933 1.30703643 -0.27367008 -0.35141355
[91] 1.81773078 -0.02555604 2.07666377 -0.67390067 -0.78873596 1.34169880
[97] 0.45602106 -0.61920289 0.14610008 1.21242458
> 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.67302571 -0.82856820 0.92619495 0.32011281 0.78714502 -1.08824270
[7] 1.03102796 -0.98415845 1.79967059 -0.02067598 -0.12675714 0.96812649
[13] 1.97884040 -0.48869333 -0.64648533 -0.59309670 -1.16958796 0.17422954
[19] 0.32149280 1.43754112 -0.32218866 1.85969793 -0.65348271 0.28271110
[25] -0.88101874 0.02854157 -1.18115387 -1.23601047 0.64170479 -0.07242627
[31] 0.50005460 -1.86039690 1.02953007 -1.39670435 0.76741002 -1.76475133
[37] 1.24296791 1.72913565 1.19793937 -1.00301387 -2.53063754 -1.09973467
[43] -1.57609090 0.99198252 -0.03791410 -0.81098805 0.62788667 0.49354733
[49] 0.97301576 0.53669994 -0.23876772 1.31684236 0.75934714 1.47829880
[55] -1.37025759 0.86978546 0.15842281 -0.25570756 1.64558491 -0.80935585
[61] -1.84325765 0.46691272 0.27797165 1.56379433 -1.87622097 0.78731850
[67] 2.44414935 -0.11096641 -0.01516279 0.12541022 0.96304204 -0.94337702
[73] -0.14476632 -1.52526400 -0.44382828 0.17461595 -0.86719402 -0.59617996
[79] -1.41887333 1.04282574 -0.31587642 -0.75231148 -1.72355381 -0.62423769
[85] 0.48483802 -0.27388968 -1.12168933 1.30703643 -0.27367008 -0.35141355
[91] 1.81773078 -0.02555604 2.07666377 -0.67390067 -0.78873596 1.34169880
[97] 0.45602106 -0.61920289 0.14610008 1.21242458
> colMin(tmp)
[1] 0.67302571 -0.82856820 0.92619495 0.32011281 0.78714502 -1.08824270
[7] 1.03102796 -0.98415845 1.79967059 -0.02067598 -0.12675714 0.96812649
[13] 1.97884040 -0.48869333 -0.64648533 -0.59309670 -1.16958796 0.17422954
[19] 0.32149280 1.43754112 -0.32218866 1.85969793 -0.65348271 0.28271110
[25] -0.88101874 0.02854157 -1.18115387 -1.23601047 0.64170479 -0.07242627
[31] 0.50005460 -1.86039690 1.02953007 -1.39670435 0.76741002 -1.76475133
[37] 1.24296791 1.72913565 1.19793937 -1.00301387 -2.53063754 -1.09973467
[43] -1.57609090 0.99198252 -0.03791410 -0.81098805 0.62788667 0.49354733
[49] 0.97301576 0.53669994 -0.23876772 1.31684236 0.75934714 1.47829880
[55] -1.37025759 0.86978546 0.15842281 -0.25570756 1.64558491 -0.80935585
[61] -1.84325765 0.46691272 0.27797165 1.56379433 -1.87622097 0.78731850
[67] 2.44414935 -0.11096641 -0.01516279 0.12541022 0.96304204 -0.94337702
[73] -0.14476632 -1.52526400 -0.44382828 0.17461595 -0.86719402 -0.59617996
[79] -1.41887333 1.04282574 -0.31587642 -0.75231148 -1.72355381 -0.62423769
[85] 0.48483802 -0.27388968 -1.12168933 1.30703643 -0.27367008 -0.35141355
[91] 1.81773078 -0.02555604 2.07666377 -0.67390067 -0.78873596 1.34169880
[97] 0.45602106 -0.61920289 0.14610008 1.21242458
> colMedians(tmp)
[1] 0.67302571 -0.82856820 0.92619495 0.32011281 0.78714502 -1.08824270
[7] 1.03102796 -0.98415845 1.79967059 -0.02067598 -0.12675714 0.96812649
[13] 1.97884040 -0.48869333 -0.64648533 -0.59309670 -1.16958796 0.17422954
[19] 0.32149280 1.43754112 -0.32218866 1.85969793 -0.65348271 0.28271110
[25] -0.88101874 0.02854157 -1.18115387 -1.23601047 0.64170479 -0.07242627
[31] 0.50005460 -1.86039690 1.02953007 -1.39670435 0.76741002 -1.76475133
[37] 1.24296791 1.72913565 1.19793937 -1.00301387 -2.53063754 -1.09973467
[43] -1.57609090 0.99198252 -0.03791410 -0.81098805 0.62788667 0.49354733
[49] 0.97301576 0.53669994 -0.23876772 1.31684236 0.75934714 1.47829880
[55] -1.37025759 0.86978546 0.15842281 -0.25570756 1.64558491 -0.80935585
[61] -1.84325765 0.46691272 0.27797165 1.56379433 -1.87622097 0.78731850
[67] 2.44414935 -0.11096641 -0.01516279 0.12541022 0.96304204 -0.94337702
[73] -0.14476632 -1.52526400 -0.44382828 0.17461595 -0.86719402 -0.59617996
[79] -1.41887333 1.04282574 -0.31587642 -0.75231148 -1.72355381 -0.62423769
[85] 0.48483802 -0.27388968 -1.12168933 1.30703643 -0.27367008 -0.35141355
[91] 1.81773078 -0.02555604 2.07666377 -0.67390067 -0.78873596 1.34169880
[97] 0.45602106 -0.61920289 0.14610008 1.21242458
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.6730257 -0.8285682 0.926195 0.3201128 0.787145 -1.088243 1.031028
[2,] 0.6730257 -0.8285682 0.926195 0.3201128 0.787145 -1.088243 1.031028
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.9841585 1.799671 -0.02067598 -0.1267571 0.9681265 1.97884 -0.4886933
[2,] -0.9841585 1.799671 -0.02067598 -0.1267571 0.9681265 1.97884 -0.4886933
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.6464853 -0.5930967 -1.169588 0.1742295 0.3214928 1.437541 -0.3221887
[2,] -0.6464853 -0.5930967 -1.169588 0.1742295 0.3214928 1.437541 -0.3221887
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.859698 -0.6534827 0.2827111 -0.8810187 0.02854157 -1.181154 -1.23601
[2,] 1.859698 -0.6534827 0.2827111 -0.8810187 0.02854157 -1.181154 -1.23601
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.6417048 -0.07242627 0.5000546 -1.860397 1.02953 -1.396704 0.76741
[2,] 0.6417048 -0.07242627 0.5000546 -1.860397 1.02953 -1.396704 0.76741
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.764751 1.242968 1.729136 1.197939 -1.003014 -2.530638 -1.099735
[2,] -1.764751 1.242968 1.729136 1.197939 -1.003014 -2.530638 -1.099735
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.576091 0.9919825 -0.0379141 -0.810988 0.6278867 0.4935473 0.9730158
[2,] -1.576091 0.9919825 -0.0379141 -0.810988 0.6278867 0.4935473 0.9730158
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.5366999 -0.2387677 1.316842 0.7593471 1.478299 -1.370258 0.8697855
[2,] 0.5366999 -0.2387677 1.316842 0.7593471 1.478299 -1.370258 0.8697855
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.1584228 -0.2557076 1.645585 -0.8093558 -1.843258 0.4669127 0.2779717
[2,] 0.1584228 -0.2557076 1.645585 -0.8093558 -1.843258 0.4669127 0.2779717
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.563794 -1.876221 0.7873185 2.444149 -0.1109664 -0.01516279 0.1254102
[2,] 1.563794 -1.876221 0.7873185 2.444149 -0.1109664 -0.01516279 0.1254102
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.963042 -0.943377 -0.1447663 -1.525264 -0.4438283 0.174616 -0.867194
[2,] 0.963042 -0.943377 -0.1447663 -1.525264 -0.4438283 0.174616 -0.867194
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.59618 -1.418873 1.042826 -0.3158764 -0.7523115 -1.723554 -0.6242377
[2,] -0.59618 -1.418873 1.042826 -0.3158764 -0.7523115 -1.723554 -0.6242377
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.484838 -0.2738897 -1.121689 1.307036 -0.2736701 -0.3514135 1.817731
[2,] 0.484838 -0.2738897 -1.121689 1.307036 -0.2736701 -0.3514135 1.817731
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.02555604 2.076664 -0.6739007 -0.788736 1.341699 0.4560211 -0.6192029
[2,] -0.02555604 2.076664 -0.6739007 -0.788736 1.341699 0.4560211 -0.6192029
[,99] [,100]
[1,] 0.1461001 1.212425
[2,] 0.1461001 1.212425
>
>
> Max(tmp2)
[1] 2.774187
> Min(tmp2)
[1] -2.148166
> mean(tmp2)
[1] 0.1185624
> Sum(tmp2)
[1] 11.85624
> Var(tmp2)
[1] 0.9289156
>
> rowMeans(tmp2)
[1] 0.91645562 0.60933105 0.25272179 -0.97478397 -0.03085492 0.36895451
[7] -0.57974531 -0.34342804 -0.44884897 0.73177906 -0.21657847 -0.41596795
[13] 1.58594108 -0.31918459 -0.03298230 1.46148508 -0.33261391 -0.19901432
[19] -0.55282604 0.78921754 -0.19684409 0.15691156 0.33368802 -2.14816641
[25] 1.00895171 -0.18521971 0.89948519 0.41199240 0.67640993 1.47250437
[31] -1.25343738 0.56974492 -0.48289837 -0.22658186 0.72879436 -0.17553159
[37] -0.16305871 0.18449375 1.59915305 2.12157580 -1.25628842 -1.75516935
[43] 2.77418688 -1.97207116 -1.04812680 0.01469595 -2.14246139 -0.57206816
[49] 0.45941696 0.90097108 0.83130023 -0.84522859 0.56018680 0.33538495
[55] 0.22102686 0.99573016 0.02626838 0.50477014 -0.06104852 -0.63814480
[61] 1.60365319 0.49653069 -0.39908657 1.26321582 -0.60056072 -2.10499120
[67] 0.73929171 1.82551385 -0.77413720 0.82526261 -0.11013454 -0.16395026
[73] -0.50796589 -0.61869768 -0.83978476 0.49792596 1.07341920 0.33056432
[79] 1.05018689 2.24169933 0.11555486 -1.62008012 -0.54517966 1.58492444
[85] -0.54357200 0.90979652 1.20678394 -0.75200475 0.67756357 -0.10162314
[91] -1.05749893 -0.94288322 1.54801972 -0.31488631 0.54948469 -0.06888669
[97] 0.34911262 0.27757872 -0.10118068 -0.07709016
> rowSums(tmp2)
[1] 0.91645562 0.60933105 0.25272179 -0.97478397 -0.03085492 0.36895451
[7] -0.57974531 -0.34342804 -0.44884897 0.73177906 -0.21657847 -0.41596795
[13] 1.58594108 -0.31918459 -0.03298230 1.46148508 -0.33261391 -0.19901432
[19] -0.55282604 0.78921754 -0.19684409 0.15691156 0.33368802 -2.14816641
[25] 1.00895171 -0.18521971 0.89948519 0.41199240 0.67640993 1.47250437
[31] -1.25343738 0.56974492 -0.48289837 -0.22658186 0.72879436 -0.17553159
[37] -0.16305871 0.18449375 1.59915305 2.12157580 -1.25628842 -1.75516935
[43] 2.77418688 -1.97207116 -1.04812680 0.01469595 -2.14246139 -0.57206816
[49] 0.45941696 0.90097108 0.83130023 -0.84522859 0.56018680 0.33538495
[55] 0.22102686 0.99573016 0.02626838 0.50477014 -0.06104852 -0.63814480
[61] 1.60365319 0.49653069 -0.39908657 1.26321582 -0.60056072 -2.10499120
[67] 0.73929171 1.82551385 -0.77413720 0.82526261 -0.11013454 -0.16395026
[73] -0.50796589 -0.61869768 -0.83978476 0.49792596 1.07341920 0.33056432
[79] 1.05018689 2.24169933 0.11555486 -1.62008012 -0.54517966 1.58492444
[85] -0.54357200 0.90979652 1.20678394 -0.75200475 0.67756357 -0.10162314
[91] -1.05749893 -0.94288322 1.54801972 -0.31488631 0.54948469 -0.06888669
[97] 0.34911262 0.27757872 -0.10118068 -0.07709016
> 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.91645562 0.60933105 0.25272179 -0.97478397 -0.03085492 0.36895451
[7] -0.57974531 -0.34342804 -0.44884897 0.73177906 -0.21657847 -0.41596795
[13] 1.58594108 -0.31918459 -0.03298230 1.46148508 -0.33261391 -0.19901432
[19] -0.55282604 0.78921754 -0.19684409 0.15691156 0.33368802 -2.14816641
[25] 1.00895171 -0.18521971 0.89948519 0.41199240 0.67640993 1.47250437
[31] -1.25343738 0.56974492 -0.48289837 -0.22658186 0.72879436 -0.17553159
[37] -0.16305871 0.18449375 1.59915305 2.12157580 -1.25628842 -1.75516935
[43] 2.77418688 -1.97207116 -1.04812680 0.01469595 -2.14246139 -0.57206816
[49] 0.45941696 0.90097108 0.83130023 -0.84522859 0.56018680 0.33538495
[55] 0.22102686 0.99573016 0.02626838 0.50477014 -0.06104852 -0.63814480
[61] 1.60365319 0.49653069 -0.39908657 1.26321582 -0.60056072 -2.10499120
[67] 0.73929171 1.82551385 -0.77413720 0.82526261 -0.11013454 -0.16395026
[73] -0.50796589 -0.61869768 -0.83978476 0.49792596 1.07341920 0.33056432
[79] 1.05018689 2.24169933 0.11555486 -1.62008012 -0.54517966 1.58492444
[85] -0.54357200 0.90979652 1.20678394 -0.75200475 0.67756357 -0.10162314
[91] -1.05749893 -0.94288322 1.54801972 -0.31488631 0.54948469 -0.06888669
[97] 0.34911262 0.27757872 -0.10118068 -0.07709016
> rowMin(tmp2)
[1] 0.91645562 0.60933105 0.25272179 -0.97478397 -0.03085492 0.36895451
[7] -0.57974531 -0.34342804 -0.44884897 0.73177906 -0.21657847 -0.41596795
[13] 1.58594108 -0.31918459 -0.03298230 1.46148508 -0.33261391 -0.19901432
[19] -0.55282604 0.78921754 -0.19684409 0.15691156 0.33368802 -2.14816641
[25] 1.00895171 -0.18521971 0.89948519 0.41199240 0.67640993 1.47250437
[31] -1.25343738 0.56974492 -0.48289837 -0.22658186 0.72879436 -0.17553159
[37] -0.16305871 0.18449375 1.59915305 2.12157580 -1.25628842 -1.75516935
[43] 2.77418688 -1.97207116 -1.04812680 0.01469595 -2.14246139 -0.57206816
[49] 0.45941696 0.90097108 0.83130023 -0.84522859 0.56018680 0.33538495
[55] 0.22102686 0.99573016 0.02626838 0.50477014 -0.06104852 -0.63814480
[61] 1.60365319 0.49653069 -0.39908657 1.26321582 -0.60056072 -2.10499120
[67] 0.73929171 1.82551385 -0.77413720 0.82526261 -0.11013454 -0.16395026
[73] -0.50796589 -0.61869768 -0.83978476 0.49792596 1.07341920 0.33056432
[79] 1.05018689 2.24169933 0.11555486 -1.62008012 -0.54517966 1.58492444
[85] -0.54357200 0.90979652 1.20678394 -0.75200475 0.67756357 -0.10162314
[91] -1.05749893 -0.94288322 1.54801972 -0.31488631 0.54948469 -0.06888669
[97] 0.34911262 0.27757872 -0.10118068 -0.07709016
>
> colMeans(tmp2)
[1] 0.1185624
> colSums(tmp2)
[1] 11.85624
> colVars(tmp2)
[1] 0.9289156
> colSd(tmp2)
[1] 0.9638027
> colMax(tmp2)
[1] 2.774187
> colMin(tmp2)
[1] -2.148166
> colMedians(tmp2)
[1] 0.02048217
> colRanges(tmp2)
[,1]
[1,] -2.148166
[2,] 2.774187
>
> 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] -0.4455989 0.9184336 -3.7131216 0.1677582 1.8910306 -6.1191535
[7] 1.9547365 1.3538859 -0.8633327 1.5345210
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.74921336
[2,] -0.74370148
[3,] 0.06526798
[4,] 0.85079788
[5,] 1.21472242
>
> rowApply(tmp,sum)
[1] 0.3700833 2.7416166 1.3365623 0.9638358 0.5761016 -6.3125899
[7] 4.3324062 -2.2201569 -4.2714194 -0.8372806
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 7 8 2 7 2 9 3 10 3
[2,] 6 1 2 10 6 1 8 9 4 10
[3,] 7 3 4 7 1 5 10 1 3 2
[4,] 10 10 7 1 3 10 3 5 2 5
[5,] 8 4 6 6 4 6 5 7 7 8
[6,] 9 2 1 3 5 4 6 4 5 6
[7,] 1 9 5 9 9 8 7 2 9 9
[8,] 5 8 10 5 10 3 1 10 1 7
[9,] 4 6 3 4 8 9 4 6 6 1
[10,] 2 5 9 8 2 7 2 8 8 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.320603893 -1.890569493 -2.108242576 -1.384076263 -4.627096142
[6] -1.939727638 -0.860871264 1.001769761 -2.332479451 -1.328875949
[11] 3.018227428 2.843185025 -0.398711973 -1.711450475 0.005044023
[16] 2.407902074 3.758166301 -1.301112858 -1.349619612 -1.285182329
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.15927921
[2,] -0.66367226
[3,] -0.12493970
[4,] 0.06293039
[5,] 0.56435689
>
> rowApply(tmp,sum)
[1] 2.313654 4.726681 -5.751316 -3.227848 -8.865497
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 10 1 14 8 18
[2,] 9 8 6 5 13
[3,] 2 10 12 17 4
[4,] 4 19 8 9 7
[5,] 12 2 1 3 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.06293039 -0.06067857 -1.2676778 -0.8963718 0.1683814 0.45654846
[2,] -1.15927921 -0.19558515 0.1910388 1.3308139 -1.0601137 -0.30241691
[3,] -0.12493970 -0.94652504 -0.2892306 -0.4422362 -2.0293722 0.06486147
[4,] -0.66367226 -0.92403082 0.6811439 -0.4739070 -1.2141350 -1.61883370
[5,] 0.56435689 0.23625009 -1.4235168 -0.9023751 -0.4918566 -0.53988697
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.7549296 -0.2611284 -1.03340082 -0.06704859 1.1448145 0.5010304
[2,] 1.8187364 -0.2677033 0.04096317 1.25552275 0.3426314 0.9967263
[3,] -0.2138570 0.7139271 -0.29438307 -0.99464658 1.1099842 -0.5977610
[4,] 0.6431584 0.5490554 -1.18924018 -0.82172855 0.9038341 1.3016678
[5,] -2.3539795 0.2676190 0.14358146 -0.70097499 -0.4830368 0.6415215
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.2970605 0.1532123 -0.6622207 1.35688190 2.6335780 0.2563912
[2,] -0.2484167 0.2336132 0.4883376 -0.70759869 0.8359856 1.1138697
[3,] 0.6136387 -1.4325917 -0.3129737 0.89006385 -0.4233379 -1.1871004
[4,] -0.6841038 0.6363521 0.1128449 0.09495943 0.1986249 0.2267392
[5,] -1.3768906 -1.3020363 0.3790560 0.77359558 0.5133158 -1.7110126
[,19] [,20]
[1,] 0.7036727 -1.4173914
[2,] 0.6488860 -0.6293302
[3,] 1.2089898 -1.0638259
[4,] -2.3302229 1.3436467
[5,] -1.5809452 0.4817184
>
>
> 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 : 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 -1.346202 -0.5712126 1.057242 0.1264228 -0.09687671 0.5231385 -0.03834466
col8 col9 col10 col11 col12 col13 col14
row1 -1.151068 0.4083593 -0.9206303 0.3778992 0.5444968 1.336827 0.9938506
col15 col16 col17 col18 col19 col20
row1 0.7928219 -0.6371964 0.7646191 1.593455 0.253937 -1.288883
> tmp[,"col10"]
col10
row1 -0.9206303
row2 1.5069712
row3 -1.1990721
row4 0.3770828
row5 0.6019908
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -1.346202 -0.5712126 1.057242 0.1264228 -0.09687671 0.5231385 -0.03834466
row5 -1.425288 -0.6059218 1.081768 -0.1571433 -0.45948392 1.3673380 0.55899970
col8 col9 col10 col11 col12 col13
row1 -1.1510680 0.4083593 -0.9206303 0.37789922 0.5444968 1.3368266
row5 0.3425478 -0.7721753 0.6019908 0.04655951 -1.5010443 -0.1385038
col14 col15 col16 col17 col18 col19 col20
row1 0.9938506 0.7928219 -0.6371964 0.7646191 1.59345472 0.253937 -1.2888831
row5 -0.2237798 1.0851865 -0.6947351 0.9048238 0.06886955 -1.020450 -0.7569467
> tmp[,c("col6","col20")]
col6 col20
row1 0.5231385 -1.2888831
row2 -1.0598348 0.3985312
row3 -1.2688722 0.4135916
row4 1.2202275 -0.2651021
row5 1.3673380 -0.7569467
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.5231385 -1.2888831
row5 1.3673380 -0.7569467
>
>
>
>
> 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 51.07239 53.12006 50.35584 51.21823 50.32563 106.6184 49.55973 49.90335
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.58945 49.54951 49.55976 49.45794 50.83431 51.20434 50.19608 50.67803
col17 col18 col19 col20
row1 48.69204 48.80948 51.64089 104.7848
> tmp[,"col10"]
col10
row1 49.54951
row2 31.59740
row3 30.37562
row4 30.32431
row5 48.58676
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.07239 53.12006 50.35584 51.21823 50.32563 106.6184 49.55973 49.90335
row5 50.77772 48.80053 49.03181 50.71136 49.74247 105.2101 51.23833 49.59087
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.58945 49.54951 49.55976 49.45794 50.83431 51.20434 50.19608 50.67803
row5 51.33962 48.58676 50.87093 50.33053 50.73186 49.65939 50.29374 50.43659
col17 col18 col19 col20
row1 48.69204 48.80948 51.64089 104.7848
row5 49.09921 49.73270 52.40269 104.4864
> tmp[,c("col6","col20")]
col6 col20
row1 106.61843 104.78476
row2 75.03090 73.87046
row3 74.91224 75.70728
row4 75.42469 75.60553
row5 105.21011 104.48645
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.6184 104.7848
row5 105.2101 104.4864
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.6184 104.7848
row5 105.2101 104.4864
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.73095425
[2,] -0.91795240
[3,] -1.24974903
[4,] 1.04642881
[5,] -0.07893475
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.08577783 -1.5945321
[2,] 1.06885698 0.4172663
[3,] -1.14377650 -0.5114639
[4,] 0.68958905 -0.6531337
[5,] -0.50716083 -0.1089475
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2617741 -0.3930349
[2,] 1.5563627 0.8995253
[3,] 0.3932392 -0.8416762
[4,] 0.2707737 0.3109591
[5,] -0.5195023 2.4455240
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2617741
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2617741
[2,] 1.5563627
>
>
>
> 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 -0.878887 0.2098554 -0.5853977 1.572609 0.06334883 1.36473468 -1.0552338
row1 1.354545 0.3736489 1.0821948 1.473234 -0.18467715 -0.02672291 0.8618569
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.278803 0.4443274 -0.05219806 -1.272372 1.249639 0.1554242 -0.4808130
row1 -1.545514 -0.3532290 0.11675452 1.435555 -0.856891 -0.6323563 -0.2096012
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.09018949 -0.8759775 -0.07024129 -0.1448789 -1.18601366 0.7997861
row1 1.10246427 -0.0468053 0.02997439 0.6546950 0.04964823 1.1327259
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.293568 1.58888 -1.357528 -0.03037088 -2.182506 0.5619766 -0.4646715
[,8] [,9] [,10]
row2 -0.2858323 0.009546382 -0.3950405
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 2.431482 -0.2216946 -0.2492153 0.8935256 -1.238938 -0.2825849 -0.08193933
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.08473527 0.2101433 0.6111658 -1.993004 0.03228469 0.06635951 1.618304
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.584999 -1.307574 0.305408 0.1430748 -0.1748837 0.007539409
>
>
> 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: 0x59c5bde2a780>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b322c42df"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b1f05930d"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b1d93cdfe"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b34e9a6e"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b2d03f056"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b209eb51f"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b3037555d"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67bfc3e474"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b18c423e0"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b713585f3"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b64d5f303"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b219ffcd5"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b28fcf035"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b7a9b9c43"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM30e67b6029c74b"
>
>
> ### 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: 0x59c5bc819900>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x59c5bc819900>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x59c5bc819900>
> rowMedians(tmp)
[1] -0.632891309 0.387515782 -0.057566408 -0.154127437 0.024957247
[6] -0.238459159 0.370067734 -0.112389313 0.112488819 0.032493444
[11] 0.404657825 -0.358262016 -0.179668258 -0.388084588 -0.187407980
[16] 0.346226364 -0.083963328 0.092849880 0.059019848 -0.062469967
[21] -0.123976036 0.657370065 0.460834878 -0.008081111 0.187115249
[26] 0.009912223 -0.293546528 0.607881223 0.494143090 -0.157885650
[31] -0.139104743 -0.205167643 -0.226129798 -0.592799187 0.233595859
[36] -0.262740951 -0.093805989 -0.097543416 0.233849582 -0.215227382
[41] -0.171952402 -0.038161650 -0.395812615 -0.053030242 -0.399050767
[46] 0.192335883 0.412423772 -0.107985755 0.187509259 0.056441563
[51] -0.228715040 -0.089594819 -0.194642755 0.001335878 -0.207777984
[56] -0.309518827 -0.564626926 -0.496172738 0.179802979 0.063621648
[61] -0.276617765 -0.026767576 0.165891588 -0.127166023 0.100614181
[66] -0.015354274 0.209001356 -0.024167059 -0.047594831 -0.351397587
[71] 0.444127782 0.073758549 0.898618095 -0.409794084 -0.182492368
[76] -0.133939478 -0.662236683 -0.442200981 -0.492665461 0.593027843
[81] -0.042005770 -1.070424311 -0.378379288 0.377022539 0.564066781
[86] 0.130836231 0.576050513 -0.184867312 0.332534022 0.592147824
[91] -0.136164384 0.487980259 0.137966354 0.089830685 0.030336823
[96] -0.354886879 -0.509088674 -0.024730091 0.272156051 -0.180398281
[101] 0.618182964 0.014827390 -0.249904931 0.086950098 -0.048468102
[106] -0.131788966 0.174564363 -0.174463832 0.660169381 0.202340414
[111] 0.095411996 -0.182572380 0.616125925 0.365549441 0.126803607
[116] 0.190083586 -0.095709025 -0.056561744 0.725933382 0.283109755
[121] 0.366593407 0.169056168 -0.494078146 -0.190551170 0.629207258
[126] 0.144408942 0.381980001 -0.276267124 -0.481540502 0.155813379
[131] -0.764597212 -0.494554191 -0.270988379 -0.060185532 0.328159593
[136] 0.253943728 -0.125283471 0.392060436 0.093960281 0.141135368
[141] 0.519111638 0.086856859 -0.215775339 0.253837081 -0.124600543
[146] -0.036980759 0.062207357 0.174915850 0.238504580 0.038128681
[151] 0.247093226 -0.405090824 0.045173777 0.006472614 -0.449042352
[156] -0.602311281 0.333012624 -0.627175478 -0.166086478 -0.412504388
[161] -0.396635919 -0.132008589 -0.270009354 -0.600593747 0.415081654
[166] 0.165888176 0.299071621 -0.341670685 -0.504826333 0.716767832
[171] 0.304967528 -0.041622311 0.455957316 0.490437074 -0.114130872
[176] 0.212361149 0.452253468 -0.168065824 -0.177632255 -0.118102371
[181] 0.048042011 0.046794350 -0.052530212 -0.162063963 0.437776052
[186] 0.048964123 -0.040365029 0.220434187 0.134656216 0.151856697
[191] 0.293229661 0.142940726 0.006913116 0.377916830 0.042839937
[196] 0.010626134 0.093971103 0.049623701 0.181198031 -0.100204393
[201] -0.468566358 0.247866947 0.014454916 -0.204144842 -0.086316264
[206] -0.073804254 -0.002465094 0.289993429 0.024626114 0.156471592
[211] 0.011609671 0.249714715 -0.028176608 0.305618175 -0.447744015
[216] 0.065428160 -0.042135951 0.463057364 0.703813876 0.007380610
[221] 0.372145541 -0.429761305 0.220036097 -0.485238592 -0.137505078
[226] 0.290115502 0.046807694 -0.304613984 -0.042917844 0.070698442
>
> proc.time()
user system elapsed
1.331 1.456 2.771
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 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: 0x5780aac17ff0>
> .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: 0x5780aac17ff0>
> .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: 0x5780aac17ff0>
> .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: 0x5780aac17ff0>
> 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: 0x5780aa8c3710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa8c3710>
> .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: 0x5780aa8c3710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa8c3710>
> .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: 0x5780aa8c3710>
> 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: 0x5780aac273f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aac273f0>
> .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: 0x5780aac273f0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5780aac273f0>
> .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: 0x5780aac273f0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5780aac273f0>
> .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: 0x5780aac273f0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5780aac273f0>
> .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: 0x5780aac273f0>
> 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: 0x5780aa35e8c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5780aa35e8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa35e8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa35e8c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30e6b54d05a56b" "BufferedMatrixFile30e6b5550c2544"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30e6b54d05a56b" "BufferedMatrixFile30e6b5550c2544"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa08ae30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780aa08ae30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5780aa08ae30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5780aa08ae30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5780aa08ae30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5780aa08ae30>
> .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: 0x5780ab1e6790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5780ab1e6790>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5780ab1e6790>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5780ab1e6790>
> 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: 0x5780aa5d1860>
> .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: 0x5780aa5d1860>
> rm(P)
>
> proc.time()
user system elapsed
0.284 0.060 0.325
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 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.273 0.056 0.309