| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-20 11:34 -0500 (Sat, 20 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4875 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4593 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 253/2332 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-12-19 21:28:06 -0500 (Fri, 19 Dec 2025) |
| EndedAt: 2025-12-19 21:28:33 -0500 (Fri, 19 Dec 2025) |
| EllapsedTime: 27.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.252 0.051 0.293
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6 1048392 56 639317 34.2
Vcells 885623 6.8 8388608 64 2082728 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Dec 19 21:28:23 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Dec 19 21:28:23 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x5ec0379905e0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Dec 19 21:28:23 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Dec 19 21:28:24 2025"
>
> ColMode(tmp2)
<pointer: 0x5ec0379905e0>
>
>
>
> ### 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.5099631 -0.4938944 -0.5992299 -0.2761498
[2,] -0.1656889 -0.7964984 0.5238256 0.4206095
[3,] 0.1292759 0.4117810 -0.1638862 -1.1324137
[4,] -1.0613268 -0.3798912 -0.6325205 -0.6520647
> 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.5099631 0.4938944 0.5992299 0.2761498
[2,] 0.1656889 0.7964984 0.5238256 0.4206095
[3,] 0.1292759 0.4117810 0.1638862 1.1324137
[4,] 1.0613268 0.3798912 0.6325205 0.6520647
> 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.9754681 0.7027762 0.7740994 0.5254996
[2,] 0.4070490 0.8924676 0.7237580 0.6485441
[3,] 0.3595496 0.6417016 0.4048286 1.0641493
[4,] 1.0302071 0.6163532 0.7953116 0.8075052
>
> 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.26464 32.52166 33.34022 30.53115
[2,] 29.23618 34.72117 32.76141 31.90605
[3,] 28.72477 31.82880 29.21217 36.77391
[4,] 36.36340 31.54342 33.58564 33.72712
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5ec03751b840>
> exp(tmp5)
<pointer: 0x5ec03751b840>
> log(tmp5,2)
<pointer: 0x5ec03751b840>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7775
> Min(tmp5)
[1] 53.31339
> mean(tmp5)
[1] 72.2844
> Sum(tmp5)
[1] 14456.88
> Var(tmp5)
[1] 859.9483
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.16869 68.77134 71.79963 69.74663 68.99400 71.19129 70.60423 71.12482
[9] 69.86394 70.57940
> rowSums(tmp5)
[1] 1803.374 1375.427 1435.993 1394.933 1379.880 1423.826 1412.085 1422.496
[9] 1397.279 1411.588
> rowVars(tmp5)
[1] 7951.29216 82.16805 97.14730 63.56392 64.48908 68.17601
[7] 52.82023 56.24066 84.31043 103.65142
> rowSd(tmp5)
[1] 89.170018 9.064659 9.856333 7.972698 8.030509 8.256876 7.267752
[8] 7.499377 9.182071 10.180934
> rowMax(tmp5)
[1] 466.77747 87.57590 91.13850 87.72339 85.26378 85.19418 81.81257
[8] 81.16010 85.41941 95.07013
> rowMin(tmp5)
[1] 53.31339 53.56870 56.72628 58.38675 56.62601 58.03607 57.58654 61.62299
[9] 53.49044 54.52680
>
> colMeans(tmp5)
[1] 109.09360 66.85759 69.69122 70.07622 70.74954 65.22873 73.60940
[8] 70.27516 70.65491 72.27722 70.86830 70.20983 67.17623 74.98147
[15] 72.98645 71.24230 67.78043 73.94959 67.18926 70.79049
> colSums(tmp5)
[1] 1090.9360 668.5759 696.9122 700.7622 707.4954 652.2873 736.0940
[8] 702.7516 706.5491 722.7722 708.6830 702.0983 671.7623 749.8147
[15] 729.8645 712.4230 677.8043 739.4959 671.8926 707.9049
> colVars(tmp5)
[1] 15866.76895 50.56154 38.21756 47.02543 45.26160 56.93646
[7] 51.04037 99.37664 45.77089 84.82213 40.40156 129.19835
[13] 140.35746 145.02836 57.45319 79.09040 87.56368 127.10570
[19] 68.07160 33.18266
> colSd(tmp5)
[1] 125.963364 7.110663 6.182036 6.857509 6.727674 7.545625
[7] 7.144254 9.968783 6.765419 9.209893 6.356222 11.366545
[13] 11.847255 12.042772 7.579789 8.893278 9.357547 11.274116
[19] 8.250551 5.760439
> colMax(tmp5)
[1] 466.77747 78.53793 80.54768 80.42625 80.04026 80.55409 80.87763
[8] 91.13850 79.71984 84.51106 82.85887 95.07013 85.19418 94.12268
[15] 87.57590 83.45913 81.31157 85.41941 79.50535 80.77926
> colMin(tmp5)
[1] 59.78685 56.62601 60.80131 59.50986 61.44924 58.03607 56.39489 61.98557
[9] 61.16070 58.60284 62.58247 53.56870 53.31339 55.07245 61.62299 58.42650
[17] 54.17690 57.65831 53.49044 62.11873
>
>
> ### 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.16869 68.77134 71.79963 69.74663 68.99400 71.19129 70.60423 NA
[9] 69.86394 70.57940
> rowSums(tmp5)
[1] 1803.374 1375.427 1435.993 1394.933 1379.880 1423.826 1412.085 NA
[9] 1397.279 1411.588
> rowVars(tmp5)
[1] 7951.29216 82.16805 97.14730 63.56392 64.48908 68.17601
[7] 52.82023 58.92343 84.31043 103.65142
> rowSd(tmp5)
[1] 89.170018 9.064659 9.856333 7.972698 8.030509 8.256876 7.267752
[8] 7.676160 9.182071 10.180934
> rowMax(tmp5)
[1] 466.77747 87.57590 91.13850 87.72339 85.26378 85.19418 81.81257
[8] NA 85.41941 95.07013
> rowMin(tmp5)
[1] 53.31339 53.56870 56.72628 58.38675 56.62601 58.03607 57.58654 NA
[9] 53.49044 54.52680
>
> colMeans(tmp5)
[1] 109.09360 66.85759 69.69122 70.07622 70.74954 65.22873 73.60940
[8] 70.27516 70.65491 72.27722 70.86830 70.20983 67.17623 74.98147
[15] 72.98645 71.24230 NA 73.94959 67.18926 70.79049
> colSums(tmp5)
[1] 1090.9360 668.5759 696.9122 700.7622 707.4954 652.2873 736.0940
[8] 702.7516 706.5491 722.7722 708.6830 702.0983 671.7623 749.8147
[15] 729.8645 712.4230 NA 739.4959 671.8926 707.9049
> colVars(tmp5)
[1] 15866.76895 50.56154 38.21756 47.02543 45.26160 56.93646
[7] 51.04037 99.37664 45.77089 84.82213 40.40156 129.19835
[13] 140.35746 145.02836 57.45319 79.09040 NA 127.10570
[19] 68.07160 33.18266
> colSd(tmp5)
[1] 125.963364 7.110663 6.182036 6.857509 6.727674 7.545625
[7] 7.144254 9.968783 6.765419 9.209893 6.356222 11.366545
[13] 11.847255 12.042772 7.579789 8.893278 NA 11.274116
[19] 8.250551 5.760439
> colMax(tmp5)
[1] 466.77747 78.53793 80.54768 80.42625 80.04026 80.55409 80.87763
[8] 91.13850 79.71984 84.51106 82.85887 95.07013 85.19418 94.12268
[15] 87.57590 83.45913 NA 85.41941 79.50535 80.77926
> colMin(tmp5)
[1] 59.78685 56.62601 60.80131 59.50986 61.44924 58.03607 56.39489 61.98557
[9] 61.16070 58.60284 62.58247 53.56870 53.31339 55.07245 61.62299 58.42650
[17] NA 57.65831 53.49044 62.11873
>
> Max(tmp5,na.rm=TRUE)
[1] 466.7775
> Min(tmp5,na.rm=TRUE)
[1] 53.31339
> mean(tmp5,na.rm=TRUE)
[1] 72.30403
> Sum(tmp5,na.rm=TRUE)
[1] 14388.5
> Var(tmp5,na.rm=TRUE)
[1] 864.214
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.16869 68.77134 71.79963 69.74663 68.99400 71.19129 70.60423 71.26947
[9] 69.86394 70.57940
> rowSums(tmp5,na.rm=TRUE)
[1] 1803.374 1375.427 1435.993 1394.933 1379.880 1423.826 1412.085 1354.120
[9] 1397.279 1411.588
> rowVars(tmp5,na.rm=TRUE)
[1] 7951.29216 82.16805 97.14730 63.56392 64.48908 68.17601
[7] 52.82023 58.92343 84.31043 103.65142
> rowSd(tmp5,na.rm=TRUE)
[1] 89.170018 9.064659 9.856333 7.972698 8.030509 8.256876 7.267752
[8] 7.676160 9.182071 10.180934
> rowMax(tmp5,na.rm=TRUE)
[1] 466.77747 87.57590 91.13850 87.72339 85.26378 85.19418 81.81257
[8] 81.16010 85.41941 95.07013
> rowMin(tmp5,na.rm=TRUE)
[1] 53.31339 53.56870 56.72628 58.38675 56.62601 58.03607 57.58654 61.62299
[9] 53.49044 54.52680
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.09360 66.85759 69.69122 70.07622 70.74954 65.22873 73.60940
[8] 70.27516 70.65491 72.27722 70.86830 70.20983 67.17623 74.98147
[15] 72.98645 71.24230 67.71420 73.94959 67.18926 70.79049
> colSums(tmp5,na.rm=TRUE)
[1] 1090.9360 668.5759 696.9122 700.7622 707.4954 652.2873 736.0940
[8] 702.7516 706.5491 722.7722 708.6830 702.0983 671.7623 749.8147
[15] 729.8645 712.4230 609.4278 739.4959 671.8926 707.9049
> colVars(tmp5,na.rm=TRUE)
[1] 15866.76895 50.56154 38.21756 47.02543 45.26160 56.93646
[7] 51.04037 99.37664 45.77089 84.82213 40.40156 129.19835
[13] 140.35746 145.02836 57.45319 79.09040 98.45979 127.10570
[19] 68.07160 33.18266
> colSd(tmp5,na.rm=TRUE)
[1] 125.963364 7.110663 6.182036 6.857509 6.727674 7.545625
[7] 7.144254 9.968783 6.765419 9.209893 6.356222 11.366545
[13] 11.847255 12.042772 7.579789 8.893278 9.922691 11.274116
[19] 8.250551 5.760439
> colMax(tmp5,na.rm=TRUE)
[1] 466.77747 78.53793 80.54768 80.42625 80.04026 80.55409 80.87763
[8] 91.13850 79.71984 84.51106 82.85887 95.07013 85.19418 94.12268
[15] 87.57590 83.45913 81.31157 85.41941 79.50535 80.77926
> colMin(tmp5,na.rm=TRUE)
[1] 59.78685 56.62601 60.80131 59.50986 61.44924 58.03607 56.39489 61.98557
[9] 61.16070 58.60284 62.58247 53.56870 53.31339 55.07245 61.62299 58.42650
[17] 54.17690 57.65831 53.49044 62.11873
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.16869 68.77134 71.79963 69.74663 68.99400 71.19129 70.60423 NaN
[9] 69.86394 70.57940
> rowSums(tmp5,na.rm=TRUE)
[1] 1803.374 1375.427 1435.993 1394.933 1379.880 1423.826 1412.085 0.000
[9] 1397.279 1411.588
> rowVars(tmp5,na.rm=TRUE)
[1] 7951.29216 82.16805 97.14730 63.56392 64.48908 68.17601
[7] 52.82023 NA 84.31043 103.65142
> rowSd(tmp5,na.rm=TRUE)
[1] 89.170018 9.064659 9.856333 7.972698 8.030509 8.256876 7.267752
[8] NA 9.182071 10.180934
> rowMax(tmp5,na.rm=TRUE)
[1] 466.77747 87.57590 91.13850 87.72339 85.26378 85.19418 81.81257
[8] NA 85.41941 95.07013
> rowMin(tmp5,na.rm=TRUE)
[1] 53.31339 53.56870 56.72628 58.38675 56.62601 58.03607 57.58654 NA
[9] 53.49044 54.52680
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.02139 67.10360 68.96564 68.92622 71.69159 63.52591 72.93588
[8] 71.19622 71.60869 71.29023 71.24777 70.32632 65.78288 75.91798
[15] 74.24905 71.76271 NaN 73.53666 66.78122 69.68063
> colSums(tmp5,na.rm=TRUE)
[1] 1026.1925 603.9324 620.6907 620.3360 645.2243 571.7332 656.4229
[8] 640.7660 644.4782 641.6121 641.2299 632.9369 592.0459 683.2618
[15] 668.2415 645.8644 0.0000 661.8299 601.0309 627.1257
> colVars(tmp5,na.rm=TRUE)
[1] 17576.92942 56.20092 37.07193 38.02540 40.93544 31.43315
[7] 52.31706 102.25465 41.25820 84.46578 43.83181 145.19549
[13] 136.06113 153.29006 46.70037 85.92986 NA 141.07563
[19] 74.70743 23.47280
> colSd(tmp5,na.rm=TRUE)
[1] 132.578013 7.496727 6.088672 6.166474 6.398081 5.606528
[7] 7.233053 10.112104 6.423255 9.190527 6.620559 12.049709
[13] 11.664525 12.381036 6.833767 9.269836 NA 11.877526
[19] 8.643346 4.844873
> colMax(tmp5,na.rm=TRUE)
[1] 466.77747 78.53793 80.54768 79.11689 80.04026 73.90563 80.87763
[8] 91.13850 79.71984 84.51106 82.85887 95.07013 85.19418 94.12268
[15] 87.57590 83.45913 -Inf 85.41941 79.50535 78.86395
> colMin(tmp5,na.rm=TRUE)
[1] 59.78685 56.62601 60.80131 59.50986 61.44924 58.03607 56.39489 62.96160
[9] 61.16070 58.60284 62.58247 53.56870 53.31339 55.07245 63.62990 58.42650
[17] Inf 57.65831 53.49044 62.11873
>
>
>
>
> 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] 119.20597 203.17449 127.09307 166.77124 242.47275 234.97156 225.74096
[8] 195.37802 223.86672 95.85986
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 119.20597 203.17449 127.09307 166.77124 242.47275 234.97156 225.74096
[8] 195.37802 223.86672 95.85986
>
>
>
> 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 -6.394885e-14 0.000000e+00 -2.842171e-14 2.842171e-14
[6] -8.526513e-14 1.136868e-13 -5.684342e-14 0.000000e+00 2.273737e-13
[11] -5.684342e-14 1.705303e-13 0.000000e+00 -2.557954e-13 2.842171e-14
[16] -5.684342e-14 5.684342e-14 0.000000e+00 -2.842171e-14 -1.136868e-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)
+ }
5 6
6 8
6 15
5 11
1 2
7 11
10 4
3 18
5 10
3 12
2 8
1 19
3 4
8 19
9 15
4 19
10 11
6 8
5 11
10 17
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.207931
> Min(tmp)
[1] -2.204717
> mean(tmp)
[1] -0.1549307
> Sum(tmp)
[1] -15.49307
> Var(tmp)
[1] 0.7098652
>
> rowMeans(tmp)
[1] -0.1549307
> rowSums(tmp)
[1] -15.49307
> rowVars(tmp)
[1] 0.7098652
> rowSd(tmp)
[1] 0.842535
> rowMax(tmp)
[1] 2.207931
> rowMin(tmp)
[1] -2.204717
>
> colMeans(tmp)
[1] 0.154285937 -0.015110377 -0.624536013 1.549509844 0.611217913
[6] 0.686506293 0.464358077 -0.166290425 -0.320073180 -0.165674810
[11] 1.298519636 -0.170895669 1.198634899 0.192987196 -2.204716998
[16] -0.595250081 0.607400428 0.536637178 0.623295826 0.334562728
[21] -0.819683756 -0.961270215 -0.161131467 -0.300443325 0.735852459
[26] 0.153483351 -1.306195393 0.473124777 -0.328190200 -0.939903676
[31] -2.199053479 -0.679293095 0.907372593 -0.344909045 0.480682184
[36] -1.162319430 -0.413026193 -0.058983580 0.098254602 -0.947696642
[41] -0.720217205 -0.196447787 -0.979512399 -1.214450344 2.207931420
[46] 0.042052696 0.940917138 -0.115221353 -0.029170933 -0.525650176
[51] -0.494879279 0.202971241 0.862808366 -0.366035224 -0.327128970
[56] -0.640088688 -1.146189767 -0.140558821 0.521832483 0.229095990
[61] -0.818442863 -0.633125618 -0.481463450 1.186978904 0.042861577
[66] -0.252461436 0.101827776 1.132494567 -1.214207685 0.005915891
[71] 0.019396319 -1.251398873 -1.351785833 0.475922547 -1.549597180
[76] 0.833288334 0.129384118 0.834903459 1.301886549 -0.188307156
[81] -0.995761670 -0.243655152 0.244200737 -1.309896989 -0.362776660
[86] -0.099048925 -0.164374263 -0.406685754 -0.778389071 1.404431020
[91] -0.740827123 -0.048870859 -0.068651310 -1.399149015 -1.859471253
[96] 0.187372133 -1.814945339 -0.986011148 1.369410054 -0.078139882
> colSums(tmp)
[1] 0.154285937 -0.015110377 -0.624536013 1.549509844 0.611217913
[6] 0.686506293 0.464358077 -0.166290425 -0.320073180 -0.165674810
[11] 1.298519636 -0.170895669 1.198634899 0.192987196 -2.204716998
[16] -0.595250081 0.607400428 0.536637178 0.623295826 0.334562728
[21] -0.819683756 -0.961270215 -0.161131467 -0.300443325 0.735852459
[26] 0.153483351 -1.306195393 0.473124777 -0.328190200 -0.939903676
[31] -2.199053479 -0.679293095 0.907372593 -0.344909045 0.480682184
[36] -1.162319430 -0.413026193 -0.058983580 0.098254602 -0.947696642
[41] -0.720217205 -0.196447787 -0.979512399 -1.214450344 2.207931420
[46] 0.042052696 0.940917138 -0.115221353 -0.029170933 -0.525650176
[51] -0.494879279 0.202971241 0.862808366 -0.366035224 -0.327128970
[56] -0.640088688 -1.146189767 -0.140558821 0.521832483 0.229095990
[61] -0.818442863 -0.633125618 -0.481463450 1.186978904 0.042861577
[66] -0.252461436 0.101827776 1.132494567 -1.214207685 0.005915891
[71] 0.019396319 -1.251398873 -1.351785833 0.475922547 -1.549597180
[76] 0.833288334 0.129384118 0.834903459 1.301886549 -0.188307156
[81] -0.995761670 -0.243655152 0.244200737 -1.309896989 -0.362776660
[86] -0.099048925 -0.164374263 -0.406685754 -0.778389071 1.404431020
[91] -0.740827123 -0.048870859 -0.068651310 -1.399149015 -1.859471253
[96] 0.187372133 -1.814945339 -0.986011148 1.369410054 -0.078139882
> 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.154285937 -0.015110377 -0.624536013 1.549509844 0.611217913
[6] 0.686506293 0.464358077 -0.166290425 -0.320073180 -0.165674810
[11] 1.298519636 -0.170895669 1.198634899 0.192987196 -2.204716998
[16] -0.595250081 0.607400428 0.536637178 0.623295826 0.334562728
[21] -0.819683756 -0.961270215 -0.161131467 -0.300443325 0.735852459
[26] 0.153483351 -1.306195393 0.473124777 -0.328190200 -0.939903676
[31] -2.199053479 -0.679293095 0.907372593 -0.344909045 0.480682184
[36] -1.162319430 -0.413026193 -0.058983580 0.098254602 -0.947696642
[41] -0.720217205 -0.196447787 -0.979512399 -1.214450344 2.207931420
[46] 0.042052696 0.940917138 -0.115221353 -0.029170933 -0.525650176
[51] -0.494879279 0.202971241 0.862808366 -0.366035224 -0.327128970
[56] -0.640088688 -1.146189767 -0.140558821 0.521832483 0.229095990
[61] -0.818442863 -0.633125618 -0.481463450 1.186978904 0.042861577
[66] -0.252461436 0.101827776 1.132494567 -1.214207685 0.005915891
[71] 0.019396319 -1.251398873 -1.351785833 0.475922547 -1.549597180
[76] 0.833288334 0.129384118 0.834903459 1.301886549 -0.188307156
[81] -0.995761670 -0.243655152 0.244200737 -1.309896989 -0.362776660
[86] -0.099048925 -0.164374263 -0.406685754 -0.778389071 1.404431020
[91] -0.740827123 -0.048870859 -0.068651310 -1.399149015 -1.859471253
[96] 0.187372133 -1.814945339 -0.986011148 1.369410054 -0.078139882
> colMin(tmp)
[1] 0.154285937 -0.015110377 -0.624536013 1.549509844 0.611217913
[6] 0.686506293 0.464358077 -0.166290425 -0.320073180 -0.165674810
[11] 1.298519636 -0.170895669 1.198634899 0.192987196 -2.204716998
[16] -0.595250081 0.607400428 0.536637178 0.623295826 0.334562728
[21] -0.819683756 -0.961270215 -0.161131467 -0.300443325 0.735852459
[26] 0.153483351 -1.306195393 0.473124777 -0.328190200 -0.939903676
[31] -2.199053479 -0.679293095 0.907372593 -0.344909045 0.480682184
[36] -1.162319430 -0.413026193 -0.058983580 0.098254602 -0.947696642
[41] -0.720217205 -0.196447787 -0.979512399 -1.214450344 2.207931420
[46] 0.042052696 0.940917138 -0.115221353 -0.029170933 -0.525650176
[51] -0.494879279 0.202971241 0.862808366 -0.366035224 -0.327128970
[56] -0.640088688 -1.146189767 -0.140558821 0.521832483 0.229095990
[61] -0.818442863 -0.633125618 -0.481463450 1.186978904 0.042861577
[66] -0.252461436 0.101827776 1.132494567 -1.214207685 0.005915891
[71] 0.019396319 -1.251398873 -1.351785833 0.475922547 -1.549597180
[76] 0.833288334 0.129384118 0.834903459 1.301886549 -0.188307156
[81] -0.995761670 -0.243655152 0.244200737 -1.309896989 -0.362776660
[86] -0.099048925 -0.164374263 -0.406685754 -0.778389071 1.404431020
[91] -0.740827123 -0.048870859 -0.068651310 -1.399149015 -1.859471253
[96] 0.187372133 -1.814945339 -0.986011148 1.369410054 -0.078139882
> colMedians(tmp)
[1] 0.154285937 -0.015110377 -0.624536013 1.549509844 0.611217913
[6] 0.686506293 0.464358077 -0.166290425 -0.320073180 -0.165674810
[11] 1.298519636 -0.170895669 1.198634899 0.192987196 -2.204716998
[16] -0.595250081 0.607400428 0.536637178 0.623295826 0.334562728
[21] -0.819683756 -0.961270215 -0.161131467 -0.300443325 0.735852459
[26] 0.153483351 -1.306195393 0.473124777 -0.328190200 -0.939903676
[31] -2.199053479 -0.679293095 0.907372593 -0.344909045 0.480682184
[36] -1.162319430 -0.413026193 -0.058983580 0.098254602 -0.947696642
[41] -0.720217205 -0.196447787 -0.979512399 -1.214450344 2.207931420
[46] 0.042052696 0.940917138 -0.115221353 -0.029170933 -0.525650176
[51] -0.494879279 0.202971241 0.862808366 -0.366035224 -0.327128970
[56] -0.640088688 -1.146189767 -0.140558821 0.521832483 0.229095990
[61] -0.818442863 -0.633125618 -0.481463450 1.186978904 0.042861577
[66] -0.252461436 0.101827776 1.132494567 -1.214207685 0.005915891
[71] 0.019396319 -1.251398873 -1.351785833 0.475922547 -1.549597180
[76] 0.833288334 0.129384118 0.834903459 1.301886549 -0.188307156
[81] -0.995761670 -0.243655152 0.244200737 -1.309896989 -0.362776660
[86] -0.099048925 -0.164374263 -0.406685754 -0.778389071 1.404431020
[91] -0.740827123 -0.048870859 -0.068651310 -1.399149015 -1.859471253
[96] 0.187372133 -1.814945339 -0.986011148 1.369410054 -0.078139882
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.1542859 -0.01511038 -0.624536 1.54951 0.6112179 0.6865063 0.4643581
[2,] 0.1542859 -0.01511038 -0.624536 1.54951 0.6112179 0.6865063 0.4643581
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.1662904 -0.3200732 -0.1656748 1.29852 -0.1708957 1.198635 0.1929872
[2,] -0.1662904 -0.3200732 -0.1656748 1.29852 -0.1708957 1.198635 0.1929872
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -2.204717 -0.5952501 0.6074004 0.5366372 0.6232958 0.3345627 -0.8196838
[2,] -2.204717 -0.5952501 0.6074004 0.5366372 0.6232958 0.3345627 -0.8196838
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.9612702 -0.1611315 -0.3004433 0.7358525 0.1534834 -1.306195 0.4731248
[2,] -0.9612702 -0.1611315 -0.3004433 0.7358525 0.1534834 -1.306195 0.4731248
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.3281902 -0.9399037 -2.199053 -0.6792931 0.9073726 -0.344909 0.4806822
[2,] -0.3281902 -0.9399037 -2.199053 -0.6792931 0.9073726 -0.344909 0.4806822
[,36] [,37] [,38] [,39] [,40] [,41]
[1,] -1.162319 -0.4130262 -0.05898358 0.0982546 -0.9476966 -0.7202172
[2,] -1.162319 -0.4130262 -0.05898358 0.0982546 -0.9476966 -0.7202172
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.1964478 -0.9795124 -1.21445 2.207931 0.0420527 0.9409171 -0.1152214
[2,] -0.1964478 -0.9795124 -1.21445 2.207931 0.0420527 0.9409171 -0.1152214
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.02917093 -0.5256502 -0.4948793 0.2029712 0.8628084 -0.3660352 -0.327129
[2,] -0.02917093 -0.5256502 -0.4948793 0.2029712 0.8628084 -0.3660352 -0.327129
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.6400887 -1.14619 -0.1405588 0.5218325 0.229096 -0.8184429 -0.6331256
[2,] -0.6400887 -1.14619 -0.1405588 0.5218325 0.229096 -0.8184429 -0.6331256
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.4814635 1.186979 0.04286158 -0.2524614 0.1018278 1.132495 -1.214208
[2,] -0.4814635 1.186979 0.04286158 -0.2524614 0.1018278 1.132495 -1.214208
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.005915891 0.01939632 -1.251399 -1.351786 0.4759225 -1.549597 0.8332883
[2,] 0.005915891 0.01939632 -1.251399 -1.351786 0.4759225 -1.549597 0.8332883
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.1293841 0.8349035 1.301887 -0.1883072 -0.9957617 -0.2436552 0.2442007
[2,] 0.1293841 0.8349035 1.301887 -0.1883072 -0.9957617 -0.2436552 0.2442007
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -1.309897 -0.3627767 -0.09904892 -0.1643743 -0.4066858 -0.7783891 1.404431
[2,] -1.309897 -0.3627767 -0.09904892 -0.1643743 -0.4066858 -0.7783891 1.404431
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] -0.7408271 -0.04887086 -0.06865131 -1.399149 -1.859471 0.1873721 -1.814945
[2,] -0.7408271 -0.04887086 -0.06865131 -1.399149 -1.859471 0.1873721 -1.814945
[,98] [,99] [,100]
[1,] -0.9860111 1.36941 -0.07813988
[2,] -0.9860111 1.36941 -0.07813988
>
>
> Max(tmp2)
[1] 2.377466
> Min(tmp2)
[1] -2.586213
> mean(tmp2)
[1] 0.1008209
> Sum(tmp2)
[1] 10.08209
> Var(tmp2)
[1] 0.9452319
>
> rowMeans(tmp2)
[1] -0.55271765 -0.05646746 -0.16100823 0.55845961 0.78853666 1.11700062
[7] -0.44210831 1.20348863 0.74970191 0.26267238 0.69654099 -1.84775865
[13] -1.84504979 0.05613081 -0.25231392 -0.14165651 0.21850704 -0.28688385
[19] 0.14698502 0.88270865 1.36992970 0.47884410 0.54856950 -0.03441515
[25] 0.24122644 0.55658026 1.32096592 1.44314863 -0.20052346 -0.26313943
[31] 0.48571212 0.57581983 -0.86426738 0.08660729 0.47689748 -0.43547418
[37] 0.66019765 0.38516978 0.12493326 -1.80174659 -0.07574020 1.10224968
[43] -1.32107136 -0.48603299 -2.18880595 -0.58508945 1.90033076 -1.22899449
[49] 0.14506752 0.75639220 0.13182525 -0.40163997 1.25123861 0.23681187
[55] 1.25421314 -0.86689253 0.11667781 1.59638221 -1.11761711 0.64918559
[61] -2.00678200 -1.19432080 0.59632400 1.18316393 -1.10717940 0.26585783
[67] 0.71629785 1.03910465 1.36644471 0.11236222 -0.24921689 0.00617698
[73] 0.34665824 0.44158656 -0.72687159 0.32713869 2.37746620 0.61424153
[79] -0.37846029 1.93693081 1.33127288 -2.58621330 -0.26168067 -0.12517611
[85] -2.22233434 0.09863697 0.11140522 0.47955180 -1.82565138 -0.18668089
[91] -0.52100652 0.83223310 0.14248942 -0.36523421 -0.10743750 -1.06046407
[97] 0.92135508 1.39315806 1.30768148 -0.05903673
> rowSums(tmp2)
[1] -0.55271765 -0.05646746 -0.16100823 0.55845961 0.78853666 1.11700062
[7] -0.44210831 1.20348863 0.74970191 0.26267238 0.69654099 -1.84775865
[13] -1.84504979 0.05613081 -0.25231392 -0.14165651 0.21850704 -0.28688385
[19] 0.14698502 0.88270865 1.36992970 0.47884410 0.54856950 -0.03441515
[25] 0.24122644 0.55658026 1.32096592 1.44314863 -0.20052346 -0.26313943
[31] 0.48571212 0.57581983 -0.86426738 0.08660729 0.47689748 -0.43547418
[37] 0.66019765 0.38516978 0.12493326 -1.80174659 -0.07574020 1.10224968
[43] -1.32107136 -0.48603299 -2.18880595 -0.58508945 1.90033076 -1.22899449
[49] 0.14506752 0.75639220 0.13182525 -0.40163997 1.25123861 0.23681187
[55] 1.25421314 -0.86689253 0.11667781 1.59638221 -1.11761711 0.64918559
[61] -2.00678200 -1.19432080 0.59632400 1.18316393 -1.10717940 0.26585783
[67] 0.71629785 1.03910465 1.36644471 0.11236222 -0.24921689 0.00617698
[73] 0.34665824 0.44158656 -0.72687159 0.32713869 2.37746620 0.61424153
[79] -0.37846029 1.93693081 1.33127288 -2.58621330 -0.26168067 -0.12517611
[85] -2.22233434 0.09863697 0.11140522 0.47955180 -1.82565138 -0.18668089
[91] -0.52100652 0.83223310 0.14248942 -0.36523421 -0.10743750 -1.06046407
[97] 0.92135508 1.39315806 1.30768148 -0.05903673
> 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.55271765 -0.05646746 -0.16100823 0.55845961 0.78853666 1.11700062
[7] -0.44210831 1.20348863 0.74970191 0.26267238 0.69654099 -1.84775865
[13] -1.84504979 0.05613081 -0.25231392 -0.14165651 0.21850704 -0.28688385
[19] 0.14698502 0.88270865 1.36992970 0.47884410 0.54856950 -0.03441515
[25] 0.24122644 0.55658026 1.32096592 1.44314863 -0.20052346 -0.26313943
[31] 0.48571212 0.57581983 -0.86426738 0.08660729 0.47689748 -0.43547418
[37] 0.66019765 0.38516978 0.12493326 -1.80174659 -0.07574020 1.10224968
[43] -1.32107136 -0.48603299 -2.18880595 -0.58508945 1.90033076 -1.22899449
[49] 0.14506752 0.75639220 0.13182525 -0.40163997 1.25123861 0.23681187
[55] 1.25421314 -0.86689253 0.11667781 1.59638221 -1.11761711 0.64918559
[61] -2.00678200 -1.19432080 0.59632400 1.18316393 -1.10717940 0.26585783
[67] 0.71629785 1.03910465 1.36644471 0.11236222 -0.24921689 0.00617698
[73] 0.34665824 0.44158656 -0.72687159 0.32713869 2.37746620 0.61424153
[79] -0.37846029 1.93693081 1.33127288 -2.58621330 -0.26168067 -0.12517611
[85] -2.22233434 0.09863697 0.11140522 0.47955180 -1.82565138 -0.18668089
[91] -0.52100652 0.83223310 0.14248942 -0.36523421 -0.10743750 -1.06046407
[97] 0.92135508 1.39315806 1.30768148 -0.05903673
> rowMin(tmp2)
[1] -0.55271765 -0.05646746 -0.16100823 0.55845961 0.78853666 1.11700062
[7] -0.44210831 1.20348863 0.74970191 0.26267238 0.69654099 -1.84775865
[13] -1.84504979 0.05613081 -0.25231392 -0.14165651 0.21850704 -0.28688385
[19] 0.14698502 0.88270865 1.36992970 0.47884410 0.54856950 -0.03441515
[25] 0.24122644 0.55658026 1.32096592 1.44314863 -0.20052346 -0.26313943
[31] 0.48571212 0.57581983 -0.86426738 0.08660729 0.47689748 -0.43547418
[37] 0.66019765 0.38516978 0.12493326 -1.80174659 -0.07574020 1.10224968
[43] -1.32107136 -0.48603299 -2.18880595 -0.58508945 1.90033076 -1.22899449
[49] 0.14506752 0.75639220 0.13182525 -0.40163997 1.25123861 0.23681187
[55] 1.25421314 -0.86689253 0.11667781 1.59638221 -1.11761711 0.64918559
[61] -2.00678200 -1.19432080 0.59632400 1.18316393 -1.10717940 0.26585783
[67] 0.71629785 1.03910465 1.36644471 0.11236222 -0.24921689 0.00617698
[73] 0.34665824 0.44158656 -0.72687159 0.32713869 2.37746620 0.61424153
[79] -0.37846029 1.93693081 1.33127288 -2.58621330 -0.26168067 -0.12517611
[85] -2.22233434 0.09863697 0.11140522 0.47955180 -1.82565138 -0.18668089
[91] -0.52100652 0.83223310 0.14248942 -0.36523421 -0.10743750 -1.06046407
[97] 0.92135508 1.39315806 1.30768148 -0.05903673
>
> colMeans(tmp2)
[1] 0.1008209
> colSums(tmp2)
[1] 10.08209
> colVars(tmp2)
[1] 0.9452319
> colSd(tmp2)
[1] 0.9722304
> colMax(tmp2)
[1] 2.377466
> colMin(tmp2)
[1] -2.586213
> colMedians(tmp2)
[1] 0.1371573
> colRanges(tmp2)
[,1]
[1,] -2.586213
[2,] 2.377466
>
> 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.0663494 0.6439683 -2.8977688 2.9588803 -3.0382128 -0.9920210
[7] 1.2361785 -1.3718899 2.8619629 4.8611261
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5994383
[2,] -0.9342622
[3,] -0.1501940
[4,] 0.3870325
[5,] 0.7049565
>
> rowApply(tmp,sum)
[1] -3.0947742 0.2444654 5.8086799 1.2257907 -0.9854494 -4.4627737
[7] -2.2924462 7.4203827 -2.8192840 0.1512832
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 1 3 5 1 10 2 5 6 1
[2,] 7 3 7 1 6 7 7 4 8 9
[3,] 6 9 1 7 9 9 1 3 1 2
[4,] 3 10 10 9 4 6 6 9 4 3
[5,] 1 4 6 2 2 1 9 10 3 5
[6,] 9 2 2 3 7 5 5 2 7 8
[7,] 5 7 4 8 5 3 10 1 9 10
[8,] 2 6 9 4 8 2 4 8 2 7
[9,] 4 8 5 10 3 4 8 6 5 6
[10,] 10 5 8 6 10 8 3 7 10 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.0353982 0.6541211 -1.0234736 -3.3331782 1.2076075 -4.5920796
[7] 0.4145073 2.0416694 1.9630447 -1.3892993 -1.5711450 0.7998839
[13] 4.4042690 -1.4845167 2.8187103 1.6280932 -4.8327201 1.7515822
[19] -0.8542930 2.7139783
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.52381490
[2,] -0.35682633
[3,] -0.28753540
[4,] -0.09693658
[5,] 1.30051141
>
> rowApply(tmp,sum)
[1] -4.2052679 0.8844769 0.6442812 -3.4946432 7.5233127
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 12 19 7 7 5
[2,] 19 5 9 9 15
[3,] 16 14 4 8 2
[4,] 18 8 3 2 1
[5,] 13 16 12 14 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.28753540 1.12940363 0.5804169 0.8059304 0.06102484 -1.66078545
[2,] 1.30051141 -0.96657812 0.8551359 -0.4252537 1.00522979 -1.87947796
[3,] -0.09693658 -0.05337188 -0.8719356 -0.9285646 0.16621372 -0.05635739
[4,] -0.52381490 -0.40174487 -0.5094623 -1.6865720 0.42598177 -0.89390610
[5,] -0.35682633 0.94641236 -1.0776285 -1.0987184 -0.45084263 -0.10155267
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.69681376 -0.4451553 -0.9981085 0.3747952 -0.9820478 -0.7599209
[2,] -1.82939185 0.8696685 0.1881298 -0.4705518 -0.2794754 0.5817124
[3,] 0.08728547 0.3213094 0.7089334 -2.1295125 -0.3332934 0.4468369
[4,] 1.26193159 0.1279359 0.8889771 0.6070490 -0.3387400 -0.1918865
[5,] 1.59149585 1.1679110 1.1751130 0.2289209 0.3624116 0.7231421
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.8015289 -0.4584692 -1.9165316 -0.4061870 -1.2446546 -0.5235876
[2,] 1.2446955 0.4821689 1.6511494 0.2091026 -0.4430696 -1.2700254
[3,] 0.2364391 -1.5755895 1.8508907 1.3639259 -0.8147873 1.3395850
[4,] 1.2472806 -0.8651028 0.6964372 -1.4521341 -2.0963203 1.0563298
[5,] 0.8743248 0.9324758 0.5367647 1.9133857 -0.2338883 1.1492805
[,19] [,20]
[1,] 1.95848859 0.46294068
[2,] -1.08034280 1.14113937
[3,] 0.05428218 0.92892831
[4,] -1.06979628 0.22291401
[5,] -0.71692471 -0.04194405
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 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.9982712 2.46284 0.2374929 0.3166477 0.5185891 -0.5220345 -0.4951483
col8 col9 col10 col11 col12 col13 col14
row1 1.268777 0.06546599 0.3229356 -0.6839753 -0.6712526 -0.7357784 0.4998149
col15 col16 col17 col18 col19 col20
row1 -0.7213019 -1.352377 -0.4434034 1.429049 0.6097 0.5698282
> tmp[,"col10"]
col10
row1 0.3229356
row2 -0.3249799
row3 1.3926079
row4 0.7398273
row5 -1.1352729
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.9982712 2.4628403 0.2374929 0.3166477 0.5185891 -0.5220345 -0.4951483
row5 1.0015283 0.4044154 0.2267672 -0.2139365 -1.1741995 1.1739338 -1.5086593
col8 col9 col10 col11 col12 col13
row1 1.26877708 0.06546599 0.3229356 -0.68397528 -0.6712526 -0.7357784
row5 -0.06701081 1.31497741 -1.1352729 -0.02190592 -0.8149801 -0.2000793
col14 col15 col16 col17 col18 col19 col20
row1 0.4998149 -0.7213019 -1.3523771 -0.4434034 1.4290490 0.6097000 0.5698282
row5 0.4061849 -0.2840993 -0.1322235 1.2898605 -0.8116336 0.8103674 2.5108089
> tmp[,c("col6","col20")]
col6 col20
row1 -0.5220345 0.5698282
row2 -2.6447535 0.4734720
row3 -0.9465337 -1.2550183
row4 -0.7192083 2.3942687
row5 1.1739338 2.5108089
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.5220345 0.5698282
row5 1.1739338 2.5108089
>
>
>
>
> 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 50.50196 49.74308 50.3099 49.07879 49.94019 104.8415 51.07112 51.45584
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.11817 51.20735 51.40573 48.23702 51.26751 49.42854 49.78567 50.54011
col17 col18 col19 col20
row1 50.18456 49.83173 51.00069 104.2733
> tmp[,"col10"]
col10
row1 51.20735
row2 30.54728
row3 29.70585
row4 29.48652
row5 50.82973
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.50196 49.74308 50.3099 49.07879 49.94019 104.8415 51.07112 51.45584
row5 48.57399 50.77834 50.7096 48.96731 49.09902 105.0748 48.79104 50.84544
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.11817 51.20735 51.40573 48.23702 51.26751 49.42854 49.78567 50.54011
row5 49.75969 50.82973 51.06807 49.12195 49.86398 51.13616 49.10396 50.63648
col17 col18 col19 col20
row1 50.18456 49.83173 51.00069 104.2733
row5 49.91348 48.41522 49.95449 104.2706
> tmp[,c("col6","col20")]
col6 col20
row1 104.84147 104.27328
row2 73.88090 75.71865
row3 75.29444 74.73721
row4 74.32285 75.03473
row5 105.07481 104.27061
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.8415 104.2733
row5 105.0748 104.2706
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.8415 104.2733
row5 105.0748 104.2706
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.2693246
[2,] -1.2880143
[3,] -0.3707527
[4,] -0.7157041
[5,] -0.6695465
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.6445744 0.3528093
[2,] -1.5077739 0.7098580
[3,] 0.6246249 0.6509141
[4,] 0.4221493 0.6649631
[5,] 0.1315911 -0.6110482
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.06379504 2.7080980
[2,] -1.00960559 -0.9313408
[3,] 1.11137495 -0.1964387
[4,] 0.96548705 0.1431684
[5,] -0.35307478 0.3063511
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.06379504
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.06379504
[2,] -1.00960559
>
>
>
> 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 -1.2907743 -1.2165357 0.3329604 -0.7787837 -0.5803314 0.09755244
row1 -0.6044421 0.9308089 -1.4943085 0.7757882 1.2178789 -0.81296359
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.1514767 -0.5433298 1.313458 0.6734611 -0.2197255 0.3576568 1.7565021
row1 0.5806179 -0.6482085 -1.080757 1.7559380 0.1253899 0.9901061 -0.3215404
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 0.4196608 0.4673192 -0.04624555 -0.7728939 1.3461917 0.1484364 -0.07480355
row1 1.1735487 0.7484148 0.34555355 0.1456027 0.7871735 1.6380509 1.92637826
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.9973439 1.429605 0.02704166 -0.4174381 -1.29908 -0.798217 0.6848108
[,8] [,9] [,10]
row2 1.687053 0.1958027 0.1742037
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.189268 0.2927982 0.3327676 -0.07140392 -0.4218511 -0.389441 0.3489342
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.118409 -0.7731308 0.3363217 -1.038206 -0.4032724 -0.6885166 1.341333
[,15] [,16] [,17] [,18] [,19] [,20]
row5 2.753901 -0.9533963 -0.0654369 0.2156082 1.535667 1.004173
>
>
> 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: 0x5ec0374c5e50>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91957c54a8c"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c9193f81b3f3"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c9194ac91a38"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91919d01161"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c9196e73ae4c"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c919d955466"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91938d3c2cc"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91918cc601c"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c9194fd3e7a1"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91928c78d34"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c919387a3986"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c919140e9b9a"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91913b96897"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c9193423fd62"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM24c91953862ef"
>
>
> ### 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: 0x5ec03841d7d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5ec03841d7d0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5ec03841d7d0>
> rowMedians(tmp)
[1] -0.320949207 0.360757564 0.191269204 -0.520428521 0.406290932
[6] -0.155362557 0.080226686 0.141959770 -0.130175740 0.221440479
[11] 0.070246477 0.097469415 0.177967299 -0.169618421 -0.385883934
[16] -0.377193785 0.740650024 -0.198556419 -0.300361157 -0.080411643
[21] 0.117695993 0.261317148 -0.535078912 -0.251802980 -0.627567762
[26] 0.108696884 0.291019807 0.278263635 -0.023990685 -0.366993459
[31] -0.380126530 -0.498559503 0.011594281 0.112332715 0.284956112
[36] -0.339420342 0.072379198 -0.399809776 -0.110691547 0.161281266
[41] 0.128581657 0.323424260 0.099338923 0.057838446 0.323949879
[46] -0.534067864 -0.420779639 -0.048853209 0.300085280 -0.257199279
[51] -0.075804219 -0.177327930 0.189816561 -0.117347521 0.862160184
[56] -0.025596133 0.004337984 0.062984355 0.010871122 -0.470241338
[61] 0.058607203 -0.072263528 1.107282364 0.970575574 -0.245677438
[66] 0.496607858 0.037024184 0.121096736 0.657089884 0.023081995
[71] 0.006729522 0.110747401 0.211162083 -0.010574969 0.302062345
[76] 0.295750527 -0.212359594 0.140562318 0.607221402 -0.359146526
[81] 0.283483752 -0.030969980 0.812404820 0.024394860 0.051357594
[86] 0.214557155 -0.024640581 0.726416418 -0.250350339 -0.058761998
[91] 0.141842214 -0.311386106 0.790809708 0.035285095 -0.098956392
[96] 0.135688134 0.276571739 -0.206060372 -0.388835888 0.312597094
[101] -0.155976582 -0.438879380 -0.128966934 0.059822498 -0.276518222
[106] -0.050113778 -0.513714308 -0.166769072 0.616212364 -0.332665994
[111] -0.467442603 -0.125820812 0.315031383 -0.462941531 -0.570118324
[116] -0.260498627 -0.499411152 0.586232118 0.459979332 0.050889011
[121] 0.302437992 0.071276480 0.042344964 -0.177829828 -0.167910978
[126] -0.101764291 -0.331270066 -0.371794012 0.829961305 -0.201362587
[131] 0.007134589 -0.655503025 0.272973316 0.060700691 -0.021698317
[136] 0.568145760 0.207070554 -0.151881397 0.298238497 0.222197139
[141] -0.536205838 -0.058056454 -0.198595305 0.415454923 -0.130769995
[146] 0.159396108 -0.228939895 0.076605982 -0.023302490 -0.096574683
[151] -0.449791396 0.543371811 -0.143540166 0.678122547 0.518834594
[156] -0.357596340 -0.077242024 -0.673057945 0.597599169 0.083454508
[161] -0.137967333 -0.052296083 0.304886596 0.344191625 -0.680720672
[166] 0.070256472 0.054167859 0.072363683 -0.605382605 0.007638437
[171] -0.159531820 -0.646032540 -0.187477182 0.190496813 0.186021560
[176] -0.303075598 -0.114557258 0.083211960 -0.622990290 -0.285364586
[181] 0.159224582 -0.639120979 0.305402543 0.443206767 -0.087168769
[186] 0.123095656 0.355075258 -0.055651976 0.009291932 0.122944252
[191] -0.196441447 0.466962036 -0.288603773 0.097702058 0.136660915
[196] -0.307283031 -0.565910224 0.204826525 -0.149126801 -0.035409991
[201] -0.332623870 -0.023146975 0.113556587 0.135765382 -0.295597042
[206] 0.281301462 -0.151614962 0.120356678 0.063385164 0.126564664
[211] -0.645250113 0.285787511 -0.643141484 0.066901872 -0.668954683
[216] 0.248024606 0.329723005 -0.324590885 -0.287263116 0.169983224
[221] 0.427483252 -0.174445706 0.370491887 -0.552575816 -0.351623035
[226] -0.590206542 0.191178506 -0.293164669 0.820279503 -0.128203349
>
> proc.time()
user system elapsed
1.347 1.413 2.749
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5c5dff224b20>
> .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: 0x5c5dff224b20>
> .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: 0x5c5dff224b20>
> .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: 0x5c5dff224b20>
> 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: 0x5c5dff205410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dff205410>
> .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: 0x5c5dff205410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dff205410>
> .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: 0x5c5dff205410>
> 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: 0x5c5dfdab27a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dfdab27a0>
> .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: 0x5c5dfdab27a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c5dfdab27a0>
> .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: 0x5c5dfdab27a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5c5dfdab27a0>
> .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: 0x5c5dfdab27a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5c5dfdab27a0>
> .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: 0x5c5dfdab27a0>
> 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: 0x5c5dfea84680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5c5dfea84680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dfea84680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dfea84680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile24ca451151f045" "BufferedMatrixFile24ca456cdd32f9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile24ca451151f045" "BufferedMatrixFile24ca456cdd32f9"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dfe818490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dfe818490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c5dfe818490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c5dfe818490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5c5dfe818490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5c5dfe818490>
> .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: 0x5c5dffe74110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c5dffe74110>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c5dffe74110>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5c5dffe74110>
> 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: 0x5c5dfff175e0>
> .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: 0x5c5dfff175e0>
> rm(P)
>
> proc.time()
user system elapsed
0.241 0.051 0.281
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.255 0.051 0.295