| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-08 11:34 -0400 (Fri, 08 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4992 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There" | 4725 |
| 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 262/2418 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
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.76.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.76.0.tar.gz |
| StartedAt: 2026-05-08 05:55:41 -0400 (Fri, 08 May 2026) |
| EndedAt: 2026-05-08 05:56:01 -0400 (Fri, 08 May 2026) |
| EllapsedTime: 20.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 Patched (2026-04-24 r89963)
* using platform: aarch64-apple-darwin23
* R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-05-08 09:55:41 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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 ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* 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 dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* 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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6/Resources/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.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.119 0.052 0.165
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 482663 25.8 1063027 56.8 NA 632020 33.8
Vcells 893071 6.9 8388608 64.0 196608 2112201 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri May 8 05:55:52 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri May 8 05:55:52 2026"
>
>
> 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: 0xc57214000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri May 8 05:55:53 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri May 8 05:55:54 2026"
>
> ColMode(tmp2)
<pointer: 0xc57214000>
>
>
>
> ### 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.4722326 -0.43718565 -0.8145598 -1.0252151
[2,] 0.3890945 -0.60996220 0.1781986 -1.6959453
[3,] 0.1680431 -1.23429567 0.1944925 0.9604938
[4,] -0.5816168 0.04054752 -0.1068553 -0.8848428
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.4722326 0.43718565 0.8145598 1.0252151
[2,] 0.3890945 0.60996220 0.1781986 1.6959453
[3,] 0.1680431 1.23429567 0.1944925 0.9604938
[4,] 0.5816168 0.04054752 0.1068553 0.8848428
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0235838 0.6612002 0.9025297 1.0125290
[2,] 0.6237744 0.7810008 0.4221357 1.3022846
[3,] 0.4099307 1.1109886 0.4410130 0.9800478
[4,] 0.7626381 0.2013642 0.3268873 0.9406608
>
> 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: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.70807 32.04919 34.83986 36.15051
[2,] 31.62684 33.41997 29.39956 39.71879
[3,] 29.26735 37.34418 29.60462 35.76097
[4,] 33.20800 27.05419 28.37573 35.29145
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xc572140c0>
> exp(tmp5)
<pointer: 0xc572140c0>
> log(tmp5,2)
<pointer: 0xc572140c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.7818
> Min(tmp5)
[1] 53.72341
> mean(tmp5)
[1] 72.8199
> Sum(tmp5)
[1] 14563.98
> Var(tmp5)
[1] 860.0169
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 87.92432 70.68740 69.30187 69.18356 70.85588 72.28529 74.10138 73.23010
[9] 69.41602 71.21314
> rowSums(tmp5)
[1] 1758.486 1413.748 1386.037 1383.671 1417.118 1445.706 1482.028 1464.602
[9] 1388.320 1424.263
> rowVars(tmp5)
[1] 8120.40322 49.16227 65.10330 40.51167 97.91101 80.77886
[7] 47.35433 70.09026 73.88510 69.27945
> rowSd(tmp5)
[1] 90.113280 7.011581 8.068661 6.364878 9.894999 8.987706 6.881448
[8] 8.371993 8.595644 8.323428
> rowMax(tmp5)
[1] 469.78178 82.66946 83.51777 78.41522 94.33508 87.62865 83.06122
[8] 86.21185 87.64880 84.33764
> rowMin(tmp5)
[1] 56.82020 56.20030 54.94243 56.30975 55.20283 57.26842 63.02470 55.64143
[9] 53.72341 55.47539
>
> colMeans(tmp5)
[1] 109.09426 67.65925 67.95078 70.70211 68.86661 69.92633 70.06682
[8] 76.82968 73.00312 71.90469 69.67532 71.31238 72.26551 69.86152
[15] 72.25591 67.64709 70.25297 72.38230 72.05480 72.68647
> colSums(tmp5)
[1] 1090.9426 676.5925 679.5078 707.0211 688.6661 699.2633 700.6682
[8] 768.2968 730.0312 719.0469 696.7532 713.1238 722.6551 698.6152
[15] 722.5591 676.4709 702.5297 723.8230 720.5480 726.8647
> colVars(tmp5)
[1] 16102.62234 98.74454 55.24837 62.08237 37.46822 36.77994
[7] 81.74633 39.98082 119.87675 37.30318 98.71611 181.15030
[13] 40.70387 87.04354 60.29215 76.91559 43.50131 49.99810
[19] 38.49944 28.51597
> colSd(tmp5)
[1] 126.896108 9.937029 7.432925 7.879236 6.121129 6.064647
[7] 9.041368 6.323039 10.948824 6.107633 9.935598 13.459209
[13] 6.379959 9.329713 7.764802 8.770154 6.595552 7.070933
[19] 6.204791 5.340034
> colMax(tmp5)
[1] 469.78178 84.93088 79.54000 82.66946 81.26424 80.60413 87.62865
[8] 87.64880 84.33764 81.52205 82.13338 94.33508 80.95571 81.02000
[15] 84.60001 83.51777 79.43800 86.21185 79.65139 79.09240
> colMin(tmp5)
[1] 60.91615 55.64143 59.06036 59.44314 59.01589 62.26903 59.09134 62.73713
[9] 56.01709 60.34941 53.72341 54.94243 63.43190 58.62059 56.82020 55.20283
[17] 58.55786 64.60662 60.59659 60.10886
>
>
> ### 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] 87.92432 70.68740 69.30187 69.18356 70.85588 72.28529 74.10138 73.23010
[9] NA 71.21314
> rowSums(tmp5)
[1] 1758.486 1413.748 1386.037 1383.671 1417.118 1445.706 1482.028 1464.602
[9] NA 1424.263
> rowVars(tmp5)
[1] 8120.40322 49.16227 65.10330 40.51167 97.91101 80.77886
[7] 47.35433 70.09026 63.58877 69.27945
> rowSd(tmp5)
[1] 90.113280 7.011581 8.068661 6.364878 9.894999 8.987706 6.881448
[8] 8.371993 7.974257 8.323428
> rowMax(tmp5)
[1] 469.78178 82.66946 83.51777 78.41522 94.33508 87.62865 83.06122
[8] 86.21185 NA 84.33764
> rowMin(tmp5)
[1] 56.82020 56.20030 54.94243 56.30975 55.20283 57.26842 63.02470 55.64143
[9] NA 55.47539
>
> colMeans(tmp5)
[1] 109.09426 67.65925 67.95078 70.70211 68.86661 69.92633 70.06682
[8] 76.82968 73.00312 71.90469 NA 71.31238 72.26551 69.86152
[15] 72.25591 67.64709 70.25297 72.38230 72.05480 72.68647
> colSums(tmp5)
[1] 1090.9426 676.5925 679.5078 707.0211 688.6661 699.2633 700.6682
[8] 768.2968 730.0312 719.0469 NA 713.1238 722.6551 698.6152
[15] 722.5591 676.4709 702.5297 723.8230 720.5480 726.8647
> colVars(tmp5)
[1] 16102.62234 98.74454 55.24837 62.08237 37.46822 36.77994
[7] 81.74633 39.98082 119.87675 37.30318 NA 181.15030
[13] 40.70387 87.04354 60.29215 76.91559 43.50131 49.99810
[19] 38.49944 28.51597
> colSd(tmp5)
[1] 126.896108 9.937029 7.432925 7.879236 6.121129 6.064647
[7] 9.041368 6.323039 10.948824 6.107633 NA 13.459209
[13] 6.379959 9.329713 7.764802 8.770154 6.595552 7.070933
[19] 6.204791 5.340034
> colMax(tmp5)
[1] 469.78178 84.93088 79.54000 82.66946 81.26424 80.60413 87.62865
[8] 87.64880 84.33764 81.52205 NA 94.33508 80.95571 81.02000
[15] 84.60001 83.51777 79.43800 86.21185 79.65139 79.09240
> colMin(tmp5)
[1] 60.91615 55.64143 59.06036 59.44314 59.01589 62.26903 59.09134 62.73713
[9] 56.01709 60.34941 NA 54.94243 63.43190 58.62059 56.82020 55.20283
[17] 58.55786 64.60662 60.59659 60.10886
>
> Max(tmp5,na.rm=TRUE)
[1] 469.7818
> Min(tmp5,na.rm=TRUE)
[1] 54.94243
> mean(tmp5,na.rm=TRUE)
[1] 72.91586
> Sum(tmp5,na.rm=TRUE)
[1] 14510.26
> Var(tmp5,na.rm=TRUE)
[1] 862.5093
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.92432 70.68740 69.30187 69.18356 70.85588 72.28529 74.10138 73.23010
[9] 70.24195 71.21314
> rowSums(tmp5,na.rm=TRUE)
[1] 1758.486 1413.748 1386.037 1383.671 1417.118 1445.706 1482.028 1464.602
[9] 1334.597 1424.263
> rowVars(tmp5,na.rm=TRUE)
[1] 8120.40322 49.16227 65.10330 40.51167 97.91101 80.77886
[7] 47.35433 70.09026 63.58877 69.27945
> rowSd(tmp5,na.rm=TRUE)
[1] 90.113280 7.011581 8.068661 6.364878 9.894999 8.987706 6.881448
[8] 8.371993 7.974257 8.323428
> rowMax(tmp5,na.rm=TRUE)
[1] 469.78178 82.66946 83.51777 78.41522 94.33508 87.62865 83.06122
[8] 86.21185 87.64880 84.33764
> rowMin(tmp5,na.rm=TRUE)
[1] 56.82020 56.20030 54.94243 56.30975 55.20283 57.26842 63.02470 55.64143
[9] 56.01709 55.47539
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.09426 67.65925 67.95078 70.70211 68.86661 69.92633 70.06682
[8] 76.82968 73.00312 71.90469 71.44775 71.31238 72.26551 69.86152
[15] 72.25591 67.64709 70.25297 72.38230 72.05480 72.68647
> colSums(tmp5,na.rm=TRUE)
[1] 1090.9426 676.5925 679.5078 707.0211 688.6661 699.2633 700.6682
[8] 768.2968 730.0312 719.0469 643.0298 713.1238 722.6551 698.6152
[15] 722.5591 676.4709 702.5297 723.8230 720.5480 726.8647
> colVars(tmp5,na.rm=TRUE)
[1] 16102.62234 98.74454 55.24837 62.08237 37.46822 36.77994
[7] 81.74633 39.98082 119.87675 37.30318 75.71350 181.15030
[13] 40.70387 87.04354 60.29215 76.91559 43.50131 49.99810
[19] 38.49944 28.51597
> colSd(tmp5,na.rm=TRUE)
[1] 126.896108 9.937029 7.432925 7.879236 6.121129 6.064647
[7] 9.041368 6.323039 10.948824 6.107633 8.701350 13.459209
[13] 6.379959 9.329713 7.764802 8.770154 6.595552 7.070933
[19] 6.204791 5.340034
> colMax(tmp5,na.rm=TRUE)
[1] 469.78178 84.93088 79.54000 82.66946 81.26424 80.60413 87.62865
[8] 87.64880 84.33764 81.52205 82.13338 94.33508 80.95571 81.02000
[15] 84.60001 83.51777 79.43800 86.21185 79.65139 79.09240
> colMin(tmp5,na.rm=TRUE)
[1] 60.91615 55.64143 59.06036 59.44314 59.01589 62.26903 59.09134 62.73713
[9] 56.01709 60.34941 58.64732 54.94243 63.43190 58.62059 56.82020 55.20283
[17] 58.55786 64.60662 60.59659 60.10886
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.92432 70.68740 69.30187 69.18356 70.85588 72.28529 74.10138 73.23010
[9] NaN 71.21314
> rowSums(tmp5,na.rm=TRUE)
[1] 1758.486 1413.748 1386.037 1383.671 1417.118 1445.706 1482.028 1464.602
[9] 0.000 1424.263
> rowVars(tmp5,na.rm=TRUE)
[1] 8120.40322 49.16227 65.10330 40.51167 97.91101 80.77886
[7] 47.35433 70.09026 NA 69.27945
> rowSd(tmp5,na.rm=TRUE)
[1] 90.113280 7.011581 8.068661 6.364878 9.894999 8.987706 6.881448
[8] 8.371993 NA 8.323428
> rowMax(tmp5,na.rm=TRUE)
[1] 469.78178 82.66946 83.51777 78.41522 94.33508 87.62865 83.06122
[8] 86.21185 NA 84.33764
> rowMin(tmp5,na.rm=TRUE)
[1] 56.82020 56.20030 54.94243 56.30975 55.20283 57.26842 63.02470 55.64143
[9] NA 55.47539
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.84468 68.11635 66.66309 71.44836 68.37371 69.53309 71.28632
[8] 75.62756 74.89045 72.32417 NaN 70.46605 73.24702 69.06925
[15] 72.80559 68.02495 69.23241 72.29805 72.28858 72.97462
> colSums(tmp5,na.rm=TRUE)
[1] 1024.6022 613.0472 599.9678 643.0352 615.3634 625.7978 641.5768
[8] 680.6480 674.0141 650.9176 0.0000 634.1945 659.2232 621.6233
[15] 655.2503 612.2246 623.0917 650.6825 650.5973 656.7716
> colVars(tmp5,na.rm=TRUE)
[1] 17861.57612 108.73699 43.50025 63.57773 39.41854 39.63779
[7] 75.23390 28.72102 94.78842 39.98647 NA 195.73610
[13] 34.95401 90.86251 64.42953 84.92378 37.22163 56.16802
[19] 42.69702 31.14636
> colSd(tmp5,na.rm=TRUE)
[1] 133.647208 10.427703 6.595472 7.973564 6.278419 6.295855
[7] 8.673748 5.359199 9.735934 6.323485 NA 13.990572
[13] 5.912191 9.532183 8.026801 9.215410 6.100953 7.494533
[19] 6.534296 5.580892
> colMax(tmp5,na.rm=TRUE)
[1] 469.78178 84.93088 75.75903 82.66946 81.26424 80.60413 87.62865
[8] 82.02681 84.33764 81.52205 -Inf 94.33508 80.95571 81.02000
[15] 84.60001 83.51777 75.85565 86.21185 79.65139 79.09240
> colMin(tmp5,na.rm=TRUE)
[1] 60.91615 55.64143 59.06036 59.44314 59.01589 62.26903 63.27301 62.73713
[9] 59.39736 60.34941 Inf 54.94243 63.84083 58.62059 56.82020 55.20283
[17] 58.55786 64.60662 60.59659 60.10886
>
>
>
>
> 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] 205.0787 230.4065 182.3572 354.6669 235.6423 180.9440 342.9866 166.4177
[9] 330.4664 377.9259
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 205.0787 230.4065 182.3572 354.6669 235.6423 180.9440 342.9866 166.4177
[9] 330.4664 377.9259
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -1.136868e-13 -2.273737e-13 -3.410605e-13 -8.526513e-14 -9.947598e-14
[6] 5.684342e-14 5.684342e-14 0.000000e+00 0.000000e+00 -1.136868e-13
[11] 0.000000e+00 2.273737e-13 -5.684342e-14 1.705303e-13 8.526513e-14
[16] 5.684342e-14 -1.421085e-13 -1.136868e-13 -5.684342e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 11
8 8
5 8
7 3
3 7
9 3
2 19
6 13
5 20
2 8
5 18
1 6
5 7
6 2
7 20
6 13
7 2
6 2
6 1
9 19
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] 1.759287
> Min(tmp)
[1] -1.974562
> mean(tmp)
[1] -0.08595804
> Sum(tmp)
[1] -8.595804
> Var(tmp)
[1] 0.8296222
>
> rowMeans(tmp)
[1] -0.08595804
> rowSums(tmp)
[1] -8.595804
> rowVars(tmp)
[1] 0.8296222
> rowSd(tmp)
[1] 0.910836
> rowMax(tmp)
[1] 1.759287
> rowMin(tmp)
[1] -1.974562
>
> colMeans(tmp)
[1] 0.662029242 0.801218110 -1.222431351 -0.421257136 -0.425049924
[6] 0.999538800 0.508794252 -0.059812619 -0.134695540 -1.092401721
[11] 0.457316914 -1.175767031 -0.463652676 1.387157850 1.291812828
[16] 1.653519535 -0.175711674 -0.452041539 0.245903947 -0.993282872
[21] -1.660327655 0.600860655 0.104517378 0.032257277 -1.974562154
[26] 0.405022995 -1.200549604 0.911542244 -0.697861181 0.171931000
[31] 0.780339679 -1.400074979 0.721800864 -1.042877541 -0.675969312
[36] 0.009352066 0.280408766 -0.131517032 0.769897483 -0.569593001
[41] -1.186123670 0.157037248 0.081724871 -0.296366394 1.584133791
[46] 0.837038022 0.599759017 -1.388681608 0.211082352 -0.524783418
[51] -1.137932890 0.676408303 -0.937338054 -0.154876544 -0.785656545
[56] 0.741857968 -0.864946480 -1.720908900 -0.078766296 0.245297766
[61] -1.225038425 0.798662943 0.039230248 -1.378485801 0.652340573
[66] 0.460223241 1.582783351 -0.261450564 -1.944092787 -0.043968983
[71] 0.453331293 -1.461513969 -1.022840182 0.315963201 1.020844767
[76] -0.485298581 1.046283799 0.611213637 1.759286998 0.608321067
[81] 0.021690944 -0.527806435 1.103499497 0.395290105 0.202815021
[86] 1.539786687 -0.745497542 0.775942736 -1.743771519 -0.160221847
[91] 1.521029915 -0.667889387 -0.796976541 -0.496277614 -0.348828651
[96] -0.587965527 -1.002577393 0.224218577 0.100102536 -1.811907296
> colSums(tmp)
[1] 0.662029242 0.801218110 -1.222431351 -0.421257136 -0.425049924
[6] 0.999538800 0.508794252 -0.059812619 -0.134695540 -1.092401721
[11] 0.457316914 -1.175767031 -0.463652676 1.387157850 1.291812828
[16] 1.653519535 -0.175711674 -0.452041539 0.245903947 -0.993282872
[21] -1.660327655 0.600860655 0.104517378 0.032257277 -1.974562154
[26] 0.405022995 -1.200549604 0.911542244 -0.697861181 0.171931000
[31] 0.780339679 -1.400074979 0.721800864 -1.042877541 -0.675969312
[36] 0.009352066 0.280408766 -0.131517032 0.769897483 -0.569593001
[41] -1.186123670 0.157037248 0.081724871 -0.296366394 1.584133791
[46] 0.837038022 0.599759017 -1.388681608 0.211082352 -0.524783418
[51] -1.137932890 0.676408303 -0.937338054 -0.154876544 -0.785656545
[56] 0.741857968 -0.864946480 -1.720908900 -0.078766296 0.245297766
[61] -1.225038425 0.798662943 0.039230248 -1.378485801 0.652340573
[66] 0.460223241 1.582783351 -0.261450564 -1.944092787 -0.043968983
[71] 0.453331293 -1.461513969 -1.022840182 0.315963201 1.020844767
[76] -0.485298581 1.046283799 0.611213637 1.759286998 0.608321067
[81] 0.021690944 -0.527806435 1.103499497 0.395290105 0.202815021
[86] 1.539786687 -0.745497542 0.775942736 -1.743771519 -0.160221847
[91] 1.521029915 -0.667889387 -0.796976541 -0.496277614 -0.348828651
[96] -0.587965527 -1.002577393 0.224218577 0.100102536 -1.811907296
> 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.662029242 0.801218110 -1.222431351 -0.421257136 -0.425049924
[6] 0.999538800 0.508794252 -0.059812619 -0.134695540 -1.092401721
[11] 0.457316914 -1.175767031 -0.463652676 1.387157850 1.291812828
[16] 1.653519535 -0.175711674 -0.452041539 0.245903947 -0.993282872
[21] -1.660327655 0.600860655 0.104517378 0.032257277 -1.974562154
[26] 0.405022995 -1.200549604 0.911542244 -0.697861181 0.171931000
[31] 0.780339679 -1.400074979 0.721800864 -1.042877541 -0.675969312
[36] 0.009352066 0.280408766 -0.131517032 0.769897483 -0.569593001
[41] -1.186123670 0.157037248 0.081724871 -0.296366394 1.584133791
[46] 0.837038022 0.599759017 -1.388681608 0.211082352 -0.524783418
[51] -1.137932890 0.676408303 -0.937338054 -0.154876544 -0.785656545
[56] 0.741857968 -0.864946480 -1.720908900 -0.078766296 0.245297766
[61] -1.225038425 0.798662943 0.039230248 -1.378485801 0.652340573
[66] 0.460223241 1.582783351 -0.261450564 -1.944092787 -0.043968983
[71] 0.453331293 -1.461513969 -1.022840182 0.315963201 1.020844767
[76] -0.485298581 1.046283799 0.611213637 1.759286998 0.608321067
[81] 0.021690944 -0.527806435 1.103499497 0.395290105 0.202815021
[86] 1.539786687 -0.745497542 0.775942736 -1.743771519 -0.160221847
[91] 1.521029915 -0.667889387 -0.796976541 -0.496277614 -0.348828651
[96] -0.587965527 -1.002577393 0.224218577 0.100102536 -1.811907296
> colMin(tmp)
[1] 0.662029242 0.801218110 -1.222431351 -0.421257136 -0.425049924
[6] 0.999538800 0.508794252 -0.059812619 -0.134695540 -1.092401721
[11] 0.457316914 -1.175767031 -0.463652676 1.387157850 1.291812828
[16] 1.653519535 -0.175711674 -0.452041539 0.245903947 -0.993282872
[21] -1.660327655 0.600860655 0.104517378 0.032257277 -1.974562154
[26] 0.405022995 -1.200549604 0.911542244 -0.697861181 0.171931000
[31] 0.780339679 -1.400074979 0.721800864 -1.042877541 -0.675969312
[36] 0.009352066 0.280408766 -0.131517032 0.769897483 -0.569593001
[41] -1.186123670 0.157037248 0.081724871 -0.296366394 1.584133791
[46] 0.837038022 0.599759017 -1.388681608 0.211082352 -0.524783418
[51] -1.137932890 0.676408303 -0.937338054 -0.154876544 -0.785656545
[56] 0.741857968 -0.864946480 -1.720908900 -0.078766296 0.245297766
[61] -1.225038425 0.798662943 0.039230248 -1.378485801 0.652340573
[66] 0.460223241 1.582783351 -0.261450564 -1.944092787 -0.043968983
[71] 0.453331293 -1.461513969 -1.022840182 0.315963201 1.020844767
[76] -0.485298581 1.046283799 0.611213637 1.759286998 0.608321067
[81] 0.021690944 -0.527806435 1.103499497 0.395290105 0.202815021
[86] 1.539786687 -0.745497542 0.775942736 -1.743771519 -0.160221847
[91] 1.521029915 -0.667889387 -0.796976541 -0.496277614 -0.348828651
[96] -0.587965527 -1.002577393 0.224218577 0.100102536 -1.811907296
> colMedians(tmp)
[1] 0.662029242 0.801218110 -1.222431351 -0.421257136 -0.425049924
[6] 0.999538800 0.508794252 -0.059812619 -0.134695540 -1.092401721
[11] 0.457316914 -1.175767031 -0.463652676 1.387157850 1.291812828
[16] 1.653519535 -0.175711674 -0.452041539 0.245903947 -0.993282872
[21] -1.660327655 0.600860655 0.104517378 0.032257277 -1.974562154
[26] 0.405022995 -1.200549604 0.911542244 -0.697861181 0.171931000
[31] 0.780339679 -1.400074979 0.721800864 -1.042877541 -0.675969312
[36] 0.009352066 0.280408766 -0.131517032 0.769897483 -0.569593001
[41] -1.186123670 0.157037248 0.081724871 -0.296366394 1.584133791
[46] 0.837038022 0.599759017 -1.388681608 0.211082352 -0.524783418
[51] -1.137932890 0.676408303 -0.937338054 -0.154876544 -0.785656545
[56] 0.741857968 -0.864946480 -1.720908900 -0.078766296 0.245297766
[61] -1.225038425 0.798662943 0.039230248 -1.378485801 0.652340573
[66] 0.460223241 1.582783351 -0.261450564 -1.944092787 -0.043968983
[71] 0.453331293 -1.461513969 -1.022840182 0.315963201 1.020844767
[76] -0.485298581 1.046283799 0.611213637 1.759286998 0.608321067
[81] 0.021690944 -0.527806435 1.103499497 0.395290105 0.202815021
[86] 1.539786687 -0.745497542 0.775942736 -1.743771519 -0.160221847
[91] 1.521029915 -0.667889387 -0.796976541 -0.496277614 -0.348828651
[96] -0.587965527 -1.002577393 0.224218577 0.100102536 -1.811907296
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.6620292 0.8012181 -1.222431 -0.4212571 -0.4250499 0.9995388 0.5087943
[2,] 0.6620292 0.8012181 -1.222431 -0.4212571 -0.4250499 0.9995388 0.5087943
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.05981262 -0.1346955 -1.092402 0.4573169 -1.175767 -0.4636527 1.387158
[2,] -0.05981262 -0.1346955 -1.092402 0.4573169 -1.175767 -0.4636527 1.387158
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.291813 1.65352 -0.1757117 -0.4520415 0.2459039 -0.9932829 -1.660328
[2,] 1.291813 1.65352 -0.1757117 -0.4520415 0.2459039 -0.9932829 -1.660328
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.6008607 0.1045174 0.03225728 -1.974562 0.405023 -1.20055 0.9115422
[2,] 0.6008607 0.1045174 0.03225728 -1.974562 0.405023 -1.20055 0.9115422
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.6978612 0.171931 0.7803397 -1.400075 0.7218009 -1.042878 -0.6759693
[2,] -0.6978612 0.171931 0.7803397 -1.400075 0.7218009 -1.042878 -0.6759693
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.009352066 0.2804088 -0.131517 0.7698975 -0.569593 -1.186124 0.1570372
[2,] 0.009352066 0.2804088 -0.131517 0.7698975 -0.569593 -1.186124 0.1570372
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.08172487 -0.2963664 1.584134 0.837038 0.599759 -1.388682 0.2110824
[2,] 0.08172487 -0.2963664 1.584134 0.837038 0.599759 -1.388682 0.2110824
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.5247834 -1.137933 0.6764083 -0.9373381 -0.1548765 -0.7856565 0.741858
[2,] -0.5247834 -1.137933 0.6764083 -0.9373381 -0.1548765 -0.7856565 0.741858
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.8649465 -1.720909 -0.0787663 0.2452978 -1.225038 0.7986629 0.03923025
[2,] -0.8649465 -1.720909 -0.0787663 0.2452978 -1.225038 0.7986629 0.03923025
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.378486 0.6523406 0.4602232 1.582783 -0.2614506 -1.944093 -0.04396898
[2,] -1.378486 0.6523406 0.4602232 1.582783 -0.2614506 -1.944093 -0.04396898
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.4533313 -1.461514 -1.02284 0.3159632 1.020845 -0.4852986 1.046284
[2,] 0.4533313 -1.461514 -1.02284 0.3159632 1.020845 -0.4852986 1.046284
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.6112136 1.759287 0.6083211 0.02169094 -0.5278064 1.103499 0.3952901
[2,] 0.6112136 1.759287 0.6083211 0.02169094 -0.5278064 1.103499 0.3952901
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.202815 1.539787 -0.7454975 0.7759427 -1.743772 -0.1602218 1.52103
[2,] 0.202815 1.539787 -0.7454975 0.7759427 -1.743772 -0.1602218 1.52103
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.6678894 -0.7969765 -0.4962776 -0.3488287 -0.5879655 -1.002577 0.2242186
[2,] -0.6678894 -0.7969765 -0.4962776 -0.3488287 -0.5879655 -1.002577 0.2242186
[,99] [,100]
[1,] 0.1001025 -1.811907
[2,] 0.1001025 -1.811907
>
>
> Max(tmp2)
[1] 2.128977
> Min(tmp2)
[1] -2.127181
> mean(tmp2)
[1] -0.0279311
> Sum(tmp2)
[1] -2.79311
> Var(tmp2)
[1] 0.9057229
>
> rowMeans(tmp2)
[1] -0.23320666 2.11893422 -0.91417007 2.00281256 -1.52885518 0.26333564
[7] 0.67785732 -1.18152563 -0.14163212 -0.04519195 2.09539779 1.87685635
[13] -0.84052298 -0.50673459 0.48347612 -1.51349963 -0.22932732 0.25505465
[19] 1.25218501 -0.40958614 -1.28295223 -0.90648404 -2.12718071 0.72003024
[25] -0.98273338 -0.53326440 -0.47148852 0.62881474 0.75275049 -1.37410937
[31] 0.43318807 0.38646629 0.63776988 -0.90647105 -0.74407595 1.17198326
[37] 1.19095270 -0.54920333 -1.34132938 -0.61888799 0.11221536 0.42421222
[43] -1.25096249 -0.29701502 0.02737095 1.59213232 0.60242711 0.78698402
[49] -1.88261949 0.77958486 0.02380311 -0.71677558 -1.07557823 0.96685677
[55] -1.15242131 0.32792964 0.79301514 -0.74674517 0.18912232 0.66051568
[61] -0.85355216 0.16496128 0.99556716 -0.48509524 -0.83709186 0.74309736
[67] -1.14692912 -0.25903371 -0.28731552 -0.95784730 0.18350494 -0.47532003
[73] 0.96061764 0.94777832 -0.03597540 0.02274509 -0.62343753 -0.63253450
[79] 1.08862823 -0.69726720 0.44317930 0.43285680 1.45431146 2.12897737
[85] 0.71404771 -1.33304454 -0.51453135 -0.26992244 -1.09018728 -0.54429479
[91] 1.29212550 -0.15161424 -0.57898010 0.38147479 -1.08135182 0.47571811
[97] -1.04879792 0.16148941 1.41064632 -0.62019797
> rowSums(tmp2)
[1] -0.23320666 2.11893422 -0.91417007 2.00281256 -1.52885518 0.26333564
[7] 0.67785732 -1.18152563 -0.14163212 -0.04519195 2.09539779 1.87685635
[13] -0.84052298 -0.50673459 0.48347612 -1.51349963 -0.22932732 0.25505465
[19] 1.25218501 -0.40958614 -1.28295223 -0.90648404 -2.12718071 0.72003024
[25] -0.98273338 -0.53326440 -0.47148852 0.62881474 0.75275049 -1.37410937
[31] 0.43318807 0.38646629 0.63776988 -0.90647105 -0.74407595 1.17198326
[37] 1.19095270 -0.54920333 -1.34132938 -0.61888799 0.11221536 0.42421222
[43] -1.25096249 -0.29701502 0.02737095 1.59213232 0.60242711 0.78698402
[49] -1.88261949 0.77958486 0.02380311 -0.71677558 -1.07557823 0.96685677
[55] -1.15242131 0.32792964 0.79301514 -0.74674517 0.18912232 0.66051568
[61] -0.85355216 0.16496128 0.99556716 -0.48509524 -0.83709186 0.74309736
[67] -1.14692912 -0.25903371 -0.28731552 -0.95784730 0.18350494 -0.47532003
[73] 0.96061764 0.94777832 -0.03597540 0.02274509 -0.62343753 -0.63253450
[79] 1.08862823 -0.69726720 0.44317930 0.43285680 1.45431146 2.12897737
[85] 0.71404771 -1.33304454 -0.51453135 -0.26992244 -1.09018728 -0.54429479
[91] 1.29212550 -0.15161424 -0.57898010 0.38147479 -1.08135182 0.47571811
[97] -1.04879792 0.16148941 1.41064632 -0.62019797
> 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.23320666 2.11893422 -0.91417007 2.00281256 -1.52885518 0.26333564
[7] 0.67785732 -1.18152563 -0.14163212 -0.04519195 2.09539779 1.87685635
[13] -0.84052298 -0.50673459 0.48347612 -1.51349963 -0.22932732 0.25505465
[19] 1.25218501 -0.40958614 -1.28295223 -0.90648404 -2.12718071 0.72003024
[25] -0.98273338 -0.53326440 -0.47148852 0.62881474 0.75275049 -1.37410937
[31] 0.43318807 0.38646629 0.63776988 -0.90647105 -0.74407595 1.17198326
[37] 1.19095270 -0.54920333 -1.34132938 -0.61888799 0.11221536 0.42421222
[43] -1.25096249 -0.29701502 0.02737095 1.59213232 0.60242711 0.78698402
[49] -1.88261949 0.77958486 0.02380311 -0.71677558 -1.07557823 0.96685677
[55] -1.15242131 0.32792964 0.79301514 -0.74674517 0.18912232 0.66051568
[61] -0.85355216 0.16496128 0.99556716 -0.48509524 -0.83709186 0.74309736
[67] -1.14692912 -0.25903371 -0.28731552 -0.95784730 0.18350494 -0.47532003
[73] 0.96061764 0.94777832 -0.03597540 0.02274509 -0.62343753 -0.63253450
[79] 1.08862823 -0.69726720 0.44317930 0.43285680 1.45431146 2.12897737
[85] 0.71404771 -1.33304454 -0.51453135 -0.26992244 -1.09018728 -0.54429479
[91] 1.29212550 -0.15161424 -0.57898010 0.38147479 -1.08135182 0.47571811
[97] -1.04879792 0.16148941 1.41064632 -0.62019797
> rowMin(tmp2)
[1] -0.23320666 2.11893422 -0.91417007 2.00281256 -1.52885518 0.26333564
[7] 0.67785732 -1.18152563 -0.14163212 -0.04519195 2.09539779 1.87685635
[13] -0.84052298 -0.50673459 0.48347612 -1.51349963 -0.22932732 0.25505465
[19] 1.25218501 -0.40958614 -1.28295223 -0.90648404 -2.12718071 0.72003024
[25] -0.98273338 -0.53326440 -0.47148852 0.62881474 0.75275049 -1.37410937
[31] 0.43318807 0.38646629 0.63776988 -0.90647105 -0.74407595 1.17198326
[37] 1.19095270 -0.54920333 -1.34132938 -0.61888799 0.11221536 0.42421222
[43] -1.25096249 -0.29701502 0.02737095 1.59213232 0.60242711 0.78698402
[49] -1.88261949 0.77958486 0.02380311 -0.71677558 -1.07557823 0.96685677
[55] -1.15242131 0.32792964 0.79301514 -0.74674517 0.18912232 0.66051568
[61] -0.85355216 0.16496128 0.99556716 -0.48509524 -0.83709186 0.74309736
[67] -1.14692912 -0.25903371 -0.28731552 -0.95784730 0.18350494 -0.47532003
[73] 0.96061764 0.94777832 -0.03597540 0.02274509 -0.62343753 -0.63253450
[79] 1.08862823 -0.69726720 0.44317930 0.43285680 1.45431146 2.12897737
[85] 0.71404771 -1.33304454 -0.51453135 -0.26992244 -1.09018728 -0.54429479
[91] 1.29212550 -0.15161424 -0.57898010 0.38147479 -1.08135182 0.47571811
[97] -1.04879792 0.16148941 1.41064632 -0.62019797
>
> colMeans(tmp2)
[1] -0.0279311
> colSums(tmp2)
[1] -2.79311
> colVars(tmp2)
[1] 0.9057229
> colSd(tmp2)
[1] 0.9516948
> colMax(tmp2)
[1] 2.128977
> colMin(tmp2)
[1] -2.127181
> colMedians(tmp2)
[1] -0.09341203
> colRanges(tmp2)
[,1]
[1,] -2.127181
[2,] 2.128977
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.2185338 -1.5921022 3.3604450 -4.1484032 -3.1298240 -2.9061779
[7] 1.6644641 -2.2234378 4.1680710 0.9624521
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.29158444
[2,] -0.96371283
[3,] -0.06783502
[4,] 0.54874325
[5,] 1.19661669
>
> rowApply(tmp,sum)
[1] 0.12342701 -1.33354367 3.64569571 -0.47780375 0.04226977 -2.16053625
[7] 0.26520045 -2.55398586 -0.82231409 -1.79145624
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 2 4 9 3 7 5 2 9 3
[2,] 4 8 8 10 6 4 3 6 3 1
[3,] 5 6 10 8 10 2 2 4 10 9
[4,] 10 1 2 6 4 1 6 1 7 7
[5,] 3 7 7 2 1 9 9 9 1 2
[6,] 2 10 3 1 8 3 4 7 6 4
[7,] 7 3 1 5 9 6 7 5 8 10
[8,] 6 4 6 7 7 8 1 8 5 5
[9,] 1 9 9 4 2 10 8 10 2 6
[10,] 8 5 5 3 5 5 10 3 4 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.41441165 -2.41535704 -0.06219651 3.39707596 -1.78638768 3.31410879
[7] -2.06517405 5.68983083 -3.96570659 -2.42114190 3.11658357 2.84526625
[13] 0.57912939 4.27449121 -3.88246393 -2.44764631 3.14510868 -1.70398791
[19] -3.25144901 -0.45468852
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.7438982
[2,] -1.1629877
[3,] -0.4639437
[4,] 0.4337476
[5,] 1.5226703
>
> rowApply(tmp,sum)
[1] -5.6796476 -2.1000770 3.9799588 -0.2250127 3.5157621
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 19 4 12 8 1
[2,] 5 8 4 12 7
[3,] 13 9 9 7 11
[4,] 10 19 15 15 17
[5,] 3 6 14 17 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.5226703 -1.2601938 0.21928225 -0.5306705 -1.5461520 -1.3001143
[2,] -1.1629877 -0.6537424 0.06352959 1.2017931 -0.9226507 0.7527867
[3,] 0.4337476 -0.3150396 0.14740050 0.6862113 0.6146682 1.1113277
[4,] -0.4639437 0.1180861 -0.61956531 0.5365166 0.9594044 0.3956332
[5,] -2.7438982 -0.3044673 0.12715647 1.5032255 -0.8916576 2.3544754
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.5964912 0.396607911 -1.1283961 1.6036903 1.4158945 -0.1282667
[2,] 0.2057276 1.308450557 -2.1559694 0.6686641 0.2096694 0.2065902
[3,] -2.0486291 0.738057524 0.2074841 -1.3139336 0.1414706 1.0799122
[4,] -0.3859351 -0.001363766 -1.4186861 -0.8666754 0.9230533 2.0091409
[5,] -0.4328286 3.248078606 0.5298610 -2.5128872 0.4264958 -0.3221104
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.1924305 -0.8089929 -1.0827303 -2.07819293 0.64182243 -1.7670142
[2,] 0.7811048 0.9614524 -1.5756705 1.09437005 0.63303100 -1.1406824
[3,] 1.5450601 0.6024999 0.4238838 -0.89652021 0.04194437 0.9439497
[4,] -0.9094842 1.3084135 -1.9269487 -0.66588985 1.88970848 0.1418105
[5,] 0.3548791 2.2111184 0.2790017 0.09858662 -0.06139759 0.1179485
[,19] [,20]
[1,] 0.96156961 -0.2145218
[2,] -1.83077604 -0.7447674
[3,] -0.03848466 -0.1250515
[4,] -1.03933626 -0.2089514
[5,] -1.30442167 0.8386036
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 655 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 567 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.4629799 -0.3568545 0.6266892 2.627195 1.171961 0.2380557 -0.1012632
col8 col9 col10 col11 col12 col13 col14
row1 -0.5118483 0.09536068 0.2577553 -2.393676 0.2729709 0.1420814 1.231606
col15 col16 col17 col18 col19 col20
row1 1.000711 1.112738 1.851415 -0.3975792 0.7261245 -0.5720974
> tmp[,"col10"]
col10
row1 0.2577553
row2 1.7233055
row3 -0.1841829
row4 -0.1519545
row5 1.6908517
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.4629799 -0.35685452 0.6266892 2.62719465 1.171961 0.2380557
row5 0.6030515 0.03361977 -1.3627595 0.05659259 0.743279 -0.4545712
col7 col8 col9 col10 col11 col12
row1 -0.1012632 -0.5118483 0.09536068 0.2577553 -2.3936764 0.2729709
row5 0.3722989 -0.6455689 -1.59384267 1.6908517 0.1695868 1.5631487
col13 col14 col15 col16 col17 col18 col19
row1 0.14208136 1.2316059 1.000711 1.1127385 1.851415 -0.3975792 0.7261245
row5 -0.01696195 0.4452249 -1.529188 -0.2920643 -1.246503 -0.1083455 -0.6131645
col20
row1 -0.5720974
row5 0.2611571
> tmp[,c("col6","col20")]
col6 col20
row1 0.2380557 -0.5720974
row2 0.7546847 0.7043156
row3 -0.7402252 0.2099914
row4 0.3832434 -1.4365682
row5 -0.4545712 0.2611571
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.2380557 -0.5720974
row5 -0.4545712 0.2611571
>
>
>
>
> 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.74604 48.35497 50.31969 49.52861 51.5269 103.2249 49.13117 51.72787
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.61896 50.83485 48.49549 50.07396 50.71074 50.77535 50.21122 49.84211
col17 col18 col19 col20
row1 49.87931 50.76508 48.77946 107.1785
> tmp[,"col10"]
col10
row1 50.83485
row2 29.54199
row3 29.91671
row4 29.46912
row5 49.66073
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.74604 48.35497 50.31969 49.52861 51.52690 103.2249 49.13117 51.72787
row5 50.60256 50.63827 49.44584 49.67367 49.37686 103.2257 49.98637 50.70639
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.61896 50.83485 48.49549 50.07396 50.71074 50.77535 50.21122 49.84211
row5 50.23356 49.66073 51.20767 49.79689 50.24657 50.97026 50.03283 50.95213
col17 col18 col19 col20
row1 49.87931 50.76508 48.77946 107.1785
row5 49.35573 48.72047 51.32050 105.0226
> tmp[,c("col6","col20")]
col6 col20
row1 103.22494 107.17850
row2 75.06208 75.43640
row3 76.32682 73.24102
row4 75.31420 74.05616
row5 103.22566 105.02265
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.2249 107.1785
row5 103.2257 105.0226
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.2249 107.1785
row5 103.2257 105.0226
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.232805052
[2,] -0.007766172
[3,] -0.359198404
[4,] -0.393042302
[5,] -0.806972926
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.74546680 -0.4796648
[2,] -1.56845699 -0.5412213
[3,] -1.03859698 0.4539635
[4,] -1.15419316 0.7224679
[5,] -0.04412027 -0.1181237
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.87478558 0.2078482
[2,] -0.06963173 -0.7129362
[3,] 0.46446585 1.6152147
[4,] -1.86372281 0.5388603
[5,] -1.74102064 0.3026896
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.8747856
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.87478558
[2,] -0.06963173
>
>
>
> 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 -1.3208738 1.078863 -0.6053973 1.70996985 2.028551 -1.8580279 -0.4140605
row1 0.4566863 -1.585272 0.2527041 0.02496849 1.878865 0.7190338 0.7019419
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.698950 -1.44679745 0.08479675 1.4278221 0.1652401 -0.8910879 -1.0475307
row1 -1.941238 0.06994831 0.36360411 0.3080586 0.3429669 -1.7809812 -0.3514609
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.9177699 0.91547846 -0.4080861 -1.521936 -0.04595762 -0.369533
row1 1.1146879 -0.06048344 -1.4063757 -1.595203 1.88735059 0.330945
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.004283874 0.648987 1.449914 0.4345857 -0.1939378 0.6449278 1.536834
[,8] [,9] [,10]
row2 0.3401079 0.5904664 0.9991636
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.12431 0.3646294 1.174875 -0.5252938 -0.2287196 1.443405 1.987572
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3236921 -0.7849773 -1.409207 -0.2622965 -0.210384 1.641559 0.1359072
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.3855466 0.1210875 0.297133 0.3843512 -0.4245352 0.4081181
>
>
> 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: 0xc572146c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158573790151b"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158575459bc1c"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158574f4cfd87"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158574798d2bd"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158572339b04"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15857a0624bd"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158571955f96f"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158575b6af367"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158574a921e14"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158573ef4d94b"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158573ce5eb37"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158571ab5871d"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM158573b98e9e"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15857b4228fb"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1585724907c83"
>
>
> ### 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: 0xc57215320>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xc57215320>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xc57215320>
> rowMedians(tmp)
[1] 0.2343576368 -0.1233692907 0.0278727920 0.0746787428 -0.1357906584
[6] -0.3365383781 -0.0438942758 -0.3376920561 -0.1261054475 0.9450076263
[11] -0.1655464929 -0.6738042486 0.0041872986 -0.1475978275 -0.1683724613
[16] 0.4807619787 0.5594831764 -0.4149904760 0.0309397140 -0.0980924141
[21] 0.4169831762 0.3708845193 0.1289324757 0.2836915024 -0.4694645740
[26] -0.3715957298 0.1033556969 -0.1765271433 0.3082560444 0.7049306267
[31] 0.1657387511 0.0235006586 -0.1641042307 0.0520351544 0.3881451092
[36] -0.0670802717 -0.3394603124 -0.2341085328 -0.1911562787 0.0004323179
[41] 0.1088498876 0.2822439141 -0.5229411782 -0.0757539006 0.2067546956
[46] 0.4710372866 -0.2418361432 0.1106767861 0.1933517286 0.7911441301
[51] -0.5469147526 -0.3568917043 0.4199698368 -0.1969525529 -0.6363576009
[56] 0.2253866226 -0.6102869581 -0.0568134925 -0.0267991671 0.4614178860
[61] 0.1411210926 -0.8323527898 -0.0380197141 0.5266358689 -0.0080676598
[66] 0.4158745178 0.0638642967 -0.2995321434 -0.5465662190 0.3767923150
[71] 0.5285463173 0.2816627593 -0.2867844731 0.2410871496 0.6840722545
[76] 0.0954975102 -0.3739088641 -0.6318445823 0.4935482597 -0.0480216129
[81] -0.4394657816 0.6520334448 -0.0165700188 0.3369167091 0.3838029338
[86] 0.5043476290 -0.1622098673 -0.1739720658 -0.8541276823 -0.4035858041
[91] 0.1010506236 -0.1087543451 -0.3610392673 -0.4132962332 0.6014109093
[96] -0.2282313766 -0.1898859432 0.2872662983 -0.1327797422 0.1574590649
[101] 0.2882642287 0.0516217965 -0.0550812016 -0.6955039671 0.3438945251
[106] 0.1189343058 0.0865938988 -0.0363690409 -0.0791994641 0.3491153070
[111] -0.0544456577 -0.0070329716 -0.1248072888 -0.1371010283 -0.1979386475
[116] -0.0129244069 -0.2246048718 -0.7801481155 -0.0034404349 0.1204437061
[121] 0.0229076280 0.4311008728 -0.4992054874 -0.1649261956 0.2150339136
[126] 0.4594485387 0.0676508176 0.8370320248 0.4347500940 0.4317154398
[131] 0.2428570545 -0.1588814850 -0.1484801334 -0.0766685950 0.2569197898
[136] -0.1270759643 -0.0428440419 -0.4156673047 0.0178337978 0.2944907049
[141] -0.1340245068 0.5323396285 0.0365823038 0.2071162974 0.2621641791
[146] 0.1304102103 -0.3038062414 -0.0304060579 0.1072429036 0.0459847593
[151] 0.1094115731 -0.6498087144 -0.2154844135 -0.0176943630 0.8066297623
[156] -0.2887770619 0.4176217516 -0.3622801675 0.3132223337 -0.1947239840
[161] -0.4776681237 -0.0545724815 -0.1076837077 -0.1240101317 0.2413527168
[166] -0.1062252152 0.6100172670 -0.3649061164 -0.5764577068 0.0243894365
[171] -0.3758491659 0.9908437313 -0.4201516751 0.2764255136 0.2826228233
[176] -0.2798410896 0.1591657418 0.2711946031 -0.1716887706 0.1705745657
[181] 0.0573291761 0.2549965823 0.2926209114 0.2550058658 0.2961137241
[186] -0.0437628210 0.5937945816 -0.0027245640 0.0612764991 0.1741196244
[191] -0.1923949135 -0.2353824323 -0.3608949294 -0.3109999189 -0.0394337710
[196] -0.1337674219 0.8266396626 0.2267779795 -0.2343181336 0.3465661840
[201] 0.3202618225 -0.2642087696 0.2699266951 -0.1661317996 -0.0847312732
[206] 0.3885836372 0.0327401856 -0.5676438453 0.0670739464 -0.1772439885
[211] 0.1598766751 -0.2560023969 -0.3449926915 -0.2606506302 -0.8847480283
[216] -0.1694236760 -0.1635286778 -0.3278757248 0.0986419755 0.1468332493
[221] 0.3422739233 -0.2325374414 -0.4100831584 -0.3069192305 -0.3549546229
[226] 0.0570453771 0.1049378715 0.0051693165 -0.5935723221 0.3160220502
>
> proc.time()
user system elapsed
0.734 4.687 5.487
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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: 0x10568b320>
> .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: 0x10568b320>
> .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: 0x10568b320>
> .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: 0x10568b320>
> 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: 0x7adee0060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0060>
> .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: 0x7adee0060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0060>
> .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: 0x7adee0060>
> 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: 0x7adee0420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0420>
> .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: 0x7adee0420>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x7adee0420>
> .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: 0x7adee0420>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x7adee0420>
> .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: 0x7adee0420>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x7adee0420>
> .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: 0x7adee0420>
> 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: 0x7adee0540>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x7adee0540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0540>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15ad127954136" "BufferedMatrixFile15ad137ec5487"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15ad127954136" "BufferedMatrixFile15ad137ec5487"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee0660>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x7adee0660>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x7adee0660>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x7adee0660>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x7adee0660>
> .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: 0x7adee07e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x7adee07e0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x7adee07e0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x7adee07e0>
> 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: 0x7adee0900>
> .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: 0x7adee0900>
> rm(P)
>
> proc.time()
user system elapsed
0.123 0.052 0.170
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.120 0.036 0.149