| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-30 11:35 -0500 (Tue, 30 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" | 4807 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4593 |
| 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 253/2332 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /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.75.0.tar.gz |
| StartedAt: 2025-12-29 18:47:30 -0500 (Mon, 29 Dec 2025) |
| EndedAt: 2025-12-29 18:47:50 -0500 (Mon, 29 Dec 2025) |
| EllapsedTime: 20.3 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.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -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 -std=gnu2x -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]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch arm64 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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-arm64/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 Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.128 0.051 0.184
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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 481248 25.8 1058085 56.6 NA 633817 33.9
Vcells 891449 6.9 8388608 64.0 196608 2110969 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] "Mon Dec 29 18:47:41 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] "Mon Dec 29 18:47:41 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: 0x600001178000>
>
>
>
> 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] "Mon Dec 29 18:47:42 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] "Mon Dec 29 18:47:43 2025"
>
> ColMode(tmp2)
<pointer: 0x600001178000>
>
>
>
> ### 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.49845651 0.7854210 -1.1628746 -0.2269295
[2,] -0.40575748 0.5419888 -1.5208227 0.2812443
[3,] 2.42801740 0.1004772 -1.9139096 0.5479109
[4,] 0.01036983 1.2435248 -0.9010051 -0.5732703
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.49845651 0.7854210 1.1628746 0.2269295
[2,] 0.40575748 0.5419888 1.5208227 0.2812443
[3,] 2.42801740 0.1004772 1.9139096 0.5479109
[4,] 0.01036983 1.2435248 0.9010051 0.5732703
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0248918 0.8862398 1.0783666 0.4763712
[2,] 0.6369910 0.7361989 1.2332164 0.5303247
[3,] 1.5582097 0.3169814 1.3834412 0.7402100
[4,] 0.1018324 1.1151344 0.9492129 0.7571462
>
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.74737 34.64782 36.94654 29.99064
[2,] 31.77567 32.90398 38.85299 30.58449
[3,] 43.01011 28.27029 40.74832 32.95001
[4,] 26.02869 37.39487 35.39313 33.14473
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001144120>
> exp(tmp5)
<pointer: 0x600001144120>
> log(tmp5,2)
<pointer: 0x600001144120>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.8636
> Min(tmp5)
[1] 53.79784
> mean(tmp5)
[1] 72.53787
> Sum(tmp5)
[1] 14507.57
> Var(tmp5)
[1] 879.0613
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.13841 71.10557 69.35207 69.44819 69.93329 70.93838 67.59189 71.28919
[9] 75.69832 70.88340
> rowSums(tmp5)
[1] 1782.768 1422.111 1387.041 1388.964 1398.666 1418.768 1351.838 1425.784
[9] 1513.966 1417.668
> rowVars(tmp5)
[1] 8057.09226 88.76832 96.34159 97.52595 118.48819 50.14877
[7] 86.03709 63.01425 111.08296 74.91707
> rowSd(tmp5)
[1] 89.761307 9.421694 9.815375 9.875523 10.885228 7.081580 9.275618
[8] 7.938152 10.539590 8.655465
> rowMax(tmp5)
[1] 469.86358 84.13598 89.51992 85.61790 94.05268 82.52910 86.04444
[8] 89.72946 94.93607 83.84008
> rowMin(tmp5)
[1] 56.66871 53.79784 55.12129 54.05512 55.12229 57.29188 54.84313 56.47402
[9] 56.54613 56.94869
>
> colMeans(tmp5)
[1] 109.25837 72.38930 75.07383 69.00537 74.11582 69.29497 71.20571
[8] 69.81246 66.73456 68.91919 70.95881 70.06794 70.76063 69.10951
[15] 73.74045 69.70849 71.25203 71.34064 69.89536 68.11394
> colSums(tmp5)
[1] 1092.5837 723.8930 750.7383 690.0537 741.1582 692.9497 712.0571
[8] 698.1246 667.3456 689.1919 709.5881 700.6794 707.6063 691.0951
[15] 737.4045 697.0849 712.5203 713.4064 698.9536 681.1394
> colVars(tmp5)
[1] 16144.43761 152.33753 55.08993 59.07054 58.13752 58.97652
[7] 49.97544 106.38197 120.92236 108.59039 105.89295 48.27354
[13] 71.72904 105.25650 55.22026 80.81861 121.98403 98.34325
[19] 94.70470 75.42756
> colSd(tmp5)
[1] 127.060763 12.342509 7.422259 7.685736 7.624796 7.679617
[7] 7.069331 10.314164 10.996471 10.420671 10.290430 6.947916
[13] 8.469300 10.259459 7.431034 8.989917 11.044638 9.916817
[19] 9.731634 8.684904
> colMax(tmp5)
[1] 469.86358 94.93607 84.81229 82.52910 85.61790 86.04444 84.13598
[8] 82.14045 83.05010 85.88876 86.73186 78.84567 81.00606 94.05268
[15] 85.45512 79.56626 89.36008 86.86321 92.31330 76.99575
> colMin(tmp5)
[1] 54.17532 56.94869 62.13476 56.54613 64.97225 58.41699 60.17613 56.20967
[9] 56.45363 55.90773 55.12129 55.12229 56.66781 56.82835 60.85203 53.79784
[17] 56.47402 58.20442 59.10572 54.05512
>
>
> ### 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.13841 71.10557 69.35207 69.44819 69.93329 70.93838 67.59189 NA
[9] 75.69832 70.88340
> rowSums(tmp5)
[1] 1782.768 1422.111 1387.041 1388.964 1398.666 1418.768 1351.838 NA
[9] 1513.966 1417.668
> rowVars(tmp5)
[1] 8057.09226 88.76832 96.34159 97.52595 118.48819 50.14877
[7] 86.03709 60.59359 111.08296 74.91707
> rowSd(tmp5)
[1] 89.761307 9.421694 9.815375 9.875523 10.885228 7.081580 9.275618
[8] 7.784188 10.539590 8.655465
> rowMax(tmp5)
[1] 469.86358 84.13598 89.51992 85.61790 94.05268 82.52910 86.04444
[8] NA 94.93607 83.84008
> rowMin(tmp5)
[1] 56.66871 53.79784 55.12129 54.05512 55.12229 57.29188 54.84313 NA
[9] 56.54613 56.94869
>
> colMeans(tmp5)
[1] 109.25837 72.38930 NA 69.00537 74.11582 69.29497 71.20571
[8] 69.81246 66.73456 68.91919 70.95881 70.06794 70.76063 69.10951
[15] 73.74045 69.70849 71.25203 71.34064 69.89536 68.11394
> colSums(tmp5)
[1] 1092.5837 723.8930 NA 690.0537 741.1582 692.9497 712.0571
[8] 698.1246 667.3456 689.1919 709.5881 700.6794 707.6063 691.0951
[15] 737.4045 697.0849 712.5203 713.4064 698.9536 681.1394
> colVars(tmp5)
[1] 16144.43761 152.33753 NA 59.07054 58.13752 58.97652
[7] 49.97544 106.38197 120.92236 108.59039 105.89295 48.27354
[13] 71.72904 105.25650 55.22026 80.81861 121.98403 98.34325
[19] 94.70470 75.42756
> colSd(tmp5)
[1] 127.060763 12.342509 NA 7.685736 7.624796 7.679617
[7] 7.069331 10.314164 10.996471 10.420671 10.290430 6.947916
[13] 8.469300 10.259459 7.431034 8.989917 11.044638 9.916817
[19] 9.731634 8.684904
> colMax(tmp5)
[1] 469.86358 94.93607 NA 82.52910 85.61790 86.04444 84.13598
[8] 82.14045 83.05010 85.88876 86.73186 78.84567 81.00606 94.05268
[15] 85.45512 79.56626 89.36008 86.86321 92.31330 76.99575
> colMin(tmp5)
[1] 54.17532 56.94869 NA 56.54613 64.97225 58.41699 60.17613 56.20967
[9] 56.45363 55.90773 55.12129 55.12229 56.66781 56.82835 60.85203 53.79784
[17] 56.47402 58.20442 59.10572 54.05512
>
> Max(tmp5,na.rm=TRUE)
[1] 469.8636
> Min(tmp5,na.rm=TRUE)
[1] 53.79784
> mean(tmp5,na.rm=TRUE)
[1] 72.49358
> Sum(tmp5,na.rm=TRUE)
[1] 14426.22
> Var(tmp5,na.rm=TRUE)
[1] 883.1067
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.13841 71.10557 69.35207 69.44819 69.93329 70.93838 67.59189 70.75958
[9] 75.69832 70.88340
> rowSums(tmp5,na.rm=TRUE)
[1] 1782.768 1422.111 1387.041 1388.964 1398.666 1418.768 1351.838 1344.432
[9] 1513.966 1417.668
> rowVars(tmp5,na.rm=TRUE)
[1] 8057.09226 88.76832 96.34159 97.52595 118.48819 50.14877
[7] 86.03709 60.59359 111.08296 74.91707
> rowSd(tmp5,na.rm=TRUE)
[1] 89.761307 9.421694 9.815375 9.875523 10.885228 7.081580 9.275618
[8] 7.784188 10.539590 8.655465
> rowMax(tmp5,na.rm=TRUE)
[1] 469.86358 84.13598 89.51992 85.61790 94.05268 82.52910 86.04444
[8] 89.72946 94.93607 83.84008
> rowMin(tmp5,na.rm=TRUE)
[1] 56.66871 53.79784 55.12129 54.05512 55.12229 57.29188 54.84313 56.47402
[9] 56.54613 56.94869
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.25837 72.38930 74.37628 69.00537 74.11582 69.29497 71.20571
[8] 69.81246 66.73456 68.91919 70.95881 70.06794 70.76063 69.10951
[15] 73.74045 69.70849 71.25203 71.34064 69.89536 68.11394
> colSums(tmp5,na.rm=TRUE)
[1] 1092.5837 723.8930 669.3865 690.0537 741.1582 692.9497 712.0571
[8] 698.1246 667.3456 689.1919 709.5881 700.6794 707.6063 691.0951
[15] 737.4045 697.0849 712.5203 713.4064 698.9536 681.1394
> colVars(tmp5,na.rm=TRUE)
[1] 16144.43761 152.33753 56.50210 59.07054 58.13752 58.97652
[7] 49.97544 106.38197 120.92236 108.59039 105.89295 48.27354
[13] 71.72904 105.25650 55.22026 80.81861 121.98403 98.34325
[19] 94.70470 75.42756
> colSd(tmp5,na.rm=TRUE)
[1] 127.060763 12.342509 7.516788 7.685736 7.624796 7.679617
[7] 7.069331 10.314164 10.996471 10.420671 10.290430 6.947916
[13] 8.469300 10.259459 7.431034 8.989917 11.044638 9.916817
[19] 9.731634 8.684904
> colMax(tmp5,na.rm=TRUE)
[1] 469.86358 94.93607 84.81229 82.52910 85.61790 86.04444 84.13598
[8] 82.14045 83.05010 85.88876 86.73186 78.84567 81.00606 94.05268
[15] 85.45512 79.56626 89.36008 86.86321 92.31330 76.99575
> colMin(tmp5,na.rm=TRUE)
[1] 54.17532 56.94869 62.13476 56.54613 64.97225 58.41699 60.17613 56.20967
[9] 56.45363 55.90773 55.12129 55.12229 56.66781 56.82835 60.85203 53.79784
[17] 56.47402 58.20442 59.10572 54.05512
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.13841 71.10557 69.35207 69.44819 69.93329 70.93838 67.59189 NaN
[9] 75.69832 70.88340
> rowSums(tmp5,na.rm=TRUE)
[1] 1782.768 1422.111 1387.041 1388.964 1398.666 1418.768 1351.838 0.000
[9] 1513.966 1417.668
> rowVars(tmp5,na.rm=TRUE)
[1] 8057.09226 88.76832 96.34159 97.52595 118.48819 50.14877
[7] 86.03709 NA 111.08296 74.91707
> rowSd(tmp5,na.rm=TRUE)
[1] 89.761307 9.421694 9.815375 9.875523 10.885228 7.081580 9.275618
[8] NA 10.539590 8.655465
> rowMax(tmp5,na.rm=TRUE)
[1] 469.86358 84.13598 89.51992 85.61790 94.05268 82.52910 86.04444
[8] NA 94.93607 83.84008
> rowMin(tmp5,na.rm=TRUE)
[1] 56.66871 53.79784 55.12129 54.05512 55.12229 57.29188 54.84313 NA
[9] 56.54613 56.94869
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.59272 70.46262 NaN 69.25019 75.00937 68.73193 70.97548
[8] 70.06445 67.80613 69.55439 69.95486 69.88877 70.73689 69.43831
[15] 74.16314 69.13544 72.89403 71.22833 69.36384 67.90506
> colSums(tmp5,na.rm=TRUE)
[1] 1013.3345 634.1635 0.0000 623.2517 675.0844 618.5873 638.7794
[8] 630.5800 610.2552 625.9895 629.5937 628.9989 636.6320 624.9448
[15] 667.4683 622.2189 656.0462 641.0550 624.2745 611.1455
> colVars(tmp5,na.rm=TRUE)
[1] 18037.41628 129.61847 NA 65.78008 56.42229 62.78210
[7] 55.62609 118.96538 123.11963 117.62509 107.79054 53.94659
[13] 80.68883 117.19732 60.11276 87.22651 106.90018 110.49425
[19] 103.36450 84.36514
> colSd(tmp5,na.rm=TRUE)
[1] 134.303449 11.385011 NA 8.110492 7.511477 7.923515
[7] 7.458290 10.907125 11.095929 10.845510 10.382222 7.344834
[13] 8.982696 10.825771 7.753242 9.339514 10.339255 10.511625
[19] 10.166833 9.185050
> colMax(tmp5,na.rm=TRUE)
[1] 469.86358 94.93607 -Inf 82.52910 85.61790 86.04444 84.13598
[8] 82.14045 83.05010 85.88876 86.73186 78.84567 81.00606 94.05268
[15] 85.45512 79.56626 89.36008 86.86321 92.31330 76.99575
> colMin(tmp5,na.rm=TRUE)
[1] 54.17532 56.94869 Inf 56.54613 64.97225 58.41699 60.17613 56.20967
[9] 56.45363 55.90773 55.12129 55.12229 56.66781 56.82835 60.85203 53.79784
[17] 61.45055 58.20442 59.10572 54.05512
>
>
>
>
> 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] 117.8679 225.9657 439.4488 243.3181 117.9130 136.3425 255.7937 159.2587
[9] 145.9358 304.2810
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 117.8679 225.9657 439.4488 243.3181 117.9130 136.3425 255.7937 159.2587
[9] 145.9358 304.2810
>
>
>
> 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] 2.842171e-14 -2.842171e-14 -2.842171e-14 -5.684342e-14 0.000000e+00
[6] 2.273737e-13 0.000000e+00 -1.705303e-13 1.705303e-13 7.105427e-14
[11] -1.136868e-13 -8.526513e-14 8.526513e-14 2.842171e-14 -1.136868e-13
[16] -1.421085e-14 1.989520e-13 2.842171e-14 9.947598e-14 8.526513e-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)
+ }
8 14
7 2
5 1
6 5
6 2
7 10
10 14
7 15
8 1
9 13
1 12
3 2
9 7
10 12
2 2
4 3
4 11
3 13
2 7
10 20
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.749416
> Min(tmp)
[1] -1.815395
> mean(tmp)
[1] 0.03780902
> Sum(tmp)
[1] 3.780902
> Var(tmp)
[1] 0.7542155
>
> rowMeans(tmp)
[1] 0.03780902
> rowSums(tmp)
[1] 3.780902
> rowVars(tmp)
[1] 0.7542155
> rowSd(tmp)
[1] 0.8684558
> rowMax(tmp)
[1] 2.749416
> rowMin(tmp)
[1] -1.815395
>
> colMeans(tmp)
[1] -0.885123222 0.302595427 -0.161916433 -0.658463241 -0.894470073
[6] -0.268238522 0.446856372 2.749416415 2.215242861 0.330858019
[11] 0.030199334 1.305016316 -0.151241293 -0.893717860 0.946992797
[16] 1.951162061 -0.339700713 0.470028404 -0.301260878 -0.672348336
[21] -1.274329363 -0.559580139 1.114180192 0.651533447 0.252622414
[26] 0.103778055 -0.831418640 0.349691276 0.833620309 0.422043856
[31] -0.360912745 -0.059674050 -0.297660236 -1.124914678 -0.855988860
[36] 1.036687713 0.623520219 -0.638050700 -0.769925269 1.057070753
[41] 0.627736281 0.143385375 0.413270783 0.038170059 -1.815394695
[46] 0.403356590 0.082996280 0.610836578 0.254735449 -0.053981373
[51] -1.646913758 0.297964991 0.320237787 -0.288936454 1.275496508
[56] 0.376123779 -0.009541414 -1.234058637 -0.322326501 0.836258983
[61] 0.024587333 0.403351569 0.006626297 0.779787479 0.347627292
[66] -0.072212424 1.122099238 0.002796461 -1.141322496 -0.406448426
[71] 0.108693554 -0.134251013 0.368948053 0.287814072 0.051138805
[76] 1.138491606 -1.737992370 0.987013201 2.630932398 0.226212288
[81] 0.448691943 0.164984802 0.500883345 0.102165373 -0.441552491
[86] -1.382709518 -0.345288561 -1.019803277 -0.338524739 -1.066606143
[91] 0.710166310 -1.584454128 -0.374335526 -1.658267639 -0.005814694
[96] -0.873512455 -0.073692199 0.453912208 -0.655400833 0.722570052
> colSums(tmp)
[1] -0.885123222 0.302595427 -0.161916433 -0.658463241 -0.894470073
[6] -0.268238522 0.446856372 2.749416415 2.215242861 0.330858019
[11] 0.030199334 1.305016316 -0.151241293 -0.893717860 0.946992797
[16] 1.951162061 -0.339700713 0.470028404 -0.301260878 -0.672348336
[21] -1.274329363 -0.559580139 1.114180192 0.651533447 0.252622414
[26] 0.103778055 -0.831418640 0.349691276 0.833620309 0.422043856
[31] -0.360912745 -0.059674050 -0.297660236 -1.124914678 -0.855988860
[36] 1.036687713 0.623520219 -0.638050700 -0.769925269 1.057070753
[41] 0.627736281 0.143385375 0.413270783 0.038170059 -1.815394695
[46] 0.403356590 0.082996280 0.610836578 0.254735449 -0.053981373
[51] -1.646913758 0.297964991 0.320237787 -0.288936454 1.275496508
[56] 0.376123779 -0.009541414 -1.234058637 -0.322326501 0.836258983
[61] 0.024587333 0.403351569 0.006626297 0.779787479 0.347627292
[66] -0.072212424 1.122099238 0.002796461 -1.141322496 -0.406448426
[71] 0.108693554 -0.134251013 0.368948053 0.287814072 0.051138805
[76] 1.138491606 -1.737992370 0.987013201 2.630932398 0.226212288
[81] 0.448691943 0.164984802 0.500883345 0.102165373 -0.441552491
[86] -1.382709518 -0.345288561 -1.019803277 -0.338524739 -1.066606143
[91] 0.710166310 -1.584454128 -0.374335526 -1.658267639 -0.005814694
[96] -0.873512455 -0.073692199 0.453912208 -0.655400833 0.722570052
> 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.885123222 0.302595427 -0.161916433 -0.658463241 -0.894470073
[6] -0.268238522 0.446856372 2.749416415 2.215242861 0.330858019
[11] 0.030199334 1.305016316 -0.151241293 -0.893717860 0.946992797
[16] 1.951162061 -0.339700713 0.470028404 -0.301260878 -0.672348336
[21] -1.274329363 -0.559580139 1.114180192 0.651533447 0.252622414
[26] 0.103778055 -0.831418640 0.349691276 0.833620309 0.422043856
[31] -0.360912745 -0.059674050 -0.297660236 -1.124914678 -0.855988860
[36] 1.036687713 0.623520219 -0.638050700 -0.769925269 1.057070753
[41] 0.627736281 0.143385375 0.413270783 0.038170059 -1.815394695
[46] 0.403356590 0.082996280 0.610836578 0.254735449 -0.053981373
[51] -1.646913758 0.297964991 0.320237787 -0.288936454 1.275496508
[56] 0.376123779 -0.009541414 -1.234058637 -0.322326501 0.836258983
[61] 0.024587333 0.403351569 0.006626297 0.779787479 0.347627292
[66] -0.072212424 1.122099238 0.002796461 -1.141322496 -0.406448426
[71] 0.108693554 -0.134251013 0.368948053 0.287814072 0.051138805
[76] 1.138491606 -1.737992370 0.987013201 2.630932398 0.226212288
[81] 0.448691943 0.164984802 0.500883345 0.102165373 -0.441552491
[86] -1.382709518 -0.345288561 -1.019803277 -0.338524739 -1.066606143
[91] 0.710166310 -1.584454128 -0.374335526 -1.658267639 -0.005814694
[96] -0.873512455 -0.073692199 0.453912208 -0.655400833 0.722570052
> colMin(tmp)
[1] -0.885123222 0.302595427 -0.161916433 -0.658463241 -0.894470073
[6] -0.268238522 0.446856372 2.749416415 2.215242861 0.330858019
[11] 0.030199334 1.305016316 -0.151241293 -0.893717860 0.946992797
[16] 1.951162061 -0.339700713 0.470028404 -0.301260878 -0.672348336
[21] -1.274329363 -0.559580139 1.114180192 0.651533447 0.252622414
[26] 0.103778055 -0.831418640 0.349691276 0.833620309 0.422043856
[31] -0.360912745 -0.059674050 -0.297660236 -1.124914678 -0.855988860
[36] 1.036687713 0.623520219 -0.638050700 -0.769925269 1.057070753
[41] 0.627736281 0.143385375 0.413270783 0.038170059 -1.815394695
[46] 0.403356590 0.082996280 0.610836578 0.254735449 -0.053981373
[51] -1.646913758 0.297964991 0.320237787 -0.288936454 1.275496508
[56] 0.376123779 -0.009541414 -1.234058637 -0.322326501 0.836258983
[61] 0.024587333 0.403351569 0.006626297 0.779787479 0.347627292
[66] -0.072212424 1.122099238 0.002796461 -1.141322496 -0.406448426
[71] 0.108693554 -0.134251013 0.368948053 0.287814072 0.051138805
[76] 1.138491606 -1.737992370 0.987013201 2.630932398 0.226212288
[81] 0.448691943 0.164984802 0.500883345 0.102165373 -0.441552491
[86] -1.382709518 -0.345288561 -1.019803277 -0.338524739 -1.066606143
[91] 0.710166310 -1.584454128 -0.374335526 -1.658267639 -0.005814694
[96] -0.873512455 -0.073692199 0.453912208 -0.655400833 0.722570052
> colMedians(tmp)
[1] -0.885123222 0.302595427 -0.161916433 -0.658463241 -0.894470073
[6] -0.268238522 0.446856372 2.749416415 2.215242861 0.330858019
[11] 0.030199334 1.305016316 -0.151241293 -0.893717860 0.946992797
[16] 1.951162061 -0.339700713 0.470028404 -0.301260878 -0.672348336
[21] -1.274329363 -0.559580139 1.114180192 0.651533447 0.252622414
[26] 0.103778055 -0.831418640 0.349691276 0.833620309 0.422043856
[31] -0.360912745 -0.059674050 -0.297660236 -1.124914678 -0.855988860
[36] 1.036687713 0.623520219 -0.638050700 -0.769925269 1.057070753
[41] 0.627736281 0.143385375 0.413270783 0.038170059 -1.815394695
[46] 0.403356590 0.082996280 0.610836578 0.254735449 -0.053981373
[51] -1.646913758 0.297964991 0.320237787 -0.288936454 1.275496508
[56] 0.376123779 -0.009541414 -1.234058637 -0.322326501 0.836258983
[61] 0.024587333 0.403351569 0.006626297 0.779787479 0.347627292
[66] -0.072212424 1.122099238 0.002796461 -1.141322496 -0.406448426
[71] 0.108693554 -0.134251013 0.368948053 0.287814072 0.051138805
[76] 1.138491606 -1.737992370 0.987013201 2.630932398 0.226212288
[81] 0.448691943 0.164984802 0.500883345 0.102165373 -0.441552491
[86] -1.382709518 -0.345288561 -1.019803277 -0.338524739 -1.066606143
[91] 0.710166310 -1.584454128 -0.374335526 -1.658267639 -0.005814694
[96] -0.873512455 -0.073692199 0.453912208 -0.655400833 0.722570052
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.8851232 0.3025954 -0.1619164 -0.6584632 -0.8944701 -0.2682385 0.4468564
[2,] -0.8851232 0.3025954 -0.1619164 -0.6584632 -0.8944701 -0.2682385 0.4468564
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 2.749416 2.215243 0.330858 0.03019933 1.305016 -0.1512413 -0.8937179
[2,] 2.749416 2.215243 0.330858 0.03019933 1.305016 -0.1512413 -0.8937179
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.9469928 1.951162 -0.3397007 0.4700284 -0.3012609 -0.6723483 -1.274329
[2,] 0.9469928 1.951162 -0.3397007 0.4700284 -0.3012609 -0.6723483 -1.274329
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.5595801 1.11418 0.6515334 0.2526224 0.1037781 -0.8314186 0.3496913
[2,] -0.5595801 1.11418 0.6515334 0.2526224 0.1037781 -0.8314186 0.3496913
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.8336203 0.4220439 -0.3609127 -0.05967405 -0.2976602 -1.124915 -0.8559889
[2,] 0.8336203 0.4220439 -0.3609127 -0.05967405 -0.2976602 -1.124915 -0.8559889
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.036688 0.6235202 -0.6380507 -0.7699253 1.057071 0.6277363 0.1433854
[2,] 1.036688 0.6235202 -0.6380507 -0.7699253 1.057071 0.6277363 0.1433854
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.4132708 0.03817006 -1.815395 0.4033566 0.08299628 0.6108366 0.2547354
[2,] 0.4132708 0.03817006 -1.815395 0.4033566 0.08299628 0.6108366 0.2547354
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.05398137 -1.646914 0.297965 0.3202378 -0.2889365 1.275497 0.3761238
[2,] -0.05398137 -1.646914 0.297965 0.3202378 -0.2889365 1.275497 0.3761238
[,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.009541414 -1.234059 -0.3223265 0.836259 0.02458733 0.4033516
[2,] -0.009541414 -1.234059 -0.3223265 0.836259 0.02458733 0.4033516
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.006626297 0.7797875 0.3476273 -0.07221242 1.122099 0.002796461 -1.141322
[2,] 0.006626297 0.7797875 0.3476273 -0.07221242 1.122099 0.002796461 -1.141322
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -0.4064484 0.1086936 -0.134251 0.3689481 0.2878141 0.0511388 1.138492
[2,] -0.4064484 0.1086936 -0.134251 0.3689481 0.2878141 0.0511388 1.138492
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -1.737992 0.9870132 2.630932 0.2262123 0.4486919 0.1649848 0.5008833
[2,] -1.737992 0.9870132 2.630932 0.2262123 0.4486919 0.1649848 0.5008833
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.1021654 -0.4415525 -1.38271 -0.3452886 -1.019803 -0.3385247 -1.066606
[2,] 0.1021654 -0.4415525 -1.38271 -0.3452886 -1.019803 -0.3385247 -1.066606
[,91] [,92] [,93] [,94] [,95] [,96]
[1,] 0.7101663 -1.584454 -0.3743355 -1.658268 -0.005814694 -0.8735125
[2,] 0.7101663 -1.584454 -0.3743355 -1.658268 -0.005814694 -0.8735125
[,97] [,98] [,99] [,100]
[1,] -0.0736922 0.4539122 -0.6554008 0.7225701
[2,] -0.0736922 0.4539122 -0.6554008 0.7225701
>
>
> Max(tmp2)
[1] 2.745657
> Min(tmp2)
[1] -2.498175
> mean(tmp2)
[1] -0.02666744
> Sum(tmp2)
[1] -2.666744
> Var(tmp2)
[1] 1.034328
>
> rowMeans(tmp2)
[1] -2.20626107 0.15879002 -0.08599044 0.22909014 -0.45945452 -0.22044978
[7] 1.17925244 -0.21165675 -0.46585726 -0.23150389 -0.18168064 2.28559375
[13] 0.04917303 -0.92081510 0.56409610 0.64319899 -0.42353902 -0.94041164
[19] -1.07377432 -0.06254271 0.75886754 0.47761561 0.74975205 1.81474196
[25] 0.38198136 -1.18600417 -0.33879788 -1.00171628 1.75913742 -0.20841529
[31] -2.49817524 0.24714052 2.74565744 0.56890873 0.17987293 0.07480191
[37] 1.30091446 -0.19601896 1.57692099 -1.44486098 -0.56070033 0.06100056
[43] -0.79380810 1.37135174 -0.32139800 0.60885252 -0.48960910 0.24966626
[49] -1.19447854 -0.07343425 -0.38143864 1.28807814 1.59987751 0.83412261
[55] -0.92760764 -0.69946528 -1.62001078 1.07821632 -0.44003303 -1.86590131
[61] -0.02541832 0.33398358 -1.27886188 0.26752936 -1.08483272 -0.33363266
[67] 2.45618168 -0.41315544 -1.12891961 2.16312395 1.17344644 -0.57183598
[73] 0.80638613 -0.37179974 -0.19947160 2.11407477 -0.84228128 -0.60524053
[79] -1.56674654 1.10502604 -0.58586928 0.27286257 -1.85857682 -0.19372497
[85] -0.96670005 -0.76215178 -0.24485216 -0.00220383 -0.14498431 -1.18104202
[91] -0.22683289 0.44590816 0.17182320 0.56900196 -0.44281547 -0.68394832
[97] -0.32165348 -0.04358974 0.99494946 -0.57076201
> rowSums(tmp2)
[1] -2.20626107 0.15879002 -0.08599044 0.22909014 -0.45945452 -0.22044978
[7] 1.17925244 -0.21165675 -0.46585726 -0.23150389 -0.18168064 2.28559375
[13] 0.04917303 -0.92081510 0.56409610 0.64319899 -0.42353902 -0.94041164
[19] -1.07377432 -0.06254271 0.75886754 0.47761561 0.74975205 1.81474196
[25] 0.38198136 -1.18600417 -0.33879788 -1.00171628 1.75913742 -0.20841529
[31] -2.49817524 0.24714052 2.74565744 0.56890873 0.17987293 0.07480191
[37] 1.30091446 -0.19601896 1.57692099 -1.44486098 -0.56070033 0.06100056
[43] -0.79380810 1.37135174 -0.32139800 0.60885252 -0.48960910 0.24966626
[49] -1.19447854 -0.07343425 -0.38143864 1.28807814 1.59987751 0.83412261
[55] -0.92760764 -0.69946528 -1.62001078 1.07821632 -0.44003303 -1.86590131
[61] -0.02541832 0.33398358 -1.27886188 0.26752936 -1.08483272 -0.33363266
[67] 2.45618168 -0.41315544 -1.12891961 2.16312395 1.17344644 -0.57183598
[73] 0.80638613 -0.37179974 -0.19947160 2.11407477 -0.84228128 -0.60524053
[79] -1.56674654 1.10502604 -0.58586928 0.27286257 -1.85857682 -0.19372497
[85] -0.96670005 -0.76215178 -0.24485216 -0.00220383 -0.14498431 -1.18104202
[91] -0.22683289 0.44590816 0.17182320 0.56900196 -0.44281547 -0.68394832
[97] -0.32165348 -0.04358974 0.99494946 -0.57076201
> 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] -2.20626107 0.15879002 -0.08599044 0.22909014 -0.45945452 -0.22044978
[7] 1.17925244 -0.21165675 -0.46585726 -0.23150389 -0.18168064 2.28559375
[13] 0.04917303 -0.92081510 0.56409610 0.64319899 -0.42353902 -0.94041164
[19] -1.07377432 -0.06254271 0.75886754 0.47761561 0.74975205 1.81474196
[25] 0.38198136 -1.18600417 -0.33879788 -1.00171628 1.75913742 -0.20841529
[31] -2.49817524 0.24714052 2.74565744 0.56890873 0.17987293 0.07480191
[37] 1.30091446 -0.19601896 1.57692099 -1.44486098 -0.56070033 0.06100056
[43] -0.79380810 1.37135174 -0.32139800 0.60885252 -0.48960910 0.24966626
[49] -1.19447854 -0.07343425 -0.38143864 1.28807814 1.59987751 0.83412261
[55] -0.92760764 -0.69946528 -1.62001078 1.07821632 -0.44003303 -1.86590131
[61] -0.02541832 0.33398358 -1.27886188 0.26752936 -1.08483272 -0.33363266
[67] 2.45618168 -0.41315544 -1.12891961 2.16312395 1.17344644 -0.57183598
[73] 0.80638613 -0.37179974 -0.19947160 2.11407477 -0.84228128 -0.60524053
[79] -1.56674654 1.10502604 -0.58586928 0.27286257 -1.85857682 -0.19372497
[85] -0.96670005 -0.76215178 -0.24485216 -0.00220383 -0.14498431 -1.18104202
[91] -0.22683289 0.44590816 0.17182320 0.56900196 -0.44281547 -0.68394832
[97] -0.32165348 -0.04358974 0.99494946 -0.57076201
> rowMin(tmp2)
[1] -2.20626107 0.15879002 -0.08599044 0.22909014 -0.45945452 -0.22044978
[7] 1.17925244 -0.21165675 -0.46585726 -0.23150389 -0.18168064 2.28559375
[13] 0.04917303 -0.92081510 0.56409610 0.64319899 -0.42353902 -0.94041164
[19] -1.07377432 -0.06254271 0.75886754 0.47761561 0.74975205 1.81474196
[25] 0.38198136 -1.18600417 -0.33879788 -1.00171628 1.75913742 -0.20841529
[31] -2.49817524 0.24714052 2.74565744 0.56890873 0.17987293 0.07480191
[37] 1.30091446 -0.19601896 1.57692099 -1.44486098 -0.56070033 0.06100056
[43] -0.79380810 1.37135174 -0.32139800 0.60885252 -0.48960910 0.24966626
[49] -1.19447854 -0.07343425 -0.38143864 1.28807814 1.59987751 0.83412261
[55] -0.92760764 -0.69946528 -1.62001078 1.07821632 -0.44003303 -1.86590131
[61] -0.02541832 0.33398358 -1.27886188 0.26752936 -1.08483272 -0.33363266
[67] 2.45618168 -0.41315544 -1.12891961 2.16312395 1.17344644 -0.57183598
[73] 0.80638613 -0.37179974 -0.19947160 2.11407477 -0.84228128 -0.60524053
[79] -1.56674654 1.10502604 -0.58586928 0.27286257 -1.85857682 -0.19372497
[85] -0.96670005 -0.76215178 -0.24485216 -0.00220383 -0.14498431 -1.18104202
[91] -0.22683289 0.44590816 0.17182320 0.56900196 -0.44281547 -0.68394832
[97] -0.32165348 -0.04358974 0.99494946 -0.57076201
>
> colMeans(tmp2)
[1] -0.02666744
> colSums(tmp2)
[1] -2.666744
> colVars(tmp2)
[1] 1.034328
> colSd(tmp2)
[1] 1.017019
> colMax(tmp2)
[1] 2.745657
> colMin(tmp2)
[1] -2.498175
> colMedians(tmp2)
[1] -0.194872
> colRanges(tmp2)
[,1]
[1,] -2.498175
[2,] 2.745657
>
> 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] -5.1895110 -0.7870333 2.8304307 2.0584938 1.9504296 4.6406503
[7] -7.6137789 0.8225803 -1.9842362 2.8117517
> colApply(tmp,quantile)[,1]
[,1]
[1,] -3.417058e+00
[2,] -8.635039e-01
[3,] -8.880386e-05
[4,] 1.927767e-01
[5,] 4.035942e-01
>
> rowApply(tmp,sum)
[1] 1.9046355 0.7325072 -1.1770814 3.1392082 0.5250745 -6.0104056
[7] -1.0058758 -0.4232290 3.0863972 -1.2314537
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 5 1 1 6 2 7 7 5 4
[2,] 1 7 5 9 3 8 2 8 8 8
[3,] 10 2 2 3 9 4 8 9 3 10
[4,] 6 9 4 2 5 9 6 4 9 6
[5,] 9 6 10 8 10 3 10 1 2 9
[6,] 7 8 7 10 4 7 5 2 10 7
[7,] 3 3 3 4 2 1 3 3 1 2
[8,] 2 10 9 5 1 5 4 10 6 1
[9,] 8 1 6 7 7 6 1 6 7 5
[10,] 4 4 8 6 8 10 9 5 4 3
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.0945712 0.4690714 3.7956224 -2.0253797 -5.8076815 0.9785789
[7] -0.3401269 -0.7102155 3.3818928 0.7428554 -2.3214506 3.9589863
[13] 1.2069828 0.9319021 3.0013592 1.5971148 -2.7228794 0.3712382
[19] -2.5236138 -3.5712923
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.70580429
[2,] -0.15293422
[3,] -0.06352587
[4,] 0.40679328
[5,] 1.61004224
>
> rowApply(tmp,sum)
[1] 1.843300 1.545188 6.440576 -5.653827 -2.667701
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 7 18 8 17
[2,] 18 5 10 6 12
[3,] 19 14 11 9 20
[4,] 3 11 4 11 15
[5,] 4 2 3 1 6
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.06352587 1.2832719 1.7811374 -1.4108560 -1.3321116 0.2079580
[2,] -0.15293422 -0.4456597 0.3442094 0.1139002 -0.8880710 -0.6880536
[3,] 1.61004224 0.3517814 0.3523104 -0.6759891 -0.6968962 0.7644217
[4,] -0.70580429 -0.8446825 -0.5274471 -0.3722324 -2.6722717 -0.4415223
[5,] 0.40679328 0.1243604 1.8454123 0.3197977 -0.2183309 1.1357752
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.8808452 -1.4247207 -0.0580352 -0.6021035 0.6010109 0.828479413
[2,] -0.1449310 0.1713570 0.7372774 1.1812311 0.7421763 0.950169295
[3,] 0.1202168 -0.3013165 1.9978214 0.9387395 -2.1733563 1.909797854
[4,] -1.3962106 0.9477003 0.8586895 -1.0906153 0.5170567 0.267471045
[5,] 0.1999527 -0.1032357 -0.1538603 0.3156035 -2.0083382 0.003068708
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.26696209 1.0749644 2.6445399 -0.5161386 -0.10637320 -0.33203961
[2,] -0.03231994 2.0504024 -0.3972001 0.7481232 -2.19916264 0.17448336
[3,] 0.96396139 0.5427494 0.3456930 1.2264800 -1.23413824 0.70691236
[4,] 0.97802355 -0.9117549 1.7272635 -0.2411127 -0.02867557 0.02425536
[5,] -0.96964430 -1.8244592 -1.3189369 0.3797628 0.84547027 -0.20237325
[,19] [,20]
[1,] -0.05518414 -1.8247810
[2,] 0.10147204 -0.8212819
[3,] -0.55267202 0.2440173
[4,] -0.70735988 -1.0345974
[5,] -1.30986985 -0.1346493
>
>
> 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 : 649 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 : 562 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 -1.126982 0.6006359 0.5596809 -0.2113849 0.4296802 -0.7024754 0.5115826
col8 col9 col10 col11 col12 col13 col14
row1 -2.288279 0.4855802 0.05752105 0.7269807 -3.304932 0.1819499 -1.145202
col15 col16 col17 col18 col19 col20
row1 0.04024752 -0.4702211 -1.46195 -0.5377699 1.564364 1.355959
> tmp[,"col10"]
col10
row1 0.05752105
row2 -1.25774304
row3 -0.10754882
row4 0.30339173
row5 0.76444635
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -1.1269824 0.6006359 0.5596809 -0.2113849 0.4296802 -0.7024754 0.5115826
row5 0.1110482 0.5580998 -1.1771966 0.8300956 -0.3620047 -1.2577258 0.4059044
col8 col9 col10 col11 col12 col13
row1 -2.2882794 0.4855802 0.05752105 0.7269807 -3.30493212 0.1819499
row5 -0.6162847 -0.7155146 0.76444635 -1.0909971 -0.03126409 0.5994568
col14 col15 col16 col17 col18 col19
row1 -1.1452022 0.04024752 -0.4702211 -1.4619504 -0.5377699 1.564364
row5 -0.6672171 -2.06619592 0.4441177 0.6377588 0.6913374 0.132963
col20
row1 1.3559585
row5 -0.6030828
> tmp[,c("col6","col20")]
col6 col20
row1 -0.7024754 1.3559585
row2 -1.2241123 -0.9280482
row3 -0.1007140 -0.3387089
row4 1.0229511 1.4026901
row5 -1.2577258 -0.6030828
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.7024754 1.3559585
row5 -1.2577258 -0.6030828
>
>
>
>
> 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 51.33733 49.64208 50.76591 51.31344 49.22952 104.52 49.06768 50.26
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63425 49.60059 51.4712 51.27078 51.36123 50.33282 49.79032 50.64989
col17 col18 col19 col20
row1 49.31368 51.22049 51.10153 104.8941
> tmp[,"col10"]
col10
row1 49.60059
row2 29.53625
row3 30.43869
row4 29.84704
row5 52.12067
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.33733 49.64208 50.76591 51.31344 49.22952 104.5200 49.06768 50.26000
row5 50.57829 50.03044 49.12872 51.21798 51.98798 105.8088 50.27935 48.52723
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63425 49.60059 51.47120 51.27078 51.36123 50.33282 49.79032 50.64989
row5 51.90637 52.12067 50.29062 51.45927 50.51237 49.12467 49.49706 49.68224
col17 col18 col19 col20
row1 49.31368 51.22049 51.10153 104.8941
row5 50.56275 49.04197 49.74498 105.3025
> tmp[,c("col6","col20")]
col6 col20
row1 104.52004 104.89406
row2 74.73724 76.90600
row3 74.10685 73.17981
row4 76.48307 74.28619
row5 105.80883 105.30249
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.5200 104.8941
row5 105.8088 105.3025
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.5200 104.8941
row5 105.8088 105.3025
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.2797885
[2,] -0.9069179
[3,] 1.6997573
[4,] -0.7140567
[5,] 0.5636582
> tmp[,c("col17","col7")]
col17 col7
[1,] 2.02950144 -0.8863411
[2,] 1.04938742 1.1559894
[3,] 1.17110222 -1.4848850
[4,] -1.29952598 -0.6624406
[5,] 0.07492207 0.8888205
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.5453720 1.0067538
[2,] -0.7072520 1.2221011
[3,] 1.0604810 -0.3331476
[4,] -0.2418686 -1.4296535
[5,] 2.3388801 1.1254329
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.545372
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.545372
[2,] -0.707252
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.4280791 -0.778859 0.2933141 1.2030424 0.1431602 -0.1697001 0.7236817
row1 -0.9676813 -2.152385 1.5345809 -0.8097688 -0.2802883 -0.3105839 0.1617754
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.1239835 -0.5951757 0.26373214 1.2530746 -0.9942727 0.7502039
row1 -1.0637647 -0.6630581 0.04970537 -0.1670219 1.3021722 1.2394522
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.5008265 0.1766440 0.5890524 -0.5311742 0.2171551 1.2996794 1.1618285
row1 0.2076965 -0.1553568 0.5115614 0.6366106 0.7167455 -0.4937651 -0.0169638
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.612569 -0.6107427 0.2780437 1.002028 -2.73301 0.8079338 -2.221802
[,8] [,9] [,10]
row2 -0.2994633 -1.127283 -1.315556
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.5236666 0.7656807 -1.620331 1.033679 -0.07678478 0.9042178 -0.1604893
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.9086448 -2.457457 1.770371 0.887796 -1.083327 -1.044864 0.9240346
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.1772203 -0.9097424 -0.9243491 -0.3180624 0.6815511 0.3229866
>
>
> 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: 0x600001178360>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd3136f54e"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd33f22d481"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd37ad8189"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd310134d4f"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd3633885c7"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd313d6feb5"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd37ec2740"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd32104ded0"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd346c03a9f"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd37648c102"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd32277a6f9"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd35d73371c"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd337273f32"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd371a607e7"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1bd34b5108fb"
>
>
> ### 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: 0x6000011485a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000011485a0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000011485a0>
> rowMedians(tmp)
[1] -0.1422230778 0.3414551622 0.2026800591 0.1896713261 0.3388905434
[6] -0.1984751347 0.4401516024 -0.0754233861 0.1776328326 -0.1259240987
[11] 0.2507581281 0.0566978941 0.0900241293 0.1240916241 0.2777942467
[16] 0.4886698229 -0.2468660257 0.7419480489 -0.1414999099 -0.1283427929
[21] -0.0821288941 0.1829316204 0.0487726167 0.1238727057 0.3334732844
[26] 0.1937156684 -0.5330671331 0.4024847605 -0.1075918121 0.3496731159
[31] -0.1145093635 -0.2689629228 -0.6030793576 -0.0393522352 -0.3785719450
[36] 0.5376709123 0.1331209489 -0.0628020275 -0.0179001001 -0.0341177961
[41] -0.3717860684 -0.0025104571 -0.1440977230 0.1816223381 -0.4746078399
[46] 0.1243323951 -0.2828349744 -0.4896975101 0.1442851567 -0.4074093256
[51] 0.1151481231 -0.0565239885 0.1537166593 0.0985601270 0.7582291999
[56] -0.1540940249 0.2746550696 -0.0245859430 0.4035380284 -0.1460437511
[61] -0.1136490023 -0.0460296171 -0.6000653585 -0.0645953185 0.0629793874
[66] 0.2220511478 -0.0437118885 0.3097406031 0.0174408726 -0.0731831492
[71] -0.3733629012 0.0048380705 -0.2372279844 -0.0145462733 -0.1700537604
[76] 0.0299685723 -0.6399672290 -0.1301149074 -0.1681513218 -0.2195182150
[81] -0.6896261184 0.5264685679 -0.0007657821 -0.0042808668 0.1694612292
[86] 0.2141060425 0.2071811437 0.2144266394 0.2045653434 -0.2132956397
[91] -0.0772199450 0.3686100888 -0.3406566110 0.4972117847 0.0868794693
[96] 0.0309134518 0.0657269391 -0.0648556961 -0.1135946865 0.2421991433
[101] -0.2333287620 -0.2133121979 0.6789518513 0.3774258151 0.5003834442
[106] -0.2190437234 0.0801596389 0.5675131894 -0.7359961021 0.1283628526
[111] -0.3755754190 0.2560091264 -0.0229028099 0.1873626823 0.0965131995
[116] 0.1919598195 -0.0633818272 -0.0084013756 -0.0725849930 -0.0534788360
[121] -0.3189992385 -0.3818469780 0.2540374570 0.2722574190 -0.2297532869
[126] -0.0745721050 0.4163706355 0.2044225225 -0.0620973375 0.3125978217
[131] 0.2915799365 0.6867576098 0.4518031864 0.2837310573 -0.4435176636
[136] -0.0778564303 -0.2615541957 0.1130654236 -0.4170491575 0.0310881266
[141] -0.0396276366 0.0324292456 0.1172714527 -0.0030463533 -0.2821804567
[146] -0.3160908609 0.5184998821 0.0627814930 0.0646239343 0.2644053634
[151] 0.3094014337 0.2853218493 -0.2018470479 0.1898992055 -0.1385401077
[156] -0.0321052842 0.1356481615 0.1540469720 -0.1492702447 -0.3377632627
[161] -0.1208956938 -0.1112070119 -0.3775087850 0.3386231556 -0.1017676583
[166] -0.2180203348 -0.1664158214 -0.2842192368 -0.1927872556 -0.0490264718
[171] -0.6193163431 0.0513354686 0.0960750951 -0.8774753191 -0.0669780641
[176] 0.2286697721 0.2733122597 -0.2672946852 0.0891252206 -0.0241880959
[181] -0.0875289468 -0.1813441462 0.2210831051 -0.3491155156 -0.5453371575
[186] -0.4239724863 -0.0632423835 0.0901559550 -0.1542539928 -0.1402547879
[191] -0.1890153060 -0.4698315855 0.0824996390 -0.3096114197 -0.2915529288
[196] 0.4757035631 -0.0619182229 -0.1270096448 -0.3146894396 -0.1262271754
[201] -0.1434115231 -0.0454406003 -0.0657031620 -0.5754707743 0.2832906414
[206] -0.1114737640 -0.1725050459 0.3941031707 0.0246100451 -0.1821371417
[211] 0.3728282146 -0.1407982534 -0.0734631938 -0.0350919872 -0.1573650246
[216] -0.0193173002 0.0068208480 0.5269057184 -0.0797373738 0.0332757327
[221] -0.1636400820 0.2138174935 -0.3625094923 -0.8752586899 0.1091084384
[226] -0.1283965212 -0.4783859464 0.3834387347 -0.0622501383 -0.3088546331
>
> proc.time()
user system elapsed
0.713 3.757 5.022
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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: 0x60000205c0c0>
> .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: 0x60000205c0c0>
> .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: 0x60000205c0c0>
> .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: 0x60000205c0c0>
> 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: 0x600002054000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054000>
> .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: 0x600002054000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054000>
> .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: 0x600002054000>
> 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: 0x600002054180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054180>
> .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: 0x600002054180>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002054180>
> .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: 0x600002054180>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002054180>
> .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: 0x600002054180>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002054180>
> .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: 0x600002054180>
> 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: 0x600002054360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002054360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile227e114ba259" "BufferedMatrixFile227e7c8f89ed"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile227e114ba259" "BufferedMatrixFile227e7c8f89ed"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002054600>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002054600>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002054600>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002054600>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002054600>
> .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: 0x6000020547e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000020547e0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000020547e0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000020547e0>
> 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: 0x6000020549c0>
> .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: 0x6000020549c0>
> rm(P)
>
> proc.time()
user system elapsed
0.129 0.055 0.180
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.136 0.037 0.163