| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-29 11:58 -0500 (Mon, 29 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4883 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4671 |
| 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.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | 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.74.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.74.0.tar.gz |
| StartedAt: 2025-12-25 21:46:45 -0500 (Thu, 25 Dec 2025) |
| EndedAt: 2025-12-25 21:47:10 -0500 (Thu, 25 Dec 2025) |
| EllapsedTime: 25.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.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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.74.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.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.251 0.039 0.277
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 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 Dec 25 21:47:01 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] "Thu Dec 25 21:47:01 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: 0x57c689e13370>
>
>
>
> 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 Dec 25 21:47:01 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] "Thu Dec 25 21:47:01 2025"
>
> ColMode(tmp2)
<pointer: 0x57c689e13370>
>
>
>
> ### 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.1862366 0.3254327 -0.42604428 0.06382361
[2,] 0.9401486 1.1183451 -0.09244526 -0.49101534
[3,] -1.1601700 0.4697726 -2.01894741 -0.40265474
[4,] 0.1294737 0.2825417 1.02562250 -0.30156146
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.1862366 0.3254327 0.42604428 0.06382361
[2,] 0.9401486 1.1183451 0.09244526 0.49101534
[3,] 1.1601700 0.4697726 2.01894741 0.40265474
[4,] 0.1294737 0.2825417 1.02562250 0.30156146
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9592287 0.5704671 0.6527207 0.2526334
[2,] 0.9696126 1.0575184 0.3040481 0.7007249
[3,] 1.0771119 0.6853996 1.4208967 0.6345508
[4,] 0.3598245 0.5315465 1.0127302 0.5491461
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 223.77852 31.03010 31.95325 27.59016
[2,] 35.63627 36.69353 28.13293 32.49826
[3,] 36.93129 32.32377 41.22791 31.74816
[4,] 28.72772 30.59801 36.15292 30.79302
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x57c68ae0f9b0>
> exp(tmp5)
<pointer: 0x57c68ae0f9b0>
> log(tmp5,2)
<pointer: 0x57c68ae0f9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7657
> Min(tmp5)
[1] 54.3253
> mean(tmp5)
[1] 73.05196
> Sum(tmp5)
[1] 14610.39
> Var(tmp5)
[1] 857.6465
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.23512 73.10133 71.94004 69.59342 70.45671 71.88619 70.21090 70.61291
[9] 73.36689 69.11604
> rowSums(tmp5)
[1] 1804.702 1462.027 1438.801 1391.868 1409.134 1437.724 1404.218 1412.258
[9] 1467.338 1382.321
> rowVars(tmp5)
[1] 7938.35136 54.38875 112.57519 77.77570 47.99821 96.78519
[7] 77.67595 71.82691 66.96730 73.98781
> rowSd(tmp5)
[1] 89.097426 7.374873 10.610146 8.819053 6.928074 9.837947 8.813396
[8] 8.475076 8.183355 8.601617
> rowMax(tmp5)
[1] 465.76568 85.57135 99.21706 94.41129 84.02914 89.99541 87.65272
[8] 84.67081 90.85119 86.12700
> rowMin(tmp5)
[1] 54.32530 58.55500 55.20630 55.52327 60.85021 56.68506 55.57281 57.28070
[9] 58.63517 56.59218
>
> colMeans(tmp5)
[1] 109.06943 71.35692 69.00394 68.94915 74.26246 73.05060 65.74536
[8] 77.02163 69.67749 72.71226 69.44184 71.98775 70.43834 71.41118
[15] 68.91485 70.70487 68.97924 75.25717 72.75406 70.30055
> colSums(tmp5)
[1] 1090.6943 713.5692 690.0394 689.4915 742.6246 730.5060 657.4536
[8] 770.2163 696.7749 727.1226 694.4184 719.8775 704.3834 714.1118
[15] 689.1485 707.0487 689.7924 752.5717 727.5406 703.0055
> colVars(tmp5)
[1] 15747.80473 91.79259 90.74232 77.86989 24.87784 120.04696
[7] 54.80371 161.50978 118.35727 62.67625 47.82736 64.13445
[13] 139.17208 60.63461 39.92438 69.60845 53.84112 67.86696
[19] 94.18287 119.30385
> colSd(tmp5)
[1] 125.490258 9.580845 9.525876 8.824392 4.987769 10.956594
[7] 7.402953 12.708650 10.879213 7.916834 6.915733 8.008399
[13] 11.797122 7.786823 6.318574 8.343168 7.337651 8.238141
[19] 9.704786 10.922630
> colMax(tmp5)
[1] 465.76568 86.16912 85.81050 87.65272 81.95261 90.85119 80.68661
[8] 99.21706 86.64730 87.34853 82.80580 85.57135 89.71753 82.23641
[15] 80.63256 84.67081 77.61283 85.55715 84.06151 89.99541
> colMin(tmp5)
[1] 58.63517 57.62621 56.68506 57.42530 66.97710 59.59152 57.80492 58.82736
[9] 55.20630 63.08188 59.80456 61.21692 55.57281 60.08734 59.70463 57.21313
[17] 54.32530 60.54991 55.27794 55.52327
>
>
> ### 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.23512 73.10133 71.94004 69.59342 70.45671 71.88619 70.21090 70.61291
[9] 73.36689 NA
> rowSums(tmp5)
[1] 1804.702 1462.027 1438.801 1391.868 1409.134 1437.724 1404.218 1412.258
[9] 1467.338 NA
> rowVars(tmp5)
[1] 7938.35136 54.38875 112.57519 77.77570 47.99821 96.78519
[7] 77.67595 71.82691 66.96730 78.02964
> rowSd(tmp5)
[1] 89.097426 7.374873 10.610146 8.819053 6.928074 9.837947 8.813396
[8] 8.475076 8.183355 8.833439
> rowMax(tmp5)
[1] 465.76568 85.57135 99.21706 94.41129 84.02914 89.99541 87.65272
[8] 84.67081 90.85119 NA
> rowMin(tmp5)
[1] 54.32530 58.55500 55.20630 55.52327 60.85021 56.68506 55.57281 57.28070
[9] 58.63517 NA
>
> colMeans(tmp5)
[1] 109.06943 71.35692 69.00394 68.94915 NA 73.05060 65.74536
[8] 77.02163 69.67749 72.71226 69.44184 71.98775 70.43834 71.41118
[15] 68.91485 70.70487 68.97924 75.25717 72.75406 70.30055
> colSums(tmp5)
[1] 1090.6943 713.5692 690.0394 689.4915 NA 730.5060 657.4536
[8] 770.2163 696.7749 727.1226 694.4184 719.8775 704.3834 714.1118
[15] 689.1485 707.0487 689.7924 752.5717 727.5406 703.0055
> colVars(tmp5)
[1] 15747.80473 91.79259 90.74232 77.86989 NA 120.04696
[7] 54.80371 161.50978 118.35727 62.67625 47.82736 64.13445
[13] 139.17208 60.63461 39.92438 69.60845 53.84112 67.86696
[19] 94.18287 119.30385
> colSd(tmp5)
[1] 125.490258 9.580845 9.525876 8.824392 NA 10.956594
[7] 7.402953 12.708650 10.879213 7.916834 6.915733 8.008399
[13] 11.797122 7.786823 6.318574 8.343168 7.337651 8.238141
[19] 9.704786 10.922630
> colMax(tmp5)
[1] 465.76568 86.16912 85.81050 87.65272 NA 90.85119 80.68661
[8] 99.21706 86.64730 87.34853 82.80580 85.57135 89.71753 82.23641
[15] 80.63256 84.67081 77.61283 85.55715 84.06151 89.99541
> colMin(tmp5)
[1] 58.63517 57.62621 56.68506 57.42530 NA 59.59152 57.80492 58.82736
[9] 55.20630 63.08188 59.80456 61.21692 55.57281 60.08734 59.70463 57.21313
[17] 54.32530 60.54991 55.27794 55.52327
>
> Max(tmp5,na.rm=TRUE)
[1] 465.7657
> Min(tmp5,na.rm=TRUE)
[1] 54.3253
> mean(tmp5,na.rm=TRUE)
[1] 73.06629
> Sum(tmp5,na.rm=TRUE)
[1] 14540.19
> Var(tmp5,na.rm=TRUE)
[1] 861.9367
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.23512 73.10133 71.94004 69.59342 70.45671 71.88619 70.21090 70.61291
[9] 73.36689 69.05903
> rowSums(tmp5,na.rm=TRUE)
[1] 1804.702 1462.027 1438.801 1391.868 1409.134 1437.724 1404.218 1412.258
[9] 1467.338 1312.122
> rowVars(tmp5,na.rm=TRUE)
[1] 7938.35136 54.38875 112.57519 77.77570 47.99821 96.78519
[7] 77.67595 71.82691 66.96730 78.02964
> rowSd(tmp5,na.rm=TRUE)
[1] 89.097426 7.374873 10.610146 8.819053 6.928074 9.837947 8.813396
[8] 8.475076 8.183355 8.833439
> rowMax(tmp5,na.rm=TRUE)
[1] 465.76568 85.57135 99.21706 94.41129 84.02914 89.99541 87.65272
[8] 84.67081 90.85119 86.12700
> rowMin(tmp5,na.rm=TRUE)
[1] 54.32530 58.55500 55.20630 55.52327 60.85021 56.68506 55.57281 57.28070
[9] 58.63517 56.59218
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.06943 71.35692 69.00394 68.94915 74.71394 73.05060 65.74536
[8] 77.02163 69.67749 72.71226 69.44184 71.98775 70.43834 71.41118
[15] 68.91485 70.70487 68.97924 75.25717 72.75406 70.30055
> colSums(tmp5,na.rm=TRUE)
[1] 1090.6943 713.5692 690.0394 689.4915 672.4255 730.5060 657.4536
[8] 770.2163 696.7749 727.1226 694.4184 719.8775 704.3834 714.1118
[15] 689.1485 707.0487 689.7924 752.5717 727.5406 703.0055
> colVars(tmp5,na.rm=TRUE)
[1] 15747.80473 91.79259 90.74232 77.86989 25.69443 120.04696
[7] 54.80371 161.50978 118.35727 62.67625 47.82736 64.13445
[13] 139.17208 60.63461 39.92438 69.60845 53.84112 67.86696
[19] 94.18287 119.30385
> colSd(tmp5,na.rm=TRUE)
[1] 125.490258 9.580845 9.525876 8.824392 5.068967 10.956594
[7] 7.402953 12.708650 10.879213 7.916834 6.915733 8.008399
[13] 11.797122 7.786823 6.318574 8.343168 7.337651 8.238141
[19] 9.704786 10.922630
> colMax(tmp5,na.rm=TRUE)
[1] 465.76568 86.16912 85.81050 87.65272 81.95261 90.85119 80.68661
[8] 99.21706 86.64730 87.34853 82.80580 85.57135 89.71753 82.23641
[15] 80.63256 84.67081 77.61283 85.55715 84.06151 89.99541
> colMin(tmp5,na.rm=TRUE)
[1] 58.63517 57.62621 56.68506 57.42530 66.97710 59.59152 57.80492 58.82736
[9] 55.20630 63.08188 59.80456 61.21692 55.57281 60.08734 59.70463 57.21313
[17] 54.32530 60.54991 55.27794 55.52327
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.23512 73.10133 71.94004 69.59342 70.45671 71.88619 70.21090 70.61291
[9] 73.36689 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1804.702 1462.027 1438.801 1391.868 1409.134 1437.724 1404.218 1412.258
[9] 1467.338 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7938.35136 54.38875 112.57519 77.77570 47.99821 96.78519
[7] 77.67595 71.82691 66.96730 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 89.097426 7.374873 10.610146 8.819053 6.928074 9.837947 8.813396
[8] 8.475076 8.183355 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 465.76568 85.57135 99.21706 94.41129 84.02914 89.99541 87.65272
[8] 84.67081 90.85119 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 54.32530 58.55500 55.20630 55.52327 60.85021 56.68506 55.57281 57.28070
[9] 58.63517 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.17296 70.72167 69.57831 68.25833 NaN 71.94830 64.96156
[8] 79.04322 71.13141 73.22386 69.45960 72.45650 71.40893 72.66938
[15] 67.61288 72.20395 68.62061 75.86702 74.19110 68.54206
> colSums(tmp5,na.rm=TRUE)
[1] 1018.5566 636.4950 626.2048 614.3250 0.0000 647.5347 584.6540
[8] 711.3890 640.1827 659.0148 625.1364 652.1085 642.6803 654.0244
[15] 608.5159 649.8356 617.5855 682.8032 667.7199 616.8785
> colVars(tmp5,na.rm=TRUE)
[1] 17526.84191 98.72676 98.37373 82.23480 NA 121.38335
[7] 54.74281 135.72191 109.37063 67.56621 53.80223 69.67942
[13] 145.97075 50.40432 25.84481 53.02799 59.12434 72.16626
[19] 82.72381 99.42844
> colSd(tmp5,na.rm=TRUE)
[1] 132.388980 9.936134 9.918353 9.068341 NA 11.017411
[7] 7.398839 11.649975 10.458041 8.219867 7.335000 8.347420
[13] 12.081835 7.099600 5.083779 7.282032 7.689235 8.495073
[19] 9.095263 9.971381
> colMax(tmp5,na.rm=TRUE)
[1] 465.76568 86.16912 85.81050 87.65272 -Inf 90.85119 80.68661
[8] 99.21706 86.64730 87.34853 82.80580 85.57135 89.71753 82.23641
[15] 76.65437 84.67081 77.61283 85.55715 84.06151 89.99541
> colMin(tmp5,na.rm=TRUE)
[1] 58.63517 57.62621 56.68506 57.42530 Inf 59.59152 57.80492 62.53681
[9] 55.20630 63.08188 59.80456 61.21692 55.57281 61.30041 59.70463 60.95002
[17] 54.32530 60.54991 55.27794 55.52327
>
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col <- 1
> cat(which.row," ",which.col,"\n")
3 1
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> rowVars(tmp5,na.rm=TRUE)
[1] 182.67141 298.93458 185.86917 272.89954 223.71355 222.31176 299.84891
[8] 291.39125 75.43872 175.48040
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 182.67141 298.93458 185.86917 272.89954 223.71355 222.31176 299.84891
[8] 291.39125 75.43872 175.48040
>
>
>
> 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 -5.684342e-14 -1.705303e-13 -8.526513e-14 0.000000e+00
[6] -2.273737e-13 1.136868e-13 -1.421085e-14 5.684342e-14 -8.526513e-14
[11] -8.526513e-14 -5.684342e-14 2.842171e-14 0.000000e+00 0.000000e+00
[16] 4.263256e-14 5.684342e-14 1.705303e-13 -1.705303e-13 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 4
1 11
8 20
2 15
10 11
1 8
8 1
7 17
10 9
1 6
4 20
9 16
3 5
3 20
8 11
10 16
1 19
10 13
10 16
10 15
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.162331
> Min(tmp)
[1] -2.181377
> mean(tmp)
[1] 0.179601
> Sum(tmp)
[1] 17.9601
> Var(tmp)
[1] 0.9181874
>
> rowMeans(tmp)
[1] 0.179601
> rowSums(tmp)
[1] 17.9601
> rowVars(tmp)
[1] 0.9181874
> rowSd(tmp)
[1] 0.958221
> rowMax(tmp)
[1] 2.162331
> rowMin(tmp)
[1] -2.181377
>
> colMeans(tmp)
[1] -1.881659663 0.014497473 0.215696401 1.610623186 0.642052136
[6] -0.343397862 0.408361902 -0.769234033 -0.915200576 -1.371178189
[11] 1.500754637 -0.512154622 0.320666073 -0.250926582 -0.253441222
[16] -2.181377477 -0.245945987 1.065549621 -0.827262899 1.669953071
[21] 0.228755904 -0.522692157 0.914663913 1.215793454 0.007433862
[26] 1.169726857 -0.270156264 0.394863925 0.256278256 0.382371081
[31] 1.939854167 -0.783082280 0.815976398 1.850001314 -0.005231804
[36] -1.028225729 -0.310441683 0.929908248 -0.219497587 1.104904828
[41] -0.455618794 -0.471808925 0.402935618 1.844666124 0.337531340
[46] -0.569223894 -0.157533523 -0.422643286 1.234277958 -1.199668989
[51] -1.502675039 0.817796684 -0.155165575 1.915992474 -0.114340429
[56] 0.456868403 1.181726450 -0.488810425 0.605920383 -0.490332158
[61] -0.690717995 0.413985974 -1.244286081 0.672735282 1.829956347
[66] 1.473847791 1.559632462 2.162331117 -0.299201473 -0.148560231
[71] 0.045781005 0.123312748 -0.004923859 0.633865543 0.338853799
[76] 0.101625891 -0.893875873 1.428282527 0.305155063 0.162657083
[81] -1.663036946 -1.119059435 0.033252550 -0.981971355 1.712801763
[86] 0.986387971 -1.370796380 -0.784441025 0.457445096 0.405431955
[91] 1.913656976 0.169230868 0.965869304 -0.063987305 1.025283037
[96] -0.650406683 0.102807256 -1.131362119 0.448681940 0.796377150
> colSums(tmp)
[1] -1.881659663 0.014497473 0.215696401 1.610623186 0.642052136
[6] -0.343397862 0.408361902 -0.769234033 -0.915200576 -1.371178189
[11] 1.500754637 -0.512154622 0.320666073 -0.250926582 -0.253441222
[16] -2.181377477 -0.245945987 1.065549621 -0.827262899 1.669953071
[21] 0.228755904 -0.522692157 0.914663913 1.215793454 0.007433862
[26] 1.169726857 -0.270156264 0.394863925 0.256278256 0.382371081
[31] 1.939854167 -0.783082280 0.815976398 1.850001314 -0.005231804
[36] -1.028225729 -0.310441683 0.929908248 -0.219497587 1.104904828
[41] -0.455618794 -0.471808925 0.402935618 1.844666124 0.337531340
[46] -0.569223894 -0.157533523 -0.422643286 1.234277958 -1.199668989
[51] -1.502675039 0.817796684 -0.155165575 1.915992474 -0.114340429
[56] 0.456868403 1.181726450 -0.488810425 0.605920383 -0.490332158
[61] -0.690717995 0.413985974 -1.244286081 0.672735282 1.829956347
[66] 1.473847791 1.559632462 2.162331117 -0.299201473 -0.148560231
[71] 0.045781005 0.123312748 -0.004923859 0.633865543 0.338853799
[76] 0.101625891 -0.893875873 1.428282527 0.305155063 0.162657083
[81] -1.663036946 -1.119059435 0.033252550 -0.981971355 1.712801763
[86] 0.986387971 -1.370796380 -0.784441025 0.457445096 0.405431955
[91] 1.913656976 0.169230868 0.965869304 -0.063987305 1.025283037
[96] -0.650406683 0.102807256 -1.131362119 0.448681940 0.796377150
> 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.881659663 0.014497473 0.215696401 1.610623186 0.642052136
[6] -0.343397862 0.408361902 -0.769234033 -0.915200576 -1.371178189
[11] 1.500754637 -0.512154622 0.320666073 -0.250926582 -0.253441222
[16] -2.181377477 -0.245945987 1.065549621 -0.827262899 1.669953071
[21] 0.228755904 -0.522692157 0.914663913 1.215793454 0.007433862
[26] 1.169726857 -0.270156264 0.394863925 0.256278256 0.382371081
[31] 1.939854167 -0.783082280 0.815976398 1.850001314 -0.005231804
[36] -1.028225729 -0.310441683 0.929908248 -0.219497587 1.104904828
[41] -0.455618794 -0.471808925 0.402935618 1.844666124 0.337531340
[46] -0.569223894 -0.157533523 -0.422643286 1.234277958 -1.199668989
[51] -1.502675039 0.817796684 -0.155165575 1.915992474 -0.114340429
[56] 0.456868403 1.181726450 -0.488810425 0.605920383 -0.490332158
[61] -0.690717995 0.413985974 -1.244286081 0.672735282 1.829956347
[66] 1.473847791 1.559632462 2.162331117 -0.299201473 -0.148560231
[71] 0.045781005 0.123312748 -0.004923859 0.633865543 0.338853799
[76] 0.101625891 -0.893875873 1.428282527 0.305155063 0.162657083
[81] -1.663036946 -1.119059435 0.033252550 -0.981971355 1.712801763
[86] 0.986387971 -1.370796380 -0.784441025 0.457445096 0.405431955
[91] 1.913656976 0.169230868 0.965869304 -0.063987305 1.025283037
[96] -0.650406683 0.102807256 -1.131362119 0.448681940 0.796377150
> colMin(tmp)
[1] -1.881659663 0.014497473 0.215696401 1.610623186 0.642052136
[6] -0.343397862 0.408361902 -0.769234033 -0.915200576 -1.371178189
[11] 1.500754637 -0.512154622 0.320666073 -0.250926582 -0.253441222
[16] -2.181377477 -0.245945987 1.065549621 -0.827262899 1.669953071
[21] 0.228755904 -0.522692157 0.914663913 1.215793454 0.007433862
[26] 1.169726857 -0.270156264 0.394863925 0.256278256 0.382371081
[31] 1.939854167 -0.783082280 0.815976398 1.850001314 -0.005231804
[36] -1.028225729 -0.310441683 0.929908248 -0.219497587 1.104904828
[41] -0.455618794 -0.471808925 0.402935618 1.844666124 0.337531340
[46] -0.569223894 -0.157533523 -0.422643286 1.234277958 -1.199668989
[51] -1.502675039 0.817796684 -0.155165575 1.915992474 -0.114340429
[56] 0.456868403 1.181726450 -0.488810425 0.605920383 -0.490332158
[61] -0.690717995 0.413985974 -1.244286081 0.672735282 1.829956347
[66] 1.473847791 1.559632462 2.162331117 -0.299201473 -0.148560231
[71] 0.045781005 0.123312748 -0.004923859 0.633865543 0.338853799
[76] 0.101625891 -0.893875873 1.428282527 0.305155063 0.162657083
[81] -1.663036946 -1.119059435 0.033252550 -0.981971355 1.712801763
[86] 0.986387971 -1.370796380 -0.784441025 0.457445096 0.405431955
[91] 1.913656976 0.169230868 0.965869304 -0.063987305 1.025283037
[96] -0.650406683 0.102807256 -1.131362119 0.448681940 0.796377150
> colMedians(tmp)
[1] -1.881659663 0.014497473 0.215696401 1.610623186 0.642052136
[6] -0.343397862 0.408361902 -0.769234033 -0.915200576 -1.371178189
[11] 1.500754637 -0.512154622 0.320666073 -0.250926582 -0.253441222
[16] -2.181377477 -0.245945987 1.065549621 -0.827262899 1.669953071
[21] 0.228755904 -0.522692157 0.914663913 1.215793454 0.007433862
[26] 1.169726857 -0.270156264 0.394863925 0.256278256 0.382371081
[31] 1.939854167 -0.783082280 0.815976398 1.850001314 -0.005231804
[36] -1.028225729 -0.310441683 0.929908248 -0.219497587 1.104904828
[41] -0.455618794 -0.471808925 0.402935618 1.844666124 0.337531340
[46] -0.569223894 -0.157533523 -0.422643286 1.234277958 -1.199668989
[51] -1.502675039 0.817796684 -0.155165575 1.915992474 -0.114340429
[56] 0.456868403 1.181726450 -0.488810425 0.605920383 -0.490332158
[61] -0.690717995 0.413985974 -1.244286081 0.672735282 1.829956347
[66] 1.473847791 1.559632462 2.162331117 -0.299201473 -0.148560231
[71] 0.045781005 0.123312748 -0.004923859 0.633865543 0.338853799
[76] 0.101625891 -0.893875873 1.428282527 0.305155063 0.162657083
[81] -1.663036946 -1.119059435 0.033252550 -0.981971355 1.712801763
[86] 0.986387971 -1.370796380 -0.784441025 0.457445096 0.405431955
[91] 1.913656976 0.169230868 0.965869304 -0.063987305 1.025283037
[96] -0.650406683 0.102807256 -1.131362119 0.448681940 0.796377150
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.88166 0.01449747 0.2156964 1.610623 0.6420521 -0.3433979 0.4083619
[2,] -1.88166 0.01449747 0.2156964 1.610623 0.6420521 -0.3433979 0.4083619
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.769234 -0.9152006 -1.371178 1.500755 -0.5121546 0.3206661 -0.2509266
[2,] -0.769234 -0.9152006 -1.371178 1.500755 -0.5121546 0.3206661 -0.2509266
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.2534412 -2.181377 -0.245946 1.06555 -0.8272629 1.669953 0.2287559
[2,] -0.2534412 -2.181377 -0.245946 1.06555 -0.8272629 1.669953 0.2287559
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.5226922 0.9146639 1.215793 0.007433862 1.169727 -0.2701563 0.3948639
[2,] -0.5226922 0.9146639 1.215793 0.007433862 1.169727 -0.2701563 0.3948639
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.2562783 0.3823711 1.939854 -0.7830823 0.8159764 1.850001 -0.005231804
[2,] 0.2562783 0.3823711 1.939854 -0.7830823 0.8159764 1.850001 -0.005231804
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.028226 -0.3104417 0.9299082 -0.2194976 1.104905 -0.4556188 -0.4718089
[2,] -1.028226 -0.3104417 0.9299082 -0.2194976 1.104905 -0.4556188 -0.4718089
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.4029356 1.844666 0.3375313 -0.5692239 -0.1575335 -0.4226433 1.234278
[2,] 0.4029356 1.844666 0.3375313 -0.5692239 -0.1575335 -0.4226433 1.234278
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.199669 -1.502675 0.8177967 -0.1551656 1.915992 -0.1143404 0.4568684
[2,] -1.199669 -1.502675 0.8177967 -0.1551656 1.915992 -0.1143404 0.4568684
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.181726 -0.4888104 0.6059204 -0.4903322 -0.690718 0.413986 -1.244286
[2,] 1.181726 -0.4888104 0.6059204 -0.4903322 -0.690718 0.413986 -1.244286
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.6727353 1.829956 1.473848 1.559632 2.162331 -0.2992015 -0.1485602
[2,] 0.6727353 1.829956 1.473848 1.559632 2.162331 -0.2992015 -0.1485602
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.045781 0.1233127 -0.004923859 0.6338655 0.3388538 0.1016259 -0.8938759
[2,] 0.045781 0.1233127 -0.004923859 0.6338655 0.3388538 0.1016259 -0.8938759
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.428283 0.3051551 0.1626571 -1.663037 -1.119059 0.03325255 -0.9819714
[2,] 1.428283 0.3051551 0.1626571 -1.663037 -1.119059 0.03325255 -0.9819714
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.712802 0.986388 -1.370796 -0.784441 0.4574451 0.405432 1.913657
[2,] 1.712802 0.986388 -1.370796 -0.784441 0.4574451 0.405432 1.913657
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.1692309 0.9658693 -0.06398731 1.025283 -0.6504067 0.1028073 -1.131362
[2,] 0.1692309 0.9658693 -0.06398731 1.025283 -0.6504067 0.1028073 -1.131362
[,99] [,100]
[1,] 0.4486819 0.7963772
[2,] 0.4486819 0.7963772
>
>
> Max(tmp2)
[1] 2.718625
> Min(tmp2)
[1] -1.831925
> mean(tmp2)
[1] 0.07341089
> Sum(tmp2)
[1] 7.341089
> Var(tmp2)
[1] 0.9883782
>
> rowMeans(tmp2)
[1] 1.625502417 -0.486223296 -1.308437150 0.276274678 0.337172442
[6] -0.741505872 -1.004773583 0.684360289 -1.417838954 0.424002384
[11] 0.802474269 -0.051819690 0.420932497 0.254104530 0.797624150
[16] 1.662769215 -1.417386237 -1.227806073 -0.339244075 -0.494091382
[21] 1.280596456 -1.460646735 1.163307341 0.282057595 2.020519382
[26] -1.205930519 0.860712400 2.718625475 -0.300524020 0.178986109
[31] 1.027343474 -1.177546366 1.267449575 -0.967186692 0.223493575
[36] 0.872259101 1.096039237 -1.821699895 1.236595792 0.513815192
[41] -1.290616328 1.314591615 -1.831925200 -0.282153870 -0.285876411
[46] 2.231537157 -0.798731649 -0.272982526 -0.336426118 -0.255331580
[51] 1.349391949 -0.800886541 -0.517126024 -0.843865652 0.459196959
[56] 0.379182018 -1.175556260 0.281195422 -1.133489951 -0.502976126
[61] 0.423008165 1.455311431 -1.754134146 2.595506947 0.150366883
[66] 0.513528951 0.976029586 1.080550664 -0.062917982 -0.652430792
[71] 0.693851270 -0.161634080 0.762770057 0.662306019 -0.001116071
[76] -0.705398907 -0.948315881 0.027857076 0.429912822 -0.998371708
[81] -0.518657300 -1.218998191 -0.561410965 0.358093411 0.773158404
[86] 0.566827856 -0.417929794 0.301012952 1.040765048 0.942798049
[91] -0.426579612 -0.261481503 0.812743383 -0.299213865 -0.306147311
[96] -0.339618470 0.299775952 -1.243877612 1.697870020 -0.636229790
> rowSums(tmp2)
[1] 1.625502417 -0.486223296 -1.308437150 0.276274678 0.337172442
[6] -0.741505872 -1.004773583 0.684360289 -1.417838954 0.424002384
[11] 0.802474269 -0.051819690 0.420932497 0.254104530 0.797624150
[16] 1.662769215 -1.417386237 -1.227806073 -0.339244075 -0.494091382
[21] 1.280596456 -1.460646735 1.163307341 0.282057595 2.020519382
[26] -1.205930519 0.860712400 2.718625475 -0.300524020 0.178986109
[31] 1.027343474 -1.177546366 1.267449575 -0.967186692 0.223493575
[36] 0.872259101 1.096039237 -1.821699895 1.236595792 0.513815192
[41] -1.290616328 1.314591615 -1.831925200 -0.282153870 -0.285876411
[46] 2.231537157 -0.798731649 -0.272982526 -0.336426118 -0.255331580
[51] 1.349391949 -0.800886541 -0.517126024 -0.843865652 0.459196959
[56] 0.379182018 -1.175556260 0.281195422 -1.133489951 -0.502976126
[61] 0.423008165 1.455311431 -1.754134146 2.595506947 0.150366883
[66] 0.513528951 0.976029586 1.080550664 -0.062917982 -0.652430792
[71] 0.693851270 -0.161634080 0.762770057 0.662306019 -0.001116071
[76] -0.705398907 -0.948315881 0.027857076 0.429912822 -0.998371708
[81] -0.518657300 -1.218998191 -0.561410965 0.358093411 0.773158404
[86] 0.566827856 -0.417929794 0.301012952 1.040765048 0.942798049
[91] -0.426579612 -0.261481503 0.812743383 -0.299213865 -0.306147311
[96] -0.339618470 0.299775952 -1.243877612 1.697870020 -0.636229790
> 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.625502417 -0.486223296 -1.308437150 0.276274678 0.337172442
[6] -0.741505872 -1.004773583 0.684360289 -1.417838954 0.424002384
[11] 0.802474269 -0.051819690 0.420932497 0.254104530 0.797624150
[16] 1.662769215 -1.417386237 -1.227806073 -0.339244075 -0.494091382
[21] 1.280596456 -1.460646735 1.163307341 0.282057595 2.020519382
[26] -1.205930519 0.860712400 2.718625475 -0.300524020 0.178986109
[31] 1.027343474 -1.177546366 1.267449575 -0.967186692 0.223493575
[36] 0.872259101 1.096039237 -1.821699895 1.236595792 0.513815192
[41] -1.290616328 1.314591615 -1.831925200 -0.282153870 -0.285876411
[46] 2.231537157 -0.798731649 -0.272982526 -0.336426118 -0.255331580
[51] 1.349391949 -0.800886541 -0.517126024 -0.843865652 0.459196959
[56] 0.379182018 -1.175556260 0.281195422 -1.133489951 -0.502976126
[61] 0.423008165 1.455311431 -1.754134146 2.595506947 0.150366883
[66] 0.513528951 0.976029586 1.080550664 -0.062917982 -0.652430792
[71] 0.693851270 -0.161634080 0.762770057 0.662306019 -0.001116071
[76] -0.705398907 -0.948315881 0.027857076 0.429912822 -0.998371708
[81] -0.518657300 -1.218998191 -0.561410965 0.358093411 0.773158404
[86] 0.566827856 -0.417929794 0.301012952 1.040765048 0.942798049
[91] -0.426579612 -0.261481503 0.812743383 -0.299213865 -0.306147311
[96] -0.339618470 0.299775952 -1.243877612 1.697870020 -0.636229790
> rowMin(tmp2)
[1] 1.625502417 -0.486223296 -1.308437150 0.276274678 0.337172442
[6] -0.741505872 -1.004773583 0.684360289 -1.417838954 0.424002384
[11] 0.802474269 -0.051819690 0.420932497 0.254104530 0.797624150
[16] 1.662769215 -1.417386237 -1.227806073 -0.339244075 -0.494091382
[21] 1.280596456 -1.460646735 1.163307341 0.282057595 2.020519382
[26] -1.205930519 0.860712400 2.718625475 -0.300524020 0.178986109
[31] 1.027343474 -1.177546366 1.267449575 -0.967186692 0.223493575
[36] 0.872259101 1.096039237 -1.821699895 1.236595792 0.513815192
[41] -1.290616328 1.314591615 -1.831925200 -0.282153870 -0.285876411
[46] 2.231537157 -0.798731649 -0.272982526 -0.336426118 -0.255331580
[51] 1.349391949 -0.800886541 -0.517126024 -0.843865652 0.459196959
[56] 0.379182018 -1.175556260 0.281195422 -1.133489951 -0.502976126
[61] 0.423008165 1.455311431 -1.754134146 2.595506947 0.150366883
[66] 0.513528951 0.976029586 1.080550664 -0.062917982 -0.652430792
[71] 0.693851270 -0.161634080 0.762770057 0.662306019 -0.001116071
[76] -0.705398907 -0.948315881 0.027857076 0.429912822 -0.998371708
[81] -0.518657300 -1.218998191 -0.561410965 0.358093411 0.773158404
[86] 0.566827856 -0.417929794 0.301012952 1.040765048 0.942798049
[91] -0.426579612 -0.261481503 0.812743383 -0.299213865 -0.306147311
[96] -0.339618470 0.299775952 -1.243877612 1.697870020 -0.636229790
>
> colMeans(tmp2)
[1] 0.07341089
> colSums(tmp2)
[1] 7.341089
> colVars(tmp2)
[1] 0.9883782
> colSd(tmp2)
[1] 0.9941721
> colMax(tmp2)
[1] 2.718625
> colMin(tmp2)
[1] -1.831925
> colMedians(tmp2)
[1] 0.08911198
> colRanges(tmp2)
[,1]
[1,] -1.831925
[2,] 2.718625
>
> 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] -1.9968508 -1.2788232 0.1847706 1.4253740 3.4439455 3.5249142
[7] 0.1860215 2.1544075 0.6535016 0.5115779
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5781826
[2,] -0.5321115
[3,] -0.2954927
[4,] 0.4459023
[5,] 1.1624154
>
> rowApply(tmp,sum)
[1] -0.0167515 -1.0846108 2.2502260 4.3690081 -0.6998723 2.4307193
[7] 0.7614006 1.2935780 0.7450729 -1.2399316
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 9 2 1 9 4 4 3 2 10
[2,] 5 6 5 8 4 3 8 7 1 1
[3,] 7 2 10 4 1 7 1 2 9 8
[4,] 9 7 4 3 5 10 2 6 6 4
[5,] 10 10 3 5 7 9 5 9 3 5
[6,] 6 5 6 2 8 8 9 5 7 6
[7,] 8 4 9 7 2 6 3 8 8 3
[8,] 1 3 8 10 10 1 7 10 4 9
[9,] 4 8 1 6 3 2 10 4 5 7
[10,] 2 1 7 9 6 5 6 1 10 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.90760189 -1.30982698 1.74784735 -1.39762155 0.07984367 -1.94872694
[7] 3.56689621 0.96320371 -2.49924996 -1.61278584 0.39867814 -1.92466735
[13] -0.09860039 0.68966365 1.22565432 -1.19833011 1.17407149 4.32131580
[19] -4.84611309 2.60604174
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.617708087
[2,] -0.213935015
[3,] 0.009898373
[4,] 0.988445847
[5,] 1.740900767
>
> rowApply(tmp,sum)
[1] -3.4212010 -0.3143546 4.5853205 -3.3267842 4.3219149
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 8 4 20 15
[2,] 3 3 8 4 18
[3,] 14 6 18 15 9
[4,] 2 9 14 7 11
[5,] 19 5 12 5 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.009898373 -1.07129339 0.121473941 -1.3384130 1.4295222 0.1144808
[2,] -0.213935015 -1.22403193 -0.320586599 -0.2028238 -0.4504788 -0.2155410
[3,] -0.617708087 0.03691556 1.135924030 0.5786119 0.4125825 1.0391731
[4,] 1.740900767 -0.98716072 0.809515650 -0.6270052 -0.8257046 -0.1492428
[5,] 0.988445847 1.93574350 0.001520331 0.1920086 -0.4860777 -2.7375970
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.5260499 0.80028735 0.3645172 -1.05089188 -0.69130328 -0.86845466
[2,] 1.3254669 0.06243721 1.4468098 1.14784657 0.10198862 -1.69695555
[3,] 0.4924769 1.59551030 -0.3525654 -0.61880617 -0.09750476 1.07237464
[4,] 1.0937383 0.01757671 -2.2969865 -1.05213035 1.51149475 0.06069768
[5,] 0.1291642 -1.51260786 -1.6610251 -0.03880402 -0.42599719 -0.49232947
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.4859779 -0.7370956 0.8075263 0.05308585 -0.4917424 -0.7135435
[2,] 0.6936995 0.8997169 -0.1985896 -0.12803264 -1.2638014 1.1850137
[3,] -0.4851858 0.1255615 -1.1536692 -1.00444627 1.3415409 0.2767612
[4,] -0.2561026 0.0599205 1.0194366 0.08253447 -0.4569563 1.3997115
[5,] 1.4349664 0.3415603 0.7509502 -0.20147152 2.0450307 2.1733729
[,19] [,20]
[1,] -0.68655257 1.4872253
[2,] -1.12168306 -0.1408744
[3,] 0.04152415 0.7662495
[4,] -3.72202958 -0.7489925
[5,] 0.64262797 1.2424338
>
>
> 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 : 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.22-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.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 1.356679 0.5195355 -1.894708 -0.916972 0.2022877 1.230672 1.089209
col8 col9 col10 col11 col12 col13 col14
row1 0.3783719 -0.5515506 1.012954 -1.274332 0.6057786 0.4216477 0.7289838
col15 col16 col17 col18 col19 col20
row1 0.1707689 -0.4964342 -1.496669 -1.728229 -0.1330356 0.9904147
> tmp[,"col10"]
col10
row1 1.0129543
row2 -0.7284443
row3 -0.4065220
row4 0.3505840
row5 0.2347394
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.3566791 0.51953547 -1.894708 -0.9169720 0.2022877 1.2306715 1.0892086
row5 0.4812739 -0.08930079 -1.819073 0.8551598 0.7359802 -0.9252783 -0.3210119
col8 col9 col10 col11 col12 col13 col14
row1 0.3783719 -0.5515506 1.0129543 -1.2743324 0.6057786 0.4216477 0.7289838
row5 -0.8229279 -0.3496816 0.2347394 0.2720021 -2.1585364 0.3593378 1.1282357
col15 col16 col17 col18 col19 col20
row1 0.1707689 -0.4964342 -1.4966689 -1.7282291 -0.1330356 0.9904147
row5 0.1588499 -0.3377576 0.4227425 0.4855643 0.3135873 1.3247442
> tmp[,c("col6","col20")]
col6 col20
row1 1.2306715 0.9904147
row2 -0.3034056 0.9463766
row3 1.9211968 0.4328194
row4 -0.9634229 0.3808736
row5 -0.9252783 1.3247442
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.2306715 0.9904147
row5 -0.9252783 1.3247442
>
>
>
>
> 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.94798 49.60332 50.9057 51.02975 50.87593 104.3431 52.3102 50.98305
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.85118 49.05763 50.97527 50.12824 50.94126 49.56736 50.75482 47.77714
col17 col18 col19 col20
row1 50.85218 51.28859 51.18232 104.3705
> tmp[,"col10"]
col10
row1 49.05763
row2 30.33940
row3 29.32232
row4 28.79789
row5 51.63635
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.94798 49.60332 50.90570 51.02975 50.87593 104.3431 52.31020 50.98305
row5 49.23737 48.77063 51.49858 47.89471 50.61137 105.8696 50.05579 50.26405
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.85118 49.05763 50.97527 50.12824 50.94126 49.56736 50.75482 47.77714
row5 49.18048 51.63635 50.37359 49.89133 50.49398 48.67126 49.99138 49.57381
col17 col18 col19 col20
row1 50.85218 51.28859 51.18232 104.3705
row5 50.25202 49.27742 50.60057 105.3974
> tmp[,c("col6","col20")]
col6 col20
row1 104.34312 104.37047
row2 75.69558 75.28535
row3 75.34108 73.66996
row4 74.17106 74.11445
row5 105.86961 105.39740
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.3431 104.3705
row5 105.8696 105.3974
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.3431 104.3705
row5 105.8696 105.3974
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.9323914
[2,] -0.7403048
[3,] -1.0495920
[4,] 1.4024448
[5,] -0.2299990
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.2749776 -0.2458198
[2,] -0.7855934 1.2373921
[3,] 0.9667047 -1.3356212
[4,] -0.6073248 0.4701106
[5,] 0.2162185 -0.6935128
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.1465095 -0.64434834
[2,] 0.2113530 0.13099650
[3,] -0.4836192 -0.03857352
[4,] 0.3216892 1.09898380
[5,] 1.9171416 0.21930469
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.14651
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.146510
[2,] 0.211353
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.2512268 -2.275876 0.3261429 -0.6788291 0.08149149 0.2509147 0.8632491
row1 -0.5401699 1.633263 1.1600872 1.0724316 1.67894102 -1.9035433 -0.5003080
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -1.261382 0.4777164 -0.8117843 -0.5923942 -0.2385767 -1.5042551 -0.4912122
row1 2.769277 1.5253396 -1.1304494 0.6214823 0.5505900 0.0320929 0.8564957
[,15] [,16] [,17] [,18] [,19] [,20]
row3 1.129447 1.0984972 0.2302537 -0.9336831 -1.79702902 -0.6427323
row1 1.340413 0.4201502 -0.7793846 0.2019720 -0.04015658 0.9647662
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.2194138 1.095188 -0.3618322 -0.7216213 0.2575965 -0.4919963 -0.8040585
[,8] [,9] [,10]
row2 -0.7396717 1.440336 1.041429
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.08762513 -1.009624 -0.281248 -0.1931984 0.02415846 -0.9658016 1.27496
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.5973151 -1.26026 -1.347093 -0.3187399 -1.851554 0.9421156 -0.9684808
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.010014 0.5462432 -1.165269 -0.09024162 1.443068 -1.719943
>
>
> 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: 0x57c68aa1e730>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff4d92678"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff2b11012e"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff64a76c22"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff3c52861"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff4b70d0e2"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff375cdb66"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202effbeb2c5b"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff130f2803"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff71f6fa8"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff12d5277a"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff61eacd37"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff2255a70"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff16405b2d"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff319dc6f2"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM202eff7bb95735"
>
>
> ### 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: 0x57c68a8b3110>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x57c68a8b3110>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x57c68a8b3110>
> rowMedians(tmp)
[1] -0.028704229 -0.468592201 -0.230412012 0.390595542 -0.133039463
[6] -0.059492765 0.640478559 0.337751248 -0.061363135 -0.187541782
[11] 0.285797479 0.131354612 0.673240981 -0.300757872 0.307106148
[16] -0.021047314 0.407433210 0.280167044 0.221931379 -0.567920841
[21] -0.143986755 0.542559097 0.801473185 0.463050787 0.321597229
[26] -0.260525382 -0.067143785 -0.186059934 0.359466365 0.601111486
[31] 0.065745025 -0.302591562 -0.020046304 -0.066726510 -0.088465122
[36] 0.199413505 0.059455465 0.534944897 -0.221815999 0.309051717
[41] 0.250510192 0.419015511 -0.107005036 -0.246371893 0.280252601
[46] 0.242587539 -0.185053820 0.049986144 1.042074361 0.140487728
[51] -0.405799133 0.015303642 -0.276336911 0.662204327 0.009650907
[56] -0.111811717 0.488793166 -0.173811937 -0.318664659 0.220142528
[61] -0.153168623 0.170597628 -0.149423191 -0.681810972 0.664087330
[66] -0.431678781 0.211962112 0.190154888 0.007259954 -0.258710858
[71] -0.262381259 -0.053688987 -0.316546687 0.524600304 -0.054845700
[76] -0.206846803 0.001420961 -0.058377552 0.072288409 0.075028110
[81] -0.040901176 -0.734957780 -0.328467028 0.051128963 -0.044347761
[86] 0.306766599 -0.162610845 0.019370855 -0.049127208 0.071555960
[91] 0.018696811 0.036472135 0.227314979 -0.561873390 -0.149583644
[96] -0.283960526 -0.491878728 0.163954983 0.267800816 0.296440204
[101] -0.273099849 -0.556507459 0.395096364 -0.091818637 0.245662654
[106] 0.188335634 -0.627731293 0.538905682 -0.240147814 -0.076623799
[111] -0.239394798 0.212652847 0.048277512 0.035184361 0.499674679
[116] -0.139769634 0.042609775 -0.553382156 0.072812097 0.332710356
[121] 0.049680941 0.008782636 -0.235300790 0.291159052 -0.044659473
[126] 0.254445769 -0.168763304 -0.283367868 0.058421336 0.292067139
[131] -0.094305991 -0.193243904 0.002272612 -0.042316171 0.031660942
[136] -0.264356276 0.162568116 0.286194200 -0.014572085 -0.227030018
[141] 0.354905907 -0.456594018 0.027759959 0.337589255 -0.269423443
[146] -0.075113709 -0.170353359 0.419650308 -0.220683634 -0.239496141
[151] 0.453669640 0.038075244 0.147596425 -0.263495597 -0.087368244
[156] -0.979868658 -0.443405345 -0.935729674 0.284040973 0.236369996
[161] 0.331918328 0.016538053 0.127430302 -0.107519563 -0.084094225
[166] 0.221963390 -0.225376051 0.734240034 -0.139365648 -0.171096021
[171] -0.463353001 -0.226666490 -0.033210573 -0.785706387 -0.339499885
[176] -0.381597079 0.097299787 -0.276313818 -0.204626236 0.198067313
[181] 0.160054123 -0.350489534 0.180550300 -0.518702901 -0.158311500
[186] 0.249768149 0.017489493 -0.583733024 0.055499501 0.285191106
[191] -0.329255650 0.006745790 -0.244855782 0.306580389 -0.345135457
[196] 0.074270754 0.149987972 0.201108503 0.263910456 -0.403566112
[201] -0.326551389 0.869051058 -0.679712570 -0.196314112 -0.277699015
[206] 0.513891568 -0.278774129 0.041310805 0.134180353 0.032008985
[211] -0.119167962 0.223359296 -0.024694566 -0.153935891 0.327411958
[216] -0.276045273 0.216388581 -0.971984530 0.288892005 0.579582280
[221] 0.054613031 0.349953638 0.166771047 -0.298789901 -0.192841152
[226] -0.191167479 -0.509540914 -0.063258456 -0.003555345 0.296435771
>
> proc.time()
user system elapsed
1.245 0.674 1.907
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x5f876bb03370>
> .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: 0x5f876bb03370>
> .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: 0x5f876bb03370>
> .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: 0x5f876bb03370>
> 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: 0x5f876baeb1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876baeb1c0>
> .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: 0x5f876baeb1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876baeb1c0>
> .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: 0x5f876baeb1c0>
> 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: 0x5f876bdce120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876bdce120>
> .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: 0x5f876bdce120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f876bdce120>
> .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: 0x5f876bdce120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5f876bdce120>
> .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: 0x5f876bdce120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5f876bdce120>
> .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: 0x5f876bdce120>
> 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: 0x5f876ab1e390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5f876ab1e390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876ab1e390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876ab1e390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile202fc21ec63960" "BufferedMatrixFile202fc245fe0ff6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile202fc21ec63960" "BufferedMatrixFile202fc245fe0ff6"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876aa153d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876aa153d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f876aa153d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f876aa153d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5f876aa153d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5f876aa153d0>
> .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: 0x5f876c54afa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f876c54afa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f876c54afa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5f876c54afa0>
> 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: 0x5f876ad22ff0>
> .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: 0x5f876ad22ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.236 0.055 0.278
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.243 0.046 0.277