| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-15 12:04 -0500 (Mon, 15 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" | 4882 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4673 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4607 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4671 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | 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-11 22:35:08 -0500 (Thu, 11 Dec 2025) |
| EndedAt: 2025-12-11 22:35:33 -0500 (Thu, 11 Dec 2025) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.243 0.044 0.276
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 11 22:35:24 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 11 22:35:24 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: 0x64f14f48d370>
>
>
>
> 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 11 22:35:24 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 11 22:35:24 2025"
>
> ColMode(tmp2)
<pointer: 0x64f14f48d370>
>
>
>
> ### 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,] 100.3278200 0.14339878 0.6467338 -1.2319770
[2,] -0.8536460 -0.73051234 -0.2067128 -0.7888367
[3,] 0.6523671 -0.07009551 0.3854993 1.4432535
[4,] -2.1182094 -0.31806740 0.6846919 0.2519139
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.3278200 0.14339878 0.6467338 1.2319770
[2,] 0.8536460 0.73051234 0.2067128 0.7888367
[3,] 0.6523671 0.07009551 0.3854993 1.4432535
[4,] 2.1182094 0.31806740 0.6846919 0.2519139
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0163776 0.3786803 0.8041976 1.1099446
[2,] 0.9239297 0.8547001 0.4546568 0.8881648
[3,] 0.8076925 0.2647556 0.6208859 1.2013549
[4,] 1.4554069 0.5639746 0.8274611 0.5019102
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.49160 28.93020 33.68871 37.33142
[2,] 35.09294 34.27751 29.75328 34.67048
[3,] 33.72929 27.71765 31.59436 38.45680
[4,] 41.67228 30.95781 33.95930 30.27102
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x64f1504899b0>
> exp(tmp5)
<pointer: 0x64f1504899b0>
> log(tmp5,2)
<pointer: 0x64f1504899b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.3312
> Min(tmp5)
[1] 54.91509
> mean(tmp5)
[1] 72.12052
> Sum(tmp5)
[1] 14424.1
> Var(tmp5)
[1] 875.2404
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.68305 68.64826 69.35865 68.39076 68.85795 71.95245 71.90307 70.00879
[9] 70.52352 71.87869
> rowSums(tmp5)
[1] 1793.661 1372.965 1387.173 1367.815 1377.159 1439.049 1438.061 1400.176
[9] 1410.470 1437.574
> rowVars(tmp5)
[1] 8025.08961 53.57179 74.79681 84.74011 98.16650 80.42260
[7] 75.07067 78.73783 124.58744 93.04388
> rowSd(tmp5)
[1] 89.582864 7.319275 8.648515 9.205439 9.907901 8.967865 8.664333
[8] 8.873434 11.161875 9.645925
> rowMax(tmp5)
[1] 469.33121 79.49161 82.34140 90.71984 85.55404 84.09659 85.14762
[8] 90.27787 99.66979 87.16626
> rowMin(tmp5)
[1] 57.70504 55.37177 57.69066 56.66844 54.91509 57.84404 58.95261 56.16681
[9] 56.15513 57.09377
>
> colMeans(tmp5)
[1] 113.37842 70.83442 68.94061 74.02758 72.17440 71.16255 70.86960
[8] 71.84053 67.41056 68.20591 68.90623 68.77928 71.40906 69.21428
[15] 69.00948 71.50631 68.53749 66.38072 66.94656 72.87636
> colSums(tmp5)
[1] 1133.7842 708.3442 689.4061 740.2758 721.7440 711.6255 708.6960
[8] 718.4053 674.1056 682.0591 689.0623 687.7928 714.0906 692.1428
[15] 690.0948 715.0631 685.3749 663.8072 669.4656 728.7636
> colVars(tmp5)
[1] 15714.93247 112.81223 41.10911 80.14051 59.33380 118.59858
[7] 79.55764 147.76696 80.67544 80.66902 70.41425 55.99591
[13] 144.70270 57.98361 52.23646 104.91334 52.43810 62.75189
[19] 59.28221 96.98233
> colSd(tmp5)
[1] 125.359214 10.621310 6.411639 8.952123 7.702844 10.890298
[7] 8.919509 12.155943 8.981951 8.981593 8.391320 7.483041
[13] 12.029244 7.614697 7.227479 10.242721 7.241416 7.921609
[19] 7.699494 9.847961
> colMax(tmp5)
[1] 469.33121 84.63807 82.46293 85.14762 84.27837 88.41013 83.71271
[8] 99.66979 81.15155 82.34140 81.40875 79.49161 90.71984 78.54499
[15] 78.22402 87.16626 76.43074 76.75476 76.58200 90.27787
> colMin(tmp5)
[1] 58.95261 57.69066 59.61244 61.92442 58.26819 57.93310 58.60160 57.34354
[9] 54.91509 57.24579 57.09377 56.73761 58.57784 59.06221 56.16681 58.67484
[17] 57.41931 56.66844 56.15513 55.37177
>
>
> ### 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.68305 68.64826 69.35865 68.39076 68.85795 71.95245 71.90307 NA
[9] 70.52352 71.87869
> rowSums(tmp5)
[1] 1793.661 1372.965 1387.173 1367.815 1377.159 1439.049 1438.061 NA
[9] 1410.470 1437.574
> rowVars(tmp5)
[1] 8025.08961 53.57179 74.79681 84.74011 98.16650 80.42260
[7] 75.07067 83.02127 124.58744 93.04388
> rowSd(tmp5)
[1] 89.582864 7.319275 8.648515 9.205439 9.907901 8.967865 8.664333
[8] 9.111601 11.161875 9.645925
> rowMax(tmp5)
[1] 469.33121 79.49161 82.34140 90.71984 85.55404 84.09659 85.14762
[8] NA 99.66979 87.16626
> rowMin(tmp5)
[1] 57.70504 55.37177 57.69066 56.66844 54.91509 57.84404 58.95261 NA
[9] 56.15513 57.09377
>
> colMeans(tmp5)
[1] 113.37842 70.83442 68.94061 74.02758 NA 71.16255 70.86960
[8] 71.84053 67.41056 68.20591 68.90623 68.77928 71.40906 69.21428
[15] 69.00948 71.50631 68.53749 66.38072 66.94656 72.87636
> colSums(tmp5)
[1] 1133.7842 708.3442 689.4061 740.2758 NA 711.6255 708.6960
[8] 718.4053 674.1056 682.0591 689.0623 687.7928 714.0906 692.1428
[15] 690.0948 715.0631 685.3749 663.8072 669.4656 728.7636
> colVars(tmp5)
[1] 15714.93247 112.81223 41.10911 80.14051 NA 118.59858
[7] 79.55764 147.76696 80.67544 80.66902 70.41425 55.99591
[13] 144.70270 57.98361 52.23646 104.91334 52.43810 62.75189
[19] 59.28221 96.98233
> colSd(tmp5)
[1] 125.359214 10.621310 6.411639 8.952123 NA 10.890298
[7] 8.919509 12.155943 8.981951 8.981593 8.391320 7.483041
[13] 12.029244 7.614697 7.227479 10.242721 7.241416 7.921609
[19] 7.699494 9.847961
> colMax(tmp5)
[1] 469.33121 84.63807 82.46293 85.14762 NA 88.41013 83.71271
[8] 99.66979 81.15155 82.34140 81.40875 79.49161 90.71984 78.54499
[15] 78.22402 87.16626 76.43074 76.75476 76.58200 90.27787
> colMin(tmp5)
[1] 58.95261 57.69066 59.61244 61.92442 NA 57.93310 58.60160 57.34354
[9] 54.91509 57.24579 57.09377 56.73761 58.57784 59.06221 56.16681 58.67484
[17] 57.41931 56.66844 56.15513 55.37177
>
> Max(tmp5,na.rm=TRUE)
[1] 469.3312
> Min(tmp5,na.rm=TRUE)
[1] 54.91509
> mean(tmp5,na.rm=TRUE)
[1] 72.12486
> Sum(tmp5,na.rm=TRUE)
[1] 14352.85
> Var(tmp5,na.rm=TRUE)
[1] 879.657
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.68305 68.64826 69.35865 68.39076 68.85795 71.95245 71.90307 69.94318
[9] 70.52352 71.87869
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.661 1372.965 1387.173 1367.815 1377.159 1439.049 1438.061 1328.920
[9] 1410.470 1437.574
> rowVars(tmp5,na.rm=TRUE)
[1] 8025.08961 53.57179 74.79681 84.74011 98.16650 80.42260
[7] 75.07067 83.02127 124.58744 93.04388
> rowSd(tmp5,na.rm=TRUE)
[1] 89.582864 7.319275 8.648515 9.205439 9.907901 8.967865 8.664333
[8] 9.111601 11.161875 9.645925
> rowMax(tmp5,na.rm=TRUE)
[1] 469.33121 79.49161 82.34140 90.71984 85.55404 84.09659 85.14762
[8] 90.27787 99.66979 87.16626
> rowMin(tmp5,na.rm=TRUE)
[1] 57.70504 55.37177 57.69066 56.66844 54.91509 57.84404 58.95261 56.16681
[9] 56.15513 57.09377
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.37842 70.83442 68.94061 74.02758 72.27651 71.16255 70.86960
[8] 71.84053 67.41056 68.20591 68.90623 68.77928 71.40906 69.21428
[15] 69.00948 71.50631 68.53749 66.38072 66.94656 72.87636
> colSums(tmp5,na.rm=TRUE)
[1] 1133.7842 708.3442 689.4061 740.2758 650.4886 711.6255 708.6960
[8] 718.4053 674.1056 682.0591 689.0623 687.7928 714.0906 692.1428
[15] 690.0948 715.0631 685.3749 663.8072 669.4656 728.7636
> colVars(tmp5,na.rm=TRUE)
[1] 15714.93247 112.81223 41.10911 80.14051 66.63323 118.59858
[7] 79.55764 147.76696 80.67544 80.66902 70.41425 55.99591
[13] 144.70270 57.98361 52.23646 104.91334 52.43810 62.75189
[19] 59.28221 96.98233
> colSd(tmp5,na.rm=TRUE)
[1] 125.359214 10.621310 6.411639 8.952123 8.162918 10.890298
[7] 8.919509 12.155943 8.981951 8.981593 8.391320 7.483041
[13] 12.029244 7.614697 7.227479 10.242721 7.241416 7.921609
[19] 7.699494 9.847961
> colMax(tmp5,na.rm=TRUE)
[1] 469.33121 84.63807 82.46293 85.14762 84.27837 88.41013 83.71271
[8] 99.66979 81.15155 82.34140 81.40875 79.49161 90.71984 78.54499
[15] 78.22402 87.16626 76.43074 76.75476 76.58200 90.27787
> colMin(tmp5,na.rm=TRUE)
[1] 58.95261 57.69066 59.61244 61.92442 58.26819 57.93310 58.60160 57.34354
[9] 54.91509 57.24579 57.09377 56.73761 58.57784 59.06221 56.16681 58.67484
[17] 57.41931 56.66844 56.15513 55.37177
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.68305 68.64826 69.35865 68.39076 68.85795 71.95245 71.90307 NaN
[9] 70.52352 71.87869
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.661 1372.965 1387.173 1367.815 1377.159 1439.049 1438.061 0.000
[9] 1410.470 1437.574
> rowVars(tmp5,na.rm=TRUE)
[1] 8025.08961 53.57179 74.79681 84.74011 98.16650 80.42260
[7] 75.07067 NA 124.58744 93.04388
> rowSd(tmp5,na.rm=TRUE)
[1] 89.582864 7.319275 8.648515 9.205439 9.907901 8.967865 8.664333
[8] NA 11.161875 9.645925
> rowMax(tmp5,na.rm=TRUE)
[1] 469.33121 79.49161 82.34140 90.71984 85.55404 84.09659 85.14762
[8] NA 99.66979 87.16626
> rowMin(tmp5,na.rm=TRUE)
[1] 57.70504 55.37177 57.69066 56.66844 54.91509 57.84404 58.95261 NA
[9] 56.15513 57.09377
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 118.04503 70.34510 69.11647 75.37238 NaN 69.24615 72.15488
[8] 73.45131 67.12900 68.17803 69.14699 68.95274 71.99840 68.18303
[15] 70.43644 72.01743 67.76498 66.26380 66.08154 70.94286
> colSums(tmp5,na.rm=TRUE)
[1] 1062.4053 633.1059 622.0482 678.3514 0.0000 623.2154 649.3940
[8] 661.0618 604.1610 613.6023 622.3229 620.5747 647.9856 613.6473
[15] 633.9280 648.1569 609.8848 596.3742 594.7338 638.4857
> colVars(tmp5,na.rm=TRUE)
[1] 17434.30502 124.22012 45.89983 69.81273 NA 92.10686
[7] 70.91793 137.04855 89.86800 90.74391 78.56390 62.65688
[13] 158.88312 53.26739 35.85852 115.08850 52.27916 70.44209
[19] 58.27446 67.04782
> colSd(tmp5,na.rm=TRUE)
[1] 132.039028 11.145408 6.774942 8.355401 NA 9.597232
[7] 8.421278 11.706774 9.479874 9.525960 8.863628 7.915610
[13] 12.604885 7.298451 5.988198 10.727931 7.230433 8.392979
[19] 7.633771 8.188273
> colMax(tmp5,na.rm=TRUE)
[1] 469.33121 84.63807 82.46293 85.14762 -Inf 82.97242 83.71271
[8] 99.66979 81.15155 82.34140 81.40875 79.49161 90.71984 78.54499
[15] 78.22402 87.16626 76.43074 76.75476 76.58200 79.59522
> colMin(tmp5,na.rm=TRUE)
[1] 58.95261 57.69066 59.61244 63.00515 Inf 57.93310 58.60160 62.96599
[9] 54.91509 57.24579 57.09377 56.73761 58.57784 59.06221 60.93978 58.67484
[17] 57.41931 56.66844 56.15513 55.37177
>
>
>
>
> 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] 206.0621 135.8399 184.9763 201.5894 231.3626 244.0201 233.5469 288.2305
[9] 196.2228 212.8608
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 206.0621 135.8399 184.9763 201.5894 231.3626 244.0201 233.5469 288.2305
[9] 196.2228 212.8608
>
>
>
> 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 -8.526513e-14 5.684342e-14 5.684342e-14
[6] -1.421085e-14 1.136868e-13 -8.526513e-14 -1.421085e-13 1.705303e-13
[11] -5.684342e-14 1.136868e-13 -1.421085e-13 -1.136868e-13 2.842171e-14
[16] 8.526513e-14 0.000000e+00 2.984279e-13 -1.136868e-13 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
9 9
7 11
5 2
6 1
2 15
7 16
7 20
2 14
10 15
6 10
2 11
10 18
7 14
2 6
3 2
7 7
3 3
9 15
10 9
8 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.922443
> Min(tmp)
[1] -2.915867
> mean(tmp)
[1] 0.02750038
> Sum(tmp)
[1] 2.750038
> Var(tmp)
[1] 1.24785
>
> rowMeans(tmp)
[1] 0.02750038
> rowSums(tmp)
[1] 2.750038
> rowVars(tmp)
[1] 1.24785
> rowSd(tmp)
[1] 1.117072
> rowMax(tmp)
[1] 2.922443
> rowMin(tmp)
[1] -2.915867
>
> colMeans(tmp)
[1] -0.447152575 2.112416289 -0.943059788 -0.301676821 0.891289835
[6] 0.131434093 0.529463950 -0.843506241 -1.901160822 0.668636192
[11] 1.319288297 -1.874800470 -1.418569143 0.050381051 -1.349982905
[16] 0.529589805 2.922442990 0.396059443 0.893286553 -2.007672061
[21] -0.292841786 -0.223261924 -0.473241372 -2.178241117 -0.026113419
[26] 0.761188913 -0.593001768 0.263311560 0.640844818 0.346573627
[31] -0.440325723 0.521717738 -0.030772369 0.848592680 1.913166031
[36] 0.314597483 -1.094438402 -0.223461511 -1.634845588 -0.561134946
[41] -0.461072140 0.331840676 -0.445670502 2.775060629 0.561377775
[46] 0.168535187 -0.910790177 -0.741953000 1.898293821 0.798824045
[51] 1.236079096 1.917764112 -0.853608391 0.511538059 -0.874274026
[56] 0.420481079 -0.654600045 0.238178417 -1.710097873 0.106133937
[61] -0.868621296 -1.244216254 0.319847682 -0.644232338 -0.245363921
[66] -1.361087634 0.659724728 0.888613491 -1.327625691 -0.633288285
[71] 0.218239340 1.250503728 -0.170897385 -1.226744358 1.395626491
[76] -0.476364088 -2.915866567 0.556252642 -0.706147292 0.630277326
[81] -0.116430551 -0.613160561 0.155872705 1.571764909 0.137600096
[86] 1.191159371 -2.513153153 0.697285220 0.004408654 -0.723988140
[91] 1.397503495 1.398397056 -0.861377289 -0.782534046 0.898340863
[96] 1.460615299 0.561510674 1.516514315 1.739533828 0.024483519
> colSums(tmp)
[1] -0.447152575 2.112416289 -0.943059788 -0.301676821 0.891289835
[6] 0.131434093 0.529463950 -0.843506241 -1.901160822 0.668636192
[11] 1.319288297 -1.874800470 -1.418569143 0.050381051 -1.349982905
[16] 0.529589805 2.922442990 0.396059443 0.893286553 -2.007672061
[21] -0.292841786 -0.223261924 -0.473241372 -2.178241117 -0.026113419
[26] 0.761188913 -0.593001768 0.263311560 0.640844818 0.346573627
[31] -0.440325723 0.521717738 -0.030772369 0.848592680 1.913166031
[36] 0.314597483 -1.094438402 -0.223461511 -1.634845588 -0.561134946
[41] -0.461072140 0.331840676 -0.445670502 2.775060629 0.561377775
[46] 0.168535187 -0.910790177 -0.741953000 1.898293821 0.798824045
[51] 1.236079096 1.917764112 -0.853608391 0.511538059 -0.874274026
[56] 0.420481079 -0.654600045 0.238178417 -1.710097873 0.106133937
[61] -0.868621296 -1.244216254 0.319847682 -0.644232338 -0.245363921
[66] -1.361087634 0.659724728 0.888613491 -1.327625691 -0.633288285
[71] 0.218239340 1.250503728 -0.170897385 -1.226744358 1.395626491
[76] -0.476364088 -2.915866567 0.556252642 -0.706147292 0.630277326
[81] -0.116430551 -0.613160561 0.155872705 1.571764909 0.137600096
[86] 1.191159371 -2.513153153 0.697285220 0.004408654 -0.723988140
[91] 1.397503495 1.398397056 -0.861377289 -0.782534046 0.898340863
[96] 1.460615299 0.561510674 1.516514315 1.739533828 0.024483519
> 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.447152575 2.112416289 -0.943059788 -0.301676821 0.891289835
[6] 0.131434093 0.529463950 -0.843506241 -1.901160822 0.668636192
[11] 1.319288297 -1.874800470 -1.418569143 0.050381051 -1.349982905
[16] 0.529589805 2.922442990 0.396059443 0.893286553 -2.007672061
[21] -0.292841786 -0.223261924 -0.473241372 -2.178241117 -0.026113419
[26] 0.761188913 -0.593001768 0.263311560 0.640844818 0.346573627
[31] -0.440325723 0.521717738 -0.030772369 0.848592680 1.913166031
[36] 0.314597483 -1.094438402 -0.223461511 -1.634845588 -0.561134946
[41] -0.461072140 0.331840676 -0.445670502 2.775060629 0.561377775
[46] 0.168535187 -0.910790177 -0.741953000 1.898293821 0.798824045
[51] 1.236079096 1.917764112 -0.853608391 0.511538059 -0.874274026
[56] 0.420481079 -0.654600045 0.238178417 -1.710097873 0.106133937
[61] -0.868621296 -1.244216254 0.319847682 -0.644232338 -0.245363921
[66] -1.361087634 0.659724728 0.888613491 -1.327625691 -0.633288285
[71] 0.218239340 1.250503728 -0.170897385 -1.226744358 1.395626491
[76] -0.476364088 -2.915866567 0.556252642 -0.706147292 0.630277326
[81] -0.116430551 -0.613160561 0.155872705 1.571764909 0.137600096
[86] 1.191159371 -2.513153153 0.697285220 0.004408654 -0.723988140
[91] 1.397503495 1.398397056 -0.861377289 -0.782534046 0.898340863
[96] 1.460615299 0.561510674 1.516514315 1.739533828 0.024483519
> colMin(tmp)
[1] -0.447152575 2.112416289 -0.943059788 -0.301676821 0.891289835
[6] 0.131434093 0.529463950 -0.843506241 -1.901160822 0.668636192
[11] 1.319288297 -1.874800470 -1.418569143 0.050381051 -1.349982905
[16] 0.529589805 2.922442990 0.396059443 0.893286553 -2.007672061
[21] -0.292841786 -0.223261924 -0.473241372 -2.178241117 -0.026113419
[26] 0.761188913 -0.593001768 0.263311560 0.640844818 0.346573627
[31] -0.440325723 0.521717738 -0.030772369 0.848592680 1.913166031
[36] 0.314597483 -1.094438402 -0.223461511 -1.634845588 -0.561134946
[41] -0.461072140 0.331840676 -0.445670502 2.775060629 0.561377775
[46] 0.168535187 -0.910790177 -0.741953000 1.898293821 0.798824045
[51] 1.236079096 1.917764112 -0.853608391 0.511538059 -0.874274026
[56] 0.420481079 -0.654600045 0.238178417 -1.710097873 0.106133937
[61] -0.868621296 -1.244216254 0.319847682 -0.644232338 -0.245363921
[66] -1.361087634 0.659724728 0.888613491 -1.327625691 -0.633288285
[71] 0.218239340 1.250503728 -0.170897385 -1.226744358 1.395626491
[76] -0.476364088 -2.915866567 0.556252642 -0.706147292 0.630277326
[81] -0.116430551 -0.613160561 0.155872705 1.571764909 0.137600096
[86] 1.191159371 -2.513153153 0.697285220 0.004408654 -0.723988140
[91] 1.397503495 1.398397056 -0.861377289 -0.782534046 0.898340863
[96] 1.460615299 0.561510674 1.516514315 1.739533828 0.024483519
> colMedians(tmp)
[1] -0.447152575 2.112416289 -0.943059788 -0.301676821 0.891289835
[6] 0.131434093 0.529463950 -0.843506241 -1.901160822 0.668636192
[11] 1.319288297 -1.874800470 -1.418569143 0.050381051 -1.349982905
[16] 0.529589805 2.922442990 0.396059443 0.893286553 -2.007672061
[21] -0.292841786 -0.223261924 -0.473241372 -2.178241117 -0.026113419
[26] 0.761188913 -0.593001768 0.263311560 0.640844818 0.346573627
[31] -0.440325723 0.521717738 -0.030772369 0.848592680 1.913166031
[36] 0.314597483 -1.094438402 -0.223461511 -1.634845588 -0.561134946
[41] -0.461072140 0.331840676 -0.445670502 2.775060629 0.561377775
[46] 0.168535187 -0.910790177 -0.741953000 1.898293821 0.798824045
[51] 1.236079096 1.917764112 -0.853608391 0.511538059 -0.874274026
[56] 0.420481079 -0.654600045 0.238178417 -1.710097873 0.106133937
[61] -0.868621296 -1.244216254 0.319847682 -0.644232338 -0.245363921
[66] -1.361087634 0.659724728 0.888613491 -1.327625691 -0.633288285
[71] 0.218239340 1.250503728 -0.170897385 -1.226744358 1.395626491
[76] -0.476364088 -2.915866567 0.556252642 -0.706147292 0.630277326
[81] -0.116430551 -0.613160561 0.155872705 1.571764909 0.137600096
[86] 1.191159371 -2.513153153 0.697285220 0.004408654 -0.723988140
[91] 1.397503495 1.398397056 -0.861377289 -0.782534046 0.898340863
[96] 1.460615299 0.561510674 1.516514315 1.739533828 0.024483519
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.4471526 2.112416 -0.9430598 -0.3016768 0.8912898 0.1314341 0.529464
[2,] -0.4471526 2.112416 -0.9430598 -0.3016768 0.8912898 0.1314341 0.529464
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.8435062 -1.901161 0.6686362 1.319288 -1.8748 -1.418569 0.05038105
[2,] -0.8435062 -1.901161 0.6686362 1.319288 -1.8748 -1.418569 0.05038105
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.349983 0.5295898 2.922443 0.3960594 0.8932866 -2.007672 -0.2928418
[2,] -1.349983 0.5295898 2.922443 0.3960594 0.8932866 -2.007672 -0.2928418
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.2232619 -0.4732414 -2.178241 -0.02611342 0.7611889 -0.5930018 0.2633116
[2,] -0.2232619 -0.4732414 -2.178241 -0.02611342 0.7611889 -0.5930018 0.2633116
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.6408448 0.3465736 -0.4403257 0.5217177 -0.03077237 0.8485927 1.913166
[2,] 0.6408448 0.3465736 -0.4403257 0.5217177 -0.03077237 0.8485927 1.913166
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.3145975 -1.094438 -0.2234615 -1.634846 -0.5611349 -0.4610721 0.3318407
[2,] 0.3145975 -1.094438 -0.2234615 -1.634846 -0.5611349 -0.4610721 0.3318407
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.4456705 2.775061 0.5613778 0.1685352 -0.9107902 -0.741953 1.898294
[2,] -0.4456705 2.775061 0.5613778 0.1685352 -0.9107902 -0.741953 1.898294
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.798824 1.236079 1.917764 -0.8536084 0.5115381 -0.874274 0.4204811
[2,] 0.798824 1.236079 1.917764 -0.8536084 0.5115381 -0.874274 0.4204811
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.6546 0.2381784 -1.710098 0.1061339 -0.8686213 -1.244216 0.3198477
[2,] -0.6546 0.2381784 -1.710098 0.1061339 -0.8686213 -1.244216 0.3198477
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.6442323 -0.2453639 -1.361088 0.6597247 0.8886135 -1.327626 -0.6332883
[2,] -0.6442323 -0.2453639 -1.361088 0.6597247 0.8886135 -1.327626 -0.6332883
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.2182393 1.250504 -0.1708974 -1.226744 1.395626 -0.4763641 -2.915867
[2,] 0.2182393 1.250504 -0.1708974 -1.226744 1.395626 -0.4763641 -2.915867
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.5562526 -0.7061473 0.6302773 -0.1164306 -0.6131606 0.1558727 1.571765
[2,] 0.5562526 -0.7061473 0.6302773 -0.1164306 -0.6131606 0.1558727 1.571765
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.1376001 1.191159 -2.513153 0.6972852 0.004408654 -0.7239881 1.397503
[2,] 0.1376001 1.191159 -2.513153 0.6972852 0.004408654 -0.7239881 1.397503
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.398397 -0.8613773 -0.782534 0.8983409 1.460615 0.5615107 1.516514
[2,] 1.398397 -0.8613773 -0.782534 0.8983409 1.460615 0.5615107 1.516514
[,99] [,100]
[1,] 1.739534 0.02448352
[2,] 1.739534 0.02448352
>
>
> Max(tmp2)
[1] 2.1344
> Min(tmp2)
[1] -2.349225
> mean(tmp2)
[1] -0.1072693
> Sum(tmp2)
[1] -10.72693
> Var(tmp2)
[1] 0.9553902
>
> rowMeans(tmp2)
[1] -1.451029917 0.213501037 -1.926153924 -0.411276925 0.942412341
[6] -0.262109662 -0.703420452 0.124375000 1.832561709 0.919994735
[11] 0.930771568 -0.595293306 0.096916331 0.290993622 -0.955325485
[16] -1.106306663 -0.279539055 0.946115250 1.252326258 1.032381649
[21] 1.372668832 0.778158721 -0.249038699 -1.018085172 0.971333167
[26] -0.602121040 -1.433717223 -2.095489530 -1.340905245 0.325185638
[31] 0.017058646 -0.549869638 -0.278118018 -0.454904952 -0.001687433
[36] -1.168188745 -0.681744371 0.349595016 -0.849755907 0.437868086
[41] 0.181251966 -0.290472383 0.048755070 -0.630662965 0.360949407
[46] 0.920207824 -0.872450403 -1.405359807 -0.312982127 1.445625266
[51] -1.267886024 -0.566925159 -0.027581194 -0.536208373 -0.493529287
[56] -1.719949374 0.780833992 0.546001816 0.618287224 0.338953368
[61] -0.902832577 -1.436779131 -0.401563524 1.758890716 0.575388408
[66] 0.124186190 0.403874055 -0.214232497 -1.286596045 0.061816525
[71] -0.925378151 -1.989682059 0.245377722 -0.919117993 -1.585451615
[76] 0.042647759 -1.254585966 -0.875949388 1.455802308 -0.442031058
[81] 0.120134940 -0.301312746 -0.605860065 -0.649758576 1.694275705
[86] -0.190830240 0.458796905 2.134400320 0.895393992 -2.349225160
[91] 0.116098165 0.348757936 0.935912712 -0.524910312 -0.941568082
[96] 0.349975754 -0.949901417 1.535729083 1.881929786 1.344250747
> rowSums(tmp2)
[1] -1.451029917 0.213501037 -1.926153924 -0.411276925 0.942412341
[6] -0.262109662 -0.703420452 0.124375000 1.832561709 0.919994735
[11] 0.930771568 -0.595293306 0.096916331 0.290993622 -0.955325485
[16] -1.106306663 -0.279539055 0.946115250 1.252326258 1.032381649
[21] 1.372668832 0.778158721 -0.249038699 -1.018085172 0.971333167
[26] -0.602121040 -1.433717223 -2.095489530 -1.340905245 0.325185638
[31] 0.017058646 -0.549869638 -0.278118018 -0.454904952 -0.001687433
[36] -1.168188745 -0.681744371 0.349595016 -0.849755907 0.437868086
[41] 0.181251966 -0.290472383 0.048755070 -0.630662965 0.360949407
[46] 0.920207824 -0.872450403 -1.405359807 -0.312982127 1.445625266
[51] -1.267886024 -0.566925159 -0.027581194 -0.536208373 -0.493529287
[56] -1.719949374 0.780833992 0.546001816 0.618287224 0.338953368
[61] -0.902832577 -1.436779131 -0.401563524 1.758890716 0.575388408
[66] 0.124186190 0.403874055 -0.214232497 -1.286596045 0.061816525
[71] -0.925378151 -1.989682059 0.245377722 -0.919117993 -1.585451615
[76] 0.042647759 -1.254585966 -0.875949388 1.455802308 -0.442031058
[81] 0.120134940 -0.301312746 -0.605860065 -0.649758576 1.694275705
[86] -0.190830240 0.458796905 2.134400320 0.895393992 -2.349225160
[91] 0.116098165 0.348757936 0.935912712 -0.524910312 -0.941568082
[96] 0.349975754 -0.949901417 1.535729083 1.881929786 1.344250747
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -1.451029917 0.213501037 -1.926153924 -0.411276925 0.942412341
[6] -0.262109662 -0.703420452 0.124375000 1.832561709 0.919994735
[11] 0.930771568 -0.595293306 0.096916331 0.290993622 -0.955325485
[16] -1.106306663 -0.279539055 0.946115250 1.252326258 1.032381649
[21] 1.372668832 0.778158721 -0.249038699 -1.018085172 0.971333167
[26] -0.602121040 -1.433717223 -2.095489530 -1.340905245 0.325185638
[31] 0.017058646 -0.549869638 -0.278118018 -0.454904952 -0.001687433
[36] -1.168188745 -0.681744371 0.349595016 -0.849755907 0.437868086
[41] 0.181251966 -0.290472383 0.048755070 -0.630662965 0.360949407
[46] 0.920207824 -0.872450403 -1.405359807 -0.312982127 1.445625266
[51] -1.267886024 -0.566925159 -0.027581194 -0.536208373 -0.493529287
[56] -1.719949374 0.780833992 0.546001816 0.618287224 0.338953368
[61] -0.902832577 -1.436779131 -0.401563524 1.758890716 0.575388408
[66] 0.124186190 0.403874055 -0.214232497 -1.286596045 0.061816525
[71] -0.925378151 -1.989682059 0.245377722 -0.919117993 -1.585451615
[76] 0.042647759 -1.254585966 -0.875949388 1.455802308 -0.442031058
[81] 0.120134940 -0.301312746 -0.605860065 -0.649758576 1.694275705
[86] -0.190830240 0.458796905 2.134400320 0.895393992 -2.349225160
[91] 0.116098165 0.348757936 0.935912712 -0.524910312 -0.941568082
[96] 0.349975754 -0.949901417 1.535729083 1.881929786 1.344250747
> rowMin(tmp2)
[1] -1.451029917 0.213501037 -1.926153924 -0.411276925 0.942412341
[6] -0.262109662 -0.703420452 0.124375000 1.832561709 0.919994735
[11] 0.930771568 -0.595293306 0.096916331 0.290993622 -0.955325485
[16] -1.106306663 -0.279539055 0.946115250 1.252326258 1.032381649
[21] 1.372668832 0.778158721 -0.249038699 -1.018085172 0.971333167
[26] -0.602121040 -1.433717223 -2.095489530 -1.340905245 0.325185638
[31] 0.017058646 -0.549869638 -0.278118018 -0.454904952 -0.001687433
[36] -1.168188745 -0.681744371 0.349595016 -0.849755907 0.437868086
[41] 0.181251966 -0.290472383 0.048755070 -0.630662965 0.360949407
[46] 0.920207824 -0.872450403 -1.405359807 -0.312982127 1.445625266
[51] -1.267886024 -0.566925159 -0.027581194 -0.536208373 -0.493529287
[56] -1.719949374 0.780833992 0.546001816 0.618287224 0.338953368
[61] -0.902832577 -1.436779131 -0.401563524 1.758890716 0.575388408
[66] 0.124186190 0.403874055 -0.214232497 -1.286596045 0.061816525
[71] -0.925378151 -1.989682059 0.245377722 -0.919117993 -1.585451615
[76] 0.042647759 -1.254585966 -0.875949388 1.455802308 -0.442031058
[81] 0.120134940 -0.301312746 -0.605860065 -0.649758576 1.694275705
[86] -0.190830240 0.458796905 2.134400320 0.895393992 -2.349225160
[91] 0.116098165 0.348757936 0.935912712 -0.524910312 -0.941568082
[96] 0.349975754 -0.949901417 1.535729083 1.881929786 1.344250747
>
> colMeans(tmp2)
[1] -0.1072693
> colSums(tmp2)
[1] -10.72693
> colVars(tmp2)
[1] 0.9553902
> colSd(tmp2)
[1] 0.9774406
> colMax(tmp2)
[1] 2.1344
> colMin(tmp2)
[1] -2.349225
> colMedians(tmp2)
[1] -0.2025314
> colRanges(tmp2)
[,1]
[1,] -2.349225
[2,] 2.134400
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.6456676 -1.5524059 4.7629965 -0.6640503 -0.2730518 0.9234987
[7] -1.4702218 -6.3107714 4.3213541 7.3742814
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.14711014
[2,] -0.80147265
[3,] -0.18198672
[4,] -0.05316105
[5,] 0.97368626
>
> rowApply(tmp,sum)
[1] 3.890880301 -2.541625950 0.294881561 1.918342949 -0.005058849
[6] 0.642766178 0.575489923 -0.265010829 -2.301025187 2.256321672
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 8 2 7 4 6 3 3 1 1
[2,] 8 1 1 6 8 3 1 10 2 9
[3,] 4 4 7 8 10 2 10 9 10 5
[4,] 1 6 8 2 7 4 9 8 8 4
[5,] 10 3 5 1 6 1 8 4 5 8
[6,] 3 10 4 5 9 9 4 7 3 2
[7,] 6 2 10 9 1 8 2 2 6 3
[8,] 2 5 3 3 2 5 7 1 4 6
[9,] 9 9 6 10 3 7 5 5 7 7
[10,] 7 7 9 4 5 10 6 6 9 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 3.2435457 2.8909510 -2.0124372 0.7374680 0.5841838 2.1654494
[7] 0.8075952 -3.5059894 2.9833505 1.7239981 0.9342662 1.6227902
[13] -1.2395441 -6.9426360 -1.6473292 -1.2741881 -2.6058465 -1.7934704
[19] -0.1430520 4.3898434
> colApply(tmp,quantile)[,1]
[,1]
[1,] 0.1550051
[2,] 0.2466545
[3,] 0.3404337
[4,] 1.0311769
[5,] 1.4702756
>
> rowApply(tmp,sum)
[1] -4.3317060 1.2856136 -0.6886204 4.1458227 0.5078387
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 15 10 17 11 18
[2,] 18 9 18 10 12
[3,] 8 2 6 8 16
[4,] 17 15 8 2 13
[5,] 6 19 4 14 17
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.3404337 0.77260980 -0.650567538 0.6193544 -0.7450957 -1.2017230
[2,] 0.1550051 -0.05826029 -1.537736278 0.9007771 1.3511866 1.0772205
[3,] 1.4702756 1.59622862 -0.740767375 -0.2602543 -1.4543587 0.6210034
[4,] 0.2466545 0.20964441 -0.006506851 -0.9603541 0.4147036 0.4338192
[5,] 1.0311769 0.37072846 0.923140887 0.4379450 1.0177480 1.2351292
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.1629778 -1.2212347 0.2493697 0.3951452 -0.2619211 -1.2346305
[2,] 0.4406832 -1.0863687 1.1009888 0.7745177 0.8801062 1.9039625
[3,] 1.6382816 0.1652575 1.8691340 0.5651105 0.2499814 -0.2268320
[4,] -1.0786892 -0.7822464 1.2182887 0.2638636 0.4699264 1.8436440
[5,] -0.3556582 -0.5813970 -1.4544307 -0.2746389 -0.4038268 -0.6633538
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.3939492 -2.4204387 -0.7331065 0.0786642 1.1355988 0.1337952
[2,] -1.5635319 -1.5160377 -0.4104462 -0.7931670 -1.1958903 -0.2080226
[3,] 0.4444388 -1.5077481 -0.9660907 -1.9644530 -2.1269705 -0.1837091
[4,] -0.2889419 -0.5497255 -0.2666450 1.1893838 0.1331430 -0.6145132
[5,] 1.5624400 -0.9486860 0.7289593 0.2153839 -0.5517275 -0.9210207
[,19] [,20]
[1,] -0.3339275 1.9769395
[2,] 0.1664941 0.9041330
[3,] -0.5260161 0.6488681
[4,] 1.8675529 0.4028206
[5,] -1.3171555 0.4570822
>
>
> 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 : 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6593735 0.5305932 1.199525 -0.7963612 -0.8650033 0.462973 -0.6440884
col8 col9 col10 col11 col12 col13 col14
row1 1.125977 -1.208365 0.7143008 -0.01329866 0.2884404 -0.3312918 -0.4784858
col15 col16 col17 col18 col19 col20
row1 -1.51484 0.1744201 -0.9159258 -1.678826 0.3273982 0.9203248
> tmp[,"col10"]
col10
row1 0.7143008
row2 0.6922503
row3 0.4700388
row4 1.1878317
row5 0.1313535
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6593735 0.5305932 1.1995249 -0.7963612 -0.8650033 0.4629730 -0.6440884
row5 -0.1995843 0.7322316 0.0230745 1.5431152 0.1238062 -0.5952818 0.2181526
col8 col9 col10 col11 col12 col13 col14
row1 1.125977 -1.208365 0.7143008 -0.01329866 0.28844040 -0.3312918 -0.4784858
row5 1.125929 1.188078 0.1313535 -0.70902037 0.06891684 -1.2532005 0.3410132
col15 col16 col17 col18 col19 col20
row1 -1.5148403 0.1744201 -0.9159258 -1.6788258 0.3273982 0.9203248
row5 0.3921471 -1.6048263 2.1402518 0.5122001 -2.6186516 1.0939372
> tmp[,c("col6","col20")]
col6 col20
row1 0.4629730 0.9203248
row2 -1.0062514 -2.1219642
row3 0.1882107 0.5092619
row4 -1.6925934 -1.2985740
row5 -0.5952818 1.0939372
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.4629730 0.9203248
row5 -0.5952818 1.0939372
>
>
>
>
> 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 50.7139 50.15518 50.16942 51.15658 50.51746 104.0751 49.24837 50.58605
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41775 48.09256 50.14225 51.96211 51.31468 48.81723 51.03875 49.51353
col17 col18 col19 col20
row1 50.51519 50.77828 49.84899 105.714
> tmp[,"col10"]
col10
row1 48.09256
row2 30.40241
row3 30.31962
row4 29.65274
row5 49.14946
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.71390 50.15518 50.16942 51.15658 50.51746 104.0751 49.24837 50.58605
row5 50.75397 50.59995 50.22290 52.04018 50.84776 105.2770 47.61722 48.56505
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41775 48.09256 50.14225 51.96211 51.31468 48.81723 51.03875 49.51353
row5 50.35677 49.14946 51.25657 51.12581 49.31749 48.57190 51.97294 49.42997
col17 col18 col19 col20
row1 50.51519 50.77828 49.84899 105.7140
row5 50.50234 50.34950 49.94273 104.7917
> tmp[,c("col6","col20")]
col6 col20
row1 104.07510 105.71400
row2 74.09270 76.61841
row3 73.75962 73.54223
row4 74.40085 76.64605
row5 105.27697 104.79173
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.0751 105.7140
row5 105.2770 104.7917
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.0751 105.7140
row5 105.2770 104.7917
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.8593196
[2,] -0.6322346
[3,] 1.4973526
[4,] 0.3028609
[5,] 1.1782804
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.9331323 0.09571337
[2,] -1.4864326 2.19425284
[3,] -0.7831295 1.39402271
[4,] 1.3752516 2.36141554
[5,] -2.8163742 -1.46050322
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.495747805 0.8634895
[2,] -1.545841814 1.4772246
[3,] 1.116183652 0.3091251
[4,] 0.783149387 0.3488040
[5,] -0.005343177 -0.3066285
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.4957478
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.4957478
[2,] -1.5458418
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.9986579 1.66202210 -0.323575 0.4512269 0.3338579 -0.9415958
row1 -0.3780347 -0.01505983 -0.206195 1.6235071 -1.2233314 -1.9505307
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.5720564 0.8077777 1.60063943 -1.499751 1.2633662 -1.232764 1.1146296
row1 -0.3328593 0.5756446 -0.04567388 1.127867 -0.6104391 1.399677 0.4076656
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 0.2256208 -0.2188242 -1.0183507 0.6428583 0.8199943 -1.017918 -1.3666913
row1 1.5036379 -1.7554782 -0.8120111 -1.4149329 -1.6284589 -1.176661 0.6975503
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.309235 -0.2768552 -1.745586 1.336692 1.445208 0.04905604 0.2264355
[,8] [,9] [,10]
row2 -0.5668325 1.421221 0.7796485
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.6926231 -0.3606161 0.4278944 -0.6863061 -0.2089971 -1.059421 0.5609311
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3694988 1.198057 -0.3552558 1.300182 3.016899 -0.2576232 -0.5077185
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3358515 0.518831 0.6584504 -1.305321 0.2466701 -0.06047415
>
>
> 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: 0x64f1504495b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80ec9e9ba"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80573362ac"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80396b2dc1"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80f693c04"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c8026498175"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c801ce2d4f4"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80b21db06"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80798e541c"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c8066851b0f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c803a2fe837"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c805b13d9fc"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c802c0a325e"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c801ca7c36f"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c80263b0f32"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2a5c804abd4267"
>
>
> ### 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: 0x64f1509df200>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x64f1509df200>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x64f1509df200>
> rowMedians(tmp)
[1] -0.2396603157 0.1527974438 -0.0202729414 -0.0755070314 -0.2699292382
[6] -0.5683556835 -0.0688111556 0.4940990003 -0.1830545180 0.3896623734
[11] 0.2616733718 0.0960866109 -0.0119609495 -0.6657151151 -0.1657390853
[16] 0.1726495857 -0.0672881779 -0.1399514263 0.1972303137 -0.0954616003
[21] -0.2727443148 -0.2999146017 0.3634838976 -0.4140656282 -0.5009902591
[26] -0.3817544932 -0.3455099845 -0.5663036796 0.4541658164 -0.2441678329
[31] -0.1878088804 -0.1370890610 0.1752382115 0.1118874407 -0.1230387828
[36] 0.2100687251 0.1303373380 -0.0470825065 -0.1361806369 0.4396531789
[41] -0.7265757985 -0.3698797184 0.0115038129 -0.0699438836 0.4883267555
[46] -0.0006558542 0.5708023386 -0.8651372824 0.0803129278 -0.3434496958
[51] 0.4119242958 0.2982385901 -0.4856270824 0.4345239801 0.0439024744
[56] -0.6174570467 -0.2974357224 -0.0060799152 -0.1040427074 -0.0386704356
[61] 0.1186259925 -0.1275415553 -0.4411633664 0.3468181373 0.1534115078
[66] -0.1789360760 0.0582064643 -0.6180000407 -0.2100987317 0.2612600589
[71] -0.1536580483 0.2197307668 0.2369737991 -0.1185698344 0.2120329810
[76] -0.2841702343 0.1567875834 -0.1029010508 -0.2181242422 0.3172978142
[81] -0.2863434194 0.0515401660 -0.0332696895 0.7178389511 -0.8849078366
[86] -0.2040855347 0.7714305398 -0.2421508653 0.3624217328 -0.0592879998
[91] 0.1960198676 0.0207695508 0.0003975533 -0.2024614974 -0.4204473231
[96] -0.2061132857 -0.3397349468 0.0687595684 0.2612898062 0.2103129837
[101] 0.0819056639 0.0057890777 -0.0604823085 0.2744825558 0.3080922167
[106] -0.3360217704 0.1569070620 -0.1983964932 -0.8789168199 0.4825735018
[111] -0.5571562868 -0.1302858944 -0.1301129492 0.3419520023 0.8554292963
[116] 0.0274833758 0.0768852397 0.5821054256 -0.0127640334 0.1076231401
[121] -0.5296892140 -0.4807736196 0.3397354816 0.2577018288 -0.0299380043
[126] -0.2676613462 -0.1031780653 -0.1746451691 -0.1905311932 0.4829773480
[131] -0.0882710961 -0.0072231935 0.2038892616 0.4287532384 -0.2438476972
[136] -0.1101937158 -0.2124866913 -0.2304687086 -0.2195300357 -0.2843995688
[141] 0.2916848635 0.2355904766 -0.5191330633 0.5181189841 -0.0713225844
[146] -0.2143213063 0.1137021715 0.5237603073 -0.1172375042 0.1481513998
[151] -0.0979094671 0.3384142090 0.3532418839 0.4508978171 -0.0169123879
[156] 0.4519623047 0.0066355746 -0.2937488361 -0.3527747626 -0.0797931647
[161] 0.5501149228 -0.5035384027 0.0234691737 0.2093983980 -0.4835445664
[166] 0.6663523305 -0.6536585830 0.3734821587 -0.2222721194 0.7941078968
[171] -0.3678315857 0.0997983081 0.0353905866 -0.1186058483 0.0476488671
[176] -0.0037595965 0.4671529308 -0.1762923639 0.3115772828 0.1555939165
[181] -0.0605677114 -0.1392341224 0.3249864444 0.2942728255 -0.3921236127
[186] -0.2354291611 -0.9602253774 -0.0891390934 0.1611598227 0.3055466364
[191] 0.5617158348 0.1125064152 0.0377405758 -0.1737101113 0.0882070966
[196] 1.0187990568 0.0229540240 -0.3413188397 -0.1222188651 -0.0827776482
[201] -0.8165222600 0.2869838861 -0.1039744932 -0.2347573607 -0.1592078824
[206] -0.2809082809 0.2706080008 -0.0002731518 -0.1604104257 0.4828798266
[211] -0.6707735817 0.1603552888 -0.0256522792 0.1304192879 0.0851046104
[216] 0.0827891526 0.0827452944 0.1933271620 0.3154165089 -0.0005731290
[221] -0.5198789552 0.3608404181 0.2620127396 -0.0367046800 0.2078583506
[226] -0.3023479159 -0.0718640656 -0.0652461416 0.4140828339 -0.0484516781
>
> proc.time()
user system elapsed
1.239 0.683 1.912
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: 0x6096e5e96370>
> .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: 0x6096e5e96370>
> .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: 0x6096e5e96370>
> .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: 0x6096e5e96370>
> 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: 0x6096e5e7e1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e5e7e1c0>
> .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: 0x6096e5e7e1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e5e7e1c0>
> .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: 0x6096e5e7e1c0>
> 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: 0x6096e6161120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e6161120>
> .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: 0x6096e6161120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6096e6161120>
> .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: 0x6096e6161120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6096e6161120>
> .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: 0x6096e6161120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6096e6161120>
> .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: 0x6096e6161120>
> 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: 0x6096e4eb1390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6096e4eb1390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e4eb1390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e4eb1390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2a5d1b67da8605" "BufferedMatrixFile2a5d1b7a1a8a73"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2a5d1b67da8605" "BufferedMatrixFile2a5d1b7a1a8a73"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e4da83d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e4da83d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6096e4da83d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6096e4da83d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6096e4da83d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6096e4da83d0>
> .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: 0x6096e68ddfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6096e68ddfa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6096e68ddfa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6096e68ddfa0>
> 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: 0x6096e50b5ff0>
> .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: 0x6096e50b5ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.245 0.051 0.283
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.248 0.035 0.273