| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-12 11:32 -0500 (Wed, 12 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4823 |
| 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 251/2325 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-11-11 21:42:50 -0500 (Tue, 11 Nov 2025) |
| EndedAt: 2025-11-11 21:43:15 -0500 (Tue, 11 Nov 2025) |
| EllapsedTime: 25.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.247 0.057 0.292
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6 1048392 56 639317 34.2
Vcells 885623 6.8 8388608 64 2082728 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Tue Nov 11 21:43:05 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] "Tue Nov 11 21:43:05 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: 0x61041327e5e0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Tue Nov 11 21:43:05 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] "Tue Nov 11 21:43:05 2025"
>
> ColMode(tmp2)
<pointer: 0x61041327e5e0>
>
>
>
> ### 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.3612177 -0.8813184 0.51869969 0.3373405
[2,] 0.6845755 0.2727772 1.48695440 0.7054362
[3,] 1.4255304 0.2478807 -0.08327578 0.5629159
[4,] -0.6511677 0.9818845 -0.23583470 -0.2384467
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.3612177 0.8813184 0.51869969 0.3373405
[2,] 0.6845755 0.2727772 1.48695440 0.7054362
[3,] 1.4255304 0.2478807 0.08327578 0.5629159
[4,] 0.6511677 0.9818845 0.23583470 0.2384467
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9680097 0.9387856 0.7202081 0.5808102
[2,] 0.8273908 0.5222808 1.2194074 0.8399025
[3,] 1.1939558 0.4978762 0.2885754 0.7502772
[4,] 0.8069496 0.9909008 0.4856281 0.4883101
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.04131 35.26917 32.72078 31.14544
[2,] 33.95848 30.49559 38.68103 34.10446
[3,] 38.36509 30.22664 27.96903 33.06569
[4,] 33.72066 35.89089 30.09212 30.12155
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x610412e09840>
> exp(tmp5)
<pointer: 0x610412e09840>
> log(tmp5,2)
<pointer: 0x610412e09840>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.3126
> Min(tmp5)
[1] 53.1479
> mean(tmp5)
[1] 73.68386
> Sum(tmp5)
[1] 14736.77
> Var(tmp5)
[1] 856.4556
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.02091 68.61516 70.41759 69.59961 73.17908 73.98464 73.77466 73.64488
[9] 71.09586 72.50623
> rowSums(tmp5)
[1] 1800.418 1372.303 1408.352 1391.992 1463.582 1479.693 1475.493 1472.898
[9] 1421.917 1450.125
> rowVars(tmp5)
[1] 7894.18739 86.36901 87.64362 96.42832 95.04350 72.02253
[7] 44.65113 106.43410 84.65182 57.15096
> rowSd(tmp5)
[1] 88.849240 9.293493 9.361817 9.819792 9.749026 8.486609 6.682150
[8] 10.316690 9.200642 7.559825
> rowMax(tmp5)
[1] 466.31264 84.43220 90.50933 88.34987 89.94731 87.19421 89.02891
[8] 92.57835 92.20072 83.99031
> rowMin(tmp5)
[1] 58.85224 53.68795 55.91884 53.14790 57.48080 59.47407 61.67208 56.97626
[9] 53.80777 58.52372
>
> colMeans(tmp5)
[1] 113.23189 72.86460 68.97919 70.75602 76.87876 67.59721 69.78950
[8] 69.53708 74.98823 71.78246 74.32250 73.90002 72.15745 73.65816
[15] 70.10214 71.58731 69.66630 71.50993 73.04458 67.32391
> colSums(tmp5)
[1] 1132.3189 728.6460 689.7919 707.5602 768.7876 675.9721 697.8950
[8] 695.3708 749.8823 717.8246 743.2250 739.0002 721.5745 736.5816
[15] 701.0214 715.8731 696.6630 715.0993 730.4458 673.2391
> colVars(tmp5)
[1] 15417.34507 104.97456 82.93446 52.08892 52.56152 104.28076
[7] 61.51805 117.34408 171.05184 86.43976 42.97955 129.08355
[13] 55.32418 79.52452 58.34369 68.86294 75.70850 85.41538
[19] 78.14054 55.38440
> colSd(tmp5)
[1] 124.166602 10.245709 9.106836 7.217265 7.249932 10.211795
[7] 7.843345 10.832547 13.078679 9.297299 6.555879 11.361494
[13] 7.438022 8.917652 7.638304 8.298370 8.701063 9.242044
[19] 8.839714 7.442069
> colMax(tmp5)
[1] 466.31264 92.57835 80.50949 82.23963 88.98446 83.61320 84.06288
[8] 84.22673 89.94731 85.19226 83.54017 92.20072 82.91365 90.50933
[15] 78.91063 83.99031 89.97035 88.34987 84.43220 79.09597
> colMin(tmp5)
[1] 67.75128 57.87742 53.80777 59.48367 65.65640 53.14790 59.47407 56.19302
[9] 55.41253 55.91884 58.52372 55.86962 61.49007 63.04722 55.04259 59.46609
[17] 59.49557 57.99583 58.85224 53.68795
>
>
> ### 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.02091 NA 70.41759 69.59961 73.17908 73.98464 73.77466 73.64488
[9] 71.09586 72.50623
> rowSums(tmp5)
[1] 1800.418 NA 1408.352 1391.992 1463.582 1479.693 1475.493 1472.898
[9] 1421.917 1450.125
> rowVars(tmp5)
[1] 7894.18739 90.05869 87.64362 96.42832 95.04350 72.02253
[7] 44.65113 106.43410 84.65182 57.15096
> rowSd(tmp5)
[1] 88.849240 9.489926 9.361817 9.819792 9.749026 8.486609 6.682150
[8] 10.316690 9.200642 7.559825
> rowMax(tmp5)
[1] 466.31264 NA 90.50933 88.34987 89.94731 87.19421 89.02891
[8] 92.57835 92.20072 83.99031
> rowMin(tmp5)
[1] 58.85224 NA 55.91884 53.14790 57.48080 59.47407 61.67208 56.97626
[9] 53.80777 58.52372
>
> colMeans(tmp5)
[1] 113.23189 72.86460 68.97919 70.75602 76.87876 67.59721 69.78950
[8] 69.53708 74.98823 71.78246 74.32250 73.90002 72.15745 73.65816
[15] 70.10214 71.58731 NA 71.50993 73.04458 67.32391
> colSums(tmp5)
[1] 1132.3189 728.6460 689.7919 707.5602 768.7876 675.9721 697.8950
[8] 695.3708 749.8823 717.8246 743.2250 739.0002 721.5745 736.5816
[15] 701.0214 715.8731 NA 715.0993 730.4458 673.2391
> colVars(tmp5)
[1] 15417.34507 104.97456 82.93446 52.08892 52.56152 104.28076
[7] 61.51805 117.34408 171.05184 86.43976 42.97955 129.08355
[13] 55.32418 79.52452 58.34369 68.86294 NA 85.41538
[19] 78.14054 55.38440
> colSd(tmp5)
[1] 124.166602 10.245709 9.106836 7.217265 7.249932 10.211795
[7] 7.843345 10.832547 13.078679 9.297299 6.555879 11.361494
[13] 7.438022 8.917652 7.638304 8.298370 NA 9.242044
[19] 8.839714 7.442069
> colMax(tmp5)
[1] 466.31264 92.57835 80.50949 82.23963 88.98446 83.61320 84.06288
[8] 84.22673 89.94731 85.19226 83.54017 92.20072 82.91365 90.50933
[15] 78.91063 83.99031 NA 88.34987 84.43220 79.09597
> colMin(tmp5)
[1] 67.75128 57.87742 53.80777 59.48367 65.65640 53.14790 59.47407 56.19302
[9] 55.41253 55.91884 58.52372 55.86962 61.49007 63.04722 55.04259 59.46609
[17] NA 57.99583 58.85224 53.68795
>
> Max(tmp5,na.rm=TRUE)
[1] 466.3126
> Min(tmp5,na.rm=TRUE)
[1] 53.1479
> mean(tmp5,na.rm=TRUE)
[1] 73.73121
> Sum(tmp5,na.rm=TRUE)
[1] 14672.51
> Var(tmp5,na.rm=TRUE)
[1] 860.3305
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.02091 68.84432 70.41759 69.59961 73.17908 73.98464 73.77466 73.64488
[9] 71.09586 72.50623
> rowSums(tmp5,na.rm=TRUE)
[1] 1800.418 1308.042 1408.352 1391.992 1463.582 1479.693 1475.493 1472.898
[9] 1421.917 1450.125
> rowVars(tmp5,na.rm=TRUE)
[1] 7894.18739 90.05869 87.64362 96.42832 95.04350 72.02253
[7] 44.65113 106.43410 84.65182 57.15096
> rowSd(tmp5,na.rm=TRUE)
[1] 88.849240 9.489926 9.361817 9.819792 9.749026 8.486609 6.682150
[8] 10.316690 9.200642 7.559825
> rowMax(tmp5,na.rm=TRUE)
[1] 466.31264 84.43220 90.50933 88.34987 89.94731 87.19421 89.02891
[8] 92.57835 92.20072 83.99031
> rowMin(tmp5,na.rm=TRUE)
[1] 58.85224 53.68795 55.91884 53.14790 57.48080 59.47407 61.67208 56.97626
[9] 53.80777 58.52372
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.23189 72.86460 68.97919 70.75602 76.87876 67.59721 69.78950
[8] 69.53708 74.98823 71.78246 74.32250 73.90002 72.15745 73.65816
[15] 70.10214 71.58731 70.26686 71.50993 73.04458 67.32391
> colSums(tmp5,na.rm=TRUE)
[1] 1132.3189 728.6460 689.7919 707.5602 768.7876 675.9721 697.8950
[8] 695.3708 749.8823 717.8246 743.2250 739.0002 721.5745 736.5816
[15] 701.0214 715.8731 632.4018 715.0993 730.4458 673.2391
> colVars(tmp5,na.rm=TRUE)
[1] 15417.34507 104.97456 82.93446 52.08892 52.56152 104.28076
[7] 61.51805 117.34408 171.05184 86.43976 42.97955 129.08355
[13] 55.32418 79.52452 58.34369 68.86294 81.11440 85.41538
[19] 78.14054 55.38440
> colSd(tmp5,na.rm=TRUE)
[1] 124.166602 10.245709 9.106836 7.217265 7.249932 10.211795
[7] 7.843345 10.832547 13.078679 9.297299 6.555879 11.361494
[13] 7.438022 8.917652 7.638304 8.298370 9.006353 9.242044
[19] 8.839714 7.442069
> colMax(tmp5,na.rm=TRUE)
[1] 466.31264 92.57835 80.50949 82.23963 88.98446 83.61320 84.06288
[8] 84.22673 89.94731 85.19226 83.54017 92.20072 82.91365 90.50933
[15] 78.91063 83.99031 89.97035 88.34987 84.43220 79.09597
> colMin(tmp5,na.rm=TRUE)
[1] 67.75128 57.87742 53.80777 59.48367 65.65640 53.14790 59.47407 56.19302
[9] 55.41253 55.91884 58.52372 55.86962 61.49007 63.04722 55.04259 59.46609
[17] 59.49557 57.99583 58.85224 53.68795
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.02091 NaN 70.41759 69.59961 73.17908 73.98464 73.77466 73.64488
[9] 71.09586 72.50623
> rowSums(tmp5,na.rm=TRUE)
[1] 1800.418 0.000 1408.352 1391.992 1463.582 1479.693 1475.493 1472.898
[9] 1421.917 1450.125
> rowVars(tmp5,na.rm=TRUE)
[1] 7894.18739 NA 87.64362 96.42832 95.04350 72.02253
[7] 44.65113 106.43410 84.65182 57.15096
> rowSd(tmp5,na.rm=TRUE)
[1] 88.849240 NA 9.361817 9.819792 9.749026 8.486609 6.682150
[8] 10.316690 9.200642 7.559825
> rowMax(tmp5,na.rm=TRUE)
[1] 466.31264 NA 90.50933 88.34987 89.94731 87.19421 89.02891
[8] 92.57835 92.20072 83.99031
> rowMin(tmp5,na.rm=TRUE)
[1] 58.85224 NA 55.91884 53.14790 57.48080 59.47407 61.67208 56.97626
[9] 53.80777 58.52372
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 117.95986 73.90816 67.69805 70.73070 77.36831 67.61776 70.83347
[8] 71.01975 74.03970 73.04211 74.22003 72.92669 73.15885 73.73903
[15] 71.18678 72.93411 NaN 71.67251 71.77928 68.83901
> colSums(tmp5,na.rm=TRUE)
[1] 1061.6387 665.1735 609.2824 636.5763 696.3148 608.5598 637.5013
[8] 639.1778 666.3573 657.3790 667.9803 656.3402 658.4296 663.6513
[15] 640.6810 656.4070 0.0000 645.0526 646.0136 619.5511
> colVars(tmp5,na.rm=TRUE)
[1] 17093.03383 105.84494 74.83628 58.59281 56.43556 117.31111
[7] 56.94663 107.28097 182.31149 79.39420 48.23386 134.56096
[13] 50.95824 89.39151 52.40172 57.06471 NA 95.79493
[19] 69.89728 36.48257
> colSd(tmp5,na.rm=TRUE)
[1] 130.740330 10.288097 8.650797 7.654594 7.512361 10.831025
[7] 7.546299 10.357653 13.502277 8.910342 6.945060 11.600041
[13] 7.138504 9.454709 7.238903 7.554119 NA 9.787489
[19] 8.360459 6.040080
> colMax(tmp5,na.rm=TRUE)
[1] 466.31264 92.57835 80.13716 82.23963 88.98446 83.61320 84.06288
[8] 84.22673 89.94731 85.19226 83.54017 92.20072 82.91365 90.50933
[15] 78.91063 83.99031 -Inf 88.34987 82.95636 79.09597
> colMin(tmp5,na.rm=TRUE)
[1] 67.75128 57.87742 53.80777 59.48367 65.65640 53.14790 59.47407 58.43409
[9] 55.41253 55.91884 58.52372 55.86962 61.49007 63.04722 55.04259 61.72578
[17] Inf 57.99583 58.85224 61.09400
>
>
>
>
> 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] 244.1106 147.5710 412.4753 169.3115 199.0440 310.9490 170.7297 349.7279
[9] 433.4620 232.7030
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 244.1106 147.5710 412.4753 169.3115 199.0440 310.9490 170.7297 349.7279
[9] 433.4620 232.7030
>
>
>
> 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] 5.684342e-14 -2.842171e-14 -5.684342e-14 2.842171e-14 0.000000e+00
[6] 5.684342e-14 -2.842171e-14 -5.684342e-14 -7.105427e-14 -1.136868e-13
[11] -1.136868e-13 1.705303e-13 -2.842171e-14 0.000000e+00 -5.684342e-14
[16] -5.684342e-14 2.842171e-14 1.136868e-13 2.842171e-14 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)
+ }
4 18
3 9
5 4
7 10
10 12
9 19
7 17
4 10
5 19
7 11
3 5
4 2
9 14
3 4
9 1
3 6
5 14
10 12
8 15
9 3
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.319229
> Min(tmp)
[1] -2.63574
> mean(tmp)
[1] 0.04335812
> Sum(tmp)
[1] 4.335812
> Var(tmp)
[1] 0.8755685
>
> rowMeans(tmp)
[1] 0.04335812
> rowSums(tmp)
[1] 4.335812
> rowVars(tmp)
[1] 0.8755685
> rowSd(tmp)
[1] 0.9357182
> rowMax(tmp)
[1] 2.319229
> rowMin(tmp)
[1] -2.63574
>
> colMeans(tmp)
[1] 0.226278643 -0.649516977 -1.217581218 -1.704845749 1.087091805
[6] 0.116560472 -0.653434292 0.906342276 0.260145581 0.019700201
[11] 1.191872534 -0.093555776 -0.919242515 -2.635739963 -1.694561689
[16] 0.956759842 -1.338903038 0.154226241 0.093556359 -0.510662448
[21] 0.964874823 1.500097275 0.264300917 -0.253108773 -0.778965550
[26] 0.985245359 -1.287379526 -1.142153618 -0.865064096 2.083724816
[31] -0.394892144 0.200423504 0.263157387 0.468018369 0.279357800
[36] 1.130487739 1.350388006 0.168821361 -0.783131597 2.048623080
[41] 0.435799484 0.684610012 -0.037389064 -0.620217954 1.028534644
[46] 0.580403622 -0.723768564 0.453951547 1.403330781 -0.242997368
[51] -1.138362839 0.802757739 0.039153085 -0.047369677 0.584248166
[56] -0.185344065 0.952252886 0.830790547 -0.365199992 0.785431329
[61] -1.653914758 0.659532271 -0.204818580 -0.576356130 0.593689896
[66] -0.051905106 0.689249380 1.939796633 0.297972468 0.318438684
[71] -0.615247301 -0.553285889 0.455734643 -0.025690619 2.319228718
[76] -0.692827664 -0.402582362 0.072080484 1.392859614 -1.042673596
[81] 0.209976043 -0.165648356 -0.957649537 -0.426830242 -0.035160788
[86] 0.805795829 -1.207652518 -2.055285336 -0.604903009 -0.755227817
[91] -1.141234993 0.442034472 1.474696462 0.006583752 -0.385964238
[96] 1.132549757 0.467541626 -0.761344907 0.630087058 -0.273761566
> colSums(tmp)
[1] 0.226278643 -0.649516977 -1.217581218 -1.704845749 1.087091805
[6] 0.116560472 -0.653434292 0.906342276 0.260145581 0.019700201
[11] 1.191872534 -0.093555776 -0.919242515 -2.635739963 -1.694561689
[16] 0.956759842 -1.338903038 0.154226241 0.093556359 -0.510662448
[21] 0.964874823 1.500097275 0.264300917 -0.253108773 -0.778965550
[26] 0.985245359 -1.287379526 -1.142153618 -0.865064096 2.083724816
[31] -0.394892144 0.200423504 0.263157387 0.468018369 0.279357800
[36] 1.130487739 1.350388006 0.168821361 -0.783131597 2.048623080
[41] 0.435799484 0.684610012 -0.037389064 -0.620217954 1.028534644
[46] 0.580403622 -0.723768564 0.453951547 1.403330781 -0.242997368
[51] -1.138362839 0.802757739 0.039153085 -0.047369677 0.584248166
[56] -0.185344065 0.952252886 0.830790547 -0.365199992 0.785431329
[61] -1.653914758 0.659532271 -0.204818580 -0.576356130 0.593689896
[66] -0.051905106 0.689249380 1.939796633 0.297972468 0.318438684
[71] -0.615247301 -0.553285889 0.455734643 -0.025690619 2.319228718
[76] -0.692827664 -0.402582362 0.072080484 1.392859614 -1.042673596
[81] 0.209976043 -0.165648356 -0.957649537 -0.426830242 -0.035160788
[86] 0.805795829 -1.207652518 -2.055285336 -0.604903009 -0.755227817
[91] -1.141234993 0.442034472 1.474696462 0.006583752 -0.385964238
[96] 1.132549757 0.467541626 -0.761344907 0.630087058 -0.273761566
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 0.226278643 -0.649516977 -1.217581218 -1.704845749 1.087091805
[6] 0.116560472 -0.653434292 0.906342276 0.260145581 0.019700201
[11] 1.191872534 -0.093555776 -0.919242515 -2.635739963 -1.694561689
[16] 0.956759842 -1.338903038 0.154226241 0.093556359 -0.510662448
[21] 0.964874823 1.500097275 0.264300917 -0.253108773 -0.778965550
[26] 0.985245359 -1.287379526 -1.142153618 -0.865064096 2.083724816
[31] -0.394892144 0.200423504 0.263157387 0.468018369 0.279357800
[36] 1.130487739 1.350388006 0.168821361 -0.783131597 2.048623080
[41] 0.435799484 0.684610012 -0.037389064 -0.620217954 1.028534644
[46] 0.580403622 -0.723768564 0.453951547 1.403330781 -0.242997368
[51] -1.138362839 0.802757739 0.039153085 -0.047369677 0.584248166
[56] -0.185344065 0.952252886 0.830790547 -0.365199992 0.785431329
[61] -1.653914758 0.659532271 -0.204818580 -0.576356130 0.593689896
[66] -0.051905106 0.689249380 1.939796633 0.297972468 0.318438684
[71] -0.615247301 -0.553285889 0.455734643 -0.025690619 2.319228718
[76] -0.692827664 -0.402582362 0.072080484 1.392859614 -1.042673596
[81] 0.209976043 -0.165648356 -0.957649537 -0.426830242 -0.035160788
[86] 0.805795829 -1.207652518 -2.055285336 -0.604903009 -0.755227817
[91] -1.141234993 0.442034472 1.474696462 0.006583752 -0.385964238
[96] 1.132549757 0.467541626 -0.761344907 0.630087058 -0.273761566
> colMin(tmp)
[1] 0.226278643 -0.649516977 -1.217581218 -1.704845749 1.087091805
[6] 0.116560472 -0.653434292 0.906342276 0.260145581 0.019700201
[11] 1.191872534 -0.093555776 -0.919242515 -2.635739963 -1.694561689
[16] 0.956759842 -1.338903038 0.154226241 0.093556359 -0.510662448
[21] 0.964874823 1.500097275 0.264300917 -0.253108773 -0.778965550
[26] 0.985245359 -1.287379526 -1.142153618 -0.865064096 2.083724816
[31] -0.394892144 0.200423504 0.263157387 0.468018369 0.279357800
[36] 1.130487739 1.350388006 0.168821361 -0.783131597 2.048623080
[41] 0.435799484 0.684610012 -0.037389064 -0.620217954 1.028534644
[46] 0.580403622 -0.723768564 0.453951547 1.403330781 -0.242997368
[51] -1.138362839 0.802757739 0.039153085 -0.047369677 0.584248166
[56] -0.185344065 0.952252886 0.830790547 -0.365199992 0.785431329
[61] -1.653914758 0.659532271 -0.204818580 -0.576356130 0.593689896
[66] -0.051905106 0.689249380 1.939796633 0.297972468 0.318438684
[71] -0.615247301 -0.553285889 0.455734643 -0.025690619 2.319228718
[76] -0.692827664 -0.402582362 0.072080484 1.392859614 -1.042673596
[81] 0.209976043 -0.165648356 -0.957649537 -0.426830242 -0.035160788
[86] 0.805795829 -1.207652518 -2.055285336 -0.604903009 -0.755227817
[91] -1.141234993 0.442034472 1.474696462 0.006583752 -0.385964238
[96] 1.132549757 0.467541626 -0.761344907 0.630087058 -0.273761566
> colMedians(tmp)
[1] 0.226278643 -0.649516977 -1.217581218 -1.704845749 1.087091805
[6] 0.116560472 -0.653434292 0.906342276 0.260145581 0.019700201
[11] 1.191872534 -0.093555776 -0.919242515 -2.635739963 -1.694561689
[16] 0.956759842 -1.338903038 0.154226241 0.093556359 -0.510662448
[21] 0.964874823 1.500097275 0.264300917 -0.253108773 -0.778965550
[26] 0.985245359 -1.287379526 -1.142153618 -0.865064096 2.083724816
[31] -0.394892144 0.200423504 0.263157387 0.468018369 0.279357800
[36] 1.130487739 1.350388006 0.168821361 -0.783131597 2.048623080
[41] 0.435799484 0.684610012 -0.037389064 -0.620217954 1.028534644
[46] 0.580403622 -0.723768564 0.453951547 1.403330781 -0.242997368
[51] -1.138362839 0.802757739 0.039153085 -0.047369677 0.584248166
[56] -0.185344065 0.952252886 0.830790547 -0.365199992 0.785431329
[61] -1.653914758 0.659532271 -0.204818580 -0.576356130 0.593689896
[66] -0.051905106 0.689249380 1.939796633 0.297972468 0.318438684
[71] -0.615247301 -0.553285889 0.455734643 -0.025690619 2.319228718
[76] -0.692827664 -0.402582362 0.072080484 1.392859614 -1.042673596
[81] 0.209976043 -0.165648356 -0.957649537 -0.426830242 -0.035160788
[86] 0.805795829 -1.207652518 -2.055285336 -0.604903009 -0.755227817
[91] -1.141234993 0.442034472 1.474696462 0.006583752 -0.385964238
[96] 1.132549757 0.467541626 -0.761344907 0.630087058 -0.273761566
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.2262786 -0.649517 -1.217581 -1.704846 1.087092 0.1165605 -0.6534343
[2,] 0.2262786 -0.649517 -1.217581 -1.704846 1.087092 0.1165605 -0.6534343
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.9063423 0.2601456 0.0197002 1.191873 -0.09355578 -0.9192425 -2.63574
[2,] 0.9063423 0.2601456 0.0197002 1.191873 -0.09355578 -0.9192425 -2.63574
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.694562 0.9567598 -1.338903 0.1542262 0.09355636 -0.5106624 0.9648748
[2,] -1.694562 0.9567598 -1.338903 0.1542262 0.09355636 -0.5106624 0.9648748
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.500097 0.2643009 -0.2531088 -0.7789656 0.9852454 -1.28738 -1.142154
[2,] 1.500097 0.2643009 -0.2531088 -0.7789656 0.9852454 -1.28738 -1.142154
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.8650641 2.083725 -0.3948921 0.2004235 0.2631574 0.4680184 0.2793578
[2,] -0.8650641 2.083725 -0.3948921 0.2004235 0.2631574 0.4680184 0.2793578
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.130488 1.350388 0.1688214 -0.7831316 2.048623 0.4357995 0.68461
[2,] 1.130488 1.350388 0.1688214 -0.7831316 2.048623 0.4357995 0.68461
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.03738906 -0.620218 1.028535 0.5804036 -0.7237686 0.4539515 1.403331
[2,] -0.03738906 -0.620218 1.028535 0.5804036 -0.7237686 0.4539515 1.403331
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.2429974 -1.138363 0.8027577 0.03915308 -0.04736968 0.5842482 -0.1853441
[2,] -0.2429974 -1.138363 0.8027577 0.03915308 -0.04736968 0.5842482 -0.1853441
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.9522529 0.8307905 -0.3652 0.7854313 -1.653915 0.6595323 -0.2048186
[2,] 0.9522529 0.8307905 -0.3652 0.7854313 -1.653915 0.6595323 -0.2048186
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.5763561 0.5936899 -0.05190511 0.6892494 1.939797 0.2979725 0.3184387
[2,] -0.5763561 0.5936899 -0.05190511 0.6892494 1.939797 0.2979725 0.3184387
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.6152473 -0.5532859 0.4557346 -0.02569062 2.319229 -0.6928277 -0.4025824
[2,] -0.6152473 -0.5532859 0.4557346 -0.02569062 2.319229 -0.6928277 -0.4025824
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.07208048 1.39286 -1.042674 0.209976 -0.1656484 -0.9576495 -0.4268302
[2,] 0.07208048 1.39286 -1.042674 0.209976 -0.1656484 -0.9576495 -0.4268302
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.03516079 0.8057958 -1.207653 -2.055285 -0.604903 -0.7552278 -1.141235
[2,] -0.03516079 0.8057958 -1.207653 -2.055285 -0.604903 -0.7552278 -1.141235
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.4420345 1.474696 0.006583752 -0.3859642 1.13255 0.4675416 -0.7613449
[2,] 0.4420345 1.474696 0.006583752 -0.3859642 1.13255 0.4675416 -0.7613449
[,99] [,100]
[1,] 0.6300871 -0.2737616
[2,] 0.6300871 -0.2737616
>
>
> Max(tmp2)
[1] 2.759997
> Min(tmp2)
[1] -1.98285
> mean(tmp2)
[1] 0.1497925
> Sum(tmp2)
[1] 14.97925
> Var(tmp2)
[1] 0.8400732
>
> rowMeans(tmp2)
[1] -0.074330422 1.637744766 0.957292830 -0.092173718 -0.291952610
[6] 0.839476988 -0.001410467 0.282852317 -0.408475205 0.138936584
[11] -1.208939389 -0.054986364 -0.132063973 0.413432803 0.375594777
[16] 1.049892242 1.460270981 -0.459090773 0.679720542 1.232817890
[21] -1.344776160 0.569865566 -0.391023122 0.559335949 -0.563935959
[26] 0.017761971 0.260488722 0.003401202 0.935406140 -1.099986264
[31] 1.032147316 -1.072698230 -1.297950695 1.321530638 2.285453147
[36] 1.230168336 -1.982849678 -0.363656648 2.759996627 -0.636423892
[41] 0.233228912 -0.618131403 -0.039855124 -0.097519234 0.850769412
[46] 0.969337213 1.412694710 0.827644573 -0.925267812 0.954973993
[51] 1.093400379 -0.941041063 1.329087929 0.335190332 -0.625327457
[56] 0.077872287 -1.452506345 0.055885116 0.137349025 0.444434356
[61] -0.888613739 -1.392268841 1.208071083 0.064947990 -0.592991273
[66] -0.269009270 -0.061509771 1.381499121 0.197405043 0.772225654
[71] 0.378203130 0.132123942 0.679319335 -0.266271289 -0.227314366
[76] 0.850935572 -1.163955792 -1.216764469 -0.568225377 0.977833784
[81] 0.300524760 0.655821579 0.167888154 -1.566285506 -1.499379197
[86] 0.072879722 -0.685830784 0.458077320 0.911470966 1.356639336
[91] 0.957952227 0.344436769 -0.234770747 0.354878099 2.344962397
[96] -1.027026525 0.365608803 0.244442659 0.061056783 -1.188821527
> rowSums(tmp2)
[1] -0.074330422 1.637744766 0.957292830 -0.092173718 -0.291952610
[6] 0.839476988 -0.001410467 0.282852317 -0.408475205 0.138936584
[11] -1.208939389 -0.054986364 -0.132063973 0.413432803 0.375594777
[16] 1.049892242 1.460270981 -0.459090773 0.679720542 1.232817890
[21] -1.344776160 0.569865566 -0.391023122 0.559335949 -0.563935959
[26] 0.017761971 0.260488722 0.003401202 0.935406140 -1.099986264
[31] 1.032147316 -1.072698230 -1.297950695 1.321530638 2.285453147
[36] 1.230168336 -1.982849678 -0.363656648 2.759996627 -0.636423892
[41] 0.233228912 -0.618131403 -0.039855124 -0.097519234 0.850769412
[46] 0.969337213 1.412694710 0.827644573 -0.925267812 0.954973993
[51] 1.093400379 -0.941041063 1.329087929 0.335190332 -0.625327457
[56] 0.077872287 -1.452506345 0.055885116 0.137349025 0.444434356
[61] -0.888613739 -1.392268841 1.208071083 0.064947990 -0.592991273
[66] -0.269009270 -0.061509771 1.381499121 0.197405043 0.772225654
[71] 0.378203130 0.132123942 0.679319335 -0.266271289 -0.227314366
[76] 0.850935572 -1.163955792 -1.216764469 -0.568225377 0.977833784
[81] 0.300524760 0.655821579 0.167888154 -1.566285506 -1.499379197
[86] 0.072879722 -0.685830784 0.458077320 0.911470966 1.356639336
[91] 0.957952227 0.344436769 -0.234770747 0.354878099 2.344962397
[96] -1.027026525 0.365608803 0.244442659 0.061056783 -1.188821527
> 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.074330422 1.637744766 0.957292830 -0.092173718 -0.291952610
[6] 0.839476988 -0.001410467 0.282852317 -0.408475205 0.138936584
[11] -1.208939389 -0.054986364 -0.132063973 0.413432803 0.375594777
[16] 1.049892242 1.460270981 -0.459090773 0.679720542 1.232817890
[21] -1.344776160 0.569865566 -0.391023122 0.559335949 -0.563935959
[26] 0.017761971 0.260488722 0.003401202 0.935406140 -1.099986264
[31] 1.032147316 -1.072698230 -1.297950695 1.321530638 2.285453147
[36] 1.230168336 -1.982849678 -0.363656648 2.759996627 -0.636423892
[41] 0.233228912 -0.618131403 -0.039855124 -0.097519234 0.850769412
[46] 0.969337213 1.412694710 0.827644573 -0.925267812 0.954973993
[51] 1.093400379 -0.941041063 1.329087929 0.335190332 -0.625327457
[56] 0.077872287 -1.452506345 0.055885116 0.137349025 0.444434356
[61] -0.888613739 -1.392268841 1.208071083 0.064947990 -0.592991273
[66] -0.269009270 -0.061509771 1.381499121 0.197405043 0.772225654
[71] 0.378203130 0.132123942 0.679319335 -0.266271289 -0.227314366
[76] 0.850935572 -1.163955792 -1.216764469 -0.568225377 0.977833784
[81] 0.300524760 0.655821579 0.167888154 -1.566285506 -1.499379197
[86] 0.072879722 -0.685830784 0.458077320 0.911470966 1.356639336
[91] 0.957952227 0.344436769 -0.234770747 0.354878099 2.344962397
[96] -1.027026525 0.365608803 0.244442659 0.061056783 -1.188821527
> rowMin(tmp2)
[1] -0.074330422 1.637744766 0.957292830 -0.092173718 -0.291952610
[6] 0.839476988 -0.001410467 0.282852317 -0.408475205 0.138936584
[11] -1.208939389 -0.054986364 -0.132063973 0.413432803 0.375594777
[16] 1.049892242 1.460270981 -0.459090773 0.679720542 1.232817890
[21] -1.344776160 0.569865566 -0.391023122 0.559335949 -0.563935959
[26] 0.017761971 0.260488722 0.003401202 0.935406140 -1.099986264
[31] 1.032147316 -1.072698230 -1.297950695 1.321530638 2.285453147
[36] 1.230168336 -1.982849678 -0.363656648 2.759996627 -0.636423892
[41] 0.233228912 -0.618131403 -0.039855124 -0.097519234 0.850769412
[46] 0.969337213 1.412694710 0.827644573 -0.925267812 0.954973993
[51] 1.093400379 -0.941041063 1.329087929 0.335190332 -0.625327457
[56] 0.077872287 -1.452506345 0.055885116 0.137349025 0.444434356
[61] -0.888613739 -1.392268841 1.208071083 0.064947990 -0.592991273
[66] -0.269009270 -0.061509771 1.381499121 0.197405043 0.772225654
[71] 0.378203130 0.132123942 0.679319335 -0.266271289 -0.227314366
[76] 0.850935572 -1.163955792 -1.216764469 -0.568225377 0.977833784
[81] 0.300524760 0.655821579 0.167888154 -1.566285506 -1.499379197
[86] 0.072879722 -0.685830784 0.458077320 0.911470966 1.356639336
[91] 0.957952227 0.344436769 -0.234770747 0.354878099 2.344962397
[96] -1.027026525 0.365608803 0.244442659 0.061056783 -1.188821527
>
> colMeans(tmp2)
[1] 0.1497925
> colSums(tmp2)
[1] 14.97925
> colVars(tmp2)
[1] 0.8400732
> colSd(tmp2)
[1] 0.9165551
> colMax(tmp2)
[1] 2.759997
> colMin(tmp2)
[1] -1.98285
> colMedians(tmp2)
[1] 0.1381428
> colRanges(tmp2)
[,1]
[1,] -1.982850
[2,] 2.759997
>
> 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.41212909 -7.24730126 -7.65082976 -2.07082453 -3.48432117 1.52392798
[7] 2.34671170 -5.79131784 -0.73416182 0.09301787
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8346177
[2,] -0.9588398
[3,] 0.3010674
[4,] 0.6621672
[5,] 1.0339673
>
> rowApply(tmp,sum)
[1] -1.1024063 1.6769823 0.4483027 -7.9883564 -1.9103233 -6.1296068
[7] -2.1313019 -1.6121452 -1.6751461 -4.0032269
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 1 4 10 6 9 1 8 10 10
[2,] 3 3 2 6 5 5 8 4 1 3
[3,] 4 2 10 1 3 1 5 9 3 1
[4,] 5 9 6 9 4 8 2 1 4 9
[5,] 1 5 1 8 1 7 10 6 7 6
[6,] 10 6 9 5 7 10 7 3 6 5
[7,] 9 10 8 4 8 6 6 5 8 7
[8,] 6 7 3 2 2 3 4 7 2 2
[9,] 7 4 5 7 9 2 3 10 9 8
[10,] 8 8 7 3 10 4 9 2 5 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.50435563 1.65691784 -1.75765039 0.49943549 1.37692365 2.35387572
[7] -3.32817642 -1.03932661 2.62300636 2.31688898 0.73348968 4.48528058
[13] 0.04234548 -0.04240615 -2.45140569 -0.08795303 4.44188578 -1.60817317
[19] 2.41370106 0.70910323
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6067735
[2,] -1.2757589
[3,] -0.5679165
[4,] 0.8788837
[5,] 1.0672096
>
> rowApply(tmp,sum)
[1] -2.1695128 -0.2412577 6.9817582 0.8310306 6.4313884
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 18 3 5 1 16
[2,] 20 5 11 15 2
[3,] 2 9 4 10 13
[4,] 1 12 15 17 6
[5,] 5 15 7 14 14
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.0672096 2.3945404 -1.1954470 -1.4095108 -0.6974399 0.01274918
[2,] -1.6067735 -0.7599656 0.1087298 0.2001670 1.0258318 1.58005203
[3,] -0.5679165 0.4060671 -1.1070992 1.2495116 -0.1579707 -0.29418728
[4,] -1.2757589 0.5580313 -0.1640141 0.6979895 0.5256343 0.64677531
[5,] 0.8788837 -0.9417555 0.6001801 -0.2387219 0.6808682 0.40848647
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.1792668 -0.9097240 0.05063476 -0.7929332 -0.6795148 1.56771678
[2,] -0.9462732 -0.4662331 -0.31107512 1.0497248 1.1989007 0.42705029
[3,] -1.3246307 1.5441209 1.18917515 1.6372958 1.1775583 2.98960611
[4,] -0.6941075 -0.5187543 -0.09015252 -0.1753053 -0.2645679 -0.40235128
[5,] -0.5424318 -0.6887361 1.78442411 0.5981069 -0.6988866 -0.09674131
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.5725858 -0.31969100 -0.5442609 -0.10091671 0.8375090 -0.2772804
[2,] -2.9003177 -0.65021246 1.6018895 0.19070324 1.8643891 0.1249581
[3,] 1.5732666 0.08588114 -2.0599506 0.05181633 0.9502521 -2.0153818
[4,] 0.9227695 0.72989624 -0.3164344 -0.27491813 0.3771303 -0.5044910
[5,] 1.0192129 0.11171994 -1.1326492 0.04536223 0.4126053 1.0640219
[,19] [,20]
[1,] -0.1600943 -0.61974050
[2,] -2.3584308 0.38562724
[3,] 1.3548373 0.29950661
[4,] 1.1273978 -0.07373822
[5,] 2.4499910 0.71744810
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.1266733 -0.7467048 0.3441056 -0.8867178 -0.7203273 1.773038 -1.981471
col8 col9 col10 col11 col12 col13 col14
row1 0.1128624 -1.222735 0.02464067 -0.3231527 -2.056669 1.091861 1.322577
col15 col16 col17 col18 col19 col20
row1 0.3490559 0.4688994 -0.2838397 0.2502464 0.8768612 -0.4903354
> tmp[,"col10"]
col10
row1 0.02464067
row2 1.17363233
row3 0.53124302
row4 -0.81642182
row5 -0.03558125
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.1266733 -0.7467048 0.3441056 -0.8867178 -0.7203273 1.7730380
row5 -0.7199711 -0.1833862 -0.1531869 0.2819413 0.6863069 0.8192453
col7 col8 col9 col10 col11 col12 col13
row1 -1.9814715 0.1128624 -1.222735 0.02464067 -0.3231527 -2.0566685 1.091861
row5 0.4250449 0.8046766 1.427328 -0.03558125 -0.4356387 0.6735768 2.240834
col14 col15 col16 col17 col18 col19
row1 1.322577 0.3490559 0.4688994 -0.2838397 0.2502464 0.87686117
row5 -1.021621 -0.1930995 1.2071349 -1.0223543 -1.0847846 -0.07717016
col20
row1 -0.4903354
row5 0.2085549
> tmp[,c("col6","col20")]
col6 col20
row1 1.7730380 -0.4903354
row2 0.4687269 0.9487346
row3 -0.8802022 0.7075880
row4 0.3835123 0.5587317
row5 0.8192453 0.2085549
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.7730380 -0.4903354
row5 0.8192453 0.2085549
>
>
>
>
> 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.0504 49.99574 49.72179 49.25599 50.64688 103.8104 50.209 50.35321
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.55175 52.62156 50.31075 49.02006 50.59931 51.08992 50.01478 49.50229
col17 col18 col19 col20
row1 51.44339 50.4915 50.15892 105.2563
> tmp[,"col10"]
col10
row1 52.62156
row2 31.14771
row3 30.26649
row4 29.11455
row5 49.57497
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.05040 49.99574 49.72179 49.25599 50.64688 103.8104 50.20900 50.35321
row5 50.59821 49.76781 50.24012 52.41330 49.55117 101.8495 49.46305 51.63274
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.55175 52.62156 50.31075 49.02006 50.59931 51.08992 50.01478 49.50229
row5 49.86269 49.57497 49.30782 48.97834 51.43351 50.42814 50.73224 52.21832
col17 col18 col19 col20
row1 51.44339 50.49150 50.15892 105.2563
row5 49.38972 49.12077 47.51727 107.8521
> tmp[,c("col6","col20")]
col6 col20
row1 103.81043 105.25627
row2 75.63053 75.15246
row3 76.33110 73.61430
row4 76.69463 74.56109
row5 101.84945 107.85209
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.8104 105.2563
row5 101.8495 107.8521
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.8104 105.2563
row5 101.8495 107.8521
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.2136632
[2,] 0.6477889
[3,] -1.2513018
[4,] 0.1027242
[5,] 0.7736911
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.7028868 -0.2154923
[2,] -0.1558220 1.5005132
[3,] -1.1992245 1.5948660
[4,] 1.5018599 0.3159413
[5,] -0.2942697 -0.4403461
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -2.0172866 0.2251031
[2,] -0.4176930 -1.3012865
[3,] -0.3500431 -0.8567800
[4,] 2.2891558 -0.2966718
[5,] 0.1678791 0.4593943
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -2.017287
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -2.017287
[2,] -0.417693
>
>
>
> 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.03106824 0.4385907 -1.0717168 -0.6311945 0.252207 1.5470151 0.8005121
row1 -0.59638666 0.4092002 0.7039068 -0.4448053 1.053728 0.1367956 -0.1918036
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.2006947 1.1129734 1.056355 1.91381616 -1.364521 0.9821174 -1.1419826
row1 -0.4261791 0.2487247 -0.347771 0.01039244 1.125556 -0.2999519 -0.8914084
[,15] [,16] [,17] [,18] [,19] [,20]
row3 2.1581393 0.6746575 -0.9249799 -1.462316 0.6404812 1.4089026
row1 -0.6144233 0.2703108 -0.4680442 -1.826080 -0.3779955 0.4484082
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.1837191 1.844763 -0.967467 -0.7013472 -0.1054006 0.394403 -1.148144
[,8] [,9] [,10]
row2 -0.3138054 -1.467258 -1.732631
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.02816922 -0.8949176 -0.6204921 -0.6619225 -1.656532 0.5112456 -0.301338
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.716494 0.7270032 -1.08957 0.2166791 -1.160662 -0.7343664 -0.1138062
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.372802 -0.06939111 -0.7478341 1.367225 1.06791 -0.4085051
>
>
> 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: 0x610413e664f0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c37cf984e8"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c3193f7f65"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c34c88a0c6"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c3747f27f0"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c341787338"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c342671f5f"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c32c5c8e90"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c32a0ffef4"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c355e7dd47"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c335781eba"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c369da698a"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c31815771"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c365576e1c"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c346d85290"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM32f7c33307f1a1"
>
>
> ### 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: 0x610413f3be90>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x610413f3be90>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x610413f3be90>
> rowMedians(tmp)
[1] -0.173684277 -0.233591309 0.120809201 0.586672922 0.331406592
[6] -0.509080928 -0.015973834 -0.367552023 -0.072590349 0.188096331
[11] -0.081736382 0.006997577 0.143855483 0.041225790 -0.856438538
[16] 0.308692818 0.017816546 0.474305292 -0.259136081 0.283161139
[21] 0.156290538 -0.182121279 0.155156303 0.040174199 -0.103497793
[26] 0.293635661 0.190616153 0.455258695 1.326651458 -0.489666688
[31] -0.256764436 -0.281808355 -0.130253397 -0.242869190 0.160511514
[36] -0.163926218 0.323670818 0.120891871 -0.192392167 -0.144494824
[41] -0.285551175 -0.052190537 -0.293974366 -0.164504817 0.413324730
[46] -0.276605791 0.066511926 0.291658735 0.078394988 0.039839133
[51] 0.020621113 0.180331464 -0.166327326 -0.128766879 -0.411724434
[56] 0.330963795 0.397835218 -0.130024333 0.092159591 0.102411161
[61] -0.582087871 -0.220048996 0.056275423 -0.143130888 0.138234710
[66] -0.876112915 0.451613342 0.526185090 0.224609455 -0.339215405
[71] -0.211870952 -0.165134530 0.227290776 -0.851386430 0.196907458
[76] 0.404722232 0.079103381 -0.239820259 -0.296380954 -0.489622361
[81] 0.032572546 -0.438498183 0.335120130 -0.103452489 0.122803606
[86] 0.725744305 -0.364847453 0.084812899 0.334147616 -0.521435598
[91] -0.436101118 -0.356515351 -0.113252311 0.009177101 0.359564877
[96] -0.465575273 0.083716846 -0.435324885 0.393670485 -0.331012387
[101] 0.510716009 0.052504542 -0.089695799 -0.182809090 0.016714426
[106] 0.127822432 -0.195933493 0.129931440 0.081728378 -0.114029435
[111] -0.701599822 -0.269665031 -0.327887660 -0.686809061 -0.311916839
[116] -0.231670751 0.257551846 -0.041346201 -0.409511811 0.697289799
[121] 0.311055021 -0.387756871 -0.145451406 0.066482068 0.591372368
[126] 0.139264480 -0.613046091 -0.010155240 -0.036709502 0.169234236
[131] -0.105634718 -0.293766517 -0.580026678 -0.328819214 0.510840966
[136] 0.409767439 0.121365737 -0.004348082 -0.081953784 -0.059704251
[141] -0.561294258 -0.462858455 -0.585066465 0.332059302 -0.236916635
[146] 0.679748164 0.030503889 -0.302660698 -0.065102693 -0.432675544
[151] 0.523612328 -0.459794517 -0.064905650 0.418109850 0.199224314
[156] -0.067194033 -0.078921043 -0.360563906 -0.200431721 0.359080616
[161] -0.136449604 -0.012503467 -0.272796234 -0.192711354 -0.779778279
[166] 0.096636915 -0.377603086 -0.292974537 -0.430616868 0.480749568
[171] 0.406330209 0.195539300 0.292633063 -0.307443273 -0.509072347
[176] -0.378103850 0.054722686 -0.440030388 0.271176976 -0.350555962
[181] -0.037928047 -0.480108819 -0.043001524 0.052286286 0.082226562
[186] -0.239505299 -0.515898718 -0.124902812 -0.486266182 -0.204482477
[191] -0.209113350 -0.703604127 0.093618195 -0.642363095 0.658259075
[196] -0.339771193 -0.221555163 -0.580677515 0.075712859 -0.018922714
[201] 0.353087335 -0.186078858 -0.433955362 0.324585384 0.155246814
[206] 0.046787220 0.215095269 -0.062142772 0.490722594 -0.318432268
[211] -0.335355518 -0.247754142 -0.019716797 0.366226753 -0.240252962
[216] 0.449397358 -0.102929661 -0.442280490 0.162327946 0.346503654
[221] 0.167968618 -0.301905391 -0.168009326 0.380150929 -0.000962805
[226] 0.143712895 -0.551604760 0.090305702 -0.019292680 0.104146194
>
> proc.time()
user system elapsed
1.329 1.413 2.730
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x59cd50c26b20>
> .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: 0x59cd50c26b20>
> .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: 0x59cd50c26b20>
> .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: 0x59cd50c26b20>
> 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: 0x59cd50c07410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd50c07410>
> .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: 0x59cd50c07410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd50c07410>
> .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: 0x59cd50c07410>
> 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: 0x59cd4f4b47a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd4f4b47a0>
> .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: 0x59cd4f4b47a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59cd4f4b47a0>
> .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: 0x59cd4f4b47a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x59cd4f4b47a0>
> .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: 0x59cd4f4b47a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x59cd4f4b47a0>
> .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: 0x59cd4f4b47a0>
> 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: 0x59cd50486680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x59cd50486680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd50486680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd50486680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32faf0590c6f13" "BufferedMatrixFile32faf0f0e5874"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32faf0590c6f13" "BufferedMatrixFile32faf0f0e5874"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd5021a490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd5021a490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59cd5021a490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59cd5021a490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x59cd5021a490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x59cd5021a490>
> .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: 0x59cd51876110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59cd51876110>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59cd51876110>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x59cd51876110>
> 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: 0x59cd519195e0>
> .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: 0x59cd519195e0>
> rm(P)
>
> proc.time()
user system elapsed
0.245 0.047 0.281
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.255 0.048 0.290