| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-15 11:35 -0500 (Sat, 15 Nov 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" | 4826 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4561 |
| 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 251/2325 | 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-11-14 18:48:23 -0500 (Fri, 14 Nov 2025) |
| EndedAt: 2025-11-14 18:48:44 -0500 (Fri, 14 Nov 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.117 0.050 0.178
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] "Fri Nov 14 18:48:35 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] "Fri Nov 14 18:48:35 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: 0x600001108000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 14 18:48:36 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] "Fri Nov 14 18:48:36 2025"
>
> ColMode(tmp2)
<pointer: 0x600001108000>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.76167694 -0.04846724 -0.7534403 -1.0751309
[2,] 0.65784953 0.42226349 -0.9960458 2.4380356
[3,] -0.48592679 0.77122498 -0.5438477 0.1947236
[4,] 0.03450609 0.70205174 1.1166572 1.0040466
> 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,] 99.76167694 0.04846724 0.7534403 1.0751309
[2,] 0.65784953 0.42226349 0.9960458 2.4380356
[3,] 0.48592679 0.77122498 0.5438477 0.1947236
[4,] 0.03450609 0.70205174 1.1166572 1.0040466
> 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.9880767 0.2201528 0.8680094 1.036885
[2,] 0.8110792 0.6498180 0.9980210 1.561421
[3,] 0.6970845 0.8781942 0.7374603 0.441275
[4,] 0.1857582 0.8378853 1.0567200 1.002021
>
> 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,] 224.64244 27.24999 34.43353 36.44398
[2,] 33.76864 31.92044 35.97626 43.05225
[3,] 32.45677 34.55317 32.91845 29.60747
[4,] 26.89209 34.08090 36.68386 36.02426
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60000110c000>
> exp(tmp5)
<pointer: 0x60000110c000>
> log(tmp5,2)
<pointer: 0x60000110c000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5638
> Min(tmp5)
[1] 54.32411
> mean(tmp5)
[1] 73.81265
> Sum(tmp5)
[1] 14762.53
> Var(tmp5)
[1] 852.8957
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.69457 72.94164 72.93353 72.41908 70.04392 72.29806 73.01502 72.97811
[9] 70.30513 71.49743
> rowSums(tmp5)
[1] 1793.891 1458.833 1458.671 1448.382 1400.878 1445.961 1460.300 1459.562
[9] 1406.103 1429.949
> rowVars(tmp5)
[1] 7973.68211 89.08147 40.42118 82.12164 42.20060 58.02823
[7] 86.03559 53.89120 101.57268 99.39735
> rowSd(tmp5)
[1] 89.295476 9.438298 6.357765 9.062099 6.496199 7.617626 9.275537
[8] 7.341063 10.078327 9.969822
> rowMax(tmp5)
[1] 467.56382 91.58397 84.75834 93.42712 85.39639 86.78752 86.04967
[8] 85.42520 92.74348 86.37644
> rowMin(tmp5)
[1] 56.71729 57.52347 61.62408 55.97236 59.43277 60.62459 54.32411 61.84218
[9] 56.57834 54.55769
>
> colMeans(tmp5)
[1] 107.20552 64.89500 72.07379 70.52283 74.54315 69.54336 76.76698
[8] 74.57432 67.20748 70.90630 71.87314 71.75721 73.36573 70.04456
[15] 75.75787 72.06012 72.03419 72.31009 75.26210 73.54925
> colSums(tmp5)
[1] 1072.0552 648.9500 720.7379 705.2283 745.4315 695.4336 767.6698
[8] 745.7432 672.0748 709.0630 718.7314 717.5721 733.6573 700.4456
[15] 757.5787 720.6012 720.3419 723.1009 752.6210 735.4925
> colVars(tmp5)
[1] 16075.06568 40.62620 61.31539 90.28613 47.36193 53.60019
[7] 69.33153 82.16625 19.59488 103.54597 41.62765 113.23471
[13] 100.61415 47.72306 49.73363 29.94570 94.71456 130.33906
[19] 79.05710 55.88896
> colSd(tmp5)
[1] 126.787482 6.373869 7.830415 9.501901 6.882000 7.321215
[7] 8.326555 9.064560 4.426610 10.175754 6.451949 10.641180
[13] 10.030661 6.908188 7.052207 5.472266 9.732140 11.416613
[19] 8.891406 7.475892
> colMax(tmp5)
[1] 467.56382 71.91789 82.91367 89.60761 85.48898 80.52569 92.74348
[8] 87.73708 74.32341 84.26318 79.78049 90.02130 91.58397 78.45072
[15] 84.05270 80.14931 84.75834 93.42712 88.23462 85.39639
> colMin(tmp5)
[1] 55.97236 54.32411 57.76629 58.77509 65.49804 59.09868 68.41185 60.42082
[9] 60.62459 56.14951 58.70356 62.51838 55.30949 57.41425 62.68874 62.99168
[17] 57.18882 54.55769 59.75780 61.56341
>
>
> ### 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.69457 72.94164 72.93353 NA 70.04392 72.29806 73.01502 72.97811
[9] 70.30513 71.49743
> rowSums(tmp5)
[1] 1793.891 1458.833 1458.671 NA 1400.878 1445.961 1460.300 1459.562
[9] 1406.103 1429.949
> rowVars(tmp5)
[1] 7973.68211 89.08147 40.42118 82.22558 42.20060 58.02823
[7] 86.03559 53.89120 101.57268 99.39735
> rowSd(tmp5)
[1] 89.295476 9.438298 6.357765 9.067832 6.496199 7.617626 9.275537
[8] 7.341063 10.078327 9.969822
> rowMax(tmp5)
[1] 467.56382 91.58397 84.75834 NA 85.39639 86.78752 86.04967
[8] 85.42520 92.74348 86.37644
> rowMin(tmp5)
[1] 56.71729 57.52347 61.62408 NA 59.43277 60.62459 54.32411 61.84218
[9] 56.57834 54.55769
>
> colMeans(tmp5)
[1] 107.20552 64.89500 72.07379 70.52283 74.54315 69.54336 76.76698
[8] 74.57432 67.20748 70.90630 71.87314 NA 73.36573 70.04456
[15] 75.75787 72.06012 72.03419 72.31009 75.26210 73.54925
> colSums(tmp5)
[1] 1072.0552 648.9500 720.7379 705.2283 745.4315 695.4336 767.6698
[8] 745.7432 672.0748 709.0630 718.7314 NA 733.6573 700.4456
[15] 757.5787 720.6012 720.3419 723.1009 752.6210 735.4925
> colVars(tmp5)
[1] 16075.06568 40.62620 61.31539 90.28613 47.36193 53.60019
[7] 69.33153 82.16625 19.59488 103.54597 41.62765 NA
[13] 100.61415 47.72306 49.73363 29.94570 94.71456 130.33906
[19] 79.05710 55.88896
> colSd(tmp5)
[1] 126.787482 6.373869 7.830415 9.501901 6.882000 7.321215
[7] 8.326555 9.064560 4.426610 10.175754 6.451949 NA
[13] 10.030661 6.908188 7.052207 5.472266 9.732140 11.416613
[19] 8.891406 7.475892
> colMax(tmp5)
[1] 467.56382 71.91789 82.91367 89.60761 85.48898 80.52569 92.74348
[8] 87.73708 74.32341 84.26318 79.78049 NA 91.58397 78.45072
[15] 84.05270 80.14931 84.75834 93.42712 88.23462 85.39639
> colMin(tmp5)
[1] 55.97236 54.32411 57.76629 58.77509 65.49804 59.09868 68.41185 60.42082
[9] 60.62459 56.14951 58.70356 NA 55.30949 57.41425 62.68874 62.99168
[17] 57.18882 54.55769 59.75780 61.56341
>
> Max(tmp5,na.rm=TRUE)
[1] 467.5638
> Min(tmp5,na.rm=TRUE)
[1] 54.32411
> mean(tmp5,na.rm=TRUE)
[1] 73.77578
> Sum(tmp5,na.rm=TRUE)
[1] 14681.38
> Var(tmp5,na.rm=TRUE)
[1] 856.93
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.69457 72.94164 72.93353 71.95953 70.04392 72.29806 73.01502 72.97811
[9] 70.30513 71.49743
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.891 1458.833 1458.671 1367.231 1400.878 1445.961 1460.300 1459.562
[9] 1406.103 1429.949
> rowVars(tmp5,na.rm=TRUE)
[1] 7973.68211 89.08147 40.42118 82.22558 42.20060 58.02823
[7] 86.03559 53.89120 101.57268 99.39735
> rowSd(tmp5,na.rm=TRUE)
[1] 89.295476 9.438298 6.357765 9.067832 6.496199 7.617626 9.275537
[8] 7.341063 10.078327 9.969822
> rowMax(tmp5,na.rm=TRUE)
[1] 467.56382 91.58397 84.75834 93.42712 85.39639 86.78752 86.04967
[8] 85.42520 92.74348 86.37644
> rowMin(tmp5,na.rm=TRUE)
[1] 56.71729 57.52347 61.62408 55.97236 59.43277 60.62459 54.32411 61.84218
[9] 56.57834 54.55769
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.20552 64.89500 72.07379 70.52283 74.54315 69.54336 76.76698
[8] 74.57432 67.20748 70.90630 71.87314 70.71351 73.36573 70.04456
[15] 75.75787 72.06012 72.03419 72.31009 75.26210 73.54925
> colSums(tmp5,na.rm=TRUE)
[1] 1072.0552 648.9500 720.7379 705.2283 745.4315 695.4336 767.6698
[8] 745.7432 672.0748 709.0630 718.7314 636.4216 733.6573 700.4456
[15] 757.5787 720.6012 720.3419 723.1009 752.6210 735.4925
> colVars(tmp5,na.rm=TRUE)
[1] 16075.06568 40.62620 61.31539 90.28613 47.36193 53.60019
[7] 69.33153 82.16625 19.59488 103.54597 41.62765 115.13429
[13] 100.61415 47.72306 49.73363 29.94570 94.71456 130.33906
[19] 79.05710 55.88896
> colSd(tmp5,na.rm=TRUE)
[1] 126.787482 6.373869 7.830415 9.501901 6.882000 7.321215
[7] 8.326555 9.064560 4.426610 10.175754 6.451949 10.730065
[13] 10.030661 6.908188 7.052207 5.472266 9.732140 11.416613
[19] 8.891406 7.475892
> colMax(tmp5,na.rm=TRUE)
[1] 467.56382 71.91789 82.91367 89.60761 85.48898 80.52569 92.74348
[8] 87.73708 74.32341 84.26318 79.78049 90.02130 91.58397 78.45072
[15] 84.05270 80.14931 84.75834 93.42712 88.23462 85.39639
> colMin(tmp5,na.rm=TRUE)
[1] 55.97236 54.32411 57.76629 58.77509 65.49804 59.09868 68.41185 60.42082
[9] 60.62459 56.14951 58.70356 62.51838 55.30949 57.41425 62.68874 62.99168
[17] 57.18882 54.55769 59.75780 61.56341
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.69457 72.94164 72.93353 NaN 70.04392 72.29806 73.01502 72.97811
[9] 70.30513 71.49743
> rowSums(tmp5,na.rm=TRUE)
[1] 1793.891 1458.833 1458.671 0.000 1400.878 1445.961 1460.300 1459.562
[9] 1406.103 1429.949
> rowVars(tmp5,na.rm=TRUE)
[1] 7973.68211 89.08147 40.42118 NA 42.20060 58.02823
[7] 86.03559 53.89120 101.57268 99.39735
> rowSd(tmp5,na.rm=TRUE)
[1] 89.295476 9.438298 6.357765 NA 6.496199 7.617626 9.275537
[8] 7.341063 10.078327 9.969822
> rowMax(tmp5,na.rm=TRUE)
[1] 467.56382 91.58397 84.75834 NA 85.39639 86.78752 86.04967
[8] 85.42520 92.74348 86.37644
> rowMin(tmp5,na.rm=TRUE)
[1] 56.71729 57.52347 61.62408 NA 59.43277 60.62459 54.32411 61.84218
[9] 56.57834 54.55769
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.89809 64.22390 71.59837 70.02761 74.53407 70.44213 77.45388
[8] 74.75615 67.22030 70.48309 71.31155 NaN 73.34875 70.34069
[15] 75.81013 72.72302 73.68367 69.96376 73.82071 73.99644
> colSums(tmp5,na.rm=TRUE)
[1] 1016.0828 578.0151 644.3853 630.2485 670.8066 633.9791 697.0849
[8] 672.8054 604.9827 634.3478 641.8039 0.0000 660.1388 633.0662
[15] 682.2911 654.5071 663.1531 629.6738 664.3863 665.9680
> colVars(tmp5,na.rm=TRUE)
[1] 17719.88820 40.63770 66.43696 98.81295 53.28124 51.21267
[7] 72.68996 92.06508 22.04239 114.47430 43.28300 NA
[13] 113.18768 52.70190 55.91961 28.74531 75.94487 84.69690
[19] 65.56612 60.62528
> colSd(tmp5,na.rm=TRUE)
[1] 133.116070 6.374771 8.150887 9.940470 7.299400 7.156303
[7] 8.525841 9.595055 4.694932 10.699266 6.578982 NA
[13] 10.638970 7.259608 7.477941 5.361465 8.714636 9.203092
[19] 8.097291 7.786224
> colMax(tmp5,na.rm=TRUE)
[1] 467.56382 71.91789 82.91367 89.60761 85.48898 80.52569 92.74348
[8] 87.73708 74.32341 84.26318 79.78049 -Inf 91.58397 78.45072
[15] 84.05270 80.14931 84.75834 82.40713 86.04967 85.39639
> colMin(tmp5,na.rm=TRUE)
[1] 61.73646 54.32411 57.76629 58.77509 65.49804 59.09868 68.41185 60.42082
[9] 60.62459 56.14951 58.70356 Inf 55.30949 57.41425 62.68874 62.99168
[17] 61.85019 54.55769 59.75780 61.56341
>
>
>
>
> 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] 120.6784 131.7414 136.6733 320.3227 183.9577 234.0514 140.8658 258.2035
[9] 200.8938 254.5657
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 120.6784 131.7414 136.6733 320.3227 183.9577 234.0514 140.8658 258.2035
[9] 200.8938 254.5657
>
>
>
> 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] -7.105427e-14 0.000000e+00 5.684342e-14 0.000000e+00 8.526513e-14
[6] 8.526513e-14 -2.842171e-14 -1.705303e-13 0.000000e+00 -2.842171e-14
[11] -2.273737e-13 1.136868e-13 5.684342e-14 8.526513e-14 -1.421085e-14
[16] -4.547474e-13 1.136868e-13 5.684342e-14 -1.136868e-13 -1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
7 4
5 14
4 2
8 4
2 19
6 12
5 10
9 1
7 11
5 4
10 6
2 17
7 11
8 13
9 13
6 9
10 18
9 20
9 20
4 1
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] 3.02881
> Min(tmp)
[1] -2.607408
> mean(tmp)
[1] 0.002969223
> Sum(tmp)
[1] 0.2969223
> Var(tmp)
[1] 0.9520549
>
> rowMeans(tmp)
[1] 0.002969223
> rowSums(tmp)
[1] 0.2969223
> rowVars(tmp)
[1] 0.9520549
> rowSd(tmp)
[1] 0.975733
> rowMax(tmp)
[1] 3.02881
> rowMin(tmp)
[1] -2.607408
>
> colMeans(tmp)
[1] -0.08371539 -0.70018074 0.45114738 -0.73042618 0.07857066 2.17701499
[7] 0.03059487 0.64857755 -1.38255063 1.65137652 1.64923454 0.28605051
[13] 3.02880978 0.33940163 -1.66306343 0.03638107 0.61294862 -0.11137312
[19] 0.81141194 -0.83531772 0.69196933 -0.77732576 -0.08832086 -0.07443951
[25] 0.35161602 -0.76518935 -0.67381877 0.46032919 -0.18041474 0.39059759
[31] 0.41743398 0.21486283 0.11078458 0.27321519 0.48181825 1.03009729
[37] 0.61488707 -0.60436017 1.10473846 0.16945507 0.38220528 -0.79433622
[43] 0.26592117 -0.63409916 -0.19036371 0.08322261 0.40822294 0.55990025
[49] -0.72643018 0.16373081 -1.33555758 0.45563891 -0.11529377 1.51776246
[55] 0.57821654 -0.81558104 -2.07249726 0.32213698 1.04155925 1.06323493
[61] -1.21797040 -1.17339584 0.67410677 1.86315516 0.07207221 -1.06146369
[67] -0.74306637 0.54468731 -2.60740803 0.81271975 -0.73284353 -1.22926798
[73] -0.88610253 -1.75701721 -0.23190522 -1.05748045 -1.12842305 -0.16103023
[79] 0.54248708 1.44420801 -0.60344432 1.34725649 1.82894473 0.64916521
[85] -0.69350325 -1.07857474 -0.62874386 0.56540316 -1.09143843 0.09991737
[91] 0.31470605 -0.45719304 1.11209153 -0.50762201 0.58970299 0.52879438
[97] -2.57001468 -0.74421865 0.12933215 -0.06012222
> colSums(tmp)
[1] -0.08371539 -0.70018074 0.45114738 -0.73042618 0.07857066 2.17701499
[7] 0.03059487 0.64857755 -1.38255063 1.65137652 1.64923454 0.28605051
[13] 3.02880978 0.33940163 -1.66306343 0.03638107 0.61294862 -0.11137312
[19] 0.81141194 -0.83531772 0.69196933 -0.77732576 -0.08832086 -0.07443951
[25] 0.35161602 -0.76518935 -0.67381877 0.46032919 -0.18041474 0.39059759
[31] 0.41743398 0.21486283 0.11078458 0.27321519 0.48181825 1.03009729
[37] 0.61488707 -0.60436017 1.10473846 0.16945507 0.38220528 -0.79433622
[43] 0.26592117 -0.63409916 -0.19036371 0.08322261 0.40822294 0.55990025
[49] -0.72643018 0.16373081 -1.33555758 0.45563891 -0.11529377 1.51776246
[55] 0.57821654 -0.81558104 -2.07249726 0.32213698 1.04155925 1.06323493
[61] -1.21797040 -1.17339584 0.67410677 1.86315516 0.07207221 -1.06146369
[67] -0.74306637 0.54468731 -2.60740803 0.81271975 -0.73284353 -1.22926798
[73] -0.88610253 -1.75701721 -0.23190522 -1.05748045 -1.12842305 -0.16103023
[79] 0.54248708 1.44420801 -0.60344432 1.34725649 1.82894473 0.64916521
[85] -0.69350325 -1.07857474 -0.62874386 0.56540316 -1.09143843 0.09991737
[91] 0.31470605 -0.45719304 1.11209153 -0.50762201 0.58970299 0.52879438
[97] -2.57001468 -0.74421865 0.12933215 -0.06012222
> 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.08371539 -0.70018074 0.45114738 -0.73042618 0.07857066 2.17701499
[7] 0.03059487 0.64857755 -1.38255063 1.65137652 1.64923454 0.28605051
[13] 3.02880978 0.33940163 -1.66306343 0.03638107 0.61294862 -0.11137312
[19] 0.81141194 -0.83531772 0.69196933 -0.77732576 -0.08832086 -0.07443951
[25] 0.35161602 -0.76518935 -0.67381877 0.46032919 -0.18041474 0.39059759
[31] 0.41743398 0.21486283 0.11078458 0.27321519 0.48181825 1.03009729
[37] 0.61488707 -0.60436017 1.10473846 0.16945507 0.38220528 -0.79433622
[43] 0.26592117 -0.63409916 -0.19036371 0.08322261 0.40822294 0.55990025
[49] -0.72643018 0.16373081 -1.33555758 0.45563891 -0.11529377 1.51776246
[55] 0.57821654 -0.81558104 -2.07249726 0.32213698 1.04155925 1.06323493
[61] -1.21797040 -1.17339584 0.67410677 1.86315516 0.07207221 -1.06146369
[67] -0.74306637 0.54468731 -2.60740803 0.81271975 -0.73284353 -1.22926798
[73] -0.88610253 -1.75701721 -0.23190522 -1.05748045 -1.12842305 -0.16103023
[79] 0.54248708 1.44420801 -0.60344432 1.34725649 1.82894473 0.64916521
[85] -0.69350325 -1.07857474 -0.62874386 0.56540316 -1.09143843 0.09991737
[91] 0.31470605 -0.45719304 1.11209153 -0.50762201 0.58970299 0.52879438
[97] -2.57001468 -0.74421865 0.12933215 -0.06012222
> colMin(tmp)
[1] -0.08371539 -0.70018074 0.45114738 -0.73042618 0.07857066 2.17701499
[7] 0.03059487 0.64857755 -1.38255063 1.65137652 1.64923454 0.28605051
[13] 3.02880978 0.33940163 -1.66306343 0.03638107 0.61294862 -0.11137312
[19] 0.81141194 -0.83531772 0.69196933 -0.77732576 -0.08832086 -0.07443951
[25] 0.35161602 -0.76518935 -0.67381877 0.46032919 -0.18041474 0.39059759
[31] 0.41743398 0.21486283 0.11078458 0.27321519 0.48181825 1.03009729
[37] 0.61488707 -0.60436017 1.10473846 0.16945507 0.38220528 -0.79433622
[43] 0.26592117 -0.63409916 -0.19036371 0.08322261 0.40822294 0.55990025
[49] -0.72643018 0.16373081 -1.33555758 0.45563891 -0.11529377 1.51776246
[55] 0.57821654 -0.81558104 -2.07249726 0.32213698 1.04155925 1.06323493
[61] -1.21797040 -1.17339584 0.67410677 1.86315516 0.07207221 -1.06146369
[67] -0.74306637 0.54468731 -2.60740803 0.81271975 -0.73284353 -1.22926798
[73] -0.88610253 -1.75701721 -0.23190522 -1.05748045 -1.12842305 -0.16103023
[79] 0.54248708 1.44420801 -0.60344432 1.34725649 1.82894473 0.64916521
[85] -0.69350325 -1.07857474 -0.62874386 0.56540316 -1.09143843 0.09991737
[91] 0.31470605 -0.45719304 1.11209153 -0.50762201 0.58970299 0.52879438
[97] -2.57001468 -0.74421865 0.12933215 -0.06012222
> colMedians(tmp)
[1] -0.08371539 -0.70018074 0.45114738 -0.73042618 0.07857066 2.17701499
[7] 0.03059487 0.64857755 -1.38255063 1.65137652 1.64923454 0.28605051
[13] 3.02880978 0.33940163 -1.66306343 0.03638107 0.61294862 -0.11137312
[19] 0.81141194 -0.83531772 0.69196933 -0.77732576 -0.08832086 -0.07443951
[25] 0.35161602 -0.76518935 -0.67381877 0.46032919 -0.18041474 0.39059759
[31] 0.41743398 0.21486283 0.11078458 0.27321519 0.48181825 1.03009729
[37] 0.61488707 -0.60436017 1.10473846 0.16945507 0.38220528 -0.79433622
[43] 0.26592117 -0.63409916 -0.19036371 0.08322261 0.40822294 0.55990025
[49] -0.72643018 0.16373081 -1.33555758 0.45563891 -0.11529377 1.51776246
[55] 0.57821654 -0.81558104 -2.07249726 0.32213698 1.04155925 1.06323493
[61] -1.21797040 -1.17339584 0.67410677 1.86315516 0.07207221 -1.06146369
[67] -0.74306637 0.54468731 -2.60740803 0.81271975 -0.73284353 -1.22926798
[73] -0.88610253 -1.75701721 -0.23190522 -1.05748045 -1.12842305 -0.16103023
[79] 0.54248708 1.44420801 -0.60344432 1.34725649 1.82894473 0.64916521
[85] -0.69350325 -1.07857474 -0.62874386 0.56540316 -1.09143843 0.09991737
[91] 0.31470605 -0.45719304 1.11209153 -0.50762201 0.58970299 0.52879438
[97] -2.57001468 -0.74421865 0.12933215 -0.06012222
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.08371539 -0.7001807 0.4511474 -0.7304262 0.07857066 2.177015 0.03059487
[2,] -0.08371539 -0.7001807 0.4511474 -0.7304262 0.07857066 2.177015 0.03059487
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.6485776 -1.382551 1.651377 1.649235 0.2860505 3.02881 0.3394016
[2,] 0.6485776 -1.382551 1.651377 1.649235 0.2860505 3.02881 0.3394016
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.663063 0.03638107 0.6129486 -0.1113731 0.8114119 -0.8353177 0.6919693
[2,] -1.663063 0.03638107 0.6129486 -0.1113731 0.8114119 -0.8353177 0.6919693
[,22] [,23] [,24] [,25] [,26] [,27]
[1,] -0.7773258 -0.08832086 -0.07443951 0.351616 -0.7651893 -0.6738188
[2,] -0.7773258 -0.08832086 -0.07443951 0.351616 -0.7651893 -0.6738188
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] 0.4603292 -0.1804147 0.3905976 0.417434 0.2148628 0.1107846 0.2732152
[2,] 0.4603292 -0.1804147 0.3905976 0.417434 0.2148628 0.1107846 0.2732152
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] 0.4818182 1.030097 0.6148871 -0.6043602 1.104738 0.1694551 0.3822053
[2,] 0.4818182 1.030097 0.6148871 -0.6043602 1.104738 0.1694551 0.3822053
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.7943362 0.2659212 -0.6340992 -0.1903637 0.08322261 0.4082229 0.5599002
[2,] -0.7943362 0.2659212 -0.6340992 -0.1903637 0.08322261 0.4082229 0.5599002
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.7264302 0.1637308 -1.335558 0.4556389 -0.1152938 1.517762 0.5782165
[2,] -0.7264302 0.1637308 -1.335558 0.4556389 -0.1152938 1.517762 0.5782165
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.815581 -2.072497 0.322137 1.041559 1.063235 -1.21797 -1.173396
[2,] -0.815581 -2.072497 0.322137 1.041559 1.063235 -1.21797 -1.173396
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.6741068 1.863155 0.07207221 -1.061464 -0.7430664 0.5446873 -2.607408
[2,] 0.6741068 1.863155 0.07207221 -1.061464 -0.7430664 0.5446873 -2.607408
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.8127197 -0.7328435 -1.229268 -0.8861025 -1.757017 -0.2319052 -1.05748
[2,] 0.8127197 -0.7328435 -1.229268 -0.8861025 -1.757017 -0.2319052 -1.05748
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -1.128423 -0.1610302 0.5424871 1.444208 -0.6034443 1.347256 1.828945
[2,] -1.128423 -0.1610302 0.5424871 1.444208 -0.6034443 1.347256 1.828945
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.6491652 -0.6935033 -1.078575 -0.6287439 0.5654032 -1.091438 0.09991737
[2,] 0.6491652 -0.6935033 -1.078575 -0.6287439 0.5654032 -1.091438 0.09991737
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.314706 -0.457193 1.112092 -0.507622 0.589703 0.5287944 -2.570015
[2,] 0.314706 -0.457193 1.112092 -0.507622 0.589703 0.5287944 -2.570015
[,98] [,99] [,100]
[1,] -0.7442186 0.1293322 -0.06012222
[2,] -0.7442186 0.1293322 -0.06012222
>
>
> Max(tmp2)
[1] 2.393162
> Min(tmp2)
[1] -2.181475
> mean(tmp2)
[1] 0.06751267
> Sum(tmp2)
[1] 6.751267
> Var(tmp2)
[1] 0.9048013
>
> rowMeans(tmp2)
[1] 0.293746507 -0.172070793 -1.467799794 -0.567774705 0.711362347
[6] 0.487864323 -0.009749535 -0.521974524 0.528231147 -0.558097646
[11] -1.543013915 0.171961298 1.158884056 -1.229702826 1.082827666
[16] 0.043129334 0.559225598 0.405467620 1.124645603 0.626469792
[21] 0.031551402 2.393162380 0.667516254 0.206369195 2.010251821
[26] -0.002725498 0.842262875 -0.082937307 -0.114583576 0.035550181
[31] 1.431606572 -0.309799227 -1.900403008 -1.538120646 -0.746470710
[36] 0.284100263 0.640045063 0.072685074 0.115064150 0.180319069
[41] 0.305293570 1.135170688 -2.181475195 -0.071286671 -1.161318609
[46] 2.202984408 -0.290281004 -0.204902766 0.590181045 0.461861538
[51] 0.115830853 1.015329496 0.742754627 0.409577417 0.615247218
[56] -1.655326470 1.578435717 -1.403216261 0.422850893 0.176374054
[61] -0.195680332 1.092276210 -1.243767633 -0.922357232 0.988741189
[66] 0.333624721 0.727477792 0.581616372 -0.962174314 -0.574460369
[71] 0.524219041 -2.074200474 0.926963373 -1.397162027 1.245517321
[76] 0.329740693 -0.141897429 -0.110914677 1.183082199 -1.245871083
[81] -0.015653355 -0.590303887 1.912197331 0.344759624 -0.097704191
[86] -0.378860378 -0.889424765 0.335268119 1.651427049 -1.401769348
[91] 0.205926142 0.531354949 -1.457082072 0.429589967 0.678130568
[96] -1.531983218 0.191525870 0.226833086 -0.253930096 -0.346967958
> rowSums(tmp2)
[1] 0.293746507 -0.172070793 -1.467799794 -0.567774705 0.711362347
[6] 0.487864323 -0.009749535 -0.521974524 0.528231147 -0.558097646
[11] -1.543013915 0.171961298 1.158884056 -1.229702826 1.082827666
[16] 0.043129334 0.559225598 0.405467620 1.124645603 0.626469792
[21] 0.031551402 2.393162380 0.667516254 0.206369195 2.010251821
[26] -0.002725498 0.842262875 -0.082937307 -0.114583576 0.035550181
[31] 1.431606572 -0.309799227 -1.900403008 -1.538120646 -0.746470710
[36] 0.284100263 0.640045063 0.072685074 0.115064150 0.180319069
[41] 0.305293570 1.135170688 -2.181475195 -0.071286671 -1.161318609
[46] 2.202984408 -0.290281004 -0.204902766 0.590181045 0.461861538
[51] 0.115830853 1.015329496 0.742754627 0.409577417 0.615247218
[56] -1.655326470 1.578435717 -1.403216261 0.422850893 0.176374054
[61] -0.195680332 1.092276210 -1.243767633 -0.922357232 0.988741189
[66] 0.333624721 0.727477792 0.581616372 -0.962174314 -0.574460369
[71] 0.524219041 -2.074200474 0.926963373 -1.397162027 1.245517321
[76] 0.329740693 -0.141897429 -0.110914677 1.183082199 -1.245871083
[81] -0.015653355 -0.590303887 1.912197331 0.344759624 -0.097704191
[86] -0.378860378 -0.889424765 0.335268119 1.651427049 -1.401769348
[91] 0.205926142 0.531354949 -1.457082072 0.429589967 0.678130568
[96] -1.531983218 0.191525870 0.226833086 -0.253930096 -0.346967958
> 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.293746507 -0.172070793 -1.467799794 -0.567774705 0.711362347
[6] 0.487864323 -0.009749535 -0.521974524 0.528231147 -0.558097646
[11] -1.543013915 0.171961298 1.158884056 -1.229702826 1.082827666
[16] 0.043129334 0.559225598 0.405467620 1.124645603 0.626469792
[21] 0.031551402 2.393162380 0.667516254 0.206369195 2.010251821
[26] -0.002725498 0.842262875 -0.082937307 -0.114583576 0.035550181
[31] 1.431606572 -0.309799227 -1.900403008 -1.538120646 -0.746470710
[36] 0.284100263 0.640045063 0.072685074 0.115064150 0.180319069
[41] 0.305293570 1.135170688 -2.181475195 -0.071286671 -1.161318609
[46] 2.202984408 -0.290281004 -0.204902766 0.590181045 0.461861538
[51] 0.115830853 1.015329496 0.742754627 0.409577417 0.615247218
[56] -1.655326470 1.578435717 -1.403216261 0.422850893 0.176374054
[61] -0.195680332 1.092276210 -1.243767633 -0.922357232 0.988741189
[66] 0.333624721 0.727477792 0.581616372 -0.962174314 -0.574460369
[71] 0.524219041 -2.074200474 0.926963373 -1.397162027 1.245517321
[76] 0.329740693 -0.141897429 -0.110914677 1.183082199 -1.245871083
[81] -0.015653355 -0.590303887 1.912197331 0.344759624 -0.097704191
[86] -0.378860378 -0.889424765 0.335268119 1.651427049 -1.401769348
[91] 0.205926142 0.531354949 -1.457082072 0.429589967 0.678130568
[96] -1.531983218 0.191525870 0.226833086 -0.253930096 -0.346967958
> rowMin(tmp2)
[1] 0.293746507 -0.172070793 -1.467799794 -0.567774705 0.711362347
[6] 0.487864323 -0.009749535 -0.521974524 0.528231147 -0.558097646
[11] -1.543013915 0.171961298 1.158884056 -1.229702826 1.082827666
[16] 0.043129334 0.559225598 0.405467620 1.124645603 0.626469792
[21] 0.031551402 2.393162380 0.667516254 0.206369195 2.010251821
[26] -0.002725498 0.842262875 -0.082937307 -0.114583576 0.035550181
[31] 1.431606572 -0.309799227 -1.900403008 -1.538120646 -0.746470710
[36] 0.284100263 0.640045063 0.072685074 0.115064150 0.180319069
[41] 0.305293570 1.135170688 -2.181475195 -0.071286671 -1.161318609
[46] 2.202984408 -0.290281004 -0.204902766 0.590181045 0.461861538
[51] 0.115830853 1.015329496 0.742754627 0.409577417 0.615247218
[56] -1.655326470 1.578435717 -1.403216261 0.422850893 0.176374054
[61] -0.195680332 1.092276210 -1.243767633 -0.922357232 0.988741189
[66] 0.333624721 0.727477792 0.581616372 -0.962174314 -0.574460369
[71] 0.524219041 -2.074200474 0.926963373 -1.397162027 1.245517321
[76] 0.329740693 -0.141897429 -0.110914677 1.183082199 -1.245871083
[81] -0.015653355 -0.590303887 1.912197331 0.344759624 -0.097704191
[86] -0.378860378 -0.889424765 0.335268119 1.651427049 -1.401769348
[91] 0.205926142 0.531354949 -1.457082072 0.429589967 0.678130568
[96] -1.531983218 0.191525870 0.226833086 -0.253930096 -0.346967958
>
> colMeans(tmp2)
[1] 0.06751267
> colSums(tmp2)
[1] 6.751267
> colVars(tmp2)
[1] 0.9048013
> colSd(tmp2)
[1] 0.9512104
> colMax(tmp2)
[1] 2.393162
> colMin(tmp2)
[1] -2.181475
> colMedians(tmp2)
[1] 0.1783466
> colRanges(tmp2)
[,1]
[1,] -2.181475
[2,] 2.393162
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.498328 -1.052697 1.093733 -2.729800 -3.738228 1.571301 -4.016735
[8] 2.754200 -1.657980 -1.351566
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.96533323
[2,] -0.50843177
[3,] -0.08137312
[4,] 0.18356154
[5,] 1.11249558
>
> rowApply(tmp,sum)
[1] 0.9642009 -0.9626642 -0.3968986 3.6325266 -4.0786989 -4.6120132
[7] -1.0360180 -5.1482326 -0.2008856 0.2125838
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 4 5 2 10 9 8 1 6 8
[2,] 6 1 1 8 5 10 10 5 4 6
[3,] 3 2 7 4 6 7 6 6 8 10
[4,] 9 3 9 1 7 6 7 4 7 2
[5,] 7 8 4 3 8 4 3 8 1 3
[6,] 2 9 10 6 4 5 9 9 5 7
[7,] 8 10 2 10 2 8 1 3 2 5
[8,] 10 7 6 5 1 2 5 7 10 4
[9,] 4 5 3 9 3 3 2 10 3 9
[10,] 5 6 8 7 9 1 4 2 9 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.2398232 2.7491380 -2.1111861 -0.3246085 -2.8701153 -5.1418619
[7] -0.9195283 -1.2810817 3.5174758 -3.2740747 0.4320643 -2.7335312
[13] -0.7101700 1.8663369 -0.8888931 -6.1815768 -2.0712610 0.4194457
[19] 1.2143880 -0.5402698
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.592226246
[2,] -0.289473003
[3,] 0.005290386
[4,] 0.153909824
[5,] 1.962322228
>
> rowApply(tmp,sum)
[1] -6.608025 3.452845 2.345890 -4.086118 -12.714078
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 10 19 13 14
[2,] 20 20 9 16 12
[3,] 14 3 17 3 7
[4,] 6 12 18 2 13
[5,] 10 5 6 12 11
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.592226246 1.4902601 -0.02887928 -1.1712377 -0.4663806 -1.348503212
[2,] 0.153909824 1.9615719 -1.03662256 0.6483537 -0.6210557 -0.005763686
[3,] 1.962322228 -0.2142498 1.13010321 1.7559766 -0.7130132 -1.957699816
[4,] 0.005290386 0.3507526 -1.07471771 -1.1447354 -0.1047304 -0.773872335
[5,] -0.289473003 -0.8391968 -1.10106977 -0.4129656 -0.9649354 -1.056022824
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.56982793 1.349791 1.2559158 -1.6071584 -1.3497260 -0.7829868
[2,] -0.48399424 -1.422843 1.6976813 0.6649995 0.9082799 1.1436798
[3,] 0.15473542 -1.205893 0.2082847 -0.2245680 1.0254885 -0.7350165
[4,] 0.03561469 1.182344 -0.7562099 -1.0290530 -0.3315735 -0.4991098
[5,] -1.19571207 -1.184481 1.1118040 -1.0782949 0.1795954 -1.8600978
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.8629545 0.7800355 -0.2145547 -2.283710870 -0.2625304 -1.7708074
[2,] -1.0683099 0.7769049 0.9368916 -0.549843902 0.8906817 -0.5209557
[3,] -0.5390169 0.3982796 0.3875821 -0.004745046 -1.1969531 0.7344215
[4,] -0.5526144 1.2130712 -0.7244519 -1.334649455 -0.5172088 0.8899313
[5,] 0.5868166 -1.3019543 -1.2743603 -2.008627493 -0.9852505 1.0868559
[,19] [,20]
[1,] -0.6897489 -0.34835901
[2,] -1.0361470 0.41542614
[3,] 2.2020737 -0.82222258
[4,] 0.9185760 0.16122841
[5,] -0.1803659 0.05365723
>
>
> 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 2.077265 1.101299 0.5757287 0.03837028 -0.5709324 -0.512553 1.158771
col8 col9 col10 col11 col12 col13 col14
row1 1.568961 -0.5531399 0.3318417 0.4118982 0.06354293 0.8308685 0.6016526
col15 col16 col17 col18 col19 col20
row1 -2.113023 1.167545 -0.7832293 0.4523702 -0.6886604 0.8062753
> tmp[,"col10"]
col10
row1 0.3318417
row2 0.5022084
row3 0.4058727
row4 -0.6612290
row5 0.2635120
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 2.077265 1.1012991 0.5757287 0.03837028 -0.5709324 -0.5125530 1.1587708
row5 -0.248821 0.6411786 -0.1831333 -0.64730755 1.5922113 0.1780895 0.4241024
col8 col9 col10 col11 col12 col13 col14
row1 1.568961 -0.5531399 0.3318417 0.4118982 0.06354293 0.83086851 0.6016526
row5 1.801568 0.2135711 0.2635120 -1.1970788 0.80173028 0.03748623 -0.1137610
col15 col16 col17 col18 col19 col20
row1 -2.113023 1.1675445 -0.7832293 0.4523702 -0.6886604 0.8062753
row5 -1.343560 0.7769802 2.6014113 -0.9600163 1.1073778 -0.4840739
> tmp[,c("col6","col20")]
col6 col20
row1 -0.5125530 0.8062753
row2 0.6611546 -0.8840623
row3 -0.4913320 1.4723889
row4 0.6981047 -0.2859579
row5 0.1780895 -0.4840739
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.5125530 0.8062753
row5 0.1780895 -0.4840739
>
>
>
>
> 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.55264 49.75704 51.07635 50.89173 49.91722 105.1804 50.00884 50.84728
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.59388 49.08406 51.01982 51.25688 49.81845 49.72425 49.40917 50.89691
col17 col18 col19 col20
row1 50.00471 49.4705 50.55416 104.2012
> tmp[,"col10"]
col10
row1 49.08406
row2 27.25785
row3 29.92419
row4 31.02526
row5 48.74273
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.55264 49.75704 51.07635 50.89173 49.91722 105.1804 50.00884 50.84728
row5 50.81844 49.54617 50.94684 52.37598 49.95498 105.0215 49.27717 49.55682
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.59388 49.08406 51.01982 51.25688 49.81845 49.72425 49.40917 50.89691
row5 50.29792 48.74273 48.74384 51.09997 51.12682 51.34647 49.03722 49.30207
col17 col18 col19 col20
row1 50.00471 49.47050 50.55416 104.2012
row5 48.22778 49.63241 49.72908 103.5021
> tmp[,c("col6","col20")]
col6 col20
row1 105.18039 104.20121
row2 75.17286 72.46173
row3 73.59663 72.61442
row4 75.63476 76.86524
row5 105.02155 103.50207
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.1804 104.2012
row5 105.0215 103.5021
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.1804 104.2012
row5 105.0215 103.5021
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.59162289
[2,] -0.18353663
[3,] -0.01443334
[4,] 0.59696121
[5,] 1.00630373
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.6801137 1.1905577
[2,] -1.0301028 0.3125374
[3,] 0.5021866 0.1301527
[4,] -0.5052283 -0.6363168
[5,] 0.5753502 -0.9855777
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.008114844 0.1930451
[2,] 0.536590045 -0.8566214
[3,] 1.726435447 -0.1894123
[4,] -0.739516558 -1.5395761
[5,] -0.405674125 1.1326616
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.008114844
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.008114844
[2,] 0.536590045
>
>
>
> 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.471853 0.3001846 -0.8677675 -1.6935759 1.023059 0.3121894 -1.8559276
row1 1.127792 1.6031862 2.3923411 -0.2213065 1.322127 0.3295323 -0.5780988
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.02392726 -0.2103606 1.1010623 -0.09251338 -2.463584 1.406849 1.65994841
row1 -0.87375300 -0.7651572 0.3033847 -0.90674751 -1.375507 2.589337 0.06874983
[,15] [,16] [,17] [,18] [,19] [,20]
row3 0.5420141 -0.1253625 -0.6721107 0.2130052 0.2664047 -0.6347654
row1 1.6037463 -0.5403425 0.1163422 -1.5477007 0.9889198 -2.2810536
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.8009538 -1.145747 -1.010517 -0.6346833 -0.2264386 1.335561 -0.563703
[,8] [,9] [,10]
row2 0.1470579 0.2854589 -0.04480336
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.63146 1.721578 -0.1329747 0.2484923 0.3253806 -1.869821 0.5750032
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.0352625 0.6930058 -0.7886436 -0.5453797 -0.4937697 0.3876169 0.4016422
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.6926561 -1.779145 2.055109 -0.1204667 0.7644793 0.005700208
>
>
> 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: 0x600001100000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83507e306791"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83501bdfa150"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM835076d7997b"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8350449d9731"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM835046313528"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83504898f918"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83503309bbe4"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8350440e8fe9"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8350180a2ce7"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83504409fe05"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83506c041d28"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8350216647f"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM8350c1fceeb"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM83507c49ac84"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM835048dd4ddb"
>
>
> ### 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: 0x60000112c300>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000112c300>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x60000112c300>
> rowMedians(tmp)
[1] -0.750273058 -0.237526254 -0.426594870 0.144484852 -0.240097641
[6] -0.403920319 -0.169136374 -0.220351869 -0.242947969 -0.135833775
[11] -0.254047630 -0.109793164 -0.047135592 -0.111542014 -0.245470545
[16] -0.108294008 -0.176651678 -0.582765700 0.151942772 0.531144824
[21] 0.100496234 0.046942219 -0.161371958 0.356194948 -0.467379553
[26] -0.410676174 -0.208781422 -0.744205168 0.088058557 0.159498835
[31] 0.159073904 -0.559717779 -0.644739537 -0.195369828 -0.245947919
[36] 0.356295766 0.325453690 -0.075117614 -0.654404430 0.212530686
[41] -0.370138922 -0.128225931 0.066687716 -0.602507296 0.677320166
[46] 0.295784163 0.055649322 0.070276627 -0.226880951 0.292633929
[51] 0.113426422 0.338150686 0.186561272 -0.163779365 0.167620281
[56] -0.201539362 -0.178227269 0.196548323 -0.142901174 0.051879619
[61] -0.620109337 -0.545510417 0.054200426 -0.313019420 -0.439907158
[66] -0.778068194 0.062585187 -0.123444007 0.067022060 0.478242599
[71] 0.388697346 -0.269557598 0.289488938 0.413577679 -0.011644445
[76] -0.203205992 -0.179603596 0.107232822 -0.176716438 -0.188320380
[81] -0.037376847 0.009953841 -0.291548301 0.575462159 -0.039868792
[86] 0.447276350 -0.150094286 -0.361495246 0.179491809 -0.077986136
[91] 0.067114675 -0.162874897 0.127510395 -0.059680667 -0.363973499
[96] -0.970193018 0.425293619 -0.133694936 0.126419855 0.342156706
[101] -0.246575923 -0.227964795 -0.333497077 -0.549631090 -0.365678455
[106] 0.135509506 -0.069297057 -0.119185737 -0.363770903 0.259378978
[111] -0.284609134 0.424370771 -0.073232724 -0.015070401 0.587750536
[116] -0.547545383 -0.057214266 0.165459053 0.186088357 -0.317556862
[121] 0.193188213 0.946819563 -0.288458474 0.175135693 -0.105789848
[126] -0.031918993 -0.310938176 -0.262781236 0.326976715 -0.259586025
[131] -0.201034521 0.198090472 -0.330478644 0.210817530 0.083703776
[136] -0.068630344 0.020008354 0.028463681 -0.443447510 -0.632513922
[141] 0.003731121 -0.219158443 0.456581729 0.306739074 0.258381902
[146] 0.526604634 -0.249820318 -0.327264138 -0.281587852 -0.261506073
[151] 0.087580527 -0.561081983 -0.223590046 0.306251610 -0.271936736
[156] -0.616073775 0.250845469 -0.511493553 -0.404779483 -0.455357131
[161] -0.200322771 0.068628172 -0.169187548 -0.165916403 -0.174170519
[166] -0.237335254 -0.307538783 0.127952562 -0.351026896 -0.134115091
[171] -0.376068917 0.104899636 0.059622754 -0.207121541 -0.148806376
[176] -0.261527760 -0.348003733 0.052239145 -0.269763771 0.235266935
[181] -0.661254396 0.973572505 0.089731905 -0.202121939 -0.031239710
[186] 0.287651503 -0.192977633 -0.316034229 -0.114771754 0.110372444
[191] 0.209649228 0.043957601 0.004732278 -0.040118043 0.275507355
[196] 0.006252760 -0.098642679 -0.399635944 -0.261479138 0.647619877
[201] -0.384005563 -0.075854086 0.236448416 -0.093104159 -0.349974859
[206] 0.053183687 0.084615377 -0.040822786 0.434812451 0.101714909
[211] -0.715694653 0.145595020 -0.551118434 0.003939578 -0.383627781
[216] 0.153921144 0.093610041 -0.627640867 -0.289628001 0.141891989
[221] -0.127057886 -0.512327416 -0.445117546 0.764024332 0.164904868
[226] 0.359400773 0.128243283 0.029179135 0.777318532 0.337714964
>
> proc.time()
user system elapsed
0.778 3.711 5.203
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: 0x600001fc00c0>
> .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: 0x600001fc00c0>
> .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: 0x600001fc00c0>
> .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: 0x600001fc00c0>
> 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: 0x600001fcc360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001fcc360>
> .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: 0x600001fcc360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001fcc360>
> .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: 0x600001fcc360>
> 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: 0x600001ff0240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff0240>
> .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: 0x600001ff0240>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001ff0240>
> .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: 0x600001ff0240>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600001ff0240>
> .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: 0x600001ff0240>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600001ff0240>
> .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: 0x600001ff0240>
> 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: 0x600001ff0420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001ff0420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff0420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff0420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile871864359c77" "BufferedMatrixFile87187bb37c06"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile871864359c77" "BufferedMatrixFile87187bb37c06"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff06c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff06c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001ff06c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001ff06c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001ff06c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001ff06c0>
> .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: 0x600001ff08a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001ff08a0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001ff08a0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001ff08a0>
> 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: 0x600001ff0a80>
> .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: 0x600001ff0a80>
> rm(P)
>
> proc.time()
user system elapsed
0.127 0.048 0.178
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.128 0.042 0.190