| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-10-25 12:03 -0400 (Sat, 25 Oct 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4901 |
| lconway | macOS 12.7.6 Monterey | x86_64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4691 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4637 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4658 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.73.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | NA | NA | ||||||||||
|
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.73.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz |
| StartedAt: 2025-10-24 21:47:26 -0400 (Fri, 24 Oct 2025) |
| EndedAt: 2025-10-24 21:47:49 -0400 (Fri, 24 Oct 2025) |
| EllapsedTime: 23.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* 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.73.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.242 0.045 0.276
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.22-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 478419 25.6 1047111 56 639600 34.2
Vcells 885237 6.8 8388608 64 2081604 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 Oct 24 21:47:40 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 Oct 24 21:47:40 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: 0x6033e8845c80>
>
>
>
> 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 Oct 24 21:47:41 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Oct 24 21:47:41 2025"
>
> ColMode(tmp2)
<pointer: 0x6033e8845c80>
>
>
>
> ### 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,] 97.3226965 -1.2522034 -0.008484562 -0.2345833
[2,] 0.3124459 -0.8353118 0.301408033 -0.6591018
[3,] -0.1132476 0.3089535 -1.491361632 0.6990391
[4,] 0.1801039 -0.5129725 1.209803432 -0.2979369
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 97.3226965 1.2522034 0.008484562 0.2345833
[2,] 0.3124459 0.8353118 0.301408033 0.6591018
[3,] 0.1132476 0.3089535 1.491361632 0.6990391
[4,] 0.1801039 0.5129725 1.209803432 0.2979369
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.8652266 1.1190189 0.09211168 0.4843380
[2,] 0.5589686 0.9139539 0.54900640 0.8118508
[3,] 0.3365228 0.5558359 1.22121318 0.8360856
[4,] 0.4243865 0.7162210 1.09991065 0.5458359
>
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 220.97496 37.44239 25.92960 30.07796
[2,] 30.90213 34.97485 30.79147 33.77761
[3,] 28.47848 30.86731 38.70349 34.05989
[4,] 29.42397 32.67518 37.20891 30.75630
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6033eaa1e3b0>
> exp(tmp5)
<pointer: 0x6033eaa1e3b0>
> log(tmp5,2)
<pointer: 0x6033eaa1e3b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 459.9304
> Min(tmp5)
[1] 52.92969
> mean(tmp5)
[1] 71.51006
> Sum(tmp5)
[1] 14302.01
> Var(tmp5)
[1] 828.7609
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.19567 69.98538 68.52035 67.10046 72.86259 69.95125 68.84054 69.06732
[9] 71.50935 67.06766
> rowSums(tmp5)
[1] 1803.913 1399.708 1370.407 1342.009 1457.252 1399.025 1376.811 1381.346
[9] 1430.187 1341.353
> rowVars(tmp5)
[1] 7645.53091 44.52745 69.16213 80.81771 76.53679 58.68647
[7] 65.53243 58.21680 82.42274 59.85510
> rowSd(tmp5)
[1] 87.438727 6.672890 8.316377 8.989867 8.748531 7.660710 8.095210
[8] 7.629994 9.078697 7.736608
> rowMax(tmp5)
[1] 459.93043 80.61839 81.65031 83.81807 91.11204 82.13206 83.78753
[8] 83.43061 88.85150 81.32122
> rowMin(tmp5)
[1] 53.96907 58.72281 56.30862 52.92969 54.74521 55.76210 56.52808 56.65009
[9] 56.53197 56.79893
>
> colMeans(tmp5)
[1] 104.90647 69.38825 69.03601 65.64088 72.32517 71.53853 70.04817
[8] 68.63319 69.32140 69.77151 70.85183 72.22950 70.35583 70.41424
[15] 68.55714 72.60489 71.05913 67.93686 68.22500 67.35716
> colSums(tmp5)
[1] 1049.0647 693.8825 690.3601 656.4088 723.2517 715.3853 700.4817
[8] 686.3319 693.2140 697.7151 708.5183 722.2950 703.5583 704.1424
[15] 685.5714 726.0489 710.5913 679.3686 682.2500 673.5716
> colVars(tmp5)
[1] 15623.12412 56.41420 100.57824 36.86421 116.34585 63.98702
[7] 104.91131 99.30407 78.16260 63.04460 43.38235 29.80254
[13] 40.90645 97.54444 49.94138 49.36093 109.90228 31.31574
[19] 94.93412 64.22795
> colSd(tmp5)
[1] 124.992496 7.510938 10.028870 6.071590 10.786373 7.999189
[7] 10.242622 9.965143 8.840961 7.940063 6.586528 5.459170
[13] 6.395815 9.876459 7.066921 7.025733 10.483429 5.596047
[19] 9.743414 8.014234
> colMax(tmp5)
[1] 459.93043 80.23701 81.74862 73.98012 91.11204 81.32122 88.85150
[8] 82.43348 81.49175 80.62767 79.34927 77.79945 81.65031 84.83492
[15] 77.90939 83.43061 83.81807 77.28952 81.41339 79.84199
> colMin(tmp5)
[1] 56.65009 57.76091 53.96907 55.76210 58.24858 60.24329 54.74521 52.92969
[9] 56.30862 58.44844 61.19863 60.80231 62.77465 57.96206 57.01338 59.59229
[17] 56.53197 59.37218 53.01538 53.76403
>
>
> ### 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.19567 69.98538 68.52035 67.10046 72.86259 69.95125 68.84054 NA
[9] 71.50935 67.06766
> rowSums(tmp5)
[1] 1803.913 1399.708 1370.407 1342.009 1457.252 1399.025 1376.811 NA
[9] 1430.187 1341.353
> rowVars(tmp5)
[1] 7645.53091 44.52745 69.16213 80.81771 76.53679 58.68647
[7] 65.53243 56.80423 82.42274 59.85510
> rowSd(tmp5)
[1] 87.438727 6.672890 8.316377 8.989867 8.748531 7.660710 8.095210
[8] 7.536858 9.078697 7.736608
> rowMax(tmp5)
[1] 459.93043 80.61839 81.65031 83.81807 91.11204 82.13206 83.78753
[8] NA 88.85150 81.32122
> rowMin(tmp5)
[1] 53.96907 58.72281 56.30862 52.92969 54.74521 55.76210 56.52808 NA
[9] 56.53197 56.79893
>
> colMeans(tmp5)
[1] 104.90647 69.38825 69.03601 65.64088 72.32517 71.53853 70.04817
[8] 68.63319 69.32140 NA 70.85183 72.22950 70.35583 70.41424
[15] 68.55714 72.60489 71.05913 67.93686 68.22500 67.35716
> colSums(tmp5)
[1] 1049.0647 693.8825 690.3601 656.4088 723.2517 715.3853 700.4817
[8] 686.3319 693.2140 NA 708.5183 722.2950 703.5583 704.1424
[15] 685.5714 726.0489 710.5913 679.3686 682.2500 673.5716
> colVars(tmp5)
[1] 15623.12412 56.41420 100.57824 36.86421 116.34585 63.98702
[7] 104.91131 99.30407 78.16260 NA 43.38235 29.80254
[13] 40.90645 97.54444 49.94138 49.36093 109.90228 31.31574
[19] 94.93412 64.22795
> colSd(tmp5)
[1] 124.992496 7.510938 10.028870 6.071590 10.786373 7.999189
[7] 10.242622 9.965143 8.840961 NA 6.586528 5.459170
[13] 6.395815 9.876459 7.066921 7.025733 10.483429 5.596047
[19] 9.743414 8.014234
> colMax(tmp5)
[1] 459.93043 80.23701 81.74862 73.98012 91.11204 81.32122 88.85150
[8] 82.43348 81.49175 NA 79.34927 77.79945 81.65031 84.83492
[15] 77.90939 83.43061 83.81807 77.28952 81.41339 79.84199
> colMin(tmp5)
[1] 56.65009 57.76091 53.96907 55.76210 58.24858 60.24329 54.74521 52.92969
[9] 56.30862 NA 61.19863 60.80231 62.77465 57.96206 57.01338 59.59229
[17] 56.53197 59.37218 53.01538 53.76403
>
> Max(tmp5,na.rm=TRUE)
[1] 459.9304
> Min(tmp5,na.rm=TRUE)
[1] 52.92969
> mean(tmp5,na.rm=TRUE)
[1] 71.56713
> Sum(tmp5,na.rm=TRUE)
[1] 14241.86
> Var(tmp5,na.rm=TRUE)
[1] 832.2919
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.19567 69.98538 68.52035 67.10046 72.86259 69.95125 68.84054 69.53648
[9] 71.50935 67.06766
> rowSums(tmp5,na.rm=TRUE)
[1] 1803.913 1399.708 1370.407 1342.009 1457.252 1399.025 1376.811 1321.193
[9] 1430.187 1341.353
> rowVars(tmp5,na.rm=TRUE)
[1] 7645.53091 44.52745 69.16213 80.81771 76.53679 58.68647
[7] 65.53243 56.80423 82.42274 59.85510
> rowSd(tmp5,na.rm=TRUE)
[1] 87.438727 6.672890 8.316377 8.989867 8.748531 7.660710 8.095210
[8] 7.536858 9.078697 7.736608
> rowMax(tmp5,na.rm=TRUE)
[1] 459.93043 80.61839 81.65031 83.81807 91.11204 82.13206 83.78753
[8] 83.43061 88.85150 81.32122
> rowMin(tmp5,na.rm=TRUE)
[1] 53.96907 58.72281 56.30862 52.92969 54.74521 55.76210 56.52808 56.65009
[9] 56.53197 56.79893
>
> colMeans(tmp5,na.rm=TRUE)
[1] 104.90647 69.38825 69.03601 65.64088 72.32517 71.53853 70.04817
[8] 68.63319 69.32140 70.84021 70.85183 72.22950 70.35583 70.41424
[15] 68.55714 72.60489 71.05913 67.93686 68.22500 67.35716
> colSums(tmp5,na.rm=TRUE)
[1] 1049.0647 693.8825 690.3601 656.4088 723.2517 715.3853 700.4817
[8] 686.3319 693.2140 637.5619 708.5183 722.2950 703.5583 704.1424
[15] 685.5714 726.0489 710.5913 679.3686 682.2500 673.5716
> colVars(tmp5,na.rm=TRUE)
[1] 15623.12412 56.41420 100.57824 36.86421 116.34585 63.98702
[7] 104.91131 99.30407 78.16260 58.07639 43.38235 29.80254
[13] 40.90645 97.54444 49.94138 49.36093 109.90228 31.31574
[19] 94.93412 64.22795
> colSd(tmp5,na.rm=TRUE)
[1] 124.992496 7.510938 10.028870 6.071590 10.786373 7.999189
[7] 10.242622 9.965143 8.840961 7.620787 6.586528 5.459170
[13] 6.395815 9.876459 7.066921 7.025733 10.483429 5.596047
[19] 9.743414 8.014234
> colMax(tmp5,na.rm=TRUE)
[1] 459.93043 80.23701 81.74862 73.98012 91.11204 81.32122 88.85150
[8] 82.43348 81.49175 80.62767 79.34927 77.79945 81.65031 84.83492
[15] 77.90939 83.43061 83.81807 77.28952 81.41339 79.84199
> colMin(tmp5,na.rm=TRUE)
[1] 56.65009 57.76091 53.96907 55.76210 58.24858 60.24329 54.74521 52.92969
[9] 56.30862 58.44844 61.19863 60.80231 62.77465 57.96206 57.01338 59.59229
[17] 56.53197 59.37218 53.01538 53.76403
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.19567 69.98538 68.52035 67.10046 72.86259 69.95125 68.84054 NaN
[9] 71.50935 67.06766
> rowSums(tmp5,na.rm=TRUE)
[1] 1803.913 1399.708 1370.407 1342.009 1457.252 1399.025 1376.811 0.000
[9] 1430.187 1341.353
> rowVars(tmp5,na.rm=TRUE)
[1] 7645.53091 44.52745 69.16213 80.81771 76.53679 58.68647
[7] 65.53243 NA 82.42274 59.85510
> rowSd(tmp5,na.rm=TRUE)
[1] 87.438727 6.672890 8.316377 8.989867 8.748531 7.660710 8.095210
[8] NA 9.078697 7.736608
> rowMax(tmp5,na.rm=TRUE)
[1] 459.93043 80.61839 81.65031 83.81807 91.11204 82.13206 83.78753
[8] NA 88.85150 81.32122
> rowMin(tmp5,na.rm=TRUE)
[1] 53.96907 58.72281 56.30862 52.92969 54.74521 55.76210 56.52808 NA
[9] 56.53197 56.79893
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 110.26829 70.11946 70.02446 65.16702 73.88924 72.79355 69.14353
[8] 68.36941 69.45177 NaN 70.71022 72.20575 69.64691 69.92853
[15] 68.05871 71.40203 70.03984 67.84764 68.49483 67.22807
> colSums(tmp5,na.rm=TRUE)
[1] 992.4146 631.0751 630.2201 586.5032 665.0032 655.1420 622.2918 615.3247
[9] 625.0659 0.0000 636.3919 649.8517 626.8222 629.3568 612.5284 642.6183
[17] 630.3586 610.6288 616.4535 605.0526
> colVars(tmp5,na.rm=TRUE)
[1] 17252.58711 57.45095 102.15901 38.94611 103.36816 54.26563
[7] 108.81859 110.93436 87.74173 NA 48.57953 33.52150
[13] 40.36578 107.08348 53.38922 39.25380 111.95203 35.14067
[19] 105.98180 72.06895
> colSd(tmp5,na.rm=TRUE)
[1] 131.349104 7.579640 10.107374 6.240682 10.167013 7.366521
[7] 10.431615 10.532538 9.367055 NA 6.969901 5.789776
[13] 6.353407 10.348115 7.306792 6.265285 10.580738 5.927957
[19] 10.294746 8.489344
> colMax(tmp5,na.rm=TRUE)
[1] 459.93043 80.23701 81.74862 73.98012 91.11204 81.32122 88.85150
[8] 82.43348 81.49175 -Inf 79.34927 77.79945 81.65031 84.83492
[15] 77.90939 78.15966 83.81807 77.28952 81.41339 79.84199
> colMin(tmp5,na.rm=TRUE)
[1] 59.27422 57.76091 53.96907 55.76210 59.89669 60.99693 54.74521 52.92969
[9] 56.30862 Inf 61.19863 60.80231 62.77465 57.96206 57.01338 59.59229
[17] 56.53197 59.37218 53.01538 53.76403
>
>
>
>
> 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] 237.0498 339.9207 226.4087 183.9105 128.1775 262.1080 220.2211 167.0573
[9] 189.2328 331.6570
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 237.0498 339.9207 226.4087 183.9105 128.1775 262.1080 220.2211 167.0573
[9] 189.2328 331.6570
>
>
>
> 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] 0.000000e+00 -7.105427e-14 2.842171e-13 5.684342e-14 0.000000e+00
[6] -5.684342e-14 -2.842171e-13 7.105427e-14 5.684342e-14 1.705303e-13
[11] 1.705303e-13 -5.684342e-14 -2.842171e-14 0.000000e+00 0.000000e+00
[16] -5.684342e-14 1.421085e-13 5.684342e-14 8.526513e-14 -8.526513e-14
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
4 19
4 19
10 20
9 18
6 2
2 13
2 2
10 18
3 4
6 1
4 15
5 17
9 7
8 11
6 11
8 12
1 10
5 10
1 5
2 5
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] 3.687709
> Min(tmp)
[1] -3.047733
> mean(tmp)
[1] 0.01545178
> Sum(tmp)
[1] 1.545178
> Var(tmp)
[1] 1.190917
>
> rowMeans(tmp)
[1] 0.01545178
> rowSums(tmp)
[1] 1.545178
> rowVars(tmp)
[1] 1.190917
> rowSd(tmp)
[1] 1.091291
> rowMax(tmp)
[1] 3.687709
> rowMin(tmp)
[1] -3.047733
>
> colMeans(tmp)
[1] -1.426287121 0.992940851 -1.086015503 1.283076036 -1.904794887
[6] 1.645475187 -0.294053107 0.811344432 -0.546256690 -0.146430459
[11] 1.607549797 -1.383387342 0.286579869 -0.802997932 -0.977561165
[16] -0.009213057 -0.007912424 -0.367970600 0.451373680 0.449303148
[21] 3.687709131 -2.086136414 0.080487300 0.572212500 -0.174384664
[26] -1.498878449 0.799639534 -1.016470548 -1.145099858 -0.915241549
[31] -1.924918894 0.687293671 0.202235485 -0.696304015 -0.195575094
[36] -0.790965400 0.329353884 0.422646992 -0.105641025 0.425319419
[41] -0.116297626 -2.052146030 0.236560062 1.068924063 0.208873895
[46] -0.133630048 0.834785341 1.271611748 -0.468297624 0.537113805
[51] -0.756608390 0.453263627 0.358729204 -0.598963455 0.627861532
[56] 0.801308543 0.097223071 -0.262916732 -0.978422584 0.843423767
[61] -0.675202076 0.707011260 1.411464791 0.126172269 0.046965326
[66] 0.114858979 -0.398770474 -2.304963562 0.606029997 0.971891378
[71] -0.237557669 0.359818973 -0.715475280 -0.492051848 1.187792578
[76] -0.955564600 -0.569008691 -1.176813502 -1.053747452 -1.187620799
[81] 0.990995637 1.175273450 2.353500432 1.088041099 -0.301046705
[86] 1.907610772 1.221137872 1.536168251 -2.709081826 0.831113899
[91] 0.371659022 -3.047732613 0.132939605 0.207630072 0.033667004
[96] 0.595678588 -0.353893927 1.010956401 1.557700701 -0.026810449
> colSums(tmp)
[1] -1.426287121 0.992940851 -1.086015503 1.283076036 -1.904794887
[6] 1.645475187 -0.294053107 0.811344432 -0.546256690 -0.146430459
[11] 1.607549797 -1.383387342 0.286579869 -0.802997932 -0.977561165
[16] -0.009213057 -0.007912424 -0.367970600 0.451373680 0.449303148
[21] 3.687709131 -2.086136414 0.080487300 0.572212500 -0.174384664
[26] -1.498878449 0.799639534 -1.016470548 -1.145099858 -0.915241549
[31] -1.924918894 0.687293671 0.202235485 -0.696304015 -0.195575094
[36] -0.790965400 0.329353884 0.422646992 -0.105641025 0.425319419
[41] -0.116297626 -2.052146030 0.236560062 1.068924063 0.208873895
[46] -0.133630048 0.834785341 1.271611748 -0.468297624 0.537113805
[51] -0.756608390 0.453263627 0.358729204 -0.598963455 0.627861532
[56] 0.801308543 0.097223071 -0.262916732 -0.978422584 0.843423767
[61] -0.675202076 0.707011260 1.411464791 0.126172269 0.046965326
[66] 0.114858979 -0.398770474 -2.304963562 0.606029997 0.971891378
[71] -0.237557669 0.359818973 -0.715475280 -0.492051848 1.187792578
[76] -0.955564600 -0.569008691 -1.176813502 -1.053747452 -1.187620799
[81] 0.990995637 1.175273450 2.353500432 1.088041099 -0.301046705
[86] 1.907610772 1.221137872 1.536168251 -2.709081826 0.831113899
[91] 0.371659022 -3.047732613 0.132939605 0.207630072 0.033667004
[96] 0.595678588 -0.353893927 1.010956401 1.557700701 -0.026810449
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] -1.426287121 0.992940851 -1.086015503 1.283076036 -1.904794887
[6] 1.645475187 -0.294053107 0.811344432 -0.546256690 -0.146430459
[11] 1.607549797 -1.383387342 0.286579869 -0.802997932 -0.977561165
[16] -0.009213057 -0.007912424 -0.367970600 0.451373680 0.449303148
[21] 3.687709131 -2.086136414 0.080487300 0.572212500 -0.174384664
[26] -1.498878449 0.799639534 -1.016470548 -1.145099858 -0.915241549
[31] -1.924918894 0.687293671 0.202235485 -0.696304015 -0.195575094
[36] -0.790965400 0.329353884 0.422646992 -0.105641025 0.425319419
[41] -0.116297626 -2.052146030 0.236560062 1.068924063 0.208873895
[46] -0.133630048 0.834785341 1.271611748 -0.468297624 0.537113805
[51] -0.756608390 0.453263627 0.358729204 -0.598963455 0.627861532
[56] 0.801308543 0.097223071 -0.262916732 -0.978422584 0.843423767
[61] -0.675202076 0.707011260 1.411464791 0.126172269 0.046965326
[66] 0.114858979 -0.398770474 -2.304963562 0.606029997 0.971891378
[71] -0.237557669 0.359818973 -0.715475280 -0.492051848 1.187792578
[76] -0.955564600 -0.569008691 -1.176813502 -1.053747452 -1.187620799
[81] 0.990995637 1.175273450 2.353500432 1.088041099 -0.301046705
[86] 1.907610772 1.221137872 1.536168251 -2.709081826 0.831113899
[91] 0.371659022 -3.047732613 0.132939605 0.207630072 0.033667004
[96] 0.595678588 -0.353893927 1.010956401 1.557700701 -0.026810449
> colMin(tmp)
[1] -1.426287121 0.992940851 -1.086015503 1.283076036 -1.904794887
[6] 1.645475187 -0.294053107 0.811344432 -0.546256690 -0.146430459
[11] 1.607549797 -1.383387342 0.286579869 -0.802997932 -0.977561165
[16] -0.009213057 -0.007912424 -0.367970600 0.451373680 0.449303148
[21] 3.687709131 -2.086136414 0.080487300 0.572212500 -0.174384664
[26] -1.498878449 0.799639534 -1.016470548 -1.145099858 -0.915241549
[31] -1.924918894 0.687293671 0.202235485 -0.696304015 -0.195575094
[36] -0.790965400 0.329353884 0.422646992 -0.105641025 0.425319419
[41] -0.116297626 -2.052146030 0.236560062 1.068924063 0.208873895
[46] -0.133630048 0.834785341 1.271611748 -0.468297624 0.537113805
[51] -0.756608390 0.453263627 0.358729204 -0.598963455 0.627861532
[56] 0.801308543 0.097223071 -0.262916732 -0.978422584 0.843423767
[61] -0.675202076 0.707011260 1.411464791 0.126172269 0.046965326
[66] 0.114858979 -0.398770474 -2.304963562 0.606029997 0.971891378
[71] -0.237557669 0.359818973 -0.715475280 -0.492051848 1.187792578
[76] -0.955564600 -0.569008691 -1.176813502 -1.053747452 -1.187620799
[81] 0.990995637 1.175273450 2.353500432 1.088041099 -0.301046705
[86] 1.907610772 1.221137872 1.536168251 -2.709081826 0.831113899
[91] 0.371659022 -3.047732613 0.132939605 0.207630072 0.033667004
[96] 0.595678588 -0.353893927 1.010956401 1.557700701 -0.026810449
> colMedians(tmp)
[1] -1.426287121 0.992940851 -1.086015503 1.283076036 -1.904794887
[6] 1.645475187 -0.294053107 0.811344432 -0.546256690 -0.146430459
[11] 1.607549797 -1.383387342 0.286579869 -0.802997932 -0.977561165
[16] -0.009213057 -0.007912424 -0.367970600 0.451373680 0.449303148
[21] 3.687709131 -2.086136414 0.080487300 0.572212500 -0.174384664
[26] -1.498878449 0.799639534 -1.016470548 -1.145099858 -0.915241549
[31] -1.924918894 0.687293671 0.202235485 -0.696304015 -0.195575094
[36] -0.790965400 0.329353884 0.422646992 -0.105641025 0.425319419
[41] -0.116297626 -2.052146030 0.236560062 1.068924063 0.208873895
[46] -0.133630048 0.834785341 1.271611748 -0.468297624 0.537113805
[51] -0.756608390 0.453263627 0.358729204 -0.598963455 0.627861532
[56] 0.801308543 0.097223071 -0.262916732 -0.978422584 0.843423767
[61] -0.675202076 0.707011260 1.411464791 0.126172269 0.046965326
[66] 0.114858979 -0.398770474 -2.304963562 0.606029997 0.971891378
[71] -0.237557669 0.359818973 -0.715475280 -0.492051848 1.187792578
[76] -0.955564600 -0.569008691 -1.176813502 -1.053747452 -1.187620799
[81] 0.990995637 1.175273450 2.353500432 1.088041099 -0.301046705
[86] 1.907610772 1.221137872 1.536168251 -2.709081826 0.831113899
[91] 0.371659022 -3.047732613 0.132939605 0.207630072 0.033667004
[96] 0.595678588 -0.353893927 1.010956401 1.557700701 -0.026810449
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.426287 0.9929409 -1.086016 1.283076 -1.904795 1.645475 -0.2940531
[2,] -1.426287 0.9929409 -1.086016 1.283076 -1.904795 1.645475 -0.2940531
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.8113444 -0.5462567 -0.1464305 1.60755 -1.383387 0.2865799 -0.8029979
[2,] 0.8113444 -0.5462567 -0.1464305 1.60755 -1.383387 0.2865799 -0.8029979
[,15] [,16] [,17] [,18] [,19] [,20]
[1,] -0.9775612 -0.009213057 -0.007912424 -0.3679706 0.4513737 0.4493031
[2,] -0.9775612 -0.009213057 -0.007912424 -0.3679706 0.4513737 0.4493031
[,21] [,22] [,23] [,24] [,25] [,26] [,27]
[1,] 3.687709 -2.086136 0.0804873 0.5722125 -0.1743847 -1.498878 0.7996395
[2,] 3.687709 -2.086136 0.0804873 0.5722125 -0.1743847 -1.498878 0.7996395
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] -1.016471 -1.1451 -0.9152415 -1.924919 0.6872937 0.2022355 -0.696304
[2,] -1.016471 -1.1451 -0.9152415 -1.924919 0.6872937 0.2022355 -0.696304
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] -0.1955751 -0.7909654 0.3293539 0.422647 -0.105641 0.4253194 -0.1162976
[2,] -0.1955751 -0.7909654 0.3293539 0.422647 -0.105641 0.4253194 -0.1162976
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -2.052146 0.2365601 1.068924 0.2088739 -0.13363 0.8347853 1.271612
[2,] -2.052146 0.2365601 1.068924 0.2088739 -0.13363 0.8347853 1.271612
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.4682976 0.5371138 -0.7566084 0.4532636 0.3587292 -0.5989635 0.6278615
[2,] -0.4682976 0.5371138 -0.7566084 0.4532636 0.3587292 -0.5989635 0.6278615
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.8013085 0.09722307 -0.2629167 -0.9784226 0.8434238 -0.6752021 0.7070113
[2,] 0.8013085 0.09722307 -0.2629167 -0.9784226 0.8434238 -0.6752021 0.7070113
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 1.411465 0.1261723 0.04696533 0.114859 -0.3987705 -2.304964 0.60603
[2,] 1.411465 0.1261723 0.04696533 0.114859 -0.3987705 -2.304964 0.60603
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.9718914 -0.2375577 0.359819 -0.7154753 -0.4920518 1.187793 -0.9555646
[2,] 0.9718914 -0.2375577 0.359819 -0.7154753 -0.4920518 1.187793 -0.9555646
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -0.5690087 -1.176814 -1.053747 -1.187621 0.9909956 1.175273 2.3535
[2,] -0.5690087 -1.176814 -1.053747 -1.187621 0.9909956 1.175273 2.3535
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 1.088041 -0.3010467 1.907611 1.221138 1.536168 -2.709082 0.8311139
[2,] 1.088041 -0.3010467 1.907611 1.221138 1.536168 -2.709082 0.8311139
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.371659 -3.047733 0.1329396 0.2076301 0.033667 0.5956786 -0.3538939
[2,] 0.371659 -3.047733 0.1329396 0.2076301 0.033667 0.5956786 -0.3538939
[,98] [,99] [,100]
[1,] 1.010956 1.557701 -0.02681045
[2,] 1.010956 1.557701 -0.02681045
>
>
> Max(tmp2)
[1] 2.252906
> Min(tmp2)
[1] -3.260344
> mean(tmp2)
[1] -0.1032953
> Sum(tmp2)
[1] -10.32953
> Var(tmp2)
[1] 1.160791
>
> rowMeans(tmp2)
[1] 0.80568386 -0.28012605 0.97801357 0.26453213 -1.49540808 0.43059951
[7] 0.81034984 1.73933803 0.46037217 1.24663409 -1.16616807 0.02647050
[13] 0.47489363 -0.13269699 0.33304015 -1.32482681 -0.28170113 0.60290792
[19] -1.78860281 0.14324023 0.66156712 0.23772954 -1.07940993 0.36529705
[25] 1.20448941 -1.28135614 0.83542669 -0.74542477 1.05375034 0.28917678
[31] -0.15506618 -1.54995685 -1.74156811 -0.27572493 0.08777069 -0.71982946
[37] 1.99932942 0.74101513 -0.90347440 -0.82681543 -0.09643039 0.45167511
[43] 0.25303714 1.37481915 0.26720911 1.71743630 1.15710179 -2.05118647
[49] -1.53239931 0.15169958 0.80108947 -0.03683372 0.75883617 -0.43873830
[55] 0.67215845 -1.34998087 -0.53888112 0.93697570 -0.65419251 2.25290553
[61] 0.07797723 -1.04544904 0.31224060 0.77713637 -0.61768569 -1.99889431
[67] 0.52748643 0.26039693 -1.45587538 0.24493649 1.06930109 -0.11251654
[73] 0.62109459 0.58554870 -0.13980005 -0.31163245 1.53781755 -1.37200492
[79] -0.08390561 0.08887101 0.46841163 2.05915830 -0.87018284 -0.09001306
[85] -2.50080342 -1.23644984 -2.21272091 0.61802796 -0.48742957 0.09514050
[91] 0.36587117 -1.61626637 -0.23615580 0.05518080 -1.34960117 -3.26034408
[97] -2.12639154 0.55564195 -0.01037184 -1.65504626
> rowSums(tmp2)
[1] 0.80568386 -0.28012605 0.97801357 0.26453213 -1.49540808 0.43059951
[7] 0.81034984 1.73933803 0.46037217 1.24663409 -1.16616807 0.02647050
[13] 0.47489363 -0.13269699 0.33304015 -1.32482681 -0.28170113 0.60290792
[19] -1.78860281 0.14324023 0.66156712 0.23772954 -1.07940993 0.36529705
[25] 1.20448941 -1.28135614 0.83542669 -0.74542477 1.05375034 0.28917678
[31] -0.15506618 -1.54995685 -1.74156811 -0.27572493 0.08777069 -0.71982946
[37] 1.99932942 0.74101513 -0.90347440 -0.82681543 -0.09643039 0.45167511
[43] 0.25303714 1.37481915 0.26720911 1.71743630 1.15710179 -2.05118647
[49] -1.53239931 0.15169958 0.80108947 -0.03683372 0.75883617 -0.43873830
[55] 0.67215845 -1.34998087 -0.53888112 0.93697570 -0.65419251 2.25290553
[61] 0.07797723 -1.04544904 0.31224060 0.77713637 -0.61768569 -1.99889431
[67] 0.52748643 0.26039693 -1.45587538 0.24493649 1.06930109 -0.11251654
[73] 0.62109459 0.58554870 -0.13980005 -0.31163245 1.53781755 -1.37200492
[79] -0.08390561 0.08887101 0.46841163 2.05915830 -0.87018284 -0.09001306
[85] -2.50080342 -1.23644984 -2.21272091 0.61802796 -0.48742957 0.09514050
[91] 0.36587117 -1.61626637 -0.23615580 0.05518080 -1.34960117 -3.26034408
[97] -2.12639154 0.55564195 -0.01037184 -1.65504626
> 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.80568386 -0.28012605 0.97801357 0.26453213 -1.49540808 0.43059951
[7] 0.81034984 1.73933803 0.46037217 1.24663409 -1.16616807 0.02647050
[13] 0.47489363 -0.13269699 0.33304015 -1.32482681 -0.28170113 0.60290792
[19] -1.78860281 0.14324023 0.66156712 0.23772954 -1.07940993 0.36529705
[25] 1.20448941 -1.28135614 0.83542669 -0.74542477 1.05375034 0.28917678
[31] -0.15506618 -1.54995685 -1.74156811 -0.27572493 0.08777069 -0.71982946
[37] 1.99932942 0.74101513 -0.90347440 -0.82681543 -0.09643039 0.45167511
[43] 0.25303714 1.37481915 0.26720911 1.71743630 1.15710179 -2.05118647
[49] -1.53239931 0.15169958 0.80108947 -0.03683372 0.75883617 -0.43873830
[55] 0.67215845 -1.34998087 -0.53888112 0.93697570 -0.65419251 2.25290553
[61] 0.07797723 -1.04544904 0.31224060 0.77713637 -0.61768569 -1.99889431
[67] 0.52748643 0.26039693 -1.45587538 0.24493649 1.06930109 -0.11251654
[73] 0.62109459 0.58554870 -0.13980005 -0.31163245 1.53781755 -1.37200492
[79] -0.08390561 0.08887101 0.46841163 2.05915830 -0.87018284 -0.09001306
[85] -2.50080342 -1.23644984 -2.21272091 0.61802796 -0.48742957 0.09514050
[91] 0.36587117 -1.61626637 -0.23615580 0.05518080 -1.34960117 -3.26034408
[97] -2.12639154 0.55564195 -0.01037184 -1.65504626
> rowMin(tmp2)
[1] 0.80568386 -0.28012605 0.97801357 0.26453213 -1.49540808 0.43059951
[7] 0.81034984 1.73933803 0.46037217 1.24663409 -1.16616807 0.02647050
[13] 0.47489363 -0.13269699 0.33304015 -1.32482681 -0.28170113 0.60290792
[19] -1.78860281 0.14324023 0.66156712 0.23772954 -1.07940993 0.36529705
[25] 1.20448941 -1.28135614 0.83542669 -0.74542477 1.05375034 0.28917678
[31] -0.15506618 -1.54995685 -1.74156811 -0.27572493 0.08777069 -0.71982946
[37] 1.99932942 0.74101513 -0.90347440 -0.82681543 -0.09643039 0.45167511
[43] 0.25303714 1.37481915 0.26720911 1.71743630 1.15710179 -2.05118647
[49] -1.53239931 0.15169958 0.80108947 -0.03683372 0.75883617 -0.43873830
[55] 0.67215845 -1.34998087 -0.53888112 0.93697570 -0.65419251 2.25290553
[61] 0.07797723 -1.04544904 0.31224060 0.77713637 -0.61768569 -1.99889431
[67] 0.52748643 0.26039693 -1.45587538 0.24493649 1.06930109 -0.11251654
[73] 0.62109459 0.58554870 -0.13980005 -0.31163245 1.53781755 -1.37200492
[79] -0.08390561 0.08887101 0.46841163 2.05915830 -0.87018284 -0.09001306
[85] -2.50080342 -1.23644984 -2.21272091 0.61802796 -0.48742957 0.09514050
[91] 0.36587117 -1.61626637 -0.23615580 0.05518080 -1.34960117 -3.26034408
[97] -2.12639154 0.55564195 -0.01037184 -1.65504626
>
> colMeans(tmp2)
[1] -0.1032953
> colSums(tmp2)
[1] -10.32953
> colVars(tmp2)
[1] 1.160791
> colSd(tmp2)
[1] 1.0774
> colMax(tmp2)
[1] 2.252906
> colMin(tmp2)
[1] -3.260344
> colMedians(tmp2)
[1] 0.08287396
> colRanges(tmp2)
[,1]
[1,] -3.260344
[2,] 2.252906
>
> 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] 2.4471841 3.7498625 -2.9352297 6.2094160 0.9251822 -4.2070571
[7] -3.8021629 2.2978501 -2.1625610 4.9172008
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3337318
[2,] -0.3314390
[3,] 0.2543604
[4,] 1.2256657
[5,] 1.6127624
>
> rowApply(tmp,sum)
[1] 5.5209005 2.4100400 -1.3035513 -2.8228625 -0.4432390 -2.5616185
[7] -1.6683358 0.3480436 7.3068182 0.6534898
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 2 8 1 3 8 9 10 8 1
[2,] 9 7 2 3 4 9 8 6 7 10
[3,] 10 6 1 7 2 1 1 3 6 2
[4,] 3 4 6 10 8 7 7 8 10 9
[5,] 2 5 7 2 10 3 10 5 3 6
[6,] 5 3 3 5 1 4 4 9 5 5
[7,] 6 1 4 4 9 6 2 2 4 3
[8,] 8 9 9 8 7 10 3 4 2 4
[9,] 1 10 5 6 5 2 6 7 1 7
[10,] 7 8 10 9 6 5 5 1 9 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.5582463 -1.4661799 1.3325641 -0.1568157 -0.5290017 0.1334075
[7] -2.7559325 0.5694682 -0.9529217 -1.6075822 -0.7577677 -1.4508966
[13] 1.9275527 -0.4028718 1.5297227 -0.2658177 -1.7736726 0.3755061
[19] 1.5498383 2.7048023
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6525911
[2,] -0.5251507
[3,] -0.4573366
[4,] 0.9391729
[5,] 2.2541519
>
> rowApply(tmp,sum)
[1] -3.6895890 0.6361958 -5.2325029 -0.3607142 7.2082582
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 2 17 7 7 20
[2,] 7 10 4 10 11
[3,] 14 5 6 18 18
[4,] 6 20 2 15 9
[5,] 12 7 18 3 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.6525911 -0.35462185 -0.002946786 -0.67424527 -0.1630200 0.3036906
[2,] 0.9391729 0.10669275 -0.644757340 1.57942246 -0.4388371 -0.3748927
[3,] -0.4573366 -1.14680106 -0.501844426 -1.48534620 1.1395919 0.1472413
[4,] -0.5251507 -0.14208487 1.041448392 0.49103472 -0.6606814 0.4223309
[5,] 2.2541519 0.07063512 1.440664285 -0.06768141 -0.4060551 -0.3649626
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.25369392 0.6884799 -2.465891686 -0.8680949 1.4386068 -0.9278256
[2,] -1.58375871 -0.9846276 0.379274962 0.2334665 -0.5096987 0.8317770
[3,] -0.26975115 0.3938164 -0.125933477 -1.2798444 1.2381745 -0.1638442
[4,] -0.59997362 1.1203954 -0.002389334 0.4594495 -2.3111840 -0.9419531
[5,] -0.04875515 -0.6485959 1.262017789 -0.1525589 -0.6136664 -0.2490507
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.88086332 -0.04965435 0.82204245 -0.245558325 -0.3258237 -0.3431309
[2,] 1.20175622 1.29786920 -1.26281503 -0.008068665 0.3404255 0.4656920
[3,] 1.87270359 -2.72208797 -0.02611098 -0.065598370 -0.4500628 -0.4331147
[4,] -0.33703034 1.68044798 0.77758526 -0.146371571 -0.6468156 -0.6218488
[5,] 0.07098654 -0.60944667 1.21902095 0.199779265 -0.6913961 1.3079085
[,19] [,20]
[1,] 0.7665699 1.49898321
[2,] -1.3958031 0.46390527
[3,] 0.1134884 -1.00984260
[4,] 0.6816515 -0.09957462
[5,] 1.3839316 1.85133109
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 647 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 561 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.5055706 1.48986 -0.06787603 0.1900589 0.7491186 -0.4179087 0.5277439
col8 col9 col10 col11 col12 col13 col14
row1 1.788986 0.09542441 -0.26999 0.8605142 -0.8582476 -1.487936 -0.2609613
col15 col16 col17 col18 col19 col20
row1 -2.131209 -1.080484 0.1696466 1.384098 -0.4543774 1.629344
> tmp[,"col10"]
col10
row1 -0.2699900
row2 0.1307068
row3 -0.3752574
row4 0.3527049
row5 -0.1830454
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.5055706 1.489860 -0.06787603 0.19005893 0.7491186 -0.4179087
row5 -0.4486480 -2.681693 -1.03484101 0.09102656 -1.0734335 1.7926755
col7 col8 col9 col10 col11 col12
row1 0.5277439 1.7889859 0.09542441 -0.2699900 0.8605142 -0.8582476
row5 0.2491880 -0.8822473 -0.48753624 -0.1830454 -0.5905873 0.7152838
col13 col14 col15 col16 col17 col18 col19
row1 -1.4879360 -0.2609613 -2.131209 -1.0804842 0.1696466 1.384098 -0.4543774
row5 0.4945989 -0.9970326 1.765059 -0.4046552 0.1512378 -1.739301 -0.2540204
col20
row1 1.6293440
row5 0.5035712
> tmp[,c("col6","col20")]
col6 col20
row1 -0.4179087 1.62934405
row2 -1.2420978 -1.14618843
row3 -0.8748030 0.05890115
row4 -2.7158418 0.01067782
row5 1.7926755 0.50357118
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.4179087 1.6293440
row5 1.7926755 0.5035712
>
>
>
>
> 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 52.17432 51.4386 50.41444 51.25786 51.74461 106.1199 51.28156 50.92265
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.00251 48.52235 49.22029 48.51027 51.253 49.70732 49.90965 50.78538
col17 col18 col19 col20
row1 50.41024 50.89992 49.89969 105.4257
> tmp[,"col10"]
col10
row1 48.52235
row2 30.17839
row3 29.29401
row4 29.87619
row5 47.70466
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 52.17432 51.43860 50.41444 51.25786 51.74461 106.1199 51.28156 50.92265
row5 51.95498 47.81277 49.59573 48.92144 51.48937 104.4819 48.97830 49.83842
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.00251 48.52235 49.22029 48.51027 51.25300 49.70732 49.90965 50.78538
row5 51.94365 47.70466 48.76130 50.15354 49.70642 49.39891 49.95738 49.38876
col17 col18 col19 col20
row1 50.41024 50.89992 49.89969 105.4257
row5 48.19429 50.88581 51.08217 106.3698
> tmp[,c("col6","col20")]
col6 col20
row1 106.11987 105.42574
row2 74.15304 74.39638
row3 75.72539 73.91862
row4 73.81355 75.17231
row5 104.48193 106.36977
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.1199 105.4257
row5 104.4819 106.3698
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.1199 105.4257
row5 104.4819 106.3698
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.1919922
[2,] 0.1662508
[3,] -0.1699475
[4,] -0.4833379
[5,] -1.2802651
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.331613134 1.2512832
[2,] 0.031604519 -0.5380835
[3,] 1.118271122 -0.6888182
[4,] 0.440922905 -0.3163386
[5,] -0.003457623 0.3382470
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2403734 1.241057110
[2,] -0.6232057 -0.388546830
[3,] 0.0210348 -1.655118678
[4,] -1.2591109 -1.092300753
[5,] -0.6134360 -0.008312297
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2403734
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2403734
[2,] -0.6232057
>
>
>
> 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.5687139 -0.6921006 -1.4147513 -0.3609244 -0.9904522 0.06159469
row1 -0.8139833 -0.3617755 0.6311567 -1.7720829 -0.2351217 -1.56062729
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.9310775 -0.2408226 2.049444 0.5669411 -1.1581011 0.7860073 -0.3647581
row1 -0.4812261 0.6743744 -1.064121 -2.1074039 0.1339565 0.6625969 -0.4077778
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.2889659 0.8204553 1.8523740 -2.5125504 -0.4309231 -1.002304 0.9422141
row1 -1.2456798 -1.5984714 -0.0998658 -0.6254462 0.0474121 2.270338 1.9684028
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.1783013 -1.499244 0.08905196 1.19288 0.8893705 -1.363667 0.7407492
[,8] [,9] [,10]
row2 -1.223909 0.8734631 -0.9792732
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.436335 0.1068052 1.380327 -0.1986145 1.114033 -0.702273 -1.099794
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.6223528 1.367212 1.421024 1.204743 0.1222901 -0.1856603 -1.093908
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3775222 -0.612368 1.046824 1.257988 -0.2085722 1.497831
>
>
> 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: 0x6033e97801d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a72883983c"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a75963dbb4"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a77e963539"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a76da4720b"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a72be91e7c"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a719e452fa"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a73cd0fc7f"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a7258d070f"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a7e815bf5"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a777ec94bb"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a77e3364f8"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a735829dab"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a73b3787fc"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a71e4af61a"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMa24a77ed9f903"
>
>
> ### 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: 0x6033ead84f30>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6033ead84f30>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6033ead84f30>
> rowMedians(tmp)
[1] -0.363458386 0.343832752 0.264311676 0.030994990 -0.266842591
[6] 0.196502658 -0.593524246 -0.002974269 0.682869658 -0.543623632
[11] -0.313907221 -0.340650175 0.118247081 -0.171978069 -0.479364631
[16] -0.669760321 -0.168652302 -0.146284488 -0.390240687 -0.299457183
[21] -0.159420237 -0.138113515 0.060500499 -0.274803947 -0.108468682
[26] 0.787586716 0.538700517 -0.283338593 -0.225685723 0.484742187
[31] 0.008673653 0.756209548 -0.375178996 -0.300473191 0.592575409
[36] 0.037561983 0.493539599 -0.296327246 -0.539839765 -0.170770460
[41] 0.270666865 -0.072903809 -0.054832145 0.570694528 0.371758968
[46] 0.223533120 0.042979734 -0.084366287 0.198361455 0.495673825
[51] -0.121630468 -0.303478158 -0.001787037 0.399377411 -0.025823944
[56] 0.446262746 -0.401144058 0.073466588 -0.230723610 0.052763675
[61] -0.418745599 0.123552160 0.028490772 -0.236444643 0.261512598
[66] -0.669005149 0.146895115 0.294606613 -0.338354750 0.110332671
[71] 0.036858864 -0.112263380 0.128608712 -0.006813676 -0.466473926
[76] 0.182295903 -0.603689641 0.468227475 -0.529102978 -0.200579173
[81] 0.204875736 -0.102547601 -0.045883581 -0.299681332 -0.075819880
[86] 0.013278999 -0.404546704 0.299680900 0.394186025 -0.502479430
[91] 0.593502502 -0.416591808 0.170089760 0.564968804 -0.568803804
[96] 0.644118175 -0.448493074 0.242578952 -0.227043701 0.854693417
[101] -0.014885318 -0.164748052 -0.822286785 -0.001006963 0.179888604
[106] -0.057689292 0.138325731 0.518934028 0.275910416 0.109321481
[111] 0.077124221 -0.003788163 -0.322024041 0.265532863 -0.216241233
[116] -0.165890594 0.105597458 -0.083936389 0.450995608 0.128779381
[121] -0.148777097 -0.204406644 -0.198110207 -0.739075322 0.100432421
[126] -0.313191402 0.062342447 0.231907612 -0.389432136 -0.008163026
[131] 0.250008782 0.104120783 -0.086002205 0.079028869 -0.021729401
[136] -0.132548073 -0.178423310 0.124067323 0.014845861 -0.217980580
[141] -0.017663925 -0.501649445 -0.310127012 0.234362165 0.259265457
[146] -0.095249379 0.343835825 0.084539269 0.120948363 0.197377019
[151] 0.197786313 -0.507892998 -0.476558293 -0.334547624 0.039480840
[156] -0.286820661 0.360171733 -0.596951339 -0.478566366 -0.408203019
[161] -0.114092970 0.174484989 -0.086528066 0.055693860 0.047127550
[166] -0.001072040 0.046069189 -0.843964993 -0.360884045 -0.047075002
[171] 1.106914500 -0.154886988 0.301757940 -0.040483084 -0.939114334
[176] 0.046415749 0.006453247 0.226741890 0.500721965 0.070116379
[181] -0.229090102 0.306978047 -0.245972095 0.492383248 0.105861086
[186] -0.133606132 -0.029204559 -0.610598362 -0.219157817 -0.262661597
[191] 0.029428726 0.135637327 -0.262264889 0.564073747 -0.111168681
[196] -0.058606890 -0.231661961 0.578552950 0.050075993 -0.363555073
[201] 0.268744201 0.136101926 -0.580363354 0.436000337 -0.243513218
[206] 0.036894382 0.203084868 -0.024323436 0.002894583 -0.124637360
[211] 0.451183610 0.526924553 -0.297785563 0.102176981 0.115824252
[216] 0.294346210 -0.121406070 -0.270708202 -0.593749998 0.530534259
[221] 0.228420851 0.279200367 -0.243716194 -0.214056373 0.567005482
[226] -0.368970301 0.634792711 0.177194172 -0.012751466 0.200096487
>
> proc.time()
user system elapsed
1.243 0.665 1.896
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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: 0x58ad406d8c80>
> .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: 0x58ad406d8c80>
> .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: 0x58ad406d8c80>
> .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: 0x58ad406d8c80>
> 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: 0x58ad4036fa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad4036fa00>
> .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: 0x58ad4036fa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad4036fa00>
> .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: 0x58ad4036fa00>
> 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: 0x58ad4043a660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad4043a660>
> .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: 0x58ad4043a660>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x58ad4043a660>
> .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: 0x58ad4043a660>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x58ad4043a660>
> .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: 0x58ad4043a660>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x58ad4043a660>
> .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: 0x58ad4043a660>
> 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: 0x58ad4095c3e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x58ad4095c3e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad4095c3e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad4095c3e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea256e202b2e18" "BufferedMatrixFilea256e96943c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea256e202b2e18" "BufferedMatrixFilea256e96943c"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad42ab9470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad42ab9470>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58ad42ab9470>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58ad42ab9470>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x58ad42ab9470>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x58ad42ab9470>
> .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: 0x58ad420f0e70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58ad420f0e70>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x58ad420f0e70>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x58ad420f0e70>
> 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: 0x58ad40f63720>
> .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: 0x58ad40f63720>
> rm(P)
>
> proc.time()
user system elapsed
0.249 0.039 0.277
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.237 0.052 0.278