| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-05 11:35 -0500 (Fri, 05 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4869 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4576 |
| 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/2331 | 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-04 18:48:24 -0500 (Thu, 04 Dec 2025) |
| EndedAt: 2025-12-04 18:48:45 -0500 (Thu, 04 Dec 2025) |
| EllapsedTime: 21.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.137 0.056 0.189
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] "Thu Dec 4 18:48:36 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Dec 4 18:48:36 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: 0x600000210000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Dec 4 18:48:38 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Dec 4 18:48:38 2025"
>
> ColMode(tmp2)
<pointer: 0x600000210000>
>
>
>
> ### 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,] 98.7642903 0.1897793 -0.1482155 0.8201393
[2,] 0.4378982 -0.0737965 1.0527874 0.9648113
[3,] -1.1015087 1.1855015 0.4364109 -2.0158984
[4,] 1.1493039 1.0404947 -1.3411910 1.7505718
> 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,] 98.7642903 0.1897793 0.1482155 0.8201393
[2,] 0.4378982 0.0737965 1.0527874 0.9648113
[3,] 1.1015087 1.1855015 0.4364109 2.0158984
[4,] 1.1493039 1.0404947 1.3411910 1.7505718
> 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,] 9.9380225 0.4356367 0.3849877 0.9056154
[2,] 0.6617387 0.2716551 1.0260543 0.9822481
[3,] 1.0495279 1.0888074 0.6606140 1.4198234
[4,] 1.0720559 1.0200464 1.1580980 1.3230918
>
> 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,] 223.14451 29.54615 28.99809 34.87629
[2,] 32.05529 27.79035 36.31333 35.78729
[3,] 36.59679 37.07358 32.04255 41.21413
[4,] 36.86986 36.24096 37.92217 39.98149
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000238000>
> exp(tmp5)
<pointer: 0x600000238000>
> log(tmp5,2)
<pointer: 0x600000238000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.4461
> Min(tmp5)
[1] 54.19512
> mean(tmp5)
[1] 73.24175
> Sum(tmp5)
[1] 14648.35
> Var(tmp5)
[1] 848.5076
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.66264 70.32930 74.63659 72.49730 70.37032 70.37413 72.63620 71.35203
[9] 70.49564 70.06339
> rowSums(tmp5)
[1] 1793.253 1406.586 1492.732 1449.946 1407.406 1407.483 1452.724 1427.041
[9] 1409.913 1401.268
> rowVars(tmp5)
[1] 7837.74044 66.00258 60.63410 96.36673 45.42177 85.78475
[7] 75.49980 104.25725 83.39016 96.45342
> rowSd(tmp5)
[1] 88.531014 8.124197 7.786790 9.816656 6.739568 9.262006 8.689062
[8] 10.210644 9.131821 9.821070
> rowMax(tmp5)
[1] 464.44607 87.55506 91.83984 92.65651 83.12248 88.75235 89.92293
[8] 91.90345 92.59345 86.19093
> rowMin(tmp5)
[1] 54.50780 57.84197 59.65993 54.30103 57.49493 55.27826 59.13687 54.19512
[9] 58.37813 54.61170
>
> colMeans(tmp5)
[1] 111.85926 73.50354 68.26581 71.18631 70.35170 73.03868 71.22219
[8] 72.10972 71.73866 65.80161 74.62088 67.90046 67.01572 74.67762
[15] 73.06211 77.10972 69.41920 71.97441 66.85535 73.12210
> colSums(tmp5)
[1] 1118.5926 735.0354 682.6581 711.8631 703.5170 730.3868 712.2219
[8] 721.0972 717.3866 658.0161 746.2088 679.0046 670.1572 746.7762
[15] 730.6211 771.0972 694.1920 719.7441 668.5535 731.2210
> colVars(tmp5)
[1] 15404.54566 109.78959 45.11721 90.92647 134.12336 29.81752
[7] 46.68425 93.75665 36.86749 47.54528 114.30873 93.86332
[13] 59.12886 139.58900 84.86013 72.24841 31.68627 88.19510
[19] 66.15133 44.46015
> colSd(tmp5)
[1] 124.115050 10.478053 6.716935 9.535537 11.581164 5.460542
[7] 6.832588 9.682802 6.071860 6.895309 10.691526 9.688308
[13] 7.689529 11.814779 9.211956 8.499907 5.629056 9.391224
[19] 8.133347 6.667845
> colMax(tmp5)
[1] 464.44607 91.90345 78.93003 85.78182 92.65651 81.73106 79.06930
[8] 83.94522 80.27579 79.13322 89.92293 84.65973 79.24259 91.83984
[15] 88.55440 92.59345 77.15139 86.96129 83.23689 86.19093
> colMin(tmp5)
[1] 61.94639 57.84197 57.71452 59.48487 55.27826 66.20580 57.49493 54.19512
[9] 62.16419 54.30103 58.17791 55.70338 54.50780 54.61170 61.64947 66.15129
[17] 59.11337 54.87706 58.39381 64.70543
>
>
> ### 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.66264 70.32930 74.63659 NA 70.37032 70.37413 72.63620 71.35203
[9] 70.49564 70.06339
> rowSums(tmp5)
[1] 1793.253 1406.586 1492.732 NA 1407.406 1407.483 1452.724 1427.041
[9] 1409.913 1401.268
> rowVars(tmp5)
[1] 7837.74044 66.00258 60.63410 82.35763 45.42177 85.78475
[7] 75.49980 104.25725 83.39016 96.45342
> rowSd(tmp5)
[1] 88.531014 8.124197 7.786790 9.075111 6.739568 9.262006 8.689062
[8] 10.210644 9.131821 9.821070
> rowMax(tmp5)
[1] 464.44607 87.55506 91.83984 NA 83.12248 88.75235 89.92293
[8] 91.90345 92.59345 86.19093
> rowMin(tmp5)
[1] 54.50780 57.84197 59.65993 NA 57.49493 55.27826 59.13687 54.19512
[9] 58.37813 54.61170
>
> colMeans(tmp5)
[1] 111.85926 73.50354 68.26581 71.18631 70.35170 73.03868 71.22219
[8] 72.10972 71.73866 NA 74.62088 67.90046 67.01572 74.67762
[15] 73.06211 77.10972 69.41920 71.97441 66.85535 73.12210
> colSums(tmp5)
[1] 1118.5926 735.0354 682.6581 711.8631 703.5170 730.3868 712.2219
[8] 721.0972 717.3866 NA 746.2088 679.0046 670.1572 746.7762
[15] 730.6211 771.0972 694.1920 719.7441 668.5535 731.2210
> colVars(tmp5)
[1] 15404.54566 109.78959 45.11721 90.92647 134.12336 29.81752
[7] 46.68425 93.75665 36.86749 NA 114.30873 93.86332
[13] 59.12886 139.58900 84.86013 72.24841 31.68627 88.19510
[19] 66.15133 44.46015
> colSd(tmp5)
[1] 124.115050 10.478053 6.716935 9.535537 11.581164 5.460542
[7] 6.832588 9.682802 6.071860 NA 10.691526 9.688308
[13] 7.689529 11.814779 9.211956 8.499907 5.629056 9.391224
[19] 8.133347 6.667845
> colMax(tmp5)
[1] 464.44607 91.90345 78.93003 85.78182 92.65651 81.73106 79.06930
[8] 83.94522 80.27579 NA 89.92293 84.65973 79.24259 91.83984
[15] 88.55440 92.59345 77.15139 86.96129 83.23689 86.19093
> colMin(tmp5)
[1] 61.94639 57.84197 57.71452 59.48487 55.27826 66.20580 57.49493 54.19512
[9] 62.16419 NA 58.17791 55.70338 54.50780 54.61170 61.64947 66.15129
[17] 59.11337 54.87706 58.39381 64.70543
>
> Max(tmp5,na.rm=TRUE)
[1] 464.4461
> Min(tmp5,na.rm=TRUE)
[1] 54.19512
> mean(tmp5,na.rm=TRUE)
[1] 73.33693
> Sum(tmp5,na.rm=TRUE)
[1] 14594.05
> Var(tmp5,na.rm=TRUE)
[1] 850.972
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.66264 70.32930 74.63659 73.45499 70.37032 70.37413 72.63620 71.35203
[9] 70.49564 70.06339
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.253 1406.586 1492.732 1395.645 1407.406 1407.483 1452.724 1427.041
[9] 1409.913 1401.268
> rowVars(tmp5,na.rm=TRUE)
[1] 7837.74044 66.00258 60.63410 82.35763 45.42177 85.78475
[7] 75.49980 104.25725 83.39016 96.45342
> rowSd(tmp5,na.rm=TRUE)
[1] 88.531014 8.124197 7.786790 9.075111 6.739568 9.262006 8.689062
[8] 10.210644 9.131821 9.821070
> rowMax(tmp5,na.rm=TRUE)
[1] 464.44607 87.55506 91.83984 92.65651 83.12248 88.75235 89.92293
[8] 91.90345 92.59345 86.19093
> rowMin(tmp5,na.rm=TRUE)
[1] 54.50780 57.84197 59.65993 58.78898 57.49493 55.27826 59.13687 54.19512
[9] 58.37813 54.61170
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.85926 73.50354 68.26581 71.18631 70.35170 73.03868 71.22219
[8] 72.10972 71.73866 67.07945 74.62088 67.90046 67.01572 74.67762
[15] 73.06211 77.10972 69.41920 71.97441 66.85535 73.12210
> colSums(tmp5,na.rm=TRUE)
[1] 1118.5926 735.0354 682.6581 711.8631 703.5170 730.3868 712.2219
[8] 721.0972 717.3866 603.7150 746.2088 679.0046 670.1572 746.7762
[15] 730.6211 771.0972 694.1920 719.7441 668.5535 731.2210
> colVars(tmp5,na.rm=TRUE)
[1] 15404.54566 109.78959 45.11721 90.92647 134.12336 29.81752
[7] 46.68425 93.75665 36.86749 35.11856 114.30873 93.86332
[13] 59.12886 139.58900 84.86013 72.24841 31.68627 88.19510
[19] 66.15133 44.46015
> colSd(tmp5,na.rm=TRUE)
[1] 124.115050 10.478053 6.716935 9.535537 11.581164 5.460542
[7] 6.832588 9.682802 6.071860 5.926091 10.691526 9.688308
[13] 7.689529 11.814779 9.211956 8.499907 5.629056 9.391224
[19] 8.133347 6.667845
> colMax(tmp5,na.rm=TRUE)
[1] 464.44607 91.90345 78.93003 85.78182 92.65651 81.73106 79.06930
[8] 83.94522 80.27579 79.13322 89.92293 84.65973 79.24259 91.83984
[15] 88.55440 92.59345 77.15139 86.96129 83.23689 86.19093
> colMin(tmp5,na.rm=TRUE)
[1] 61.94639 57.84197 57.71452 59.48487 55.27826 66.20580 57.49493 54.19512
[9] 62.16419 60.76462 58.17791 55.70338 54.50780 54.61170 61.64947 66.15129
[17] 59.11337 54.87706 58.39381 64.70543
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.66264 70.32930 74.63659 NaN 70.37032 70.37413 72.63620 71.35203
[9] 70.49564 70.06339
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.253 1406.586 1492.732 0.000 1407.406 1407.483 1452.724 1427.041
[9] 1409.913 1401.268
> rowVars(tmp5,na.rm=TRUE)
[1] 7837.74044 66.00258 60.63410 NA 45.42177 85.78475
[7] 75.49980 104.25725 83.39016 96.45342
> rowSd(tmp5,na.rm=TRUE)
[1] 88.531014 8.124197 7.786790 NA 6.739568 9.262006 8.689062
[8] 10.210644 9.131821 9.821070
> rowMax(tmp5,na.rm=TRUE)
[1] 464.44607 87.55506 91.83984 NA 83.12248 88.75235 89.92293
[8] 91.90345 92.59345 86.19093
> rowMin(tmp5,na.rm=TRUE)
[1] 54.50780 57.84197 59.65993 NA 57.49493 55.27826 59.13687 54.19512
[9] 58.37813 54.61170
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.76142 73.28940 67.08090 69.84966 67.87338 73.55847 70.35029
[8] 73.58980 72.31383 NaN 76.37550 68.86713 65.87902 73.94440
[15] 72.57731 77.47332 69.65173 70.86023 66.48880 73.62537
> colSums(tmp5,na.rm=TRUE)
[1] 1041.8528 659.6046 603.7281 628.6469 610.8604 662.0262 633.1526
[8] 662.3082 650.8244 0.0000 687.3795 619.8042 592.9112 665.4996
[15] 653.1958 697.2598 626.8656 637.7420 598.3992 662.6283
> colVars(tmp5,na.rm=TRUE)
[1] 17158.81151 122.99740 34.96165 82.19243 81.79088 30.50520
[7] 43.96740 80.83148 37.75429 NA 93.96207 95.08361
[13] 51.98423 150.98952 92.82352 79.79220 35.03872 85.25360
[19] 72.90871 47.16833
> colSd(tmp5,na.rm=TRUE)
[1] 130.991647 11.090419 5.912838 9.066004 9.043831 5.523151
[7] 6.630792 8.990633 6.144452 NA 9.693403 9.751083
[13] 7.210009 12.287779 9.634496 8.932648 5.919352 9.233288
[19] 8.538660 6.867921
> colMax(tmp5,na.rm=TRUE)
[1] 464.44607 91.90345 75.58144 85.78182 79.48200 81.73106 78.53255
[8] 83.94522 80.27579 -Inf 89.92293 84.65973 79.24259 91.83984
[15] 88.55440 92.59345 77.15139 86.96129 83.23689 86.19093
> colMin(tmp5,na.rm=TRUE)
[1] 61.94639 57.84197 57.71452 59.48487 55.27826 66.20580 57.49493 54.19512
[9] 62.16419 Inf 58.17791 55.70338 54.50780 54.61170 61.64947 66.15129
[17] 59.11337 54.87706 58.39381 64.70543
>
>
>
>
> 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] 243.7503 175.4635 186.2708 148.8374 160.4924 211.4050 320.8500 280.9353
[9] 186.0200 175.7828
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 243.7503 175.4635 186.2708 148.8374 160.4924 211.4050 320.8500 280.9353
[9] 186.0200 175.7828
>
>
>
> 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 5.684342e-14 -8.526513e-14 1.989520e-13 1.278977e-13
[6] 5.684342e-14 -2.842171e-14 7.105427e-14 0.000000e+00 0.000000e+00
[11] 8.526513e-14 0.000000e+00 -5.684342e-14 5.684342e-14 1.136868e-13
[16] -2.842171e-14 5.684342e-14 2.842171e-13 5.684342e-14 -5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 6
5 18
9 17
5 12
7 11
10 5
8 20
4 14
5 16
2 13
9 3
4 6
5 16
4 3
10 14
4 14
5 11
4 2
8 19
7 13
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.093358
> Min(tmp)
[1] -2.053889
> mean(tmp)
[1] -0.02345406
> Sum(tmp)
[1] -2.345406
> Var(tmp)
[1] 0.9968427
>
> rowMeans(tmp)
[1] -0.02345406
> rowSums(tmp)
[1] -2.345406
> rowVars(tmp)
[1] 0.9968427
> rowSd(tmp)
[1] 0.9984201
> rowMax(tmp)
[1] 2.093358
> rowMin(tmp)
[1] -2.053889
>
> colMeans(tmp)
[1] -0.008163278 -1.847185143 -0.161076469 -1.125733020 1.242663628
[6] -0.704624968 1.481511562 0.340518274 -0.110566707 0.114855108
[11] 0.886071693 -0.245377857 0.040252933 -1.262575407 0.878203537
[16] -1.591291949 2.093358305 -1.630187072 -1.459122367 1.623101774
[21] -1.056218220 -0.451311153 -0.794058244 0.512825119 0.230756728
[26] 0.632210530 -0.675849171 -1.273366840 1.931276662 0.501719996
[31] -1.152804434 -0.726305992 -0.617229533 -0.402280609 -0.309795597
[36] 0.915905431 0.641770800 -1.244510979 1.745020643 0.892741905
[41] -0.725602449 -1.292459447 -0.233607058 0.889066332 0.021621393
[46] -1.640323047 0.370883608 -0.020939504 0.994656444 -2.053889399
[51] -0.689125688 0.318880354 0.980692041 -0.095923088 -0.893783683
[56] -1.240778422 -0.108892763 -1.778107287 -1.033266179 -0.848450481
[61] -0.053619909 -1.941473206 0.830796878 0.833167586 -0.486715639
[66] 0.002745860 -0.346044994 1.004165893 -0.912615684 1.450132649
[71] -0.970068754 -0.115451155 0.113746496 0.755783334 -0.161121132
[76] -1.928157615 -0.163720314 1.316651254 1.958736650 0.442263297
[81] 0.372797422 1.208746024 0.882022153 0.004807218 1.381367313
[86] 1.565379986 -0.291269955 1.520294518 0.105969530 0.999530476
[91] -1.116321410 -0.614719148 -0.440026656 -0.088173938 -0.544042950
[96] 0.384654455 0.648361149 0.945312650 0.082593525 0.242329138
> colSums(tmp)
[1] -0.008163278 -1.847185143 -0.161076469 -1.125733020 1.242663628
[6] -0.704624968 1.481511562 0.340518274 -0.110566707 0.114855108
[11] 0.886071693 -0.245377857 0.040252933 -1.262575407 0.878203537
[16] -1.591291949 2.093358305 -1.630187072 -1.459122367 1.623101774
[21] -1.056218220 -0.451311153 -0.794058244 0.512825119 0.230756728
[26] 0.632210530 -0.675849171 -1.273366840 1.931276662 0.501719996
[31] -1.152804434 -0.726305992 -0.617229533 -0.402280609 -0.309795597
[36] 0.915905431 0.641770800 -1.244510979 1.745020643 0.892741905
[41] -0.725602449 -1.292459447 -0.233607058 0.889066332 0.021621393
[46] -1.640323047 0.370883608 -0.020939504 0.994656444 -2.053889399
[51] -0.689125688 0.318880354 0.980692041 -0.095923088 -0.893783683
[56] -1.240778422 -0.108892763 -1.778107287 -1.033266179 -0.848450481
[61] -0.053619909 -1.941473206 0.830796878 0.833167586 -0.486715639
[66] 0.002745860 -0.346044994 1.004165893 -0.912615684 1.450132649
[71] -0.970068754 -0.115451155 0.113746496 0.755783334 -0.161121132
[76] -1.928157615 -0.163720314 1.316651254 1.958736650 0.442263297
[81] 0.372797422 1.208746024 0.882022153 0.004807218 1.381367313
[86] 1.565379986 -0.291269955 1.520294518 0.105969530 0.999530476
[91] -1.116321410 -0.614719148 -0.440026656 -0.088173938 -0.544042950
[96] 0.384654455 0.648361149 0.945312650 0.082593525 0.242329138
> 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.008163278 -1.847185143 -0.161076469 -1.125733020 1.242663628
[6] -0.704624968 1.481511562 0.340518274 -0.110566707 0.114855108
[11] 0.886071693 -0.245377857 0.040252933 -1.262575407 0.878203537
[16] -1.591291949 2.093358305 -1.630187072 -1.459122367 1.623101774
[21] -1.056218220 -0.451311153 -0.794058244 0.512825119 0.230756728
[26] 0.632210530 -0.675849171 -1.273366840 1.931276662 0.501719996
[31] -1.152804434 -0.726305992 -0.617229533 -0.402280609 -0.309795597
[36] 0.915905431 0.641770800 -1.244510979 1.745020643 0.892741905
[41] -0.725602449 -1.292459447 -0.233607058 0.889066332 0.021621393
[46] -1.640323047 0.370883608 -0.020939504 0.994656444 -2.053889399
[51] -0.689125688 0.318880354 0.980692041 -0.095923088 -0.893783683
[56] -1.240778422 -0.108892763 -1.778107287 -1.033266179 -0.848450481
[61] -0.053619909 -1.941473206 0.830796878 0.833167586 -0.486715639
[66] 0.002745860 -0.346044994 1.004165893 -0.912615684 1.450132649
[71] -0.970068754 -0.115451155 0.113746496 0.755783334 -0.161121132
[76] -1.928157615 -0.163720314 1.316651254 1.958736650 0.442263297
[81] 0.372797422 1.208746024 0.882022153 0.004807218 1.381367313
[86] 1.565379986 -0.291269955 1.520294518 0.105969530 0.999530476
[91] -1.116321410 -0.614719148 -0.440026656 -0.088173938 -0.544042950
[96] 0.384654455 0.648361149 0.945312650 0.082593525 0.242329138
> colMin(tmp)
[1] -0.008163278 -1.847185143 -0.161076469 -1.125733020 1.242663628
[6] -0.704624968 1.481511562 0.340518274 -0.110566707 0.114855108
[11] 0.886071693 -0.245377857 0.040252933 -1.262575407 0.878203537
[16] -1.591291949 2.093358305 -1.630187072 -1.459122367 1.623101774
[21] -1.056218220 -0.451311153 -0.794058244 0.512825119 0.230756728
[26] 0.632210530 -0.675849171 -1.273366840 1.931276662 0.501719996
[31] -1.152804434 -0.726305992 -0.617229533 -0.402280609 -0.309795597
[36] 0.915905431 0.641770800 -1.244510979 1.745020643 0.892741905
[41] -0.725602449 -1.292459447 -0.233607058 0.889066332 0.021621393
[46] -1.640323047 0.370883608 -0.020939504 0.994656444 -2.053889399
[51] -0.689125688 0.318880354 0.980692041 -0.095923088 -0.893783683
[56] -1.240778422 -0.108892763 -1.778107287 -1.033266179 -0.848450481
[61] -0.053619909 -1.941473206 0.830796878 0.833167586 -0.486715639
[66] 0.002745860 -0.346044994 1.004165893 -0.912615684 1.450132649
[71] -0.970068754 -0.115451155 0.113746496 0.755783334 -0.161121132
[76] -1.928157615 -0.163720314 1.316651254 1.958736650 0.442263297
[81] 0.372797422 1.208746024 0.882022153 0.004807218 1.381367313
[86] 1.565379986 -0.291269955 1.520294518 0.105969530 0.999530476
[91] -1.116321410 -0.614719148 -0.440026656 -0.088173938 -0.544042950
[96] 0.384654455 0.648361149 0.945312650 0.082593525 0.242329138
> colMedians(tmp)
[1] -0.008163278 -1.847185143 -0.161076469 -1.125733020 1.242663628
[6] -0.704624968 1.481511562 0.340518274 -0.110566707 0.114855108
[11] 0.886071693 -0.245377857 0.040252933 -1.262575407 0.878203537
[16] -1.591291949 2.093358305 -1.630187072 -1.459122367 1.623101774
[21] -1.056218220 -0.451311153 -0.794058244 0.512825119 0.230756728
[26] 0.632210530 -0.675849171 -1.273366840 1.931276662 0.501719996
[31] -1.152804434 -0.726305992 -0.617229533 -0.402280609 -0.309795597
[36] 0.915905431 0.641770800 -1.244510979 1.745020643 0.892741905
[41] -0.725602449 -1.292459447 -0.233607058 0.889066332 0.021621393
[46] -1.640323047 0.370883608 -0.020939504 0.994656444 -2.053889399
[51] -0.689125688 0.318880354 0.980692041 -0.095923088 -0.893783683
[56] -1.240778422 -0.108892763 -1.778107287 -1.033266179 -0.848450481
[61] -0.053619909 -1.941473206 0.830796878 0.833167586 -0.486715639
[66] 0.002745860 -0.346044994 1.004165893 -0.912615684 1.450132649
[71] -0.970068754 -0.115451155 0.113746496 0.755783334 -0.161121132
[76] -1.928157615 -0.163720314 1.316651254 1.958736650 0.442263297
[81] 0.372797422 1.208746024 0.882022153 0.004807218 1.381367313
[86] 1.565379986 -0.291269955 1.520294518 0.105969530 0.999530476
[91] -1.116321410 -0.614719148 -0.440026656 -0.088173938 -0.544042950
[96] 0.384654455 0.648361149 0.945312650 0.082593525 0.242329138
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.008163278 -1.847185 -0.1610765 -1.125733 1.242664 -0.704625 1.481512
[2,] -0.008163278 -1.847185 -0.1610765 -1.125733 1.242664 -0.704625 1.481512
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.3405183 -0.1105667 0.1148551 0.8860717 -0.2453779 0.04025293 -1.262575
[2,] 0.3405183 -0.1105667 0.1148551 0.8860717 -0.2453779 0.04025293 -1.262575
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.8782035 -1.591292 2.093358 -1.630187 -1.459122 1.623102 -1.056218
[2,] 0.8782035 -1.591292 2.093358 -1.630187 -1.459122 1.623102 -1.056218
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.4513112 -0.7940582 0.5128251 0.2307567 0.6322105 -0.6758492 -1.273367
[2,] -0.4513112 -0.7940582 0.5128251 0.2307567 0.6322105 -0.6758492 -1.273367
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.931277 0.50172 -1.152804 -0.726306 -0.6172295 -0.4022806 -0.3097956
[2,] 1.931277 0.50172 -1.152804 -0.726306 -0.6172295 -0.4022806 -0.3097956
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.9159054 0.6417708 -1.244511 1.745021 0.8927419 -0.7256024 -1.292459
[2,] 0.9159054 0.6417708 -1.244511 1.745021 0.8927419 -0.7256024 -1.292459
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.2336071 0.8890663 0.02162139 -1.640323 0.3708836 -0.0209395 0.9946564
[2,] -0.2336071 0.8890663 0.02162139 -1.640323 0.3708836 -0.0209395 0.9946564
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -2.053889 -0.6891257 0.3188804 0.980692 -0.09592309 -0.8937837 -1.240778
[2,] -2.053889 -0.6891257 0.3188804 0.980692 -0.09592309 -0.8937837 -1.240778
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.1088928 -1.778107 -1.033266 -0.8484505 -0.05361991 -1.941473 0.8307969
[2,] -0.1088928 -1.778107 -1.033266 -0.8484505 -0.05361991 -1.941473 0.8307969
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.8331676 -0.4867156 0.00274586 -0.346045 1.004166 -0.9126157 1.450133
[2,] 0.8331676 -0.4867156 0.00274586 -0.346045 1.004166 -0.9126157 1.450133
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.9700688 -0.1154512 0.1137465 0.7557833 -0.1611211 -1.928158 -0.1637203
[2,] -0.9700688 -0.1154512 0.1137465 0.7557833 -0.1611211 -1.928158 -0.1637203
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.316651 1.958737 0.4422633 0.3727974 1.208746 0.8820222 0.004807218
[2,] 1.316651 1.958737 0.4422633 0.3727974 1.208746 0.8820222 0.004807218
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.381367 1.56538 -0.29127 1.520295 0.1059695 0.9995305 -1.116321
[2,] 1.381367 1.56538 -0.29127 1.520295 0.1059695 0.9995305 -1.116321
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.6147191 -0.4400267 -0.08817394 -0.544043 0.3846545 0.6483611 0.9453127
[2,] -0.6147191 -0.4400267 -0.08817394 -0.544043 0.3846545 0.6483611 0.9453127
[,99] [,100]
[1,] 0.08259352 0.2423291
[2,] 0.08259352 0.2423291
>
>
> Max(tmp2)
[1] 2.032666
> Min(tmp2)
[1] -2.5946
> mean(tmp2)
[1] 0.01349105
> Sum(tmp2)
[1] 1.349105
> Var(tmp2)
[1] 0.8683963
>
> rowMeans(tmp2)
[1] 0.524009324 -0.882225554 0.715680156 -0.544043019 0.439243424
[6] 0.328127387 -2.594599599 -1.559480263 0.178195602 -2.121714032
[11] -0.260793016 0.819650390 -0.068638436 0.267628578 -0.217527512
[16] 1.318137743 0.961816602 0.931544043 -0.879730474 -0.579926980
[21] 1.139407879 0.855085667 1.275952988 -0.300860932 -1.258158294
[26] 0.566638902 0.739126854 -0.730202022 -0.005211611 0.524076660
[31] -0.671960529 1.134892033 -0.522201648 -0.856874394 0.276890145
[36] 0.382801271 1.797163093 -0.945963173 -0.334950231 -0.672894601
[41] -0.895221547 0.031820338 -1.014837956 -0.718821598 0.428146123
[46] 0.173157791 -0.529115485 0.679782547 -0.025062964 0.686335145
[51] 0.806544029 -0.976289168 0.589090872 2.032666343 -0.956645253
[56] 0.659134779 0.242387088 1.070789896 -1.023490088 -1.550577452
[61] -0.541246686 0.122996913 0.073654901 -0.488656571 0.075698076
[66] 0.609860118 -0.703416833 -0.131279785 0.919786988 0.431128571
[71] -0.594863318 -1.415263325 -0.166903492 -1.059470076 -0.265367349
[76] 0.769063283 1.409637731 0.356557616 0.740967499 0.706463919
[81] 0.635711472 1.977032678 1.387415329 -1.371813236 1.316975148
[86] 1.579757878 -0.910255560 -1.088327841 0.176001838 -1.003037383
[91] 0.583142459 -1.172302328 -1.283829438 1.072991270 1.214854884
[96] -0.645852662 -0.437576439 -1.319367083 0.193302843 0.717027123
> rowSums(tmp2)
[1] 0.524009324 -0.882225554 0.715680156 -0.544043019 0.439243424
[6] 0.328127387 -2.594599599 -1.559480263 0.178195602 -2.121714032
[11] -0.260793016 0.819650390 -0.068638436 0.267628578 -0.217527512
[16] 1.318137743 0.961816602 0.931544043 -0.879730474 -0.579926980
[21] 1.139407879 0.855085667 1.275952988 -0.300860932 -1.258158294
[26] 0.566638902 0.739126854 -0.730202022 -0.005211611 0.524076660
[31] -0.671960529 1.134892033 -0.522201648 -0.856874394 0.276890145
[36] 0.382801271 1.797163093 -0.945963173 -0.334950231 -0.672894601
[41] -0.895221547 0.031820338 -1.014837956 -0.718821598 0.428146123
[46] 0.173157791 -0.529115485 0.679782547 -0.025062964 0.686335145
[51] 0.806544029 -0.976289168 0.589090872 2.032666343 -0.956645253
[56] 0.659134779 0.242387088 1.070789896 -1.023490088 -1.550577452
[61] -0.541246686 0.122996913 0.073654901 -0.488656571 0.075698076
[66] 0.609860118 -0.703416833 -0.131279785 0.919786988 0.431128571
[71] -0.594863318 -1.415263325 -0.166903492 -1.059470076 -0.265367349
[76] 0.769063283 1.409637731 0.356557616 0.740967499 0.706463919
[81] 0.635711472 1.977032678 1.387415329 -1.371813236 1.316975148
[86] 1.579757878 -0.910255560 -1.088327841 0.176001838 -1.003037383
[91] 0.583142459 -1.172302328 -1.283829438 1.072991270 1.214854884
[96] -0.645852662 -0.437576439 -1.319367083 0.193302843 0.717027123
> 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.524009324 -0.882225554 0.715680156 -0.544043019 0.439243424
[6] 0.328127387 -2.594599599 -1.559480263 0.178195602 -2.121714032
[11] -0.260793016 0.819650390 -0.068638436 0.267628578 -0.217527512
[16] 1.318137743 0.961816602 0.931544043 -0.879730474 -0.579926980
[21] 1.139407879 0.855085667 1.275952988 -0.300860932 -1.258158294
[26] 0.566638902 0.739126854 -0.730202022 -0.005211611 0.524076660
[31] -0.671960529 1.134892033 -0.522201648 -0.856874394 0.276890145
[36] 0.382801271 1.797163093 -0.945963173 -0.334950231 -0.672894601
[41] -0.895221547 0.031820338 -1.014837956 -0.718821598 0.428146123
[46] 0.173157791 -0.529115485 0.679782547 -0.025062964 0.686335145
[51] 0.806544029 -0.976289168 0.589090872 2.032666343 -0.956645253
[56] 0.659134779 0.242387088 1.070789896 -1.023490088 -1.550577452
[61] -0.541246686 0.122996913 0.073654901 -0.488656571 0.075698076
[66] 0.609860118 -0.703416833 -0.131279785 0.919786988 0.431128571
[71] -0.594863318 -1.415263325 -0.166903492 -1.059470076 -0.265367349
[76] 0.769063283 1.409637731 0.356557616 0.740967499 0.706463919
[81] 0.635711472 1.977032678 1.387415329 -1.371813236 1.316975148
[86] 1.579757878 -0.910255560 -1.088327841 0.176001838 -1.003037383
[91] 0.583142459 -1.172302328 -1.283829438 1.072991270 1.214854884
[96] -0.645852662 -0.437576439 -1.319367083 0.193302843 0.717027123
> rowMin(tmp2)
[1] 0.524009324 -0.882225554 0.715680156 -0.544043019 0.439243424
[6] 0.328127387 -2.594599599 -1.559480263 0.178195602 -2.121714032
[11] -0.260793016 0.819650390 -0.068638436 0.267628578 -0.217527512
[16] 1.318137743 0.961816602 0.931544043 -0.879730474 -0.579926980
[21] 1.139407879 0.855085667 1.275952988 -0.300860932 -1.258158294
[26] 0.566638902 0.739126854 -0.730202022 -0.005211611 0.524076660
[31] -0.671960529 1.134892033 -0.522201648 -0.856874394 0.276890145
[36] 0.382801271 1.797163093 -0.945963173 -0.334950231 -0.672894601
[41] -0.895221547 0.031820338 -1.014837956 -0.718821598 0.428146123
[46] 0.173157791 -0.529115485 0.679782547 -0.025062964 0.686335145
[51] 0.806544029 -0.976289168 0.589090872 2.032666343 -0.956645253
[56] 0.659134779 0.242387088 1.070789896 -1.023490088 -1.550577452
[61] -0.541246686 0.122996913 0.073654901 -0.488656571 0.075698076
[66] 0.609860118 -0.703416833 -0.131279785 0.919786988 0.431128571
[71] -0.594863318 -1.415263325 -0.166903492 -1.059470076 -0.265367349
[76] 0.769063283 1.409637731 0.356557616 0.740967499 0.706463919
[81] 0.635711472 1.977032678 1.387415329 -1.371813236 1.316975148
[86] 1.579757878 -0.910255560 -1.088327841 0.176001838 -1.003037383
[91] 0.583142459 -1.172302328 -1.283829438 1.072991270 1.214854884
[96] -0.645852662 -0.437576439 -1.319367083 0.193302843 0.717027123
>
> colMeans(tmp2)
[1] 0.01349105
> colSums(tmp2)
[1] 1.349105
> colVars(tmp2)
[1] 0.8683963
> colSd(tmp2)
[1] 0.9318778
> colMax(tmp2)
[1] 2.032666
> colMin(tmp2)
[1] -2.5946
> colMedians(tmp2)
[1] 0.09934749
> colRanges(tmp2)
[,1]
[1,] -2.594600
[2,] 2.032666
>
> 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.3912245 -1.8223120 -2.2526267 -1.5628330 0.8399344 3.1955398
[7] 0.3109258 -0.3750230 0.5526690 2.6741336
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.92503193
[2,] -0.52938228
[3,] 0.07293556
[4,] 0.37152549
[5,] 1.60026189
>
> rowApply(tmp,sum)
[1] 0.1606094 -1.6205003 -5.5336330 -3.5198376 -0.7811230 3.7598972
[7] 1.8020966 -1.4092328 0.8003632 9.2929927
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 10 6 8 2 10 4 4 6 3
[2,] 6 3 3 4 3 4 8 9 1 8
[3,] 5 2 10 3 6 2 1 5 3 7
[4,] 1 1 8 9 1 3 5 10 4 5
[5,] 7 9 4 1 5 1 6 3 10 10
[6,] 8 4 5 7 9 7 9 8 7 1
[7,] 10 8 1 10 4 8 2 6 2 6
[8,] 3 5 7 2 8 5 7 1 9 4
[9,] 9 6 9 5 7 6 3 7 8 2
[10,] 4 7 2 6 10 9 10 2 5 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.26119714 0.24632072 2.66933101 -0.19871919 -6.69351119 0.23638537
[7] -0.58790848 -1.76786634 -1.43867005 -0.96119389 -0.08385346 -0.20745911
[13] -0.36534167 -0.01715472 2.96819396 1.75351452 -1.81509255 -1.63886134
[19] -0.61005293 2.59090901
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2951346
[2,] -0.5721565
[3,] -0.5272995
[4,] -0.4793036
[5,] 0.6126971
>
> rowApply(tmp,sum)
[1] 8.494573 -5.249989 -5.487942 0.581615 -6.520484
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 4 8 18 6 4
[2,] 8 5 4 9 20
[3,] 18 17 11 19 8
[4,] 14 18 7 1 15
[5,] 3 2 1 5 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.5721565 0.3272948 1.4825286 0.7593466 -0.6495294 0.63302982
[2,] -0.5272995 -1.0869844 0.7189795 1.1967491 -2.1769151 -0.66012615
[3,] 0.6126971 -0.9384468 -0.3633913 -0.6811602 -1.4366348 -0.41660451
[4,] -0.4793036 -0.1494492 1.3344622 -1.6068497 -0.7197859 0.78005393
[5,] -1.2951346 2.0939063 -0.5032480 0.1331951 -1.7106459 -0.09996773
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.02617214 -1.6985610 0.65421284 0.5771528 -0.6631781 1.5695047
[2,] -0.82898318 1.7857177 -1.87476583 -0.1448854 -0.2630440 -1.7654625
[3,] 0.28711799 -0.8522916 -0.86261842 -1.1202999 1.0550168 0.2579223
[4,] 0.75027251 0.6198347 0.56171983 -0.1346566 1.0560044 0.2117056
[5,] -0.77014365 -1.6225662 0.08278153 -0.1385048 -1.2686525 -0.4811292
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.6090282 -0.3386517 1.6026498 1.1036042 1.1348159 1.10048286
[2,] 0.1465630 0.1378805 -0.2307301 0.4216695 -2.4650013 -0.09503909
[3,] -1.2082451 0.1482784 0.4161493 0.3835467 -0.6235914 -0.22532820
[4,] -0.4301792 0.4679732 1.3916404 -0.2947243 -0.8290628 -0.81596381
[5,] 0.5174914 -0.4326350 -0.2115155 0.1394184 0.9677471 -1.60301311
[,19] [,20]
[1,] 0.1333709 0.7557996
[2,] 0.4866745 1.9750138
[3,] -0.5355795 0.6155212
[4,] -1.3380059 0.2059293
[5,] 0.6434870 -0.9613549
>
>
> 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 : 563 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.7814404 0.557604 0.08861747 -1.777922 -0.4901677 -1.461916 0.05707014
col8 col9 col10 col11 col12 col13 col14
row1 -2.043147 0.1945797 2.900164 0.1907162 -0.01515858 -0.06381361 -0.255765
col15 col16 col17 col18 col19 col20
row1 0.845752 0.08761992 0.8773366 2.158506 1.641634 -1.933481
> tmp[,"col10"]
col10
row1 2.9001639
row2 -1.0973607
row3 -0.8947030
row4 1.2102943
row5 0.5839849
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.7814404 0.5576040 0.08861747 -1.777922 -0.4901677 -1.461916 0.05707014
row5 0.8786294 0.5291965 -0.86273277 0.158909 -0.9430046 -1.637398 -0.57776774
col8 col9 col10 col11 col12 col13
row1 -2.0431473 0.1945797 2.9001639 0.1907162 -0.01515858 -0.06381361
row5 -0.3562748 -0.3630461 0.5839849 -1.4365737 0.93465017 0.03863376
col14 col15 col16 col17 col18 col19 col20
row1 -0.2557650 0.8457520 0.08761992 0.8773366 2.1585058 1.641634 -1.9334813
row5 -0.7143576 0.7008092 -0.49703605 1.0370698 -0.6232634 -1.235175 -0.2198371
> tmp[,c("col6","col20")]
col6 col20
row1 -1.4619157 -1.93348134
row2 1.2151075 0.78305155
row3 -0.8213539 0.20147473
row4 0.4800717 -0.01521751
row5 -1.6373983 -0.21983709
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.461916 -1.9334813
row5 -1.637398 -0.2198371
>
>
>
>
> 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 48.86103 50.08171 50.62512 51.3275 51.95554 105.6004 50.18707 49.37163
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.20837 50.08737 48.33165 49.68275 50.48453 50.25171 47.97666 49.25975
col17 col18 col19 col20
row1 50.37485 50.86512 48.92063 104.0587
> tmp[,"col10"]
col10
row1 50.08737
row2 29.16599
row3 30.08134
row4 29.22426
row5 49.75763
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.86103 50.08171 50.62512 51.32750 51.95554 105.6004 50.18707 49.37163
row5 49.52762 48.89169 49.79202 48.27057 50.15708 105.3912 49.79704 49.10217
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.20837 50.08737 48.33165 49.68275 50.48453 50.25171 47.97666 49.25975
row5 50.74776 49.75763 49.07512 49.66391 50.51055 50.50271 49.82564 50.91992
col17 col18 col19 col20
row1 50.37485 50.86512 48.92063 104.0587
row5 50.67949 50.83387 51.00241 107.1186
> tmp[,c("col6","col20")]
col6 col20
row1 105.60043 104.05870
row2 75.34097 75.37439
row3 76.12676 74.04272
row4 74.23082 75.01593
row5 105.39120 107.11863
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.6004 104.0587
row5 105.3912 107.1186
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.6004 104.0587
row5 105.3912 107.1186
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.9167311
[2,] 2.3209237
[3,] -0.4348749
[4,] 0.5224662
[5,] -1.9148879
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.6405327 -1.3099217
[2,] 0.7644748 -1.3645175
[3,] 1.3428044 0.2341751
[4,] 0.7558188 -0.2908664
[5,] 1.5479293 -1.7219917
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.5930890 -0.3872571
[2,] 0.1234679 1.0749498
[3,] 1.1760050 0.5504341
[4,] -0.1038488 0.3961386
[5,] -1.0726489 -1.2735580
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.593089
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.5930890
[2,] 0.1234679
>
>
>
> 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.076181 -2.167381 -1.697504 -0.7627789 -0.9939019 -0.3366311 1.4423887
row1 -1.155695 1.394427 -1.520229 -1.5003583 0.3853871 -0.9151355 -0.8138939
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -2.5493889 0.04217878 0.4597074 0.2954137 0.1841748 0.1117288 0.3587934
row1 -0.7302151 1.60783046 -1.2198235 -1.0258590 0.3202416 0.6855628 -0.8682313
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.2818734 -2.296511 1.4913206 0.5285135 0.1533542 1.846770
row1 1.0711014 1.364999 -0.7780943 1.6402675 1.1056057 1.808144
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.09148729 0.4933026 0.263485 0.174705 1.365263 -0.08973013 0.1209054
[,8] [,9] [,10]
row2 -0.2163697 -0.5304682 1.367801
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.5216989 -1.131423 -1.628933 0.4246802 1.201868 -0.04516147 -0.2636834
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.364264 0.3533106 -0.1510532 2.132576 1.432925 0.3278718 -1.713327
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.5034167 0.6048014 0.9243395 1.43488 -0.3802145 0.9329274
>
>
> 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: 0x600000200120>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd34494053e"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd351e44c9e"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd363624312"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd3482185b7"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd310d1d660"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd340514140"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd31692f1bd"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd393cbadf"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd372108b35"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd31c237f14"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd35e6c087a"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd36a0b204"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd320072802"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd335d3abbb"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5cd35baf9d98"
>
>
> ### 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: 0x60000027c1e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000027c1e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x60000027c1e0>
> rowMedians(tmp)
[1] 0.5361616140 1.0119123006 -0.3488913531 0.1770694733 0.1712101688
[6] -0.2946034271 -0.0390025051 -0.1191663373 -0.3474243304 -0.2123143312
[11] -0.2162773273 -0.3178539305 -0.5397545338 -0.0239047984 -0.4262723515
[16] 0.0440848747 -0.3165066917 0.0961751883 -0.4629490361 -0.6936648547
[21] -0.2824262419 0.1344381851 0.5945290523 0.2774011067 -0.0372307193
[26] -0.1887390310 0.3013703033 -0.0786081614 -0.5393271307 -0.1187979655
[31] -0.0325786984 0.0715198501 -0.0088086115 -0.0353300588 0.2622029326
[36] 0.0185990033 -0.6589865169 0.2515061591 -0.3774021454 -0.0088474087
[41] 0.0986594556 -0.3674926783 0.1499198337 0.1785801037 -0.0916479298
[46] -0.4799295134 -0.1053805849 -0.0002561997 -0.1785900677 -0.0745449829
[51] 0.5565856798 0.0550381674 0.1145645121 -0.0242094780 0.1612243474
[56] 0.0959241121 0.2900988095 -0.1467776021 0.1387262322 -0.6685311609
[61] 0.2206771003 0.2941837066 0.2902487264 0.1127930103 0.3822752417
[66] -0.0224392614 -0.1563815954 0.4829877025 0.4832698957 -0.2759829828
[71] 0.0692498074 -0.0568854439 -0.3850425760 -0.0791268806 -0.2561746435
[76] 0.6504324917 0.3044654866 -0.2275762995 0.3310946594 -0.3027787173
[81] -0.1433989320 -0.2664414701 -0.3801958288 0.5937590816 -0.0764781071
[86] 0.1456837925 -0.1267261458 0.1604963429 -0.0937580474 -0.1188906230
[91] 0.3306662345 -0.0708904189 -0.2644975352 -0.1258393112 -0.2467711295
[96] 0.1026998934 -0.1253495062 0.2531034658 0.8372588341 -0.2541536693
[101] -0.5153857436 0.2690811810 -0.0454180065 0.3741146399 0.0973279275
[106] 0.3489769100 -0.1520073841 -0.0581774685 0.0732160358 -0.4313967759
[111] -0.0989984431 -0.4842041011 0.1663358376 0.5804334178 -0.1049655352
[116] 0.0673493140 -0.2843569813 0.3071377105 -0.1069476061 0.2791217201
[121] -0.2075390001 -0.4209000254 0.1923688142 0.1708279015 -0.0583673536
[126] 0.3010638653 0.1892778083 0.0775446419 -0.3840594060 0.5118461476
[131] -0.3645081916 -0.7927724020 -0.0950605664 0.2049026294 0.5354989837
[136] 0.0336302366 0.2993778471 -0.1492248459 -0.1748586702 -0.3265420789
[141] 0.1790491819 -0.0213946983 -0.3637093334 0.5235547056 0.3582060904
[146] 0.4850919783 -0.3936344983 0.1490744461 -0.4374225735 -0.4929327466
[151] -0.0841201081 -0.2426116214 0.3595068281 0.0323480598 0.3525454838
[156] -0.3383126549 -0.4578303879 0.0640846297 -0.1688923462 0.2699140707
[161] 0.1458919294 0.4527500948 -0.3039891769 -0.1082572502 -0.0024438390
[166] 0.1219328827 -0.5408900545 -0.1775709033 -0.5982474515 -0.0118874285
[171] -0.1675164683 -0.4327659004 0.1523143738 0.1377994221 0.4032796118
[176] 0.5606569413 0.3334176446 0.1716649625 -0.1373692070 -0.4710208555
[181] -0.3445702118 -0.0845513797 0.1441756107 0.7398766113 0.1138640038
[186] 0.3679739799 -0.0721605667 -0.0846909152 -0.0143295723 0.8924007036
[191] -0.1633706511 0.2067291750 0.0957416499 0.3638060679 0.4047600274
[196] 0.1844626551 0.0366766251 -0.2692155284 -0.2444967091 -0.5650142740
[201] -0.5449042057 -0.1688527500 0.6060369380 -0.0426532335 0.0250253769
[206] 0.3273625205 -0.2828774012 0.0534909469 0.1001611340 0.0738008999
[211] 0.4260181639 -0.0563365510 -0.1261221813 0.1836752671 0.0519679782
[216] 0.0518978977 0.3812532259 0.1952869343 -0.0685878656 0.2153448988
[221] -0.1690546642 -0.5334955906 -0.2260723480 0.6235364421 -0.0889227075
[226] 0.0919085549 -0.3265317257 -0.2057064842 -0.0114939446 -0.0266382319
>
> proc.time()
user system elapsed
0.710 3.515 4.828
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: 0x6000036b0420>
> .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: 0x6000036b0420>
> .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: 0x6000036b0420>
> .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: 0x6000036b0420>
> 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: 0x6000036ac300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000036ac300>
> .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: 0x6000036ac300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000036ac300>
> .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: 0x6000036ac300>
> 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: 0x6000036ac480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000036ac480>
> .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: 0x6000036ac480>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000036ac480>
> .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: 0x6000036ac480>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000036ac480>
> .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: 0x6000036ac480>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000036ac480>
> .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: 0x6000036ac480>
> 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: 0x6000036ac660>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000036ac660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000036ac660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000036ac660>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile608c1af5ed3e" "BufferedMatrixFile608c576e8d2a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile608c1af5ed3e" "BufferedMatrixFile608c576e8d2a"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000368c060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000368c060>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000368c060>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000368c060>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60000368c060>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60000368c060>
> .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: 0x600003684000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003684000>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003684000>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003684000>
> 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: 0x600003698000>
> .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: 0x600003698000>
> rm(P)
>
> proc.time()
user system elapsed
0.147 0.069 0.208
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.154 0.041 0.190