| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-03 11:34 -0500 (Sat, 03 Jan 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" | 4809 |
| 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: 2026-01-01 21:34:35 -0500 (Thu, 01 Jan 2026) |
| EndedAt: 2026-01-01 21:35:01 -0500 (Thu, 01 Jan 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-12-22 r89219)
* 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-12-22 r89219) -- "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.235 0.051 0.275
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "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 478851 25.6 1048487 56 639317 34.2
Vcells 885659 6.8 8388608 64 2082734 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] "Thu Jan 1 21:34: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] "Thu Jan 1 21:34: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: 0x58d80d2b22b0>
>
>
>
> 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] "Thu Jan 1 21:34: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] "Thu Jan 1 21:34:51 2026"
>
> ColMode(tmp2)
<pointer: 0x58d80d2b22b0>
>
>
>
> ### 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.17427280 0.2039335 -0.225891773 0.37510105
[2,] 0.05386146 -1.8046739 0.318345115 -0.54336303
[3,] -1.84887159 0.0467386 -0.635824314 -0.02241154
[4,] -0.39162062 0.5305508 -0.001413884 0.72949874
> 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.17427280 0.2039335 0.225891773 0.37510105
[2,] 0.05386146 1.8046739 0.318345115 0.54336303
[3,] 1.84887159 0.0467386 0.635824314 0.02241154
[4,] 0.39162062 0.5305508 0.001413884 0.72949874
> 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.9586281 0.4515899 0.47528073 0.6124549
[2,] 0.2320807 1.3433815 0.56422080 0.7371316
[3,] 1.3597322 0.2161911 0.79738593 0.1497048
[4,] 0.6257960 0.7283892 0.03760165 0.8541070
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 223.76055 29.71983 29.97870 31.49965
[2,] 27.37467 40.23849 30.96055 32.91468
[3,] 40.44619 27.20865 33.60968 26.51946
[4,] 31.64958 32.81444 25.37743 34.27057
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x58d80e4f6300>
> exp(tmp5)
<pointer: 0x58d80e4f6300>
> log(tmp5,2)
<pointer: 0x58d80e4f6300>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7283
> Min(tmp5)
[1] 52.8198
> mean(tmp5)
[1] 72.9702
> Sum(tmp5)
[1] 14594.04
> Var(tmp5)
[1] 846.0545
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.20571 69.02142 71.03210 68.28480 72.28672 74.16803 72.48153 69.91403
[9] 69.96750 73.34019
> rowSums(tmp5)
[1] 1784.114 1380.428 1420.642 1365.696 1445.734 1483.361 1449.631 1398.281
[9] 1399.350 1466.804
> rowVars(tmp5)
[1] 7902.39059 67.95410 94.27995 57.81919 78.63195 63.92039
[7] 68.09679 54.99101 64.13896 66.42350
> rowSd(tmp5)
[1] 88.895391 8.243428 9.709786 7.603893 8.867466 7.995023 8.252078
[8] 7.415592 8.008680 8.150061
> rowMax(tmp5)
[1] 465.72827 83.75114 85.87226 85.96280 88.97327 91.08355 95.42958
[8] 82.09877 85.32127 85.42687
> rowMin(tmp5)
[1] 57.24926 54.58940 55.19678 52.81980 55.64359 57.29873 59.32589 58.41032
[9] 56.26050 58.64523
>
> colMeans(tmp5)
[1] 107.68771 70.75001 68.52521 66.09511 70.41885 72.67294 71.45413
[8] 71.58212 69.66571 72.02114 71.93875 66.26353 69.00270 72.38505
[15] 76.86731 73.93901 72.32022 70.02764 71.34081 74.44615
> colSums(tmp5)
[1] 1076.8771 707.5001 685.2521 660.9511 704.1885 726.7294 714.5413
[8] 715.8212 696.6571 720.2114 719.3875 662.6353 690.0270 723.8505
[15] 768.6731 739.3901 723.2022 700.2764 713.4081 744.4615
> colVars(tmp5)
[1] 15893.44747 81.99657 75.32043 29.55669 87.36789 49.87169
[7] 68.71643 61.26610 67.75579 104.96281 22.27961 44.86152
[13] 70.00886 114.85565 85.68740 57.02994 105.05746 48.59915
[19] 60.30023 31.51825
> colSd(tmp5)
[1] 126.069217 9.055196 8.678734 5.436606 9.347079 7.061989
[7] 8.289537 7.827266 8.231390 10.245136 4.720128 6.697875
[13] 8.367130 10.717073 9.256749 7.551817 10.249754 6.971309
[19] 7.765322 5.614112
> colMax(tmp5)
[1] 465.72827 83.75114 83.40440 74.65872 88.85834 80.25869 86.00722
[8] 81.43992 79.48686 88.88786 77.46515 78.77547 85.42687 85.69431
[15] 91.08355 88.97327 95.42958 84.93014 85.96280 85.87226
> colMin(tmp5)
[1] 56.26050 56.63124 52.81980 55.19678 56.38514 60.21301 54.58940 59.32589
[9] 58.41032 57.08272 63.42358 57.29873 55.64359 57.52534 60.11597 64.99400
[17] 58.64523 61.60601 60.85655 69.23218
>
>
> ### 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] 89.20571 69.02142 71.03210 68.28480 72.28672 74.16803 72.48153 NA
[9] 69.96750 73.34019
> rowSums(tmp5)
[1] 1784.114 1380.428 1420.642 1365.696 1445.734 1483.361 1449.631 NA
[9] 1399.350 1466.804
> rowVars(tmp5)
[1] 7902.39059 67.95410 94.27995 57.81919 78.63195 63.92039
[7] 68.09679 57.36157 64.13896 66.42350
> rowSd(tmp5)
[1] 88.895391 8.243428 9.709786 7.603893 8.867466 7.995023 8.252078
[8] 7.573742 8.008680 8.150061
> rowMax(tmp5)
[1] 465.72827 83.75114 85.87226 85.96280 88.97327 91.08355 95.42958
[8] NA 85.32127 85.42687
> rowMin(tmp5)
[1] 57.24926 54.58940 55.19678 52.81980 55.64359 57.29873 59.32589 NA
[9] 56.26050 58.64523
>
> colMeans(tmp5)
[1] 107.68771 70.75001 68.52521 66.09511 70.41885 72.67294 71.45413
[8] 71.58212 69.66571 72.02114 NA 66.26353 69.00270 72.38505
[15] 76.86731 73.93901 72.32022 70.02764 71.34081 74.44615
> colSums(tmp5)
[1] 1076.8771 707.5001 685.2521 660.9511 704.1885 726.7294 714.5413
[8] 715.8212 696.6571 720.2114 NA 662.6353 690.0270 723.8505
[15] 768.6731 739.3901 723.2022 700.2764 713.4081 744.4615
> colVars(tmp5)
[1] 15893.44747 81.99657 75.32043 29.55669 87.36789 49.87169
[7] 68.71643 61.26610 67.75579 104.96281 NA 44.86152
[13] 70.00886 114.85565 85.68740 57.02994 105.05746 48.59915
[19] 60.30023 31.51825
> colSd(tmp5)
[1] 126.069217 9.055196 8.678734 5.436606 9.347079 7.061989
[7] 8.289537 7.827266 8.231390 10.245136 NA 6.697875
[13] 8.367130 10.717073 9.256749 7.551817 10.249754 6.971309
[19] 7.765322 5.614112
> colMax(tmp5)
[1] 465.72827 83.75114 83.40440 74.65872 88.85834 80.25869 86.00722
[8] 81.43992 79.48686 88.88786 NA 78.77547 85.42687 85.69431
[15] 91.08355 88.97327 95.42958 84.93014 85.96280 85.87226
> colMin(tmp5)
[1] 56.26050 56.63124 52.81980 55.19678 56.38514 60.21301 54.58940 59.32589
[9] 58.41032 57.08272 NA 57.29873 55.64359 57.52534 60.11597 64.99400
[17] 58.64523 61.60601 60.85655 69.23218
>
> Max(tmp5,na.rm=TRUE)
[1] 465.7283
> Min(tmp5,na.rm=TRUE)
[1] 52.8198
> mean(tmp5,na.rm=TRUE)
[1] 72.96837
> Sum(tmp5,na.rm=TRUE)
[1] 14520.71
> Var(tmp5,na.rm=TRUE)
[1] 850.3268
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.20571 69.02142 71.03210 68.28480 72.28672 74.16803 72.48153 69.73396
[9] 69.96750 73.34019
> rowSums(tmp5,na.rm=TRUE)
[1] 1784.114 1380.428 1420.642 1365.696 1445.734 1483.361 1449.631 1324.945
[9] 1399.350 1466.804
> rowVars(tmp5,na.rm=TRUE)
[1] 7902.39059 67.95410 94.27995 57.81919 78.63195 63.92039
[7] 68.09679 57.36157 64.13896 66.42350
> rowSd(tmp5,na.rm=TRUE)
[1] 88.895391 8.243428 9.709786 7.603893 8.867466 7.995023 8.252078
[8] 7.573742 8.008680 8.150061
> rowMax(tmp5,na.rm=TRUE)
[1] 465.72827 83.75114 85.87226 85.96280 88.97327 91.08355 95.42958
[8] 82.09877 85.32127 85.42687
> rowMin(tmp5,na.rm=TRUE)
[1] 57.24926 54.58940 55.19678 52.81980 55.64359 57.29873 59.32589 58.41032
[9] 56.26050 58.64523
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.68771 70.75001 68.52521 66.09511 70.41885 72.67294 71.45413
[8] 71.58212 69.66571 72.02114 71.78358 66.26353 69.00270 72.38505
[15] 76.86731 73.93901 72.32022 70.02764 71.34081 74.44615
> colSums(tmp5,na.rm=TRUE)
[1] 1076.8771 707.5001 685.2521 660.9511 704.1885 726.7294 714.5413
[8] 715.8212 696.6571 720.2114 646.0522 662.6353 690.0270 723.8505
[15] 768.6731 739.3901 723.2022 700.2764 713.4081 744.4615
> colVars(tmp5,na.rm=TRUE)
[1] 15893.44747 81.99657 75.32043 29.55669 87.36789 49.87169
[7] 68.71643 61.26610 67.75579 104.96281 24.79368 44.86152
[13] 70.00886 114.85565 85.68740 57.02994 105.05746 48.59915
[19] 60.30023 31.51825
> colSd(tmp5,na.rm=TRUE)
[1] 126.069217 9.055196 8.678734 5.436606 9.347079 7.061989
[7] 8.289537 7.827266 8.231390 10.245136 4.979326 6.697875
[13] 8.367130 10.717073 9.256749 7.551817 10.249754 6.971309
[19] 7.765322 5.614112
> colMax(tmp5,na.rm=TRUE)
[1] 465.72827 83.75114 83.40440 74.65872 88.85834 80.25869 86.00722
[8] 81.43992 79.48686 88.88786 77.46515 78.77547 85.42687 85.69431
[15] 91.08355 88.97327 95.42958 84.93014 85.96280 85.87226
> colMin(tmp5,na.rm=TRUE)
[1] 56.26050 56.63124 52.81980 55.19678 56.38514 60.21301 54.58940 59.32589
[9] 58.41032 57.08272 63.42358 57.29873 55.64359 57.52534 60.11597 64.99400
[17] 58.64523 61.60601 60.85655 69.23218
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.20571 69.02142 71.03210 68.28480 72.28672 74.16803 72.48153 NaN
[9] 69.96750 73.34019
> rowSums(tmp5,na.rm=TRUE)
[1] 1784.114 1380.428 1420.642 1365.696 1445.734 1483.361 1449.631 0.000
[9] 1399.350 1466.804
> rowVars(tmp5,na.rm=TRUE)
[1] 7902.39059 67.95410 94.27995 57.81919 78.63195 63.92039
[7] 68.09679 NA 64.13896 66.42350
> rowSd(tmp5,na.rm=TRUE)
[1] 88.895391 8.243428 9.709786 7.603893 8.867466 7.995023 8.252078
[8] NA 8.008680 8.150061
> rowMax(tmp5,na.rm=TRUE)
[1] 465.72827 83.75114 85.87226 85.96280 88.97327 91.08355 95.42958
[8] NA 85.32127 85.42687
> rowMin(tmp5,na.rm=TRUE)
[1] 57.24926 54.58940 55.19678 52.81980 55.64359 57.29873 59.32589 NA
[9] 56.26050 58.64523
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.90895 69.55197 67.64368 65.14360 70.74294 72.29216 71.50117
[8] 72.65837 70.91630 72.59741 NaN 66.80097 69.11034 71.30575
[15] 78.72857 74.93290 71.52326 70.40375 72.50573 74.14418
> colSums(tmp5,na.rm=TRUE)
[1] 1007.1805 625.9677 608.7931 586.2924 636.6864 650.6294 643.5105
[8] 653.9253 638.2467 653.3767 0.0000 601.2088 621.9930 641.7518
[15] 708.5571 674.3961 643.7094 633.6337 652.5515 667.2976
> colVars(tmp5,na.rm=TRUE)
[1] 17679.66599 76.09900 75.99317 23.06579 97.10724 54.47452
[7] 77.28110 55.89328 58.63029 114.34714 NA 47.21967
[13] 78.62962 116.10756 57.42511 53.04573 111.04430 53.08265
[19] 52.57112 34.43217
> colSd(tmp5,na.rm=TRUE)
[1] 132.964905 8.723474 8.717406 4.802686 9.854300 7.380685
[7] 8.790967 7.476181 7.657042 10.693322 NA 6.871657
[13] 8.867334 10.775322 7.577936 7.283250 10.537756 7.285784
[19] 7.250595 5.867893
> colMax(tmp5,na.rm=TRUE)
[1] 465.72827 83.75114 83.40440 71.32970 88.85834 80.25869 86.00722
[8] 81.43992 79.48686 88.88786 -Inf 78.77547 85.42687 85.69431
[15] 91.08355 88.97327 95.42958 84.93014 85.96280 85.87226
> colMin(tmp5,na.rm=TRUE)
[1] 56.26050 56.63124 52.81980 55.19678 56.38514 60.21301 54.58940 59.32589
[9] 59.59526 57.08272 Inf 57.29873 55.64359 57.52534 65.67992 66.07499
[17] 58.64523 61.60601 63.14419 69.23218
>
>
>
>
> 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] 370.8865 224.9718 202.6522 238.8230 151.9863 214.1399 102.6508 259.2998
[9] 229.6150 245.0369
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 370.8865 224.9718 202.6522 238.8230 151.9863 214.1399 102.6508 259.2998
[9] 229.6150 245.0369
>
>
>
> 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.136868e-13 2.273737e-13 4.547474e-13 -5.684342e-14 -5.684342e-14
[6] 0.000000e+00 1.136868e-13 1.136868e-13 -1.705303e-13 0.000000e+00
[11] 8.526513e-14 3.410605e-13 5.684342e-14 2.842171e-13 0.000000e+00
[16] 5.684342e-14 -5.684342e-14 8.526513e-14 -8.526513e-14 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)
+ }
6 13
3 9
2 7
2 8
1 1
1 18
4 5
2 14
8 7
6 6
3 18
2 1
9 7
4 13
7 8
7 6
3 1
5 10
3 14
8 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.453544
> Min(tmp)
[1] -2.050029
> mean(tmp)
[1] 0.07044055
> Sum(tmp)
[1] 7.044055
> Var(tmp)
[1] 1.039466
>
> rowMeans(tmp)
[1] 0.07044055
> rowSums(tmp)
[1] 7.044055
> rowVars(tmp)
[1] 1.039466
> rowSd(tmp)
[1] 1.019542
> rowMax(tmp)
[1] 2.453544
> rowMin(tmp)
[1] -2.050029
>
> colMeans(tmp)
[1] 0.886677660 -1.033066919 0.893165952 0.959804876 0.045363139
[6] 0.798530956 -0.219184735 0.732989716 -1.537379701 -0.688827722
[11] 0.381091606 -0.199536259 -0.314423155 0.162146652 -0.205637555
[16] 0.116880517 -0.094437240 1.372564743 -0.315717526 -0.387710734
[21] -0.111460364 0.319828571 0.592446819 2.453544369 -0.843299419
[26] 1.906184301 -0.822443603 0.601992994 0.254100783 0.273623891
[31] -0.442425297 -0.948404474 -0.531859568 0.368146368 -0.045870084
[36] -0.641937105 0.034914918 -0.591592738 0.098102560 -0.789504389
[41] 1.045238684 1.329997507 1.968628149 -1.692557398 -0.137779523
[46] 2.177903096 0.926635760 0.734141427 0.202178574 2.184576226
[51] -0.385054564 -0.204266438 1.853748142 1.241903157 -1.857579992
[56] 0.645704509 0.274450004 -1.449726431 0.615632478 1.214435094
[61] 1.139280432 -0.618320443 0.339687521 -0.126469321 2.240629926
[66] -0.015711710 -1.977502158 -1.209853372 -1.729995566 -0.697726244
[71] 0.002096939 0.767354677 1.077779733 -1.241420722 -0.083969690
[76] -1.076451242 1.990065675 0.249320496 -2.050029206 0.281795091
[81] 0.166373232 0.271154632 -0.127122132 -1.682968906 -0.132282844
[86] -0.703927198 0.434624060 -0.363698304 0.735466765 -0.711936980
[91] -0.826519137 -0.721935136 -1.440608006 2.110123084 0.733250441
[96] 1.078315760 -0.092202931 -0.886547201 -1.079993374 -0.151663280
> colSums(tmp)
[1] 0.886677660 -1.033066919 0.893165952 0.959804876 0.045363139
[6] 0.798530956 -0.219184735 0.732989716 -1.537379701 -0.688827722
[11] 0.381091606 -0.199536259 -0.314423155 0.162146652 -0.205637555
[16] 0.116880517 -0.094437240 1.372564743 -0.315717526 -0.387710734
[21] -0.111460364 0.319828571 0.592446819 2.453544369 -0.843299419
[26] 1.906184301 -0.822443603 0.601992994 0.254100783 0.273623891
[31] -0.442425297 -0.948404474 -0.531859568 0.368146368 -0.045870084
[36] -0.641937105 0.034914918 -0.591592738 0.098102560 -0.789504389
[41] 1.045238684 1.329997507 1.968628149 -1.692557398 -0.137779523
[46] 2.177903096 0.926635760 0.734141427 0.202178574 2.184576226
[51] -0.385054564 -0.204266438 1.853748142 1.241903157 -1.857579992
[56] 0.645704509 0.274450004 -1.449726431 0.615632478 1.214435094
[61] 1.139280432 -0.618320443 0.339687521 -0.126469321 2.240629926
[66] -0.015711710 -1.977502158 -1.209853372 -1.729995566 -0.697726244
[71] 0.002096939 0.767354677 1.077779733 -1.241420722 -0.083969690
[76] -1.076451242 1.990065675 0.249320496 -2.050029206 0.281795091
[81] 0.166373232 0.271154632 -0.127122132 -1.682968906 -0.132282844
[86] -0.703927198 0.434624060 -0.363698304 0.735466765 -0.711936980
[91] -0.826519137 -0.721935136 -1.440608006 2.110123084 0.733250441
[96] 1.078315760 -0.092202931 -0.886547201 -1.079993374 -0.151663280
> 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.886677660 -1.033066919 0.893165952 0.959804876 0.045363139
[6] 0.798530956 -0.219184735 0.732989716 -1.537379701 -0.688827722
[11] 0.381091606 -0.199536259 -0.314423155 0.162146652 -0.205637555
[16] 0.116880517 -0.094437240 1.372564743 -0.315717526 -0.387710734
[21] -0.111460364 0.319828571 0.592446819 2.453544369 -0.843299419
[26] 1.906184301 -0.822443603 0.601992994 0.254100783 0.273623891
[31] -0.442425297 -0.948404474 -0.531859568 0.368146368 -0.045870084
[36] -0.641937105 0.034914918 -0.591592738 0.098102560 -0.789504389
[41] 1.045238684 1.329997507 1.968628149 -1.692557398 -0.137779523
[46] 2.177903096 0.926635760 0.734141427 0.202178574 2.184576226
[51] -0.385054564 -0.204266438 1.853748142 1.241903157 -1.857579992
[56] 0.645704509 0.274450004 -1.449726431 0.615632478 1.214435094
[61] 1.139280432 -0.618320443 0.339687521 -0.126469321 2.240629926
[66] -0.015711710 -1.977502158 -1.209853372 -1.729995566 -0.697726244
[71] 0.002096939 0.767354677 1.077779733 -1.241420722 -0.083969690
[76] -1.076451242 1.990065675 0.249320496 -2.050029206 0.281795091
[81] 0.166373232 0.271154632 -0.127122132 -1.682968906 -0.132282844
[86] -0.703927198 0.434624060 -0.363698304 0.735466765 -0.711936980
[91] -0.826519137 -0.721935136 -1.440608006 2.110123084 0.733250441
[96] 1.078315760 -0.092202931 -0.886547201 -1.079993374 -0.151663280
> colMin(tmp)
[1] 0.886677660 -1.033066919 0.893165952 0.959804876 0.045363139
[6] 0.798530956 -0.219184735 0.732989716 -1.537379701 -0.688827722
[11] 0.381091606 -0.199536259 -0.314423155 0.162146652 -0.205637555
[16] 0.116880517 -0.094437240 1.372564743 -0.315717526 -0.387710734
[21] -0.111460364 0.319828571 0.592446819 2.453544369 -0.843299419
[26] 1.906184301 -0.822443603 0.601992994 0.254100783 0.273623891
[31] -0.442425297 -0.948404474 -0.531859568 0.368146368 -0.045870084
[36] -0.641937105 0.034914918 -0.591592738 0.098102560 -0.789504389
[41] 1.045238684 1.329997507 1.968628149 -1.692557398 -0.137779523
[46] 2.177903096 0.926635760 0.734141427 0.202178574 2.184576226
[51] -0.385054564 -0.204266438 1.853748142 1.241903157 -1.857579992
[56] 0.645704509 0.274450004 -1.449726431 0.615632478 1.214435094
[61] 1.139280432 -0.618320443 0.339687521 -0.126469321 2.240629926
[66] -0.015711710 -1.977502158 -1.209853372 -1.729995566 -0.697726244
[71] 0.002096939 0.767354677 1.077779733 -1.241420722 -0.083969690
[76] -1.076451242 1.990065675 0.249320496 -2.050029206 0.281795091
[81] 0.166373232 0.271154632 -0.127122132 -1.682968906 -0.132282844
[86] -0.703927198 0.434624060 -0.363698304 0.735466765 -0.711936980
[91] -0.826519137 -0.721935136 -1.440608006 2.110123084 0.733250441
[96] 1.078315760 -0.092202931 -0.886547201 -1.079993374 -0.151663280
> colMedians(tmp)
[1] 0.886677660 -1.033066919 0.893165952 0.959804876 0.045363139
[6] 0.798530956 -0.219184735 0.732989716 -1.537379701 -0.688827722
[11] 0.381091606 -0.199536259 -0.314423155 0.162146652 -0.205637555
[16] 0.116880517 -0.094437240 1.372564743 -0.315717526 -0.387710734
[21] -0.111460364 0.319828571 0.592446819 2.453544369 -0.843299419
[26] 1.906184301 -0.822443603 0.601992994 0.254100783 0.273623891
[31] -0.442425297 -0.948404474 -0.531859568 0.368146368 -0.045870084
[36] -0.641937105 0.034914918 -0.591592738 0.098102560 -0.789504389
[41] 1.045238684 1.329997507 1.968628149 -1.692557398 -0.137779523
[46] 2.177903096 0.926635760 0.734141427 0.202178574 2.184576226
[51] -0.385054564 -0.204266438 1.853748142 1.241903157 -1.857579992
[56] 0.645704509 0.274450004 -1.449726431 0.615632478 1.214435094
[61] 1.139280432 -0.618320443 0.339687521 -0.126469321 2.240629926
[66] -0.015711710 -1.977502158 -1.209853372 -1.729995566 -0.697726244
[71] 0.002096939 0.767354677 1.077779733 -1.241420722 -0.083969690
[76] -1.076451242 1.990065675 0.249320496 -2.050029206 0.281795091
[81] 0.166373232 0.271154632 -0.127122132 -1.682968906 -0.132282844
[86] -0.703927198 0.434624060 -0.363698304 0.735466765 -0.711936980
[91] -0.826519137 -0.721935136 -1.440608006 2.110123084 0.733250441
[96] 1.078315760 -0.092202931 -0.886547201 -1.079993374 -0.151663280
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.8866777 -1.033067 0.893166 0.9598049 0.04536314 0.798531 -0.2191847
[2,] 0.8866777 -1.033067 0.893166 0.9598049 0.04536314 0.798531 -0.2191847
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.7329897 -1.53738 -0.6888277 0.3810916 -0.1995363 -0.3144232 0.1621467
[2,] 0.7329897 -1.53738 -0.6888277 0.3810916 -0.1995363 -0.3144232 0.1621467
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.2056376 0.1168805 -0.09443724 1.372565 -0.3157175 -0.3877107 -0.1114604
[2,] -0.2056376 0.1168805 -0.09443724 1.372565 -0.3157175 -0.3877107 -0.1114604
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.3198286 0.5924468 2.453544 -0.8432994 1.906184 -0.8224436 0.601993
[2,] 0.3198286 0.5924468 2.453544 -0.8432994 1.906184 -0.8224436 0.601993
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.2541008 0.2736239 -0.4424253 -0.9484045 -0.5318596 0.3681464 -0.04587008
[2,] 0.2541008 0.2736239 -0.4424253 -0.9484045 -0.5318596 0.3681464 -0.04587008
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.6419371 0.03491492 -0.5915927 0.09810256 -0.7895044 1.045239 1.329998
[2,] -0.6419371 0.03491492 -0.5915927 0.09810256 -0.7895044 1.045239 1.329998
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.968628 -1.692557 -0.1377795 2.177903 0.9266358 0.7341414 0.2021786
[2,] 1.968628 -1.692557 -0.1377795 2.177903 0.9266358 0.7341414 0.2021786
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 2.184576 -0.3850546 -0.2042664 1.853748 1.241903 -1.85758 0.6457045
[2,] 2.184576 -0.3850546 -0.2042664 1.853748 1.241903 -1.85758 0.6457045
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.27445 -1.449726 0.6156325 1.214435 1.13928 -0.6183204 0.3396875
[2,] 0.27445 -1.449726 0.6156325 1.214435 1.13928 -0.6183204 0.3396875
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.1264693 2.24063 -0.01571171 -1.977502 -1.209853 -1.729996 -0.6977262
[2,] -0.1264693 2.24063 -0.01571171 -1.977502 -1.209853 -1.729996 -0.6977262
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.002096939 0.7673547 1.07778 -1.241421 -0.08396969 -1.076451 1.990066
[2,] 0.002096939 0.7673547 1.07778 -1.241421 -0.08396969 -1.076451 1.990066
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.2493205 -2.050029 0.2817951 0.1663732 0.2711546 -0.1271221 -1.682969
[2,] 0.2493205 -2.050029 0.2817951 0.1663732 0.2711546 -0.1271221 -1.682969
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.1322828 -0.7039272 0.4346241 -0.3636983 0.7354668 -0.711937 -0.8265191
[2,] -0.1322828 -0.7039272 0.4346241 -0.3636983 0.7354668 -0.711937 -0.8265191
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.7219351 -1.440608 2.110123 0.7332504 1.078316 -0.09220293 -0.8865472
[2,] -0.7219351 -1.440608 2.110123 0.7332504 1.078316 -0.09220293 -0.8865472
[,99] [,100]
[1,] -1.079993 -0.1516633
[2,] -1.079993 -0.1516633
>
>
> Max(tmp2)
[1] 2.087917
> Min(tmp2)
[1] -2.86119
> mean(tmp2)
[1] -0.04982915
> Sum(tmp2)
[1] -4.982915
> Var(tmp2)
[1] 1.059096
>
> rowMeans(tmp2)
[1] -1.4029759423 -0.1005025899 -0.0683121228 0.3711760645 -1.1493972187
[6] -2.2170559216 0.0447210146 -1.0436337515 -1.0966969053 0.9621740627
[11] -0.4469568043 -0.5607338960 -1.6881837035 -0.0099161016 0.9260238500
[16] -1.7338003718 -0.9296112147 -0.5144109040 0.4209849551 0.8732840092
[21] -1.8536802043 0.5494617622 0.6513886847 0.5440903030 -0.2049858062
[26] 1.1122942342 0.3507953988 0.5611623405 0.9718575533 0.5639505862
[31] -0.3809301890 0.8131427012 0.0008888433 0.5739207638 -1.6880988348
[36] -0.0265446906 1.6692553946 0.0638415305 -0.2782800640 0.5546255019
[41] 1.7851457823 1.0860599991 -0.1437450758 -0.7359960426 -0.0078861916
[46] 0.3653329965 -1.1200962283 0.2499745864 0.6986055877 0.6905820337
[51] -2.3475134686 -2.8611902528 -0.6402209956 1.5923532631 1.2747795755
[56] 2.0879170458 1.0395360929 0.4740127377 1.0836932482 0.2241426748
[61] -0.5327764555 -0.7891155904 0.3134371573 1.5719946908 -0.5873018352
[66] 0.9951689224 -0.8026993283 1.5807879594 -0.8460001763 -0.7207353028
[71] 0.0430677112 0.0500194441 -0.1956458780 1.2795218746 -0.1796611008
[76] -0.6795753408 1.3036296038 -1.0393190905 -0.5977963947 0.8208372478
[81] -1.6784106533 0.6739203750 1.6281442268 0.3604961142 -1.0915847443
[86] -1.1850219740 -1.5187811852 -1.3106594026 -0.1227707553 -2.1368371251
[91] -0.5466437797 0.0598486153 -0.7276494430 -0.2441996491 0.6434910994
[96] -0.0919537572 1.6277388244 0.0876018316 0.3831671028 -0.7604689393
> rowSums(tmp2)
[1] -1.4029759423 -0.1005025899 -0.0683121228 0.3711760645 -1.1493972187
[6] -2.2170559216 0.0447210146 -1.0436337515 -1.0966969053 0.9621740627
[11] -0.4469568043 -0.5607338960 -1.6881837035 -0.0099161016 0.9260238500
[16] -1.7338003718 -0.9296112147 -0.5144109040 0.4209849551 0.8732840092
[21] -1.8536802043 0.5494617622 0.6513886847 0.5440903030 -0.2049858062
[26] 1.1122942342 0.3507953988 0.5611623405 0.9718575533 0.5639505862
[31] -0.3809301890 0.8131427012 0.0008888433 0.5739207638 -1.6880988348
[36] -0.0265446906 1.6692553946 0.0638415305 -0.2782800640 0.5546255019
[41] 1.7851457823 1.0860599991 -0.1437450758 -0.7359960426 -0.0078861916
[46] 0.3653329965 -1.1200962283 0.2499745864 0.6986055877 0.6905820337
[51] -2.3475134686 -2.8611902528 -0.6402209956 1.5923532631 1.2747795755
[56] 2.0879170458 1.0395360929 0.4740127377 1.0836932482 0.2241426748
[61] -0.5327764555 -0.7891155904 0.3134371573 1.5719946908 -0.5873018352
[66] 0.9951689224 -0.8026993283 1.5807879594 -0.8460001763 -0.7207353028
[71] 0.0430677112 0.0500194441 -0.1956458780 1.2795218746 -0.1796611008
[76] -0.6795753408 1.3036296038 -1.0393190905 -0.5977963947 0.8208372478
[81] -1.6784106533 0.6739203750 1.6281442268 0.3604961142 -1.0915847443
[86] -1.1850219740 -1.5187811852 -1.3106594026 -0.1227707553 -2.1368371251
[91] -0.5466437797 0.0598486153 -0.7276494430 -0.2441996491 0.6434910994
[96] -0.0919537572 1.6277388244 0.0876018316 0.3831671028 -0.7604689393
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -1.4029759423 -0.1005025899 -0.0683121228 0.3711760645 -1.1493972187
[6] -2.2170559216 0.0447210146 -1.0436337515 -1.0966969053 0.9621740627
[11] -0.4469568043 -0.5607338960 -1.6881837035 -0.0099161016 0.9260238500
[16] -1.7338003718 -0.9296112147 -0.5144109040 0.4209849551 0.8732840092
[21] -1.8536802043 0.5494617622 0.6513886847 0.5440903030 -0.2049858062
[26] 1.1122942342 0.3507953988 0.5611623405 0.9718575533 0.5639505862
[31] -0.3809301890 0.8131427012 0.0008888433 0.5739207638 -1.6880988348
[36] -0.0265446906 1.6692553946 0.0638415305 -0.2782800640 0.5546255019
[41] 1.7851457823 1.0860599991 -0.1437450758 -0.7359960426 -0.0078861916
[46] 0.3653329965 -1.1200962283 0.2499745864 0.6986055877 0.6905820337
[51] -2.3475134686 -2.8611902528 -0.6402209956 1.5923532631 1.2747795755
[56] 2.0879170458 1.0395360929 0.4740127377 1.0836932482 0.2241426748
[61] -0.5327764555 -0.7891155904 0.3134371573 1.5719946908 -0.5873018352
[66] 0.9951689224 -0.8026993283 1.5807879594 -0.8460001763 -0.7207353028
[71] 0.0430677112 0.0500194441 -0.1956458780 1.2795218746 -0.1796611008
[76] -0.6795753408 1.3036296038 -1.0393190905 -0.5977963947 0.8208372478
[81] -1.6784106533 0.6739203750 1.6281442268 0.3604961142 -1.0915847443
[86] -1.1850219740 -1.5187811852 -1.3106594026 -0.1227707553 -2.1368371251
[91] -0.5466437797 0.0598486153 -0.7276494430 -0.2441996491 0.6434910994
[96] -0.0919537572 1.6277388244 0.0876018316 0.3831671028 -0.7604689393
> rowMin(tmp2)
[1] -1.4029759423 -0.1005025899 -0.0683121228 0.3711760645 -1.1493972187
[6] -2.2170559216 0.0447210146 -1.0436337515 -1.0966969053 0.9621740627
[11] -0.4469568043 -0.5607338960 -1.6881837035 -0.0099161016 0.9260238500
[16] -1.7338003718 -0.9296112147 -0.5144109040 0.4209849551 0.8732840092
[21] -1.8536802043 0.5494617622 0.6513886847 0.5440903030 -0.2049858062
[26] 1.1122942342 0.3507953988 0.5611623405 0.9718575533 0.5639505862
[31] -0.3809301890 0.8131427012 0.0008888433 0.5739207638 -1.6880988348
[36] -0.0265446906 1.6692553946 0.0638415305 -0.2782800640 0.5546255019
[41] 1.7851457823 1.0860599991 -0.1437450758 -0.7359960426 -0.0078861916
[46] 0.3653329965 -1.1200962283 0.2499745864 0.6986055877 0.6905820337
[51] -2.3475134686 -2.8611902528 -0.6402209956 1.5923532631 1.2747795755
[56] 2.0879170458 1.0395360929 0.4740127377 1.0836932482 0.2241426748
[61] -0.5327764555 -0.7891155904 0.3134371573 1.5719946908 -0.5873018352
[66] 0.9951689224 -0.8026993283 1.5807879594 -0.8460001763 -0.7207353028
[71] 0.0430677112 0.0500194441 -0.1956458780 1.2795218746 -0.1796611008
[76] -0.6795753408 1.3036296038 -1.0393190905 -0.5977963947 0.8208372478
[81] -1.6784106533 0.6739203750 1.6281442268 0.3604961142 -1.0915847443
[86] -1.1850219740 -1.5187811852 -1.3106594026 -0.1227707553 -2.1368371251
[91] -0.5466437797 0.0598486153 -0.7276494430 -0.2441996491 0.6434910994
[96] -0.0919537572 1.6277388244 0.0876018316 0.3831671028 -0.7604689393
>
> colMeans(tmp2)
[1] -0.04982915
> colSums(tmp2)
[1] -4.982915
> colVars(tmp2)
[1] 1.059096
> colSd(tmp2)
[1] 1.029124
> colMax(tmp2)
[1] 2.087917
> colMin(tmp2)
[1] -2.86119
> colMedians(tmp2)
[1] -0.003498674
> colRanges(tmp2)
[,1]
[1,] -2.861190
[2,] 2.087917
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.763615451 -2.847393082 2.050646307 0.534914456 2.437820236
[6] -0.385600461 0.007215925 -1.821020370 -0.375560261 1.764414709
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8946068
[2,] -0.5874377
[3,] -0.4957955
[4,] 0.2686570
[5,] 1.7010630
>
> rowApply(tmp,sum)
[1] 3.0785729 0.7298594 2.4510468 2.2983110 -1.6660817 -1.1811077
[7] 1.1792766 -3.0194750 -1.3475895 -1.9209909
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 5 2 5 9 2 2 6 5 3
[2,] 9 3 4 10 4 1 1 7 4 4
[3,] 2 6 3 7 10 4 7 1 10 5
[4,] 6 7 8 2 7 10 6 8 2 2
[5,] 7 10 7 9 2 6 4 5 7 7
[6,] 4 2 9 3 8 9 8 2 3 1
[7,] 1 9 6 1 5 7 5 9 9 6
[8,] 3 1 5 6 1 5 9 4 6 10
[9,] 5 8 1 8 3 3 3 3 8 9
[10,] 8 4 10 4 6 8 10 10 1 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.7674948 -0.2597296 -0.3038531 0.3442165 -0.1641670 0.1560429
[7] 0.8645071 -0.5850762 0.9030096 0.5428188 -0.1139666 -0.0702502
[13] 3.2760404 -1.7548390 -1.3603093 4.2125822 -3.5433199 1.6012728
[19] -3.6952339 2.2846168
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.4056025
[2,] -0.4850643
[3,] -0.3635045
[4,] 0.5387905
[5,] 0.9478860
>
> rowApply(tmp,sum)
[1] -6.54515365 -0.08043881 -2.68279758 11.18320619 -1.30794860
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 6 10 14 1
[2,] 16 9 8 9 7
[3,] 15 4 16 11 9
[4,] 6 3 20 7 15
[5,] 10 7 6 8 17
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.5387905 0.44749241 0.2677824 -0.5699737 -0.3140451 -0.09922077
[2,] -0.4850643 -0.06298042 -1.4833791 -1.7376382 -0.3639422 0.89234547
[3,] -0.3635045 -0.53254784 0.4917722 1.9448162 -0.7336248 -0.28157239
[4,] 0.9478860 0.37806824 0.5962812 0.1736335 0.2884722 -0.54134947
[5,] -2.4056025 -0.48976202 -0.1763098 0.5333787 0.9589729 0.18584009
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.1540655 0.91450432 -0.3399184 -1.0782799 -1.04321134 -2.0035919
[2,] 0.3741482 1.13410147 0.4611389 1.0927925 0.23364665 0.6475217
[3,] 0.2524958 -1.00106874 1.1903546 0.1859261 -1.92594751 -0.5561087
[4,] 0.5994627 -0.07380398 -2.0362053 0.9256736 2.64026308 1.4002639
[5,] -0.2075341 -1.55880929 1.6276398 -0.5832934 -0.01871744 0.4416647
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4151628 -2.1495350 1.7272488 -0.2945805 -1.92572326 0.5741848
[2,] 0.5116985 0.3271756 -1.8261183 1.7701481 -0.65422334 1.0677145
[3,] -0.8067230 -0.8044605 -0.8314639 1.0552104 -0.08930997 0.9044288
[4,] 3.0579374 1.6063790 1.5697945 0.5128827 -1.05133874 -1.1730295
[5,] 0.9282903 -0.7343980 -1.9997703 1.1689215 0.17727537 0.2279742
[,19] [,20]
[1,] -0.41617196 -0.2116767
[2,] -1.75909342 -0.2204310
[3,] -0.51973305 -0.2617369
[4,] -0.05232918 1.4142643
[5,] -0.94790623 1.5641970
>
>
> 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 : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.296333 -0.746012 -1.148246 0.2016734 0.3498189 -0.338279 0.5903251
col8 col9 col10 col11 col12 col13 col14
row1 -0.3604971 -0.1886385 0.3902121 -1.130408 -1.003149 -0.874371 0.7012824
col15 col16 col17 col18 col19 col20
row1 0.5096448 -0.9656014 0.9649125 0.2003593 0.2736958 -0.7208461
> tmp[,"col10"]
col10
row1 0.3902121
row2 1.0233459
row3 2.0024022
row4 -0.5965261
row5 0.3665675
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.296333 -0.746012 -1.1482459 0.2016734 0.3498189 -0.338279 0.59032510
row5 1.138060 1.497111 0.4938639 -1.1338677 0.7771234 1.237966 -0.04171018
col8 col9 col10 col11 col12 col13 col14
row1 -0.3604971 -0.1886385 0.3902121 -1.1304077 -1.0031493 -0.8743710 0.7012824
row5 -0.7439140 0.2392299 0.3665675 0.2841819 -0.8346055 0.5280489 0.1877224
col15 col16 col17 col18 col19 col20
row1 0.5096448 -0.9656014 0.9649125 0.2003593 0.2736958 -0.7208461
row5 0.9139622 1.4639291 -1.4410144 -0.5537561 0.9334810 0.8627025
> tmp[,c("col6","col20")]
col6 col20
row1 -0.3382790 -0.72084611
row2 1.7026311 -1.05759599
row3 0.5328611 -0.07965825
row4 0.2600005 0.44744995
row5 1.2379656 0.86270255
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.338279 -0.7208461
row5 1.237966 0.8627025
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.0608 50.07757 50.90527 49.42572 50.77452 102.9004 49.49629 49.47189
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.47059 50.39229 50.09496 50.34413 49.89661 49.19075 49.53969 49.68415
col17 col18 col19 col20
row1 51.52739 49.27481 48.77596 104.4374
> tmp[,"col10"]
col10
row1 50.39229
row2 29.48873
row3 29.31295
row4 28.52769
row5 51.78492
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.06080 50.07757 50.90527 49.42572 50.77452 102.9004 49.49629 49.47189
row5 49.62945 50.31256 51.30767 50.38962 50.99741 104.5266 49.83353 48.41761
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.47059 50.39229 50.09496 50.34413 49.89661 49.19075 49.53969 49.68415
row5 51.47878 51.78492 49.99934 50.11223 48.91614 51.24521 50.91521 51.45102
col17 col18 col19 col20
row1 51.52739 49.27481 48.77596 104.4374
row5 50.40798 49.09170 49.51938 104.1963
> tmp[,c("col6","col20")]
col6 col20
row1 102.90038 104.43739
row2 73.29568 74.64587
row3 74.92885 74.48979
row4 74.01011 75.95788
row5 104.52664 104.19633
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 102.9004 104.4374
row5 104.5266 104.1963
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 102.9004 104.4374
row5 104.5266 104.1963
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.5623380
[2,] -0.8893535
[3,] 0.4002304
[4,] -0.8698510
[5,] 0.6280960
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.17436155 -0.13751985
[2,] -0.24766388 0.70476914
[3,] -0.08677399 -0.03064956
[4,] -0.76285063 0.79758327
[5,] 0.28994695 2.20327046
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.1007740 -0.60551416
[2,] -0.6185214 1.50702055
[3,] 1.3047546 0.93374621
[4,] -1.4434892 0.02900931
[5,] 0.0987993 -2.29055562
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.100774
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.1007740
[2,] -0.6185214
>
>
>
> 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.8617774 -2.1379884 -0.5539771 1.653471 -0.005799367 0.2104987
row1 -1.7700298 -0.2376535 -1.3028000 1.926028 -1.723036019 -0.4581496
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.7235954 0.807139 -0.6520833 -1.6257305 -0.02711267 0.07068807
row1 -2.0191023 -1.043360 0.4276052 -0.3627886 -0.90434640 0.23940131
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 0.8189728 -0.218883 0.77396780 -0.6245240 -0.4472213 -0.7932958 0.8193122
row1 1.8863428 2.263615 -0.08873645 0.8707954 2.1966626 -0.3850121 1.0214695
[,20]
row3 1.5128505
row1 -0.1256647
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.823257 -0.5634729 -1.020898 -1.59291 -0.2522039 -1.574746 -0.8302568
[,8] [,9] [,10]
row2 0.3099925 -0.6888971 1.152345
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -2.269853 -0.5535014 1.151176 -1.616816 -0.461401 0.3744215 0.3792568
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.2214933 -1.199384 -0.9010808 0.269682 1.519105 -0.1800151 0.8282169
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.08510382 -1.473224 0.1060486 -2.553535 -0.2853558 -0.4589253
>
>
> 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: 0x58d81076b0b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a4a6f46f6"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a64abf268"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a1eec5d1"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5aa0bbd26"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a7843c36d"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a178dd593"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a3b69376"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a3627b976"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a2d654679"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a635d90c9"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a41b8f14c"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a3e6f4152"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a25b39d65"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a2f6083d6"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM186a5a526ad5b3"
>
>
> ### 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: 0x58d80e32c650>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x58d80e32c650>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x58d80e32c650>
> rowMedians(tmp)
[1] -0.2847800756 0.0315566854 -0.1680852154 0.1431218762 0.2976345987
[6] -0.0937319372 0.0806150090 -0.0524999438 -0.5898717645 -0.2648718401
[11] 0.1289456725 -0.1046652324 0.3517441572 0.0228851592 0.0473321366
[16] -0.1170182528 -0.0598777079 -0.4511148734 0.2362811708 0.0533995123
[21] -0.2120680896 -0.2750667841 0.1123165475 0.0234387527 0.2522027686
[26] 0.0739801428 0.5142119649 -0.3295292209 0.7398169899 0.0977360148
[31] -0.1318931251 0.3124009411 0.1159926711 0.2861353020 -0.1056061789
[36] -0.6189180365 -0.2323437560 0.6678535572 0.3827783895 0.4517286714
[41] -0.4319931957 -0.3530223692 -0.3772984392 -0.0048739729 -0.2374441826
[46] 0.3707880305 0.4857370139 -0.2882003976 -0.4059851109 0.4010901964
[51] 0.1068020312 -0.1152163077 -0.0618503282 0.0529989705 0.5518335412
[56] -0.0707222637 0.2452630983 0.0379811682 0.1773525982 0.0539864488
[61] 0.0953027962 0.4105561189 0.3839446220 -0.4037941408 0.1983695100
[66] -0.0365697046 0.5217456651 0.1372504896 -0.1792993184 -0.0920492037
[71] -0.1351462893 -0.4760602532 0.0192539307 0.0005899604 -0.0957501966
[76] 0.0925571466 0.3303869290 0.2271182013 -0.1698693317 0.5421583470
[81] -0.0455492577 -0.3608300486 0.1997451926 0.0467399152 -0.0732001507
[86] -0.0285443165 -0.2385260418 0.2649763816 -0.0264064352 0.1885913792
[91] 0.7050928331 0.2169264709 -0.5832867081 0.1152275659 0.2912945096
[96] 0.3034666979 0.3104275729 0.1129486700 0.4059354760 -0.0308796096
[101] 0.0462111291 0.1562328635 0.5578088002 -0.0896423460 -0.0414792444
[106] 0.2132377478 0.4284916867 0.2730629561 -0.0898550178 0.1960727340
[111] 0.1386866994 0.0334118283 -0.7499011489 0.1387614666 0.1256141680
[116] 0.2935565680 -0.3323713487 0.4373731953 -0.3744667689 0.5108307450
[121] -0.2408583382 0.0650023799 -0.0133212146 -0.3240067490 -0.0869391033
[126] -0.1115814896 -0.4668042066 -0.1125780332 -0.0363570347 0.2161105252
[131] 0.0562737946 0.1583189526 -0.2518765448 -0.7586112148 -0.1976566583
[136] 0.3662037936 -0.3890633947 0.1011603467 0.0356337506 -0.4795844419
[141] 0.6548698656 0.0952194907 0.4526476202 0.2783398367 -0.5515387570
[146] -0.2707028942 0.4293867606 -0.2362339123 -0.3505982016 -0.5478666953
[151] -0.3118488048 0.5062330286 0.6181033027 -0.5398991178 -0.1602924548
[156] 0.2089105497 0.5038392300 -0.0338929356 -0.4005720550 -0.3062326648
[161] 0.1619327838 0.1626372244 0.1443503175 -0.2855227755 -0.3338993268
[166] 0.1852894422 0.3862941309 0.5522658640 -0.2770763248 -0.4617355558
[171] -0.1845141767 -0.3915902042 0.2340855734 0.2113263430 0.1833330000
[176] -0.2233285975 -0.0015792245 0.0410979930 -0.5917542096 -0.2078711271
[181] -0.4386333595 -0.1691495738 -0.1212863549 0.1767276373 0.3450353230
[186] -0.0055309575 -0.4212535671 0.0467685632 0.1948353013 -0.1557066004
[191] -0.7124199687 -0.5701038918 -0.3590317038 -0.0154985702 -0.5660123575
[196] 0.0358179697 0.2764248127 -0.1053480391 0.2145683968 0.4131447688
[201] 0.4749520461 0.4325168958 0.1140460854 0.3124374798 0.4684099690
[206] 0.5686056534 0.0871288126 -0.0918766253 0.2237361744 0.6650719507
[211] -0.0420873150 0.2361705108 -0.0850023222 0.0996971050 0.6596355322
[216] -0.3220519403 0.0456255521 -0.1166744199 -0.2640004687 -0.2332875731
[221] 0.0378860101 -0.2593385562 -0.0306038645 0.4062713949 -0.0269503764
[226] 0.1107908479 0.2413607868 0.0569139570 0.0586605957 0.1466360204
>
> proc.time()
user system elapsed
1.267 1.509 2.764
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "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: 0x5f403c69d5f0>
> .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: 0x5f403c69d5f0>
> .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: 0x5f403c69d5f0>
> .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: 0x5f403c69d5f0>
> 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: 0x5f403cf1b2b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403cf1b2b0>
> .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: 0x5f403cf1b2b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403cf1b2b0>
> .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: 0x5f403cf1b2b0>
> 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: 0x5f403c5fea20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403c5fea20>
> .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: 0x5f403c5fea20>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f403c5fea20>
> .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: 0x5f403c5fea20>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5f403c5fea20>
> .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: 0x5f403c5fea20>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5f403c5fea20>
> .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: 0x5f403c5fea20>
> 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: 0x5f403cddbe00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5f403cddbe00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403cddbe00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403cddbe00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile186af25b49e311" "BufferedMatrixFile186af2bbe29f7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile186af25b49e311" "BufferedMatrixFile186af2bbe29f7"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403ce90a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403ce90a10>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f403ce90a10>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f403ce90a10>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5f403ce90a10>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5f403ce90a10>
> .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: 0x5f403bdebd10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f403bdebd10>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f403bdebd10>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5f403bdebd10>
> 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: 0x5f403e152490>
> .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: 0x5f403e152490>
> rm(P)
>
> proc.time()
user system elapsed
0.234 0.057 0.279
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "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.241 0.042 0.270