| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-08 12:00 -0500 (Mon, 08 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" | 4879 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4668 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4669 |
| 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 | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | 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-04 21:54:14 -0500 (Thu, 04 Dec 2025) |
| EndedAt: 2025-12-04 21:54:38 -0500 (Thu, 04 Dec 2025) |
| EllapsedTime: 24.2 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.279 0.040 0.308
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 4 21:54:30 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 4 21:54:30 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: 0x560afb2471c0>
>
>
>
> 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 4 21:54:30 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 4 21:54:30 2025"
>
> ColMode(tmp2)
<pointer: 0x560afb2471c0>
>
>
>
> ### 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.7580749 0.1037873 0.4937418 -0.3287408
[2,] 1.6398351 -1.6628034 1.0725131 -0.4826953
[3,] 0.2414085 -0.8028145 -0.9037628 -0.2748471
[4,] 0.4624862 -1.3648724 -1.5191687 1.5771984
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.7580749 0.1037873 0.4937418 0.3287408
[2,] 1.6398351 1.6628034 1.0725131 0.4826953
[3,] 0.2414085 0.8028145 0.9037628 0.2748471
[4,] 0.4624862 1.3648724 1.5191687 1.5771984
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9878964 0.3221604 0.7026676 0.5733592
[2,] 1.2805605 1.2894973 1.0356221 0.6947628
[3,] 0.4913334 0.8959991 0.9506644 0.5242587
[4,] 0.6800633 1.1682775 1.2325456 1.2558656
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.63704 28.32539 32.52042 31.06233
[2,] 39.44544 39.55778 36.42873 32.43032
[3,] 30.15474 34.76281 35.41041 30.51743
[4,] 32.26312 38.04765 38.84462 39.13585
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x560afbe4d8b0>
> exp(tmp5)
<pointer: 0x560afbe4d8b0>
> log(tmp5,2)
<pointer: 0x560afbe4d8b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5526
> Min(tmp5)
[1] 52.92797
> mean(tmp5)
[1] 72.4277
> Sum(tmp5)
[1] 14485.54
> Var(tmp5)
[1] 859.6362
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.90583 73.01785 70.41104 71.30182 68.53536 68.61767 70.88835 69.93337
[9] 71.78387 69.88185
> rowSums(tmp5)
[1] 1798.117 1460.357 1408.221 1426.036 1370.707 1372.353 1417.767 1398.667
[9] 1435.677 1397.637
> rowVars(tmp5)
[1] 7957.76387 67.94313 80.81256 62.56943 62.70089 75.73788
[7] 93.15081 99.54572 75.31098 52.94734
> rowSd(tmp5)
[1] 89.206300 8.242762 8.989581 7.910084 7.918389 8.702751 9.651467
[8] 9.977260 8.678190 7.276493
> rowMax(tmp5)
[1] 467.55257 84.70880 86.56053 84.96293 86.97262 87.12044 89.17748
[8] 87.46919 85.88818 85.64445
> rowMin(tmp5)
[1] 57.95382 56.45742 58.21160 59.58865 57.58475 54.13617 54.13757 52.92797
[9] 60.89377 54.67909
>
> colMeans(tmp5)
[1] 109.41708 68.42145 75.23395 71.17282 70.07126 66.56136 68.34275
[8] 67.75034 71.20156 69.03980 69.50395 69.34943 68.57790 71.81317
[15] 67.80301 71.49806 70.45559 75.82090 72.76018 73.75948
> colSums(tmp5)
[1] 1094.1708 684.2145 752.3395 711.7282 700.7126 665.6136 683.4275
[8] 677.5034 712.0156 690.3980 695.0395 693.4943 685.7790 718.1317
[15] 678.0301 714.9806 704.5559 758.2090 727.6018 737.5948
> colVars(tmp5)
[1] 15875.80453 93.19865 55.03165 95.93839 59.77926 97.10688
[7] 79.26937 41.91715 56.64776 64.04151 54.84212 128.51542
[13] 85.97454 66.92653 50.23528 112.39973 52.48565 44.20509
[19] 102.08824 60.00585
> colSd(tmp5)
[1] 125.999224 9.653945 7.418332 9.794814 7.731705 9.854282
[7] 8.903335 6.474345 7.526470 8.002594 7.405547 11.336464
[13] 9.272246 8.180864 7.087685 10.601874 7.244698 6.648691
[19] 10.103873 7.746344
> colMax(tmp5)
[1] 467.55257 82.33433 89.17748 86.97262 86.13482 84.96293 87.12044
[8] 79.71074 84.16590 85.12942 80.08561 87.89694 84.04373 87.46919
[15] 85.88818 85.46292 78.79905 85.64445 85.48394 84.70880
> colMin(tmp5)
[1] 59.37980 54.13757 63.84282 62.08386 60.92603 52.92797 57.58475 58.76646
[9] 62.08371 58.05530 57.95382 56.02499 56.45742 60.45225 62.40840 54.13617
[17] 58.43800 65.34119 54.67909 59.58865
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 89.90583 73.01785 70.41104 71.30182 68.53536 68.61767 70.88835 69.93337
[9] NA 69.88185
> rowSums(tmp5)
[1] 1798.117 1460.357 1408.221 1426.036 1370.707 1372.353 1417.767 1398.667
[9] NA 1397.637
> rowVars(tmp5)
[1] 7957.76387 67.94313 80.81256 62.56943 62.70089 75.73788
[7] 93.15081 99.54572 79.26037 52.94734
> rowSd(tmp5)
[1] 89.206300 8.242762 8.989581 7.910084 7.918389 8.702751 9.651467
[8] 9.977260 8.902829 7.276493
> rowMax(tmp5)
[1] 467.55257 84.70880 86.56053 84.96293 86.97262 87.12044 89.17748
[8] 87.46919 NA 85.64445
> rowMin(tmp5)
[1] 57.95382 56.45742 58.21160 59.58865 57.58475 54.13617 54.13757 52.92797
[9] NA 54.67909
>
> colMeans(tmp5)
[1] NA 68.42145 75.23395 71.17282 70.07126 66.56136 68.34275 67.75034
[9] 71.20156 69.03980 69.50395 69.34943 68.57790 71.81317 67.80301 71.49806
[17] 70.45559 75.82090 72.76018 73.75948
> colSums(tmp5)
[1] NA 684.2145 752.3395 711.7282 700.7126 665.6136 683.4275 677.5034
[9] 712.0156 690.3980 695.0395 693.4943 685.7790 718.1317 678.0301 714.9806
[17] 704.5559 758.2090 727.6018 737.5948
> colVars(tmp5)
[1] NA 93.19865 55.03165 95.93839 59.77926 97.10688 79.26937
[8] 41.91715 56.64776 64.04151 54.84212 128.51542 85.97454 66.92653
[15] 50.23528 112.39973 52.48565 44.20509 102.08824 60.00585
> colSd(tmp5)
[1] NA 9.653945 7.418332 9.794814 7.731705 9.854282 8.903335
[8] 6.474345 7.526470 8.002594 7.405547 11.336464 9.272246 8.180864
[15] 7.087685 10.601874 7.244698 6.648691 10.103873 7.746344
> colMax(tmp5)
[1] NA 82.33433 89.17748 86.97262 86.13482 84.96293 87.12044 79.71074
[9] 84.16590 85.12942 80.08561 87.89694 84.04373 87.46919 85.88818 85.46292
[17] 78.79905 85.64445 85.48394 84.70880
> colMin(tmp5)
[1] NA 54.13757 63.84282 62.08386 60.92603 52.92797 57.58475 58.76646
[9] 62.08371 58.05530 57.95382 56.02499 56.45742 60.45225 62.40840 54.13617
[17] 58.43800 65.34119 54.67909 59.58865
>
> Max(tmp5,na.rm=TRUE)
[1] 467.5526
> Min(tmp5,na.rm=TRUE)
[1] 52.92797
> mean(tmp5,na.rm=TRUE)
[1] 72.42087
> Sum(tmp5,na.rm=TRUE)
[1] 14411.75
> Var(tmp5,na.rm=TRUE)
[1] 863.9684
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.90583 73.01785 70.41104 71.30182 68.53536 68.61767 70.88835 69.93337
[9] 71.67846 69.88185
> rowSums(tmp5,na.rm=TRUE)
[1] 1798.117 1460.357 1408.221 1426.036 1370.707 1372.353 1417.767 1398.667
[9] 1361.891 1397.637
> rowVars(tmp5,na.rm=TRUE)
[1] 7957.76387 67.94313 80.81256 62.56943 62.70089 75.73788
[7] 93.15081 99.54572 79.26037 52.94734
> rowSd(tmp5,na.rm=TRUE)
[1] 89.206300 8.242762 8.989581 7.910084 7.918389 8.702751 9.651467
[8] 9.977260 8.902829 7.276493
> rowMax(tmp5,na.rm=TRUE)
[1] 467.55257 84.70880 86.56053 84.96293 86.97262 87.12044 89.17748
[8] 87.46919 85.88818 85.64445
> rowMin(tmp5,na.rm=TRUE)
[1] 57.95382 56.45742 58.21160 59.58865 57.58475 54.13617 54.13757 52.92797
[9] 60.89377 54.67909
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.37602 68.42145 75.23395 71.17282 70.07126 66.56136 68.34275
[8] 67.75034 71.20156 69.03980 69.50395 69.34943 68.57790 71.81317
[15] 67.80301 71.49806 70.45559 75.82090 72.76018 73.75948
> colSums(tmp5,na.rm=TRUE)
[1] 1020.3842 684.2145 752.3395 711.7282 700.7126 665.6136 683.4275
[8] 677.5034 712.0156 690.3980 695.0395 693.4943 685.7790 718.1317
[15] 678.0301 714.9806 704.5559 758.2090 727.6018 737.5948
> colVars(tmp5,na.rm=TRUE)
[1] 17683.95628 93.19865 55.03165 95.93839 59.77926 97.10688
[7] 79.26937 41.91715 56.64776 64.04151 54.84212 128.51542
[13] 85.97454 66.92653 50.23528 112.39973 52.48565 44.20509
[19] 102.08824 60.00585
> colSd(tmp5,na.rm=TRUE)
[1] 132.981037 9.653945 7.418332 9.794814 7.731705 9.854282
[7] 8.903335 6.474345 7.526470 8.002594 7.405547 11.336464
[13] 9.272246 8.180864 7.087685 10.601874 7.244698 6.648691
[19] 10.103873 7.746344
> colMax(tmp5,na.rm=TRUE)
[1] 467.55257 82.33433 89.17748 86.97262 86.13482 84.96293 87.12044
[8] 79.71074 84.16590 85.12942 80.08561 87.89694 84.04373 87.46919
[15] 85.88818 85.46292 78.79905 85.64445 85.48394 84.70880
> colMin(tmp5,na.rm=TRUE)
[1] 59.37980 54.13757 63.84282 62.08386 60.92603 52.92797 57.58475 58.76646
[9] 62.08371 58.05530 57.95382 56.02499 56.45742 60.45225 62.40840 54.13617
[17] 58.43800 65.34119 54.67909 59.58865
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.90583 73.01785 70.41104 71.30182 68.53536 68.61767 70.88835 69.93337
[9] NaN 69.88185
> rowSums(tmp5,na.rm=TRUE)
[1] 1798.117 1460.357 1408.221 1426.036 1370.707 1372.353 1417.767 1398.667
[9] 0.000 1397.637
> rowVars(tmp5,na.rm=TRUE)
[1] 7957.76387 67.94313 80.81256 62.56943 62.70089 75.73788
[7] 93.15081 99.54572 NA 52.94734
> rowSd(tmp5,na.rm=TRUE)
[1] 89.206300 8.242762 8.989581 7.910084 7.918389 8.702751 9.651467
[8] 9.977260 NA 7.276493
> rowMax(tmp5,na.rm=TRUE)
[1] 467.55257 84.70880 86.56053 84.96293 86.97262 87.12044 89.17748
[8] 87.46919 NA 85.64445
> rowMin(tmp5,na.rm=TRUE)
[1] 57.95382 56.45742 58.21160 59.58865 57.58475 54.13617 54.13757 52.92797
[9] NA 54.67909
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] NaN 69.01952 74.98490 72.16256 70.29027 67.19110 68.62195 68.34322
[9] 70.95365 69.92836 70.26995 70.00906 67.23769 71.78471 65.79354 70.37059
[17] 69.52854 74.79279 72.29132 73.03506
> colSums(tmp5,na.rm=TRUE)
[1] 0.0000 621.1756 674.8641 649.4630 632.6124 604.7199 617.5975 615.0890
[9] 638.5828 629.3553 632.4295 630.0815 605.1392 646.0624 592.1419 633.3353
[17] 625.7568 673.1351 650.6219 657.3156
> colVars(tmp5,na.rm=TRUE)
[1] NA 100.82457 61.21276 96.91052 66.71204 104.78390 88.30109
[8] 43.20224 63.03730 63.16436 55.09649 139.68480 76.51462 75.28324
[15] 11.08779 112.14880 49.37783 37.83923 112.37626 61.60276
> colSd(tmp5,na.rm=TRUE)
[1] NA 10.041144 7.823858 9.844314 8.167744 10.236401 9.396866
[8] 6.572841 7.939603 7.947601 7.422701 11.818832 8.747264 8.676591
[15] 3.329834 10.590033 7.026936 6.151360 10.600767 7.848742
> colMax(tmp5,na.rm=TRUE)
[1] -Inf 82.33433 89.17748 86.97262 86.13482 84.96293 87.12044 79.71074
[9] 84.16590 85.12942 80.08561 87.89694 84.04373 87.46919 71.58991 85.46292
[17] 78.18503 85.64445 85.48394 84.70880
> colMin(tmp5,na.rm=TRUE)
[1] Inf 54.13757 63.84282 62.08386 60.92603 52.92797 57.58475 58.76646
[9] 62.08371 58.05530 57.95382 56.02499 56.45742 60.45225 62.40840 54.13617
[17] 58.43800 65.34119 54.67909 59.58865
>
>
>
>
> 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] 251.4718 204.4584 265.7333 171.0526 258.7153 206.4239 234.9673 165.7165
[9] 214.0512 156.0340
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 251.4718 204.4584 265.7333 171.0526 258.7153 206.4239 234.9673 165.7165
[9] 214.0512 156.0340
>
>
>
> 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] 8.526513e-14 -8.526513e-14 0.000000e+00 -5.684342e-14 1.421085e-13
[6] -1.136868e-13 -8.526513e-14 -1.705303e-13 -2.842171e-14 -1.136868e-13
[11] 2.842171e-14 1.136868e-13 5.684342e-14 -2.273737e-13 0.000000e+00
[16] -5.684342e-14 -8.526513e-14 -2.842171e-14 0.000000e+00 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 9
6 14
2 8
3 9
4 2
2 19
1 7
6 20
7 13
8 5
9 20
8 20
2 14
3 12
8 7
4 10
3 4
7 4
4 11
4 9
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.436377
> Min(tmp)
[1] -2.58406
> mean(tmp)
[1] 0.1151608
> Sum(tmp)
[1] 11.51608
> Var(tmp)
[1] 1.08412
>
> rowMeans(tmp)
[1] 0.1151608
> rowSums(tmp)
[1] 11.51608
> rowVars(tmp)
[1] 1.08412
> rowSd(tmp)
[1] 1.041211
> rowMax(tmp)
[1] 2.436377
> rowMin(tmp)
[1] -2.58406
>
> colMeans(tmp)
[1] 0.876108390 0.346565949 1.358870630 1.648881988 -1.812098091
[6] 0.734970897 0.621682006 0.170234410 -0.320866510 -0.386027852
[11] 1.242789269 -0.175932268 -1.747737216 -1.444705625 0.161037698
[16] 0.162783955 -0.840187275 1.271352637 -1.306666806 0.232537231
[21] 0.533825173 0.099685321 -0.895544174 0.100798105 -0.606348029
[26] -0.760531247 -0.968168291 -0.819199379 0.028601219 0.007115041
[31] -0.307171989 0.674151810 1.202988156 -0.377540881 -0.095103392
[36] -1.790631754 -0.804306740 0.803052321 -0.692320555 2.418334994
[41] -0.431330421 0.181114692 0.314909326 -0.816292994 -0.524153109
[46] 0.326846074 -0.195305845 0.127975348 1.427827033 0.640413568
[51] 0.662678591 1.937049180 0.899173144 0.100115517 0.307851949
[56] -1.294324718 -2.262082300 2.412544945 1.694322409 -0.569786309
[61] -0.576408907 0.190870320 0.262034218 -0.778622394 -0.483351007
[66] 0.904331208 0.655159014 2.436377011 0.675196053 0.979023526
[71] -0.351845420 1.289906509 1.522050603 -0.658644913 2.069921138
[76] -1.023909583 -0.264408660 1.116772409 1.070622717 0.701869284
[81] -0.547585101 -1.014377831 1.221485347 -1.184988619 0.904510058
[86] 1.056160651 1.427717290 -1.110195846 -0.808756698 -2.584059666
[91] -0.470276350 0.746770379 0.545224845 -0.744015641 0.849381220
[96] -0.848046005 0.068594402 -0.999513945 0.084869626 1.701416751
> colSums(tmp)
[1] 0.876108390 0.346565949 1.358870630 1.648881988 -1.812098091
[6] 0.734970897 0.621682006 0.170234410 -0.320866510 -0.386027852
[11] 1.242789269 -0.175932268 -1.747737216 -1.444705625 0.161037698
[16] 0.162783955 -0.840187275 1.271352637 -1.306666806 0.232537231
[21] 0.533825173 0.099685321 -0.895544174 0.100798105 -0.606348029
[26] -0.760531247 -0.968168291 -0.819199379 0.028601219 0.007115041
[31] -0.307171989 0.674151810 1.202988156 -0.377540881 -0.095103392
[36] -1.790631754 -0.804306740 0.803052321 -0.692320555 2.418334994
[41] -0.431330421 0.181114692 0.314909326 -0.816292994 -0.524153109
[46] 0.326846074 -0.195305845 0.127975348 1.427827033 0.640413568
[51] 0.662678591 1.937049180 0.899173144 0.100115517 0.307851949
[56] -1.294324718 -2.262082300 2.412544945 1.694322409 -0.569786309
[61] -0.576408907 0.190870320 0.262034218 -0.778622394 -0.483351007
[66] 0.904331208 0.655159014 2.436377011 0.675196053 0.979023526
[71] -0.351845420 1.289906509 1.522050603 -0.658644913 2.069921138
[76] -1.023909583 -0.264408660 1.116772409 1.070622717 0.701869284
[81] -0.547585101 -1.014377831 1.221485347 -1.184988619 0.904510058
[86] 1.056160651 1.427717290 -1.110195846 -0.808756698 -2.584059666
[91] -0.470276350 0.746770379 0.545224845 -0.744015641 0.849381220
[96] -0.848046005 0.068594402 -0.999513945 0.084869626 1.701416751
> 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.876108390 0.346565949 1.358870630 1.648881988 -1.812098091
[6] 0.734970897 0.621682006 0.170234410 -0.320866510 -0.386027852
[11] 1.242789269 -0.175932268 -1.747737216 -1.444705625 0.161037698
[16] 0.162783955 -0.840187275 1.271352637 -1.306666806 0.232537231
[21] 0.533825173 0.099685321 -0.895544174 0.100798105 -0.606348029
[26] -0.760531247 -0.968168291 -0.819199379 0.028601219 0.007115041
[31] -0.307171989 0.674151810 1.202988156 -0.377540881 -0.095103392
[36] -1.790631754 -0.804306740 0.803052321 -0.692320555 2.418334994
[41] -0.431330421 0.181114692 0.314909326 -0.816292994 -0.524153109
[46] 0.326846074 -0.195305845 0.127975348 1.427827033 0.640413568
[51] 0.662678591 1.937049180 0.899173144 0.100115517 0.307851949
[56] -1.294324718 -2.262082300 2.412544945 1.694322409 -0.569786309
[61] -0.576408907 0.190870320 0.262034218 -0.778622394 -0.483351007
[66] 0.904331208 0.655159014 2.436377011 0.675196053 0.979023526
[71] -0.351845420 1.289906509 1.522050603 -0.658644913 2.069921138
[76] -1.023909583 -0.264408660 1.116772409 1.070622717 0.701869284
[81] -0.547585101 -1.014377831 1.221485347 -1.184988619 0.904510058
[86] 1.056160651 1.427717290 -1.110195846 -0.808756698 -2.584059666
[91] -0.470276350 0.746770379 0.545224845 -0.744015641 0.849381220
[96] -0.848046005 0.068594402 -0.999513945 0.084869626 1.701416751
> colMin(tmp)
[1] 0.876108390 0.346565949 1.358870630 1.648881988 -1.812098091
[6] 0.734970897 0.621682006 0.170234410 -0.320866510 -0.386027852
[11] 1.242789269 -0.175932268 -1.747737216 -1.444705625 0.161037698
[16] 0.162783955 -0.840187275 1.271352637 -1.306666806 0.232537231
[21] 0.533825173 0.099685321 -0.895544174 0.100798105 -0.606348029
[26] -0.760531247 -0.968168291 -0.819199379 0.028601219 0.007115041
[31] -0.307171989 0.674151810 1.202988156 -0.377540881 -0.095103392
[36] -1.790631754 -0.804306740 0.803052321 -0.692320555 2.418334994
[41] -0.431330421 0.181114692 0.314909326 -0.816292994 -0.524153109
[46] 0.326846074 -0.195305845 0.127975348 1.427827033 0.640413568
[51] 0.662678591 1.937049180 0.899173144 0.100115517 0.307851949
[56] -1.294324718 -2.262082300 2.412544945 1.694322409 -0.569786309
[61] -0.576408907 0.190870320 0.262034218 -0.778622394 -0.483351007
[66] 0.904331208 0.655159014 2.436377011 0.675196053 0.979023526
[71] -0.351845420 1.289906509 1.522050603 -0.658644913 2.069921138
[76] -1.023909583 -0.264408660 1.116772409 1.070622717 0.701869284
[81] -0.547585101 -1.014377831 1.221485347 -1.184988619 0.904510058
[86] 1.056160651 1.427717290 -1.110195846 -0.808756698 -2.584059666
[91] -0.470276350 0.746770379 0.545224845 -0.744015641 0.849381220
[96] -0.848046005 0.068594402 -0.999513945 0.084869626 1.701416751
> colMedians(tmp)
[1] 0.876108390 0.346565949 1.358870630 1.648881988 -1.812098091
[6] 0.734970897 0.621682006 0.170234410 -0.320866510 -0.386027852
[11] 1.242789269 -0.175932268 -1.747737216 -1.444705625 0.161037698
[16] 0.162783955 -0.840187275 1.271352637 -1.306666806 0.232537231
[21] 0.533825173 0.099685321 -0.895544174 0.100798105 -0.606348029
[26] -0.760531247 -0.968168291 -0.819199379 0.028601219 0.007115041
[31] -0.307171989 0.674151810 1.202988156 -0.377540881 -0.095103392
[36] -1.790631754 -0.804306740 0.803052321 -0.692320555 2.418334994
[41] -0.431330421 0.181114692 0.314909326 -0.816292994 -0.524153109
[46] 0.326846074 -0.195305845 0.127975348 1.427827033 0.640413568
[51] 0.662678591 1.937049180 0.899173144 0.100115517 0.307851949
[56] -1.294324718 -2.262082300 2.412544945 1.694322409 -0.569786309
[61] -0.576408907 0.190870320 0.262034218 -0.778622394 -0.483351007
[66] 0.904331208 0.655159014 2.436377011 0.675196053 0.979023526
[71] -0.351845420 1.289906509 1.522050603 -0.658644913 2.069921138
[76] -1.023909583 -0.264408660 1.116772409 1.070622717 0.701869284
[81] -0.547585101 -1.014377831 1.221485347 -1.184988619 0.904510058
[86] 1.056160651 1.427717290 -1.110195846 -0.808756698 -2.584059666
[91] -0.470276350 0.746770379 0.545224845 -0.744015641 0.849381220
[96] -0.848046005 0.068594402 -0.999513945 0.084869626 1.701416751
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.8761084 0.3465659 1.358871 1.648882 -1.812098 0.7349709 0.621682
[2,] 0.8761084 0.3465659 1.358871 1.648882 -1.812098 0.7349709 0.621682
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.1702344 -0.3208665 -0.3860279 1.242789 -0.1759323 -1.747737 -1.444706
[2,] 0.1702344 -0.3208665 -0.3860279 1.242789 -0.1759323 -1.747737 -1.444706
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.1610377 0.162784 -0.8401873 1.271353 -1.306667 0.2325372 0.5338252
[2,] 0.1610377 0.162784 -0.8401873 1.271353 -1.306667 0.2325372 0.5338252
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.09968532 -0.8955442 0.1007981 -0.606348 -0.7605312 -0.9681683 -0.8191994
[2,] 0.09968532 -0.8955442 0.1007981 -0.606348 -0.7605312 -0.9681683 -0.8191994
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.02860122 0.007115041 -0.307172 0.6741518 1.202988 -0.3775409 -0.09510339
[2,] 0.02860122 0.007115041 -0.307172 0.6741518 1.202988 -0.3775409 -0.09510339
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.790632 -0.8043067 0.8030523 -0.6923206 2.418335 -0.4313304 0.1811147
[2,] -1.790632 -0.8043067 0.8030523 -0.6923206 2.418335 -0.4313304 0.1811147
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.3149093 -0.816293 -0.5241531 0.3268461 -0.1953058 0.1279753 1.427827
[2,] 0.3149093 -0.816293 -0.5241531 0.3268461 -0.1953058 0.1279753 1.427827
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.6404136 0.6626786 1.937049 0.8991731 0.1001155 0.3078519 -1.294325
[2,] 0.6404136 0.6626786 1.937049 0.8991731 0.1001155 0.3078519 -1.294325
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -2.262082 2.412545 1.694322 -0.5697863 -0.5764089 0.1908703 0.2620342
[2,] -2.262082 2.412545 1.694322 -0.5697863 -0.5764089 0.1908703 0.2620342
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.7786224 -0.483351 0.9043312 0.655159 2.436377 0.6751961 0.9790235
[2,] -0.7786224 -0.483351 0.9043312 0.655159 2.436377 0.6751961 0.9790235
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.3518454 1.289907 1.522051 -0.6586449 2.069921 -1.02391 -0.2644087
[2,] -0.3518454 1.289907 1.522051 -0.6586449 2.069921 -1.02391 -0.2644087
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.116772 1.070623 0.7018693 -0.5475851 -1.014378 1.221485 -1.184989
[2,] 1.116772 1.070623 0.7018693 -0.5475851 -1.014378 1.221485 -1.184989
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.9045101 1.056161 1.427717 -1.110196 -0.8087567 -2.58406 -0.4702764
[2,] 0.9045101 1.056161 1.427717 -1.110196 -0.8087567 -2.58406 -0.4702764
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.7467704 0.5452248 -0.7440156 0.8493812 -0.848046 0.0685944 -0.9995139
[2,] 0.7467704 0.5452248 -0.7440156 0.8493812 -0.848046 0.0685944 -0.9995139
[,99] [,100]
[1,] 0.08486963 1.701417
[2,] 0.08486963 1.701417
>
>
> Max(tmp2)
[1] 2.361317
> Min(tmp2)
[1] -2.305715
> mean(tmp2)
[1] 0.01073234
> Sum(tmp2)
[1] 1.073234
> Var(tmp2)
[1] 0.865908
>
> rowMeans(tmp2)
[1] 0.636837940 -0.503493216 -0.361499352 -0.838112300 -0.241743918
[6] -0.363616868 0.421520813 1.191123055 -0.249654582 -1.165730265
[11] -0.155251235 -0.445063347 -0.354498524 1.244371375 -0.656086145
[16] 0.738215351 2.040000579 0.820137327 -0.484166021 -0.555262300
[21] -0.095120118 0.393166186 1.142918679 0.997131520 0.367323350
[26] -0.383428924 -1.699744055 0.930659347 0.200792021 0.240738845
[31] 0.638943965 1.363350313 -0.308372562 -0.130648322 0.629655027
[36] 1.656852909 -0.051875645 -1.380700198 -0.538529326 -0.711881564
[41] -1.575947512 -0.950862962 0.258468411 1.673663815 -0.759663736
[46] -0.428870444 2.330637379 1.347747379 -1.729908643 -0.582600510
[51] 0.098334224 -0.728811632 0.610913986 0.859885247 -0.525348217
[56] -1.446860788 -0.917359404 -0.930801161 1.011869662 1.457234122
[61] 0.153491494 -0.117064366 0.068836507 -1.552700449 -0.012763273
[66] -0.962150821 -2.305715136 -0.496280735 -0.090593130 -0.618113941
[71] -0.101279980 1.690031104 0.528475114 -2.019175104 -0.061499598
[76] 0.507871503 -0.087000618 -0.298438650 2.361317025 0.115156622
[81] -0.971528356 1.000690052 -0.974818859 -0.874710467 -0.248137318
[86] 0.505337171 0.523390266 0.094114578 -0.268377625 -0.955581664
[91] 0.458458345 1.286854379 0.006886175 0.405539581 -0.480875022
[96] -0.233332081 0.115646838 0.525026695 0.972353412 0.432914968
> rowSums(tmp2)
[1] 0.636837940 -0.503493216 -0.361499352 -0.838112300 -0.241743918
[6] -0.363616868 0.421520813 1.191123055 -0.249654582 -1.165730265
[11] -0.155251235 -0.445063347 -0.354498524 1.244371375 -0.656086145
[16] 0.738215351 2.040000579 0.820137327 -0.484166021 -0.555262300
[21] -0.095120118 0.393166186 1.142918679 0.997131520 0.367323350
[26] -0.383428924 -1.699744055 0.930659347 0.200792021 0.240738845
[31] 0.638943965 1.363350313 -0.308372562 -0.130648322 0.629655027
[36] 1.656852909 -0.051875645 -1.380700198 -0.538529326 -0.711881564
[41] -1.575947512 -0.950862962 0.258468411 1.673663815 -0.759663736
[46] -0.428870444 2.330637379 1.347747379 -1.729908643 -0.582600510
[51] 0.098334224 -0.728811632 0.610913986 0.859885247 -0.525348217
[56] -1.446860788 -0.917359404 -0.930801161 1.011869662 1.457234122
[61] 0.153491494 -0.117064366 0.068836507 -1.552700449 -0.012763273
[66] -0.962150821 -2.305715136 -0.496280735 -0.090593130 -0.618113941
[71] -0.101279980 1.690031104 0.528475114 -2.019175104 -0.061499598
[76] 0.507871503 -0.087000618 -0.298438650 2.361317025 0.115156622
[81] -0.971528356 1.000690052 -0.974818859 -0.874710467 -0.248137318
[86] 0.505337171 0.523390266 0.094114578 -0.268377625 -0.955581664
[91] 0.458458345 1.286854379 0.006886175 0.405539581 -0.480875022
[96] -0.233332081 0.115646838 0.525026695 0.972353412 0.432914968
> 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.636837940 -0.503493216 -0.361499352 -0.838112300 -0.241743918
[6] -0.363616868 0.421520813 1.191123055 -0.249654582 -1.165730265
[11] -0.155251235 -0.445063347 -0.354498524 1.244371375 -0.656086145
[16] 0.738215351 2.040000579 0.820137327 -0.484166021 -0.555262300
[21] -0.095120118 0.393166186 1.142918679 0.997131520 0.367323350
[26] -0.383428924 -1.699744055 0.930659347 0.200792021 0.240738845
[31] 0.638943965 1.363350313 -0.308372562 -0.130648322 0.629655027
[36] 1.656852909 -0.051875645 -1.380700198 -0.538529326 -0.711881564
[41] -1.575947512 -0.950862962 0.258468411 1.673663815 -0.759663736
[46] -0.428870444 2.330637379 1.347747379 -1.729908643 -0.582600510
[51] 0.098334224 -0.728811632 0.610913986 0.859885247 -0.525348217
[56] -1.446860788 -0.917359404 -0.930801161 1.011869662 1.457234122
[61] 0.153491494 -0.117064366 0.068836507 -1.552700449 -0.012763273
[66] -0.962150821 -2.305715136 -0.496280735 -0.090593130 -0.618113941
[71] -0.101279980 1.690031104 0.528475114 -2.019175104 -0.061499598
[76] 0.507871503 -0.087000618 -0.298438650 2.361317025 0.115156622
[81] -0.971528356 1.000690052 -0.974818859 -0.874710467 -0.248137318
[86] 0.505337171 0.523390266 0.094114578 -0.268377625 -0.955581664
[91] 0.458458345 1.286854379 0.006886175 0.405539581 -0.480875022
[96] -0.233332081 0.115646838 0.525026695 0.972353412 0.432914968
> rowMin(tmp2)
[1] 0.636837940 -0.503493216 -0.361499352 -0.838112300 -0.241743918
[6] -0.363616868 0.421520813 1.191123055 -0.249654582 -1.165730265
[11] -0.155251235 -0.445063347 -0.354498524 1.244371375 -0.656086145
[16] 0.738215351 2.040000579 0.820137327 -0.484166021 -0.555262300
[21] -0.095120118 0.393166186 1.142918679 0.997131520 0.367323350
[26] -0.383428924 -1.699744055 0.930659347 0.200792021 0.240738845
[31] 0.638943965 1.363350313 -0.308372562 -0.130648322 0.629655027
[36] 1.656852909 -0.051875645 -1.380700198 -0.538529326 -0.711881564
[41] -1.575947512 -0.950862962 0.258468411 1.673663815 -0.759663736
[46] -0.428870444 2.330637379 1.347747379 -1.729908643 -0.582600510
[51] 0.098334224 -0.728811632 0.610913986 0.859885247 -0.525348217
[56] -1.446860788 -0.917359404 -0.930801161 1.011869662 1.457234122
[61] 0.153491494 -0.117064366 0.068836507 -1.552700449 -0.012763273
[66] -0.962150821 -2.305715136 -0.496280735 -0.090593130 -0.618113941
[71] -0.101279980 1.690031104 0.528475114 -2.019175104 -0.061499598
[76] 0.507871503 -0.087000618 -0.298438650 2.361317025 0.115156622
[81] -0.971528356 1.000690052 -0.974818859 -0.874710467 -0.248137318
[86] 0.505337171 0.523390266 0.094114578 -0.268377625 -0.955581664
[91] 0.458458345 1.286854379 0.006886175 0.405539581 -0.480875022
[96] -0.233332081 0.115646838 0.525026695 0.972353412 0.432914968
>
> colMeans(tmp2)
[1] 0.01073234
> colSums(tmp2)
[1] 1.073234
> colVars(tmp2)
[1] 0.865908
> colSd(tmp2)
[1] 0.9305418
> colMax(tmp2)
[1] 2.361317
> colMin(tmp2)
[1] -2.305715
> colMedians(tmp2)
[1] -0.08879687
> colRanges(tmp2)
[,1]
[1,] -2.305715
[2,] 2.361317
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -3.3461209 2.6882279 0.2256838 1.9082029 -1.3497435 -3.6979858
[7] -8.8586268 0.5146147 -2.1104729 2.8583512
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3322856
[2,] -1.1068940
[3,] -0.4595485
[4,] 0.1623895
[5,] 1.1869717
>
> rowApply(tmp,sum)
[1] -2.4539821 -2.6571874 -0.9872688 -6.5962792 1.6558346 3.5433312
[7] 1.1192915 -2.3555307 -3.5758891 1.1398106
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 6 2 3 4 9 1 6 2 4
[2,] 4 5 9 7 10 8 5 2 6 7
[3,] 2 10 10 4 5 10 2 10 7 3
[4,] 6 8 7 2 2 5 9 8 1 10
[5,] 8 3 4 6 9 3 4 1 8 8
[6,] 5 1 5 1 7 4 6 5 9 5
[7,] 1 2 1 8 3 2 8 3 5 1
[8,] 9 4 3 5 1 6 3 7 10 9
[9,] 3 7 6 10 8 1 10 4 3 2
[10,] 7 9 8 9 6 7 7 9 4 6
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.5484814 1.4692074 -2.2678227 0.7928139 -0.5313179 2.0414985
[7] -2.4828879 0.2165252 -1.7770017 -2.0469010 -0.6125455 -2.5836245
[13] 1.3210121 -3.2856180 -0.5272977 -3.8075080 0.1726360 4.1565171
[19] -1.7363368 -2.7880334
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7798798
[2,] -0.3922561
[3,] 0.2710137
[4,] 0.5591503
[5,] 0.8904532
>
> rowApply(tmp,sum)
[1] -4.944458 3.420085 1.171369 -10.684694 -2.690504
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 5 12 18 18
[2,] 1 17 19 13 19
[3,] 9 2 15 4 12
[4,] 16 11 17 14 6
[5,] 7 14 20 3 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.7798798 -2.29450377 -0.3892292 0.2756782 -0.8529981 -0.38293307
[2,] -0.3922561 1.03847690 -1.5006284 0.1619301 0.5832097 1.47914602
[3,] 0.2710137 1.84325722 0.8782398 1.1192343 1.8521006 0.34141176
[4,] 0.5591503 -0.09053839 -1.5343318 -0.0848447 -1.7681558 -0.01977672
[5,] 0.8904532 0.97251546 0.2781269 -0.6791841 -0.3454742 0.62365053
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.1405472 0.7551177 -2.1862822 1.0473510 0.08527804 2.13575698
[2,] 1.4789969 0.6071180 0.1737240 0.1134618 -0.33448490 -0.46457929
[3,] -1.2044666 0.2422904 -1.0704792 -1.7591420 1.22723877 0.06420438
[4,] -1.2701318 -0.9739382 0.6156230 -0.5742746 -0.87893327 -2.01077647
[5,] -1.6278336 -0.4140626 0.6904126 -0.8742973 -0.71164409 -2.30823012
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.03955661 -1.1926221 -1.0073273 -2.0310855 -1.2904550 3.18377750
[2,] 2.09628423 -0.8472464 -0.1528084 1.0154592 0.2784499 0.08441599
[3,] -0.18282664 -2.0135170 0.9573296 -1.1165974 0.8452780 -0.15777436
[4,] -0.01611088 -0.2945051 -0.5656625 -2.0143909 -0.2712917 0.71069318
[5,] -0.61589121 1.0622727 0.2411709 0.3391066 0.6106550 0.33540478
[,19] [,20]
[1,] 0.0608333 -0.26103895
[2,] -0.3608351 -1.63774954
[3,] 0.1696807 -1.13510721
[4,] -0.3998697 0.19737213
[5,] -1.2061460 0.04849018
>
>
> 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 : 649 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 : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.6329327 -1.212397 -0.7248802 -2.053231 0.4698124 0.5144917 1.03135
col8 col9 col10 col11 col12 col13 col14
row1 -1.689256 -1.379754 1.663032 0.5169436 -1.380418 -0.8601057 -1.048716
col15 col16 col17 col18 col19 col20
row1 0.7849034 0.9344142 -0.5070989 -2.782801 0.8496683 -1.190199
> tmp[,"col10"]
col10
row1 1.6630324
row2 2.1002968
row3 0.8214822
row4 -1.2673783
row5 -1.2036374
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.6329327 -1.2123974 -0.7248802 -2.0532314 0.4698124 0.5144917
row5 -0.4322925 -0.4672189 0.5397781 0.4978726 -2.3895723 -0.4539901
col7 col8 col9 col10 col11 col12 col13
row1 1.0313498 -1.6892559 -1.379754 1.663032 0.5169436 -1.3804185 -0.8601057
row5 0.4812921 -0.1270854 1.935260 -1.203637 2.0024680 0.3007423 -0.4322129
col14 col15 col16 col17 col18 col19 col20
row1 -1.0487160 0.7849034 0.9344142 -0.5070989 -2.782801 0.8496683 -1.1901993
row5 0.7428632 0.1586280 -2.4729307 0.3832665 1.479350 -0.2832268 -0.5485447
> tmp[,c("col6","col20")]
col6 col20
row1 0.5144917 -1.1901993
row2 -1.6238690 -0.9251545
row3 0.5107848 -0.7350963
row4 0.4071898 0.3957999
row5 -0.4539901 -0.5485447
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.5144917 -1.1901993
row5 -0.4539901 -0.5485447
>
>
>
>
> 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.53269 49.12133 50.39461 49.79434 49.59927 106.5111 52.0333 49.5306
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.22823 49.29967 49.30279 49.45591 49.89057 48.14485 48.79563 48.92569
col17 col18 col19 col20
row1 50.58177 50.27681 51.24085 104.8643
> tmp[,"col10"]
col10
row1 49.29967
row2 30.09681
row3 31.64603
row4 27.64421
row5 49.40371
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.53269 49.12133 50.39461 49.79434 49.59927 106.5111 52.0333 49.53060
row5 49.94300 50.49881 48.62296 50.92120 50.55555 104.4771 49.9129 50.85678
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.22823 49.29967 49.30279 49.45591 49.89057 48.14485 48.79563 48.92569
row5 50.11883 49.40371 49.92592 49.53014 49.27358 49.81983 50.98927 49.58104
col17 col18 col19 col20
row1 50.58177 50.27681 51.24085 104.8643
row5 50.60468 49.01820 51.38763 104.4339
> tmp[,c("col6","col20")]
col6 col20
row1 106.51115 104.86427
row2 74.47611 76.30520
row3 77.32037 76.09049
row4 75.13667 75.05111
row5 104.47707 104.43387
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.5111 104.8643
row5 104.4771 104.4339
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.5111 104.8643
row5 104.4771 104.4339
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.22982712
[2,] 0.05392175
[3,] 0.69912410
[4,] 0.32946911
[5,] -0.70682591
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.3260489 1.4271515713
[2,] 0.8153097 1.6414022995
[3,] -1.4679081 -0.0005594549
[4,] -1.1998845 1.3415525521
[5,] -1.3322494 1.3268667083
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.5973217 -0.2870684
[2,] -0.6989124 0.2823327
[3,] 0.8669742 0.4536078
[4,] 1.1339245 -2.2945303
[5,] -0.4367560 0.7707445
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.5973217
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.5973217
[2,] -0.6989124
>
>
>
> 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.3390116 -0.6779499 -0.6385475 2.516784 0.6932719 -1.536459 0.4720064
row1 0.2361553 0.1604070 1.2753356 1.960118 0.9178366 1.292228 0.5308774
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.5331021 0.7305397 -0.3934315 0.1708099 -2.0276570 -2.0035371
row1 -1.0282688 -0.1199673 0.5177706 0.3244595 0.8305266 -0.1507171
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.0489903 1.0003460 -0.8357884 0.2718810 0.5758140 0.2455198 0.6720538
row1 -0.1554027 -0.8276084 -0.2955037 0.7304949 -0.2258451 -1.4293088 0.4901971
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 2.261777 -0.6346652 0.9425423 -0.3220045 -0.557329 -0.0761446 -0.8846876
[,8] [,9] [,10]
row2 -0.2747646 -0.5013035 -0.378797
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.588992 -1.297107 0.2913744 -1.022995 0.6666898 1.274044 -2.118749
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.748771 1.273237 -0.3390456 0.5572617 -0.9705096 -0.6202956 -0.1263979
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.1734436 -0.2506342 -0.07693301 -1.215981 -1.264746 -0.8518105
>
>
> 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: 0x560afb0d4fa0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb1928d306"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cbaa762bf"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb5ff806ec"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb28f91e2f"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb508b4427"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb71f4d146"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb62861f56"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb3d4b5707"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb3f7ba3fc"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb94a4b66"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb53c5f2b"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb3fe51c1d"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb5c82d318"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb6e4784c3"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMf47cb3db226db"
>
>
> ### 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: 0x560af9f2b1d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x560af9f2b1d0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x560af9f2b1d0>
> rowMedians(tmp)
[1] 0.705173443 0.618048607 -0.314104849 -0.093755900 0.189922156
[6] 0.347862934 -0.017659134 -0.458394028 -0.253866165 -0.009031254
[11] -0.170878446 0.313958526 -0.238187207 -0.220170045 -0.086203256
[16] -0.736205874 -0.435771232 0.010451128 0.088798098 -0.357741652
[21] -0.504708668 -0.169695749 0.215231824 -0.263931172 0.170508531
[26] 0.190684875 0.463911239 0.292173977 0.404762274 -0.070606339
[31] 0.216886485 0.392218218 -0.845284585 0.292285896 -0.339373790
[36] 0.287625454 0.199872799 0.446133229 -0.213032148 -0.139314297
[41] -0.632972958 0.196634571 0.429896173 0.040980103 -0.030700410
[46] 0.155636702 -0.786849867 0.421692108 -0.099260603 -0.294965374
[51] -0.022996971 0.120513981 0.183402131 -0.259410465 0.284702151
[56] 0.123768013 -0.002082380 -0.560371076 0.344533830 -0.558732156
[61] -0.117819519 -0.464200590 0.019892142 0.094832713 0.315801859
[66] 0.342652600 -0.282031697 -0.290357807 -0.372830831 0.166334835
[71] 0.182096701 0.075583052 0.157359137 -0.288086088 0.629099963
[76] -0.052462998 0.222731790 0.073056888 -0.291907523 -0.128236807
[81] -0.125422016 -0.051652716 -0.215247804 0.045306130 0.444119414
[86] -0.189893499 -0.364953931 -0.431795474 -0.331425355 -0.155926014
[91] -0.151286189 0.107376326 0.472962857 -0.047285438 0.244892596
[96] -0.374228047 0.377542378 0.102876231 -0.324000661 0.310178661
[101] 0.379886018 0.305599106 -0.436832367 0.316318002 -0.404618204
[106] -0.193564994 0.189086978 -0.055494106 -0.363247505 0.449269141
[111] -0.039429260 0.048631435 0.437833262 0.659590210 -0.055758307
[116] -0.473061971 -0.252464154 -0.542584618 -0.085746012 -0.529911721
[121] -0.180676424 -0.070836399 -0.026861235 0.109850218 -0.037365110
[126] 0.131554107 -0.385098613 -0.226779888 0.115847733 -0.122164109
[131] 0.065254858 0.005066836 -0.668975216 -0.068380162 -0.103435662
[136] -0.247819896 0.312811031 0.021525051 0.503354383 0.456425890
[141] -0.014977294 -0.546280630 0.214129142 0.115359199 -0.204460879
[146] 0.439005981 -0.230508856 0.484176132 0.378986399 -0.530999604
[151] 0.276507169 -0.055870069 0.086499659 0.726770643 0.256755398
[156] 0.198322862 0.277071905 -0.291477602 -0.011781132 0.190079904
[161] -0.264964647 0.122963928 0.432131029 -0.314988005 -0.065174238
[166] 0.244754613 -0.240472916 -0.155026532 0.153037525 0.245880883
[171] -0.046784757 -0.079743529 -0.690152348 0.115133371 -0.320305928
[176] -0.009898741 0.380793356 -0.364450416 0.059574061 -0.639209614
[181] -0.306093287 0.269964425 -0.026745885 0.368319462 0.422393819
[186] 0.471243814 -0.395408599 -0.015599192 0.567681417 -0.294379494
[191] 0.554654923 -0.079755400 -0.131471912 -0.487509514 -0.160801318
[196] -0.625803835 -0.002236398 0.125625804 0.271321626 -0.073444440
[201] -0.085165125 -0.075166210 -0.237818388 -0.323431131 -0.041056685
[206] 0.481277923 0.120421923 0.028518718 -0.160268064 -0.173226165
[211] 0.253703183 -0.127090073 0.360702119 -0.200259479 -0.632006381
[216] 0.204251249 0.145321605 -0.001504029 -0.150532183 -0.494944401
[221] -0.175237012 -0.349207353 -0.160533918 0.438251169 0.339539047
[226] -0.108105203 -0.031344147 0.244415465 -0.252443023 -0.016663137
>
> proc.time()
user system elapsed
1.214 0.671 1.875
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: 0x5c4ae9d231c0>
> .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: 0x5c4ae9d231c0>
> .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: 0x5c4ae9d231c0>
> .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: 0x5c4ae9d231c0>
> 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: 0x5c4aea006120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4aea006120>
> .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: 0x5c4aea006120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4aea006120>
> .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: 0x5c4aea006120>
> 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: 0x5c4ae8cba4a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4ae8cba4a0>
> .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: 0x5c4ae8cba4a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c4ae8cba4a0>
> .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: 0x5c4ae8cba4a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5c4ae8cba4a0>
> .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: 0x5c4ae8cba4a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5c4ae8cba4a0>
> .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: 0x5c4ae8cba4a0>
> 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: 0x5c4ae8d56390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5c4ae8d56390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4ae8d56390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4ae8d56390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilef492c199e4b0b" "BufferedMatrixFilef492cc93b381"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilef492c199e4b0b" "BufferedMatrixFilef492cc93b381"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4ae95d5650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4ae95d5650>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c4ae95d5650>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c4ae95d5650>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5c4ae95d5650>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5c4ae95d5650>
> .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: 0x5c4aea75c430>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c4aea75c430>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c4aea75c430>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5c4aea75c430>
> 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: 0x5c4aeaa51250>
> .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: 0x5c4aeaa51250>
> rm(P)
>
> proc.time()
user system elapsed
0.240 0.050 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.233 0.046 0.268