| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-29 10:14 -0400 (Wed, 29 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4988 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There" | 4694 |
| 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 260/2415 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| 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.76.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.76.0.tar.gz |
| StartedAt: 2026-04-28 22:20:35 -0400 (Tue, 28 Apr 2026) |
| EndedAt: 2026-04-28 22:21:00 -0400 (Tue, 28 Apr 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.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-29 02:20:36 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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.76.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 version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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.251 0.058 0.295
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 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] "Tue Apr 28 22:20:51 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] "Tue Apr 28 22:20:51 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: 0x5b8d837828f0>
>
>
>
> 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] "Tue Apr 28 22:20:51 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] "Tue Apr 28 22:20:51 2026"
>
> ColMode(tmp2)
<pointer: 0x5b8d837828f0>
>
>
>
> ### 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.86045066 -0.2750320 1.3737145 1.56051178
[2,] -0.12250741 0.2806746 0.5229831 -1.78353261
[3,] 0.08208915 -1.2686057 1.0207161 -0.02945592
[4,] 0.44140568 0.7152007 2.4170517 0.56460206
> 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.86045066 0.2750320 1.3737145 1.56051178
[2,] 0.12250741 0.2806746 0.5229831 1.78353261
[3,] 0.08208915 1.2686057 1.0207161 0.02945592
[4,] 0.44140568 0.7152007 2.4170517 0.56460206
> 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.9930201 0.5244349 1.1720557 1.2492045
[2,] 0.3500106 0.5297873 0.7231757 1.3354897
[3,] 0.2865120 1.1263240 1.0103050 0.1716273
[4,] 0.6643837 0.8456954 1.5546870 0.7514001
>
> 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,] 224.79065 30.51938 38.09427 39.05256
[2,] 28.62261 30.57855 32.75474 40.13843
[3,] 27.94721 37.53185 36.12377 26.74573
[4,] 32.08524 34.17215 42.96392 33.07860
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5b8d830cf830>
> exp(tmp5)
<pointer: 0x5b8d830cf830>
> log(tmp5,2)
<pointer: 0x5b8d830cf830>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.8723
> Min(tmp5)
[1] 53.22223
> mean(tmp5)
[1] 72.79017
> Sum(tmp5)
[1] 14558.03
> Var(tmp5)
[1] 869.5552
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.49004 67.94449 72.27198 73.12865 73.56445 69.11273 70.66265 66.81205
[9] 70.91498 72.99971
> rowSums(tmp5)
[1] 1809.801 1358.890 1445.440 1462.573 1471.289 1382.255 1413.253 1336.241
[9] 1418.300 1459.994
> rowVars(tmp5)
[1] 7968.37406 92.40816 101.46787 88.22249 91.69598 86.80355
[7] 70.59790 66.75383 50.09444 75.13692
> rowSd(tmp5)
[1] 89.265750 9.612916 10.073126 9.392683 9.575802 9.316842 8.402256
[8] 8.170301 7.077743 8.668156
> rowMax(tmp5)
[1] 467.87229 84.05006 86.95276 93.96147 97.56164 84.91059 86.33638
[8] 88.24033 83.00245 90.58854
> rowMin(tmp5)
[1] 57.28027 53.35627 55.66773 57.46801 55.68148 53.41915 53.22223 55.11716
[9] 58.07183 55.62409
>
> colMeans(tmp5)
[1] 106.15490 67.97689 74.23960 71.39115 69.76568 73.16431 72.65616
[8] 73.67645 70.17041 72.87386 71.95583 71.00215 70.05890 71.57195
[15] 68.59407 69.87395 68.64453 68.38890 71.24025 72.40350
> colSums(tmp5)
[1] 1061.5490 679.7689 742.3960 713.9115 697.6568 731.6431 726.5616
[8] 736.7645 701.7041 728.7386 719.5583 710.0215 700.5890 715.7195
[15] 685.9407 698.7395 686.4453 683.8890 712.4025 724.0350
> colVars(tmp5)
[1] 16201.70169 32.55834 116.26675 126.99926 69.46833 66.52078
[7] 100.74354 69.61740 130.98154 74.23435 37.49153 135.32808
[13] 79.33893 91.71179 78.80933 165.20949 83.73772 40.24094
[19] 102.50469 50.64518
> colSd(tmp5)
[1] 127.285905 5.705991 10.782706 11.269395 8.334766 8.156027
[7] 10.037108 8.343704 11.444717 8.615936 6.123033 11.633060
[13] 8.907240 9.576627 8.877462 12.853384 9.150831 6.343575
[19] 10.124460 7.116543
> colMax(tmp5)
[1] 467.87229 78.11762 89.42377 86.77785 83.04417 84.13630 86.33638
[8] 85.47748 86.95276 85.77707 78.41984 90.58854 85.73101 93.96147
[15] 81.69872 97.56164 84.05006 78.83728 85.60226 85.19541
> colMin(tmp5)
[1] 58.07183 60.10841 54.53829 53.41915 53.35627 59.77119 58.47790 60.75972
[9] 55.11716 57.31057 58.62594 53.73853 57.64826 62.07124 53.95128 53.22223
[17] 56.94536 57.46801 55.62409 65.26521
>
>
> ### 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.49004 67.94449 72.27198 73.12865 73.56445 69.11273 NA 66.81205
[9] 70.91498 72.99971
> rowSums(tmp5)
[1] 1809.801 1358.890 1445.440 1462.573 1471.289 1382.255 NA 1336.241
[9] 1418.300 1459.994
> rowVars(tmp5)
[1] 7968.37406 92.40816 101.46787 88.22249 91.69598 86.80355
[7] 73.61472 66.75383 50.09444 75.13692
> rowSd(tmp5)
[1] 89.265750 9.612916 10.073126 9.392683 9.575802 9.316842 8.579902
[8] 8.170301 7.077743 8.668156
> rowMax(tmp5)
[1] 467.87229 84.05006 86.95276 93.96147 97.56164 84.91059 NA
[8] 88.24033 83.00245 90.58854
> rowMin(tmp5)
[1] 57.28027 53.35627 55.66773 57.46801 55.68148 53.41915 NA 55.11716
[9] 58.07183 55.62409
>
> colMeans(tmp5)
[1] 106.15490 67.97689 74.23960 71.39115 69.76568 73.16431 72.65616
[8] 73.67645 70.17041 72.87386 71.95583 71.00215 70.05890 71.57195
[15] 68.59407 69.87395 NA 68.38890 71.24025 72.40350
> colSums(tmp5)
[1] 1061.5490 679.7689 742.3960 713.9115 697.6568 731.6431 726.5616
[8] 736.7645 701.7041 728.7386 719.5583 710.0215 700.5890 715.7195
[15] 685.9407 698.7395 NA 683.8890 712.4025 724.0350
> colVars(tmp5)
[1] 16201.70169 32.55834 116.26675 126.99926 69.46833 66.52078
[7] 100.74354 69.61740 130.98154 74.23435 37.49153 135.32808
[13] 79.33893 91.71179 78.80933 165.20949 NA 40.24094
[19] 102.50469 50.64518
> colSd(tmp5)
[1] 127.285905 5.705991 10.782706 11.269395 8.334766 8.156027
[7] 10.037108 8.343704 11.444717 8.615936 6.123033 11.633060
[13] 8.907240 9.576627 8.877462 12.853384 NA 6.343575
[19] 10.124460 7.116543
> colMax(tmp5)
[1] 467.87229 78.11762 89.42377 86.77785 83.04417 84.13630 86.33638
[8] 85.47748 86.95276 85.77707 78.41984 90.58854 85.73101 93.96147
[15] 81.69872 97.56164 NA 78.83728 85.60226 85.19541
> colMin(tmp5)
[1] 58.07183 60.10841 54.53829 53.41915 53.35627 59.77119 58.47790 60.75972
[9] 55.11716 57.31057 58.62594 53.73853 57.64826 62.07124 53.95128 53.22223
[17] NA 57.46801 55.62409 65.26521
>
> Max(tmp5,na.rm=TRUE)
[1] 467.8723
> Min(tmp5,na.rm=TRUE)
[1] 53.22223
> mean(tmp5,na.rm=TRUE)
[1] 72.82064
> Sum(tmp5,na.rm=TRUE)
[1] 14491.31
> Var(tmp5,na.rm=TRUE)
[1] 873.7604
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.49004 67.94449 72.27198 73.12865 73.56445 69.11273 70.86973 66.81205
[9] 70.91498 72.99971
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.801 1358.890 1445.440 1462.573 1471.289 1382.255 1346.525 1336.241
[9] 1418.300 1459.994
> rowVars(tmp5,na.rm=TRUE)
[1] 7968.37406 92.40816 101.46787 88.22249 91.69598 86.80355
[7] 73.61472 66.75383 50.09444 75.13692
> rowSd(tmp5,na.rm=TRUE)
[1] 89.265750 9.612916 10.073126 9.392683 9.575802 9.316842 8.579902
[8] 8.170301 7.077743 8.668156
> rowMax(tmp5,na.rm=TRUE)
[1] 467.87229 84.05006 86.95276 93.96147 97.56164 84.91059 86.33638
[8] 88.24033 83.00245 90.58854
> rowMin(tmp5,na.rm=TRUE)
[1] 57.28027 53.35627 55.66773 57.46801 55.68148 53.41915 53.22223 55.11716
[9] 58.07183 55.62409
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.15490 67.97689 74.23960 71.39115 69.76568 73.16431 72.65616
[8] 73.67645 70.17041 72.87386 71.95583 71.00215 70.05890 71.57195
[15] 68.59407 69.87395 68.85746 68.38890 71.24025 72.40350
> colSums(tmp5,na.rm=TRUE)
[1] 1061.5490 679.7689 742.3960 713.9115 697.6568 731.6431 726.5616
[8] 736.7645 701.7041 728.7386 719.5583 710.0215 700.5890 715.7195
[15] 685.9407 698.7395 619.7172 683.8890 712.4025 724.0350
> colVars(tmp5,na.rm=TRUE)
[1] 16201.70169 32.55834 116.26675 126.99926 69.46833 66.52078
[7] 100.74354 69.61740 130.98154 74.23435 37.49153 135.32808
[13] 79.33893 91.71179 78.80933 165.20949 93.69485 40.24094
[19] 102.50469 50.64518
> colSd(tmp5,na.rm=TRUE)
[1] 127.285905 5.705991 10.782706 11.269395 8.334766 8.156027
[7] 10.037108 8.343704 11.444717 8.615936 6.123033 11.633060
[13] 8.907240 9.576627 8.877462 12.853384 9.679610 6.343575
[19] 10.124460 7.116543
> colMax(tmp5,na.rm=TRUE)
[1] 467.87229 78.11762 89.42377 86.77785 83.04417 84.13630 86.33638
[8] 85.47748 86.95276 85.77707 78.41984 90.58854 85.73101 93.96147
[15] 81.69872 97.56164 84.05006 78.83728 85.60226 85.19541
> colMin(tmp5,na.rm=TRUE)
[1] 58.07183 60.10841 54.53829 53.41915 53.35627 59.77119 58.47790 60.75972
[9] 55.11716 57.31057 58.62594 53.73853 57.64826 62.07124 53.95128 53.22223
[17] 56.94536 57.46801 55.62409 65.26521
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.49004 67.94449 72.27198 73.12865 73.56445 69.11273 NaN 66.81205
[9] 70.91498 72.99971
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.801 1358.890 1445.440 1462.573 1471.289 1382.255 0.000 1336.241
[9] 1418.300 1459.994
> rowVars(tmp5,na.rm=TRUE)
[1] 7968.37406 92.40816 101.46787 88.22249 91.69598 86.80355
[7] NA 66.75383 50.09444 75.13692
> rowSd(tmp5,na.rm=TRUE)
[1] 89.265750 9.612916 10.073126 9.392683 9.575802 9.316842 NA
[8] 8.170301 7.077743 8.668156
> rowMax(tmp5,na.rm=TRUE)
[1] 467.87229 84.05006 86.95276 93.96147 97.56164 84.91059 NA
[8] 88.24033 83.00245 90.58854
> rowMin(tmp5,na.rm=TRUE)
[1] 57.28027 53.35627 55.66773 57.46801 55.68148 53.41915 NA 55.11716
[9] 58.07183 55.62409
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 110.90520 67.67903 74.77891 72.27475 69.48094 73.10041 71.13614
[8] 73.51719 69.64331 72.94658 72.13243 72.92033 69.37501 70.84136
[15] 68.31512 71.72414 NaN 68.63574 69.64447 72.62276
> colSums(tmp5,na.rm=TRUE)
[1] 998.1468 609.1113 673.0102 650.4728 625.3285 657.9036 640.2252 661.6547
[9] 626.7898 656.5192 649.1919 656.2830 624.3751 637.5722 614.8361 645.5173
[17] 0.0000 617.7216 626.8002 653.6049
> colVars(tmp5,na.rm=TRUE)
[1] 17973.05369 35.63001 127.52800 134.09077 77.23975 74.78994
[7] 87.34364 78.03425 144.22858 83.45416 41.82710 110.85066
[13] 83.99466 97.17091 87.78509 147.34961 NA 44.58564
[19] 86.66953 56.43495
> colSd(tmp5,na.rm=TRUE)
[1] 134.063618 5.969088 11.292830 11.579757 8.788615 8.648118
[7] 9.345782 8.833700 12.009520 9.135325 6.467388 10.528564
[13] 9.164860 9.857531 9.369370 12.138765 NA 6.677248
[19] 9.309647 7.512320
> colMax(tmp5,na.rm=TRUE)
[1] 467.87229 78.11762 89.42377 86.77785 83.04417 84.13630 84.91059
[8] 85.47748 86.95276 85.77707 78.41984 90.58854 85.73101 93.96147
[15] 81.69872 97.56164 -Inf 78.83728 82.55936 85.19541
> colMin(tmp5,na.rm=TRUE)
[1] 58.07183 60.10841 54.53829 53.41915 53.35627 59.77119 58.47790 60.75972
[9] 55.11716 57.31057 58.62594 57.73862 57.64826 62.07124 53.95128 57.17480
[17] Inf 57.46801 55.62409 65.26521
>
>
>
>
> 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] 217.7183 145.9164 163.5064 61.5831 286.1471 272.6689 289.0815 287.6878
[9] 404.3613 247.9693
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 217.7183 145.9164 163.5064 61.5831 286.1471 272.6689 289.0815 287.6878
[9] 404.3613 247.9693
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.705303e-13 1.136868e-13 7.105427e-14 -7.105427e-14 1.136868e-13
[6] 5.684342e-14 -1.421085e-14 -2.273737e-13 -5.684342e-14 -2.842171e-14
[11] 5.684342e-14 0.000000e+00 -3.410605e-13 1.421085e-14 -1.705303e-13
[16] -8.526513e-14 -1.136868e-13 8.526513e-14 1.136868e-13 -1.421085e-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 4
9 13
8 3
3 5
3 11
5 7
7 2
10 16
1 6
10 10
3 18
2 5
10 6
5 3
8 18
9 20
10 11
7 17
2 6
9 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.519832
> Min(tmp)
[1] -2.876692
> mean(tmp)
[1] -0.03560114
> Sum(tmp)
[1] -3.560114
> Var(tmp)
[1] 1.067307
>
> rowMeans(tmp)
[1] -0.03560114
> rowSums(tmp)
[1] -3.560114
> rowVars(tmp)
[1] 1.067307
> rowSd(tmp)
[1] 1.033106
> rowMax(tmp)
[1] 2.519832
> rowMin(tmp)
[1] -2.876692
>
> colMeans(tmp)
[1] -1.14553742 0.71557037 0.25662810 0.66811873 0.23397306 -0.07022990
[7] 0.05487908 0.98114469 0.68089019 0.27407838 0.21033202 -1.56962359
[13] 0.13291013 1.06967629 -0.64805248 0.61193564 -1.93725500 -1.09371019
[19] 1.12145109 0.24864122 0.96994868 0.37982399 -1.16764059 -1.63087878
[25] -0.09644795 -0.97950307 -0.84915731 -0.14238706 -2.74333398 0.84529149
[31] 0.33260432 -1.39936070 -0.26583021 -0.39261808 1.31942734 -1.23384652
[37] -0.50559344 -0.75477409 1.04716680 0.14429559 -0.01809456 0.37863639
[43] -0.82869338 -0.12242208 -1.49510852 -0.28374829 -1.58660305 1.49624460
[49] -2.87669152 -1.80099096 1.68971666 1.79831683 0.58802941 -0.76711902
[55] -1.17521431 -0.36938123 -1.39337531 0.35108128 -1.09648787 0.39729513
[61] 1.01361674 -0.09299710 1.75585212 -0.67960016 1.23098014 -0.67658189
[67] 1.33241181 -0.51863069 -0.79818142 -1.38079741 0.55489063 -1.85920154
[73] 0.33030483 0.67196196 -1.73730883 0.22523307 0.79695736 0.37216361
[79] 2.51983186 0.87611803 0.18170665 0.64691718 0.91622502 0.87037526
[85] 0.39837076 1.11813790 2.04975219 0.79845368 0.26294861 0.19701054
[91] 0.19677011 0.39608620 -0.09688398 -0.16443964 -0.19420081 0.59941848
[97] -0.28718192 -0.69474954 -1.06624672 -0.18400449
> colSums(tmp)
[1] -1.14553742 0.71557037 0.25662810 0.66811873 0.23397306 -0.07022990
[7] 0.05487908 0.98114469 0.68089019 0.27407838 0.21033202 -1.56962359
[13] 0.13291013 1.06967629 -0.64805248 0.61193564 -1.93725500 -1.09371019
[19] 1.12145109 0.24864122 0.96994868 0.37982399 -1.16764059 -1.63087878
[25] -0.09644795 -0.97950307 -0.84915731 -0.14238706 -2.74333398 0.84529149
[31] 0.33260432 -1.39936070 -0.26583021 -0.39261808 1.31942734 -1.23384652
[37] -0.50559344 -0.75477409 1.04716680 0.14429559 -0.01809456 0.37863639
[43] -0.82869338 -0.12242208 -1.49510852 -0.28374829 -1.58660305 1.49624460
[49] -2.87669152 -1.80099096 1.68971666 1.79831683 0.58802941 -0.76711902
[55] -1.17521431 -0.36938123 -1.39337531 0.35108128 -1.09648787 0.39729513
[61] 1.01361674 -0.09299710 1.75585212 -0.67960016 1.23098014 -0.67658189
[67] 1.33241181 -0.51863069 -0.79818142 -1.38079741 0.55489063 -1.85920154
[73] 0.33030483 0.67196196 -1.73730883 0.22523307 0.79695736 0.37216361
[79] 2.51983186 0.87611803 0.18170665 0.64691718 0.91622502 0.87037526
[85] 0.39837076 1.11813790 2.04975219 0.79845368 0.26294861 0.19701054
[91] 0.19677011 0.39608620 -0.09688398 -0.16443964 -0.19420081 0.59941848
[97] -0.28718192 -0.69474954 -1.06624672 -0.18400449
> 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.14553742 0.71557037 0.25662810 0.66811873 0.23397306 -0.07022990
[7] 0.05487908 0.98114469 0.68089019 0.27407838 0.21033202 -1.56962359
[13] 0.13291013 1.06967629 -0.64805248 0.61193564 -1.93725500 -1.09371019
[19] 1.12145109 0.24864122 0.96994868 0.37982399 -1.16764059 -1.63087878
[25] -0.09644795 -0.97950307 -0.84915731 -0.14238706 -2.74333398 0.84529149
[31] 0.33260432 -1.39936070 -0.26583021 -0.39261808 1.31942734 -1.23384652
[37] -0.50559344 -0.75477409 1.04716680 0.14429559 -0.01809456 0.37863639
[43] -0.82869338 -0.12242208 -1.49510852 -0.28374829 -1.58660305 1.49624460
[49] -2.87669152 -1.80099096 1.68971666 1.79831683 0.58802941 -0.76711902
[55] -1.17521431 -0.36938123 -1.39337531 0.35108128 -1.09648787 0.39729513
[61] 1.01361674 -0.09299710 1.75585212 -0.67960016 1.23098014 -0.67658189
[67] 1.33241181 -0.51863069 -0.79818142 -1.38079741 0.55489063 -1.85920154
[73] 0.33030483 0.67196196 -1.73730883 0.22523307 0.79695736 0.37216361
[79] 2.51983186 0.87611803 0.18170665 0.64691718 0.91622502 0.87037526
[85] 0.39837076 1.11813790 2.04975219 0.79845368 0.26294861 0.19701054
[91] 0.19677011 0.39608620 -0.09688398 -0.16443964 -0.19420081 0.59941848
[97] -0.28718192 -0.69474954 -1.06624672 -0.18400449
> colMin(tmp)
[1] -1.14553742 0.71557037 0.25662810 0.66811873 0.23397306 -0.07022990
[7] 0.05487908 0.98114469 0.68089019 0.27407838 0.21033202 -1.56962359
[13] 0.13291013 1.06967629 -0.64805248 0.61193564 -1.93725500 -1.09371019
[19] 1.12145109 0.24864122 0.96994868 0.37982399 -1.16764059 -1.63087878
[25] -0.09644795 -0.97950307 -0.84915731 -0.14238706 -2.74333398 0.84529149
[31] 0.33260432 -1.39936070 -0.26583021 -0.39261808 1.31942734 -1.23384652
[37] -0.50559344 -0.75477409 1.04716680 0.14429559 -0.01809456 0.37863639
[43] -0.82869338 -0.12242208 -1.49510852 -0.28374829 -1.58660305 1.49624460
[49] -2.87669152 -1.80099096 1.68971666 1.79831683 0.58802941 -0.76711902
[55] -1.17521431 -0.36938123 -1.39337531 0.35108128 -1.09648787 0.39729513
[61] 1.01361674 -0.09299710 1.75585212 -0.67960016 1.23098014 -0.67658189
[67] 1.33241181 -0.51863069 -0.79818142 -1.38079741 0.55489063 -1.85920154
[73] 0.33030483 0.67196196 -1.73730883 0.22523307 0.79695736 0.37216361
[79] 2.51983186 0.87611803 0.18170665 0.64691718 0.91622502 0.87037526
[85] 0.39837076 1.11813790 2.04975219 0.79845368 0.26294861 0.19701054
[91] 0.19677011 0.39608620 -0.09688398 -0.16443964 -0.19420081 0.59941848
[97] -0.28718192 -0.69474954 -1.06624672 -0.18400449
> colMedians(tmp)
[1] -1.14553742 0.71557037 0.25662810 0.66811873 0.23397306 -0.07022990
[7] 0.05487908 0.98114469 0.68089019 0.27407838 0.21033202 -1.56962359
[13] 0.13291013 1.06967629 -0.64805248 0.61193564 -1.93725500 -1.09371019
[19] 1.12145109 0.24864122 0.96994868 0.37982399 -1.16764059 -1.63087878
[25] -0.09644795 -0.97950307 -0.84915731 -0.14238706 -2.74333398 0.84529149
[31] 0.33260432 -1.39936070 -0.26583021 -0.39261808 1.31942734 -1.23384652
[37] -0.50559344 -0.75477409 1.04716680 0.14429559 -0.01809456 0.37863639
[43] -0.82869338 -0.12242208 -1.49510852 -0.28374829 -1.58660305 1.49624460
[49] -2.87669152 -1.80099096 1.68971666 1.79831683 0.58802941 -0.76711902
[55] -1.17521431 -0.36938123 -1.39337531 0.35108128 -1.09648787 0.39729513
[61] 1.01361674 -0.09299710 1.75585212 -0.67960016 1.23098014 -0.67658189
[67] 1.33241181 -0.51863069 -0.79818142 -1.38079741 0.55489063 -1.85920154
[73] 0.33030483 0.67196196 -1.73730883 0.22523307 0.79695736 0.37216361
[79] 2.51983186 0.87611803 0.18170665 0.64691718 0.91622502 0.87037526
[85] 0.39837076 1.11813790 2.04975219 0.79845368 0.26294861 0.19701054
[91] 0.19677011 0.39608620 -0.09688398 -0.16443964 -0.19420081 0.59941848
[97] -0.28718192 -0.69474954 -1.06624672 -0.18400449
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.145537 0.7155704 0.2566281 0.6681187 0.2339731 -0.0702299 0.05487908
[2,] -1.145537 0.7155704 0.2566281 0.6681187 0.2339731 -0.0702299 0.05487908
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.9811447 0.6808902 0.2740784 0.210332 -1.569624 0.1329101 1.069676
[2,] 0.9811447 0.6808902 0.2740784 0.210332 -1.569624 0.1329101 1.069676
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.6480525 0.6119356 -1.937255 -1.09371 1.121451 0.2486412 0.9699487
[2,] -0.6480525 0.6119356 -1.937255 -1.09371 1.121451 0.2486412 0.9699487
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.379824 -1.167641 -1.630879 -0.09644795 -0.9795031 -0.8491573 -0.1423871
[2,] 0.379824 -1.167641 -1.630879 -0.09644795 -0.9795031 -0.8491573 -0.1423871
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -2.743334 0.8452915 0.3326043 -1.399361 -0.2658302 -0.3926181 1.319427
[2,] -2.743334 0.8452915 0.3326043 -1.399361 -0.2658302 -0.3926181 1.319427
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.233847 -0.5055934 -0.7547741 1.047167 0.1442956 -0.01809456 0.3786364
[2,] -1.233847 -0.5055934 -0.7547741 1.047167 0.1442956 -0.01809456 0.3786364
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.8286934 -0.1224221 -1.495109 -0.2837483 -1.586603 1.496245 -2.876692
[2,] -0.8286934 -0.1224221 -1.495109 -0.2837483 -1.586603 1.496245 -2.876692
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.800991 1.689717 1.798317 0.5880294 -0.767119 -1.175214 -0.3693812
[2,] -1.800991 1.689717 1.798317 0.5880294 -0.767119 -1.175214 -0.3693812
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.393375 0.3510813 -1.096488 0.3972951 1.013617 -0.0929971 1.755852
[2,] -1.393375 0.3510813 -1.096488 0.3972951 1.013617 -0.0929971 1.755852
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.6796002 1.23098 -0.6765819 1.332412 -0.5186307 -0.7981814 -1.380797
[2,] -0.6796002 1.23098 -0.6765819 1.332412 -0.5186307 -0.7981814 -1.380797
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.5548906 -1.859202 0.3303048 0.671962 -1.737309 0.2252331 0.7969574
[2,] 0.5548906 -1.859202 0.3303048 0.671962 -1.737309 0.2252331 0.7969574
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.3721636 2.519832 0.876118 0.1817067 0.6469172 0.916225 0.8703753
[2,] 0.3721636 2.519832 0.876118 0.1817067 0.6469172 0.916225 0.8703753
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.3983708 1.118138 2.049752 0.7984537 0.2629486 0.1970105 0.1967701
[2,] 0.3983708 1.118138 2.049752 0.7984537 0.2629486 0.1970105 0.1967701
[,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.3960862 -0.09688398 -0.1644396 -0.1942008 0.5994185 -0.2871819
[2,] 0.3960862 -0.09688398 -0.1644396 -0.1942008 0.5994185 -0.2871819
[,98] [,99] [,100]
[1,] -0.6947495 -1.066247 -0.1840045
[2,] -0.6947495 -1.066247 -0.1840045
>
>
> Max(tmp2)
[1] 1.860792
> Min(tmp2)
[1] -2.227119
> mean(tmp2)
[1] -0.09346277
> Sum(tmp2)
[1] -9.346277
> Var(tmp2)
[1] 0.8413487
>
> rowMeans(tmp2)
[1] -0.640993511 1.589162687 -0.847011814 -1.053794066 -0.102747751
[6] -0.071449304 -1.042878141 -2.103849394 0.805423846 0.710844240
[11] 0.547136709 -1.103603313 0.386642263 1.170415241 -0.758332056
[16] 1.155769848 1.181982742 -0.011560536 -0.158536389 -1.721623738
[21] -0.662153381 -1.159886328 -0.041200121 -0.193990227 -0.578736655
[26] -0.308738218 -1.067021488 1.367031666 1.764859401 0.195770598
[31] 1.248475401 -1.158188960 -0.107032466 -2.063380155 -0.053670574
[36] -0.067162286 -0.576165536 0.828434072 -2.227118643 0.250125842
[41] -0.484252934 0.210043708 0.482893859 0.273578981 0.218934685
[46] 0.004094558 0.044129337 -0.316980717 -0.497906106 -0.569482302
[51] -0.358382597 -0.410106452 -0.571004137 -1.298383847 -0.511224102
[56] 1.345560466 0.638980405 0.325378150 -0.240438698 -0.491784910
[61] -0.403235700 -0.050892179 0.751483625 -0.941101298 0.582598868
[66] -1.272701498 0.402433759 1.400076707 0.061835416 1.860791599
[71] 1.581321950 0.144136844 -1.588263479 -0.270816449 0.938638095
[76] 1.185410448 -1.327560597 -0.394620863 -0.339395121 -0.272301789
[81] 1.160194643 1.389075477 0.537925179 0.264295322 -0.805441426
[86] 0.019388751 -0.257196925 0.490353907 0.583051763 -0.347677177
[91] 0.226886911 -0.880990520 -0.245429375 1.510514698 -0.252768856
[96] -0.697142203 -1.554434119 -0.547445979 -1.924063485 -1.178108885
> rowSums(tmp2)
[1] -0.640993511 1.589162687 -0.847011814 -1.053794066 -0.102747751
[6] -0.071449304 -1.042878141 -2.103849394 0.805423846 0.710844240
[11] 0.547136709 -1.103603313 0.386642263 1.170415241 -0.758332056
[16] 1.155769848 1.181982742 -0.011560536 -0.158536389 -1.721623738
[21] -0.662153381 -1.159886328 -0.041200121 -0.193990227 -0.578736655
[26] -0.308738218 -1.067021488 1.367031666 1.764859401 0.195770598
[31] 1.248475401 -1.158188960 -0.107032466 -2.063380155 -0.053670574
[36] -0.067162286 -0.576165536 0.828434072 -2.227118643 0.250125842
[41] -0.484252934 0.210043708 0.482893859 0.273578981 0.218934685
[46] 0.004094558 0.044129337 -0.316980717 -0.497906106 -0.569482302
[51] -0.358382597 -0.410106452 -0.571004137 -1.298383847 -0.511224102
[56] 1.345560466 0.638980405 0.325378150 -0.240438698 -0.491784910
[61] -0.403235700 -0.050892179 0.751483625 -0.941101298 0.582598868
[66] -1.272701498 0.402433759 1.400076707 0.061835416 1.860791599
[71] 1.581321950 0.144136844 -1.588263479 -0.270816449 0.938638095
[76] 1.185410448 -1.327560597 -0.394620863 -0.339395121 -0.272301789
[81] 1.160194643 1.389075477 0.537925179 0.264295322 -0.805441426
[86] 0.019388751 -0.257196925 0.490353907 0.583051763 -0.347677177
[91] 0.226886911 -0.880990520 -0.245429375 1.510514698 -0.252768856
[96] -0.697142203 -1.554434119 -0.547445979 -1.924063485 -1.178108885
> 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.640993511 1.589162687 -0.847011814 -1.053794066 -0.102747751
[6] -0.071449304 -1.042878141 -2.103849394 0.805423846 0.710844240
[11] 0.547136709 -1.103603313 0.386642263 1.170415241 -0.758332056
[16] 1.155769848 1.181982742 -0.011560536 -0.158536389 -1.721623738
[21] -0.662153381 -1.159886328 -0.041200121 -0.193990227 -0.578736655
[26] -0.308738218 -1.067021488 1.367031666 1.764859401 0.195770598
[31] 1.248475401 -1.158188960 -0.107032466 -2.063380155 -0.053670574
[36] -0.067162286 -0.576165536 0.828434072 -2.227118643 0.250125842
[41] -0.484252934 0.210043708 0.482893859 0.273578981 0.218934685
[46] 0.004094558 0.044129337 -0.316980717 -0.497906106 -0.569482302
[51] -0.358382597 -0.410106452 -0.571004137 -1.298383847 -0.511224102
[56] 1.345560466 0.638980405 0.325378150 -0.240438698 -0.491784910
[61] -0.403235700 -0.050892179 0.751483625 -0.941101298 0.582598868
[66] -1.272701498 0.402433759 1.400076707 0.061835416 1.860791599
[71] 1.581321950 0.144136844 -1.588263479 -0.270816449 0.938638095
[76] 1.185410448 -1.327560597 -0.394620863 -0.339395121 -0.272301789
[81] 1.160194643 1.389075477 0.537925179 0.264295322 -0.805441426
[86] 0.019388751 -0.257196925 0.490353907 0.583051763 -0.347677177
[91] 0.226886911 -0.880990520 -0.245429375 1.510514698 -0.252768856
[96] -0.697142203 -1.554434119 -0.547445979 -1.924063485 -1.178108885
> rowMin(tmp2)
[1] -0.640993511 1.589162687 -0.847011814 -1.053794066 -0.102747751
[6] -0.071449304 -1.042878141 -2.103849394 0.805423846 0.710844240
[11] 0.547136709 -1.103603313 0.386642263 1.170415241 -0.758332056
[16] 1.155769848 1.181982742 -0.011560536 -0.158536389 -1.721623738
[21] -0.662153381 -1.159886328 -0.041200121 -0.193990227 -0.578736655
[26] -0.308738218 -1.067021488 1.367031666 1.764859401 0.195770598
[31] 1.248475401 -1.158188960 -0.107032466 -2.063380155 -0.053670574
[36] -0.067162286 -0.576165536 0.828434072 -2.227118643 0.250125842
[41] -0.484252934 0.210043708 0.482893859 0.273578981 0.218934685
[46] 0.004094558 0.044129337 -0.316980717 -0.497906106 -0.569482302
[51] -0.358382597 -0.410106452 -0.571004137 -1.298383847 -0.511224102
[56] 1.345560466 0.638980405 0.325378150 -0.240438698 -0.491784910
[61] -0.403235700 -0.050892179 0.751483625 -0.941101298 0.582598868
[66] -1.272701498 0.402433759 1.400076707 0.061835416 1.860791599
[71] 1.581321950 0.144136844 -1.588263479 -0.270816449 0.938638095
[76] 1.185410448 -1.327560597 -0.394620863 -0.339395121 -0.272301789
[81] 1.160194643 1.389075477 0.537925179 0.264295322 -0.805441426
[86] 0.019388751 -0.257196925 0.490353907 0.583051763 -0.347677177
[91] 0.226886911 -0.880990520 -0.245429375 1.510514698 -0.252768856
[96] -0.697142203 -1.554434119 -0.547445979 -1.924063485 -1.178108885
>
> colMeans(tmp2)
[1] -0.09346277
> colSums(tmp2)
[1] -9.346277
> colVars(tmp2)
[1] 0.8413487
> colSd(tmp2)
[1] 0.9172506
> colMax(tmp2)
[1] 1.860792
> colMin(tmp2)
[1] -2.227119
> colMedians(tmp2)
[1] -0.1327844
> colRanges(tmp2)
[,1]
[1,] -2.227119
[2,] 1.860792
>
> 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] -3.7806636 4.2837836 -4.6939336 -3.6155209 4.1940369 0.8875636
[7] 0.9005317 1.8683593 0.1054334 0.3056914
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.2356712
[2,] -0.8970497
[3,] -0.2032805
[4,] 0.1074467
[5,] 1.2063705
>
> rowApply(tmp,sum)
[1] -0.81062536 -3.74369753 5.82148104 5.62288117 -3.89437214 -1.22412487
[7] 2.82677517 1.47042117 -0.08665876 -5.52679807
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 3 2 7 2 8 7 1 6 7
[2,] 9 10 3 6 1 10 1 6 9 8
[3,] 3 5 1 8 6 2 4 4 10 2
[4,] 8 1 7 5 7 7 3 3 4 3
[5,] 7 6 9 10 10 5 10 2 3 6
[6,] 6 4 10 3 8 1 9 8 1 5
[7,] 10 8 8 4 5 3 2 10 5 1
[8,] 1 7 4 9 3 9 5 7 8 10
[9,] 2 9 6 2 9 4 6 9 2 4
[10,] 5 2 5 1 4 6 8 5 7 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.2065902 1.7336585 3.5627312 1.1370137 1.3815126 1.9588768
[7] -1.5519335 -3.5059688 1.1271228 4.3263227 -4.0644026 1.2536736
[13] 0.8516407 -0.7780653 -1.4549257 2.3849453 -1.9006683 0.3442982
[19] -1.6780167 2.5581778
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0330957
[2,] -0.8272102
[3,] -0.5184632
[4,] -0.2300713
[5,] 2.4022502
>
> rowApply(tmp,sum)
[1] -2.5313480 11.0420565 0.4197869 6.0998914 -7.5509838
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 4 4 3 8
[2,] 14 20 16 1 19
[3,] 19 17 20 6 4
[4,] 11 18 7 14 9
[5,] 5 9 18 18 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2.4022502 0.1981605 1.2250345 -0.1494543 -0.8554387 0.47583511
[2,] -0.2300713 1.7635598 1.4414063 1.6160436 0.5628884 0.08328428
[3,] -1.0330957 0.8536233 2.3696633 -0.5583420 1.1874265 0.22620290
[4,] -0.8272102 -1.7044822 -0.1744724 0.6166983 1.6703461 0.43030070
[5,] -0.5184632 0.6227970 -1.2989005 -0.3879319 -1.1837098 0.74325383
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.8293128 -1.3523530 -0.19498959 0.50633870 -1.07610273 0.16373791
[2,] 1.0788016 -0.5199424 -0.21899644 1.74891322 -0.03835356 0.47426915
[3,] -1.9920298 -0.6621294 1.87560651 -0.52540463 -0.81248143 0.81796545
[4,] 0.7548334 0.4477519 -0.28441514 2.63481204 0.09214240 -0.04803385
[5,] -0.5642259 -1.4192958 -0.05008252 -0.03833662 -2.22960728 -0.15426505
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.6232597650 -0.98502555 0.5328361 -0.9983066 0.48172380 -0.5031279
[2,] 1.1938110626 0.89958716 1.1590759 0.8310991 0.88294517 -1.7870582
[3,] 0.4702521339 -0.28738395 -1.8300295 0.0912141 -1.72512146 0.5746947
[4,] -0.0003455019 -0.50161850 -1.0428416 1.9107119 -0.08606136 1.5446558
[5,] -0.1888172223 0.09637552 -0.2739666 0.5502270 -1.45415443 0.5151338
[,19] [,20]
[1,] -0.80512940 -0.1447646
[2,] -1.07946935 1.1802630
[3,] 0.87624673 0.5029091
[4,] -0.02533998 0.6924598
[5,] -0.64432470 0.3273106
>
>
> 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 0.5246979 0.3214429 0.01757494 -0.9981083 0.8008736 0.4026161 -0.320401
col8 col9 col10 col11 col12 col13 col14
row1 0.2393295 -1.944882 -1.219982 0.0961936 -0.4764331 0.5364868 -0.4236141
col15 col16 col17 col18 col19 col20
row1 1.502785 2.196248 -1.44956 -1.203729 0.6460773 1.98715
> tmp[,"col10"]
col10
row1 -1.21998155
row2 1.30153275
row3 0.26931848
row4 0.04122902
row5 -0.63427295
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.5246979 0.3214429 0.01757494 -0.9981083 0.8008736 0.4026161 -0.320401
row5 0.3403473 1.6983197 0.14403776 -1.7105024 -2.3962144 -1.4687731 1.419872
col8 col9 col10 col11 col12 col13 col14
row1 0.2393295 -1.9448821 -1.2199815 0.0961936 -0.4764331 0.53648682 -0.4236141
row5 0.9138378 0.2124302 -0.6342729 0.1740921 -0.5335224 0.02773718 0.3811722
col15 col16 col17 col18 col19 col20
row1 1.502785 2.1962478 -1.4495599 -1.203729 0.6460773 1.9871496
row5 -2.334052 -0.7609961 0.5419801 -1.826699 -0.6159604 -0.4447036
> tmp[,c("col6","col20")]
col6 col20
row1 0.4026161 1.9871496
row2 0.8568727 0.1166670
row3 -0.2241855 0.6387781
row4 -2.3784159 0.3469279
row5 -1.4687731 -0.4447036
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.4026161 1.9871496
row5 -1.4687731 -0.4447036
>
>
>
>
> 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 48.84826 49.78045 50.17707 49.0164 48.84244 105.0407 50.72592 49.2254
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.37906 48.62761 48.84852 49.09931 50.80646 51.43656 48.64462 51.1776
col17 col18 col19 col20
row1 50.97108 51.35717 51.04705 104.2831
> tmp[,"col10"]
col10
row1 48.62761
row2 31.63950
row3 29.87233
row4 29.38318
row5 50.17170
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.84826 49.78045 50.17707 49.01640 48.84244 105.0407 50.72592 49.22540
row5 47.90262 50.42117 51.40535 51.13202 50.37020 104.2667 48.50019 47.91774
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.37906 48.62761 48.84852 49.09931 50.80646 51.43656 48.64462 51.1776
row5 49.62977 50.17170 48.96074 49.27487 48.67620 50.95377 51.74821 50.0973
col17 col18 col19 col20
row1 50.97108 51.35717 51.04705 104.2831
row5 49.21501 50.07045 49.02848 104.7747
> tmp[,c("col6","col20")]
col6 col20
row1 105.04065 104.28312
row2 75.63930 73.87226
row3 75.45078 75.85520
row4 73.71894 75.68816
row5 104.26672 104.77472
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.0407 104.2831
row5 104.2667 104.7747
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.0407 104.2831
row5 104.2667 104.7747
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.3032372
[2,] 0.4560508
[3,] -0.6831483
[4,] -0.7343881
[5,] 0.2868829
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.4521947 -0.55985596
[2,] 0.1910232 1.16657741
[3,] 0.9243950 0.31192855
[4,] -0.3804438 -0.08140431
[5,] -0.3881379 -0.58634415
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.07687516 -1.34408195
[2,] -0.41606497 0.18232553
[3,] 0.54407943 -0.13229550
[4,] -1.19368992 0.05829586
[5,] 0.99056631 0.13091786
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.07687516
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.07687516
[2,] -0.41606497
>
>
>
> 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.4100429 -0.9045857 -0.3798284 -0.1993078 -1.0187694 0.1733434
row1 0.5531405 0.3675168 -0.8438702 -0.7835421 -0.6240884 -0.7990795
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -1.6674936 -0.597935 0.7505959 0.082694 -1.387734 -0.1218566 -0.2387080
row1 -0.3366729 1.490933 -0.6243227 0.618331 2.301018 -0.2082218 -0.1491337
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.9038999 1.086570 -0.0732731 -0.07429732 -1.0736400 -0.048773170
row1 0.9618752 2.190301 0.5880708 -1.08015074 0.9555987 0.008027386
[,20]
row3 -0.1348662
row1 -1.9834494
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 2.420063 1.150528 1.198199 0.9987067 -1.877428 -0.6903778 -0.44641
[,8] [,9] [,10]
row2 -1.329618 -2.477663 -0.6436373
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.880855 0.7059982 0.8589149 0.3961633 0.4180215 -1.280821 0.265272
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.8899134 -0.77635 -0.05313354 -0.6979824 -0.9080823 1.136874 0.1217478
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.426346 -2.416751 -0.4410932 0.6424824 -0.510889 0.5400834
>
>
> 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: 0x5b8d80b7ea10>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36290965a"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3612fddf67"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3676298161"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36556b8f37"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36449ee849"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3635f61251"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36556d618c"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3645853550"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3654f9eeb6"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36a518635"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a36b828501"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a367db7fdb1"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a364157c450"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a3674429824"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM314a365dd58a5c"
>
>
> ### 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: 0x5b8d8382d640>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5b8d8382d640>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5b8d8382d640>
> rowMedians(tmp)
[1] 0.546869889 0.395877074 -0.223294044 -0.460444352 -0.308958378
[6] 0.108865024 0.544877321 -0.045415043 0.554682334 -0.092641986
[11] 0.546821006 -0.535805804 0.032594231 0.367579371 0.059998824
[16] 0.066498811 -0.160635228 0.141282140 0.398314049 -0.248835856
[21] 0.179804465 -0.904579740 -0.246892199 0.369909065 0.330083560
[26] 0.357404168 -0.168772263 -0.225751614 0.056548286 0.192506140
[31] -0.079115319 0.023812625 -0.210863161 0.217894066 0.259642366
[36] -0.078398605 0.011457710 0.502659954 -0.412485498 0.122099363
[41] -0.169039831 0.807397841 -0.025775374 0.164585773 -0.140016163
[46] -0.400294703 0.486193781 -0.187159454 0.350306261 -0.069233572
[51] 0.148571241 -0.654262390 -0.164098404 -0.456822610 -0.576661321
[56] -0.255444118 -0.045455510 -0.263164214 -0.181221868 0.421276812
[61] -0.201021210 -0.401243240 0.370400050 -0.315475096 0.147092797
[66] 0.286679454 0.036899014 0.482454363 -0.306096623 -0.056195581
[71] 0.088010435 -0.369354690 0.007353283 -0.137852420 -0.396800974
[76] -0.252408182 0.170516306 0.171282256 -0.251782071 0.176169355
[81] -0.220378856 0.019761305 0.069236320 0.404122995 0.222301221
[86] 0.009168773 0.428356280 -0.201348616 0.360064467 0.419585701
[91] 0.275906732 0.123524276 0.429710014 -0.254335755 0.077291326
[96] -0.081050375 -0.171363965 -0.067515257 0.278983591 -0.204640864
[101] 0.045608167 0.555304268 -0.347594528 0.018378167 -0.415692350
[106] -0.307056307 -0.126481691 -0.368038312 -0.127422593 -0.234492096
[111] -0.092074809 -0.673154230 0.132721115 -0.057900908 0.016016971
[116] -0.359124640 -0.408050517 0.150292307 -0.421595782 -0.200113213
[121] -0.167857736 -0.027374668 -0.269491073 -0.135656540 0.133200750
[126] 0.005776606 0.009798949 0.678535206 0.474026518 0.770796610
[131] 0.951824694 -0.493823951 -0.121335202 -0.132558325 -0.311192585
[136] 0.038638454 0.075989438 0.346683830 0.143177690 0.373349390
[141] 0.080265289 -0.221201712 -0.201330455 0.149587503 0.517214332
[146] 0.206259311 -0.405696954 0.569737105 -0.031734500 0.020238229
[151] 0.290054293 0.445278329 -0.084841739 0.093308124 -0.205282547
[156] 0.141115057 0.230093432 -0.224226601 0.159871803 -0.281569801
[161] -0.334256322 -0.162028746 -0.472147973 0.441218924 -0.028233443
[166] 0.589033940 -0.084421408 -0.351169247 -0.302662414 -0.039622333
[171] 0.390444053 -0.447599223 -0.289498056 -0.311406383 -0.313383801
[176] 0.234640769 0.165187288 0.389766955 -0.461677501 -0.400177521
[181] -0.194098451 0.499838035 -0.072864047 0.011814401 0.084471500
[186] -0.413242543 -0.146493912 -0.037243769 -0.005070914 0.577715474
[191] 0.594616685 0.087282345 1.022076789 -0.563482619 0.062031983
[196] 0.025382640 0.261886787 -0.116026745 -0.539878423 0.328551428
[201] 0.227494381 0.154880155 0.370993285 -0.167409050 0.366251526
[206] -0.031152244 -0.118586569 -0.161486389 -0.349184750 -0.005191819
[211] 0.186624426 -0.089006501 -0.029470962 -0.270704183 0.344700237
[216] -0.565665352 0.313355798 0.342342328 0.309633829 0.318295280
[221] -0.249320736 -0.427339881 0.326465852 -0.346951988 -0.219618158
[226] 0.349462318 -0.050146251 -0.101100935 0.470778027 -0.176395089
>
> proc.time()
user system elapsed
1.319 1.606 2.915
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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: 0x5a1fbba520b0>
> .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: 0x5a1fbba520b0>
> .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: 0x5a1fbba520b0>
> .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: 0x5a1fbba520b0>
> 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: 0x5a1fbd339470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbd339470>
> .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: 0x5a1fbd339470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbd339470>
> .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: 0x5a1fbd339470>
> 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: 0x5a1fbdcbd060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbdcbd060>
> .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: 0x5a1fbdcbd060>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a1fbdcbd060>
> .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: 0x5a1fbdcbd060>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5a1fbdcbd060>
> .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: 0x5a1fbdcbd060>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5a1fbdcbd060>
> .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: 0x5a1fbdcbd060>
> 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: 0x5a1fbdd0d0c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5a1fbdd0d0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbdd0d0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbdd0d0c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile314b3322e8b497" "BufferedMatrixFile314b337dde6571"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile314b3322e8b497" "BufferedMatrixFile314b337dde6571"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbba9f020>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbba9f020>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a1fbba9f020>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a1fbba9f020>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5a1fbba9f020>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5a1fbba9f020>
> .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: 0x5a1fbd5a5950>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a1fbd5a5950>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a1fbd5a5950>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5a1fbd5a5950>
> 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: 0x5a1fbb34dd20>
> .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: 0x5a1fbb34dd20>
> rm(P)
>
> proc.time()
user system elapsed
0.292 0.057 0.335
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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.247 0.050 0.283