| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-04 12:03 -0500 (Tue, 04 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4902 |
| lconway | macOS 12.7.6 Monterey | x86_64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4692 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4638 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | 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.74.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.74.0.tar.gz |
| StartedAt: 2025-11-03 19:56:23 -0500 (Mon, 03 Nov 2025) |
| EndedAt: 2025-11-03 19:57:13 -0500 (Mon, 03 Nov 2025) |
| EllapsedTime: 49.7 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.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* 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 ... NOTE
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, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-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.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/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 x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/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.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.310 0.136 0.442
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480848 25.7 1056621 56.5 NA 634460 33.9
Vcells 891079 6.8 8388608 64.0 98304 2108715 16.1
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Nov 3 19:56:47 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Nov 3 19:56:47 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: 0x600003d0c000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Nov 3 19:56:51 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Nov 3 19:56:53 2025"
>
> ColMode(tmp2)
<pointer: 0x600003d0c000>
>
>
>
> ### 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.3821618 -0.8469817 -0.40315353 6.978218e-05
[2,] 0.3198496 -0.3525079 0.06802348 1.512350e+00
[3,] 1.0552455 0.8878535 0.17127992 -1.292814e+00
[4,] -0.6631249 -0.3533052 0.48411401 1.592261e-01
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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.3821618 0.8469817 0.40315353 6.978218e-05
[2,] 0.3198496 0.3525079 0.06802348 1.512350e+00
[3,] 1.0552455 0.8878535 0.17127992 1.292814e+00
[4,] 0.6631249 0.3533052 0.48411401 1.592261e-01
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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.9187782 0.9203161 0.6349437 0.008353573
[2,] 0.5655524 0.5937237 0.2608131 1.229776439
[3,] 1.0272514 0.9422598 0.4138598 1.137019673
[4,] 0.8143248 0.5943948 0.6957830 0.399031450
>
> 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.22-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,] 222.56994 35.05014 31.75259 25.08361
[2,] 30.97537 31.28975 27.67615 38.81011
[3,] 36.32776 35.31045 29.30988 37.66301
[4,] 33.80637 31.29725 32.44194 29.14954
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003d18000>
> exp(tmp5)
<pointer: 0x600003d18000>
> log(tmp5,2)
<pointer: 0x600003d18000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.2502
> Min(tmp5)
[1] 52.20824
> mean(tmp5)
[1] 71.86433
> Sum(tmp5)
[1] 14372.87
> Var(tmp5)
[1] 843.6105
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 87.76488 72.27994 68.22508 66.88068 68.94328 71.56415 71.82903 70.17189
[9] 70.16759 70.81677
> rowSums(tmp5)
[1] 1755.298 1445.599 1364.502 1337.614 1378.866 1431.283 1436.581 1403.438
[9] 1403.352 1416.335
> rowVars(tmp5)
[1] 7869.01371 86.89682 56.94472 80.09287 95.37801 69.83126
[7] 58.80680 47.21894 91.78459 57.06243
> rowSd(tmp5)
[1] 88.707461 9.321846 7.546173 8.949462 9.766166 8.356510 7.668559
[8] 6.871604 9.580428 7.553968
> rowMax(tmp5)
[1] 463.25018 91.60362 85.65767 90.37551 83.49923 84.81013 85.82169
[8] 82.86908 85.55303 87.04279
> rowMin(tmp5)
[1] 52.20824 57.60429 54.66362 53.75305 53.58064 55.57238 58.16525 59.91913
[9] 52.97474 60.32835
>
> colMeans(tmp5)
[1] 108.64441 69.06758 65.85424 70.75672 64.34925 68.57025 69.76762
[8] 65.77162 72.88394 74.16111 67.11403 74.19119 69.42086 67.38896
[15] 68.98784 71.75616 70.66275 74.25180 72.35583 71.33042
> colSums(tmp5)
[1] 1086.4441 690.6758 658.5424 707.5672 643.4925 685.7025 697.6762
[8] 657.7162 728.8394 741.6111 671.1403 741.9119 694.2086 673.8896
[15] 689.8784 717.5616 706.6275 742.5180 723.5583 713.3042
> colVars(tmp5)
[1] 15568.76067 44.73237 54.38383 126.93348 57.94361 75.81997
[7] 60.04886 53.07307 60.75579 66.85445 58.18575 66.36658
[13] 65.57351 57.19580 79.05434 62.84340 100.34038 134.14578
[19] 62.81073 38.41072
> colSd(tmp5)
[1] 124.774840 6.688227 7.374539 11.266476 7.612070 8.707466
[7] 7.749120 7.285127 7.794600 8.176457 7.627958 8.146569
[13] 8.097747 7.562790 8.891251 7.927383 10.017005 11.582132
[19] 7.925322 6.197638
> colMax(tmp5)
[1] 463.25018 84.81013 77.24704 82.45337 76.97134 80.98311 76.85223
[8] 80.26852 83.49923 85.55303 83.09465 85.82169 79.21237 83.81299
[15] 86.76396 83.10615 91.60362 90.37551 84.42726 82.62850
> colMin(tmp5)
[1] 55.52356 62.26867 57.60429 52.20824 54.32680 56.68641 52.97474 58.02042
[9] 60.76518 63.49014 55.57238 61.69733 53.75305 57.95162 58.16525 58.51749
[17] 54.83856 54.38114 59.87862 63.98257
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 87.76488 72.27994 68.22508 66.88068 68.94328 71.56415 71.82903 70.17189
[9] 70.16759 NA
> rowSums(tmp5)
[1] 1755.298 1445.599 1364.502 1337.614 1378.866 1431.283 1436.581 1403.438
[9] 1403.352 NA
> rowVars(tmp5)
[1] 7869.01371 86.89682 56.94472 80.09287 95.37801 69.83126
[7] 58.80680 47.21894 91.78459 60.22776
> rowSd(tmp5)
[1] 88.707461 9.321846 7.546173 8.949462 9.766166 8.356510 7.668559
[8] 6.871604 9.580428 7.760655
> rowMax(tmp5)
[1] 463.25018 91.60362 85.65767 90.37551 83.49923 84.81013 85.82169
[8] 82.86908 85.55303 NA
> rowMin(tmp5)
[1] 52.20824 57.60429 54.66362 53.75305 53.58064 55.57238 58.16525 59.91913
[9] 52.97474 NA
>
> colMeans(tmp5)
[1] NA 69.06758 65.85424 70.75672 64.34925 68.57025 69.76762 65.77162
[9] 72.88394 74.16111 67.11403 74.19119 69.42086 67.38896 68.98784 71.75616
[17] 70.66275 74.25180 72.35583 71.33042
> colSums(tmp5)
[1] NA 690.6758 658.5424 707.5672 643.4925 685.7025 697.6762 657.7162
[9] 728.8394 741.6111 671.1403 741.9119 694.2086 673.8896 689.8784 717.5616
[17] 706.6275 742.5180 723.5583 713.3042
> colVars(tmp5)
[1] NA 44.73237 54.38383 126.93348 57.94361 75.81997 60.04886
[8] 53.07307 60.75579 66.85445 58.18575 66.36658 65.57351 57.19580
[15] 79.05434 62.84340 100.34038 134.14578 62.81073 38.41072
> colSd(tmp5)
[1] NA 6.688227 7.374539 11.266476 7.612070 8.707466 7.749120
[8] 7.285127 7.794600 8.176457 7.627958 8.146569 8.097747 7.562790
[15] 8.891251 7.927383 10.017005 11.582132 7.925322 6.197638
> colMax(tmp5)
[1] NA 84.81013 77.24704 82.45337 76.97134 80.98311 76.85223 80.26852
[9] 83.49923 85.55303 83.09465 85.82169 79.21237 83.81299 86.76396 83.10615
[17] 91.60362 90.37551 84.42726 82.62850
> colMin(tmp5)
[1] NA 62.26867 57.60429 52.20824 54.32680 56.68641 52.97474 58.02042
[9] 60.76518 63.49014 55.57238 61.69733 53.75305 57.95162 58.16525 58.51749
[17] 54.83856 54.38114 59.87862 63.98257
>
> Max(tmp5,na.rm=TRUE)
[1] 463.2502
> Min(tmp5,na.rm=TRUE)
[1] 52.20824
> mean(tmp5,na.rm=TRUE)
[1] 71.87103
> Sum(tmp5,na.rm=TRUE)
[1] 14302.34
> Var(tmp5,na.rm=TRUE)
[1] 847.8621
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.76488 72.27994 68.22508 66.88068 68.94328 71.56415 71.82903 70.17189
[9] 70.16759 70.83186
> rowSums(tmp5,na.rm=TRUE)
[1] 1755.298 1445.599 1364.502 1337.614 1378.866 1431.283 1436.581 1403.438
[9] 1403.352 1345.805
> rowVars(tmp5,na.rm=TRUE)
[1] 7869.01371 86.89682 56.94472 80.09287 95.37801 69.83126
[7] 58.80680 47.21894 91.78459 60.22776
> rowSd(tmp5,na.rm=TRUE)
[1] 88.707461 9.321846 7.546173 8.949462 9.766166 8.356510 7.668559
[8] 6.871604 9.580428 7.760655
> rowMax(tmp5,na.rm=TRUE)
[1] 463.25018 91.60362 85.65767 90.37551 83.49923 84.81013 85.82169
[8] 82.86908 85.55303 87.04279
> rowMin(tmp5,na.rm=TRUE)
[1] 52.20824 57.60429 54.66362 53.75305 53.58064 55.57238 58.16525 59.91913
[9] 52.97474 60.32835
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.87934 69.06758 65.85424 70.75672 64.34925 68.57025 69.76762
[8] 65.77162 72.88394 74.16111 67.11403 74.19119 69.42086 67.38896
[15] 68.98784 71.75616 70.66275 74.25180 72.35583 71.33042
> colSums(tmp5,na.rm=TRUE)
[1] 1015.9140 690.6758 658.5424 707.5672 643.4925 685.7025 697.6762
[8] 657.7162 728.8394 741.6111 671.1403 741.9119 694.2086 673.8896
[15] 689.8784 717.5616 706.6275 742.5180 723.5583 713.3042
> colVars(tmp5,na.rm=TRUE)
[1] 17313.09129 44.73237 54.38383 126.93348 57.94361 75.81997
[7] 60.04886 53.07307 60.75579 66.85445 58.18575 66.36658
[13] 65.57351 57.19580 79.05434 62.84340 100.34038 134.14578
[19] 62.81073 38.41072
> colSd(tmp5,na.rm=TRUE)
[1] 131.579221 6.688227 7.374539 11.266476 7.612070 8.707466
[7] 7.749120 7.285127 7.794600 8.176457 7.627958 8.146569
[13] 8.097747 7.562790 8.891251 7.927383 10.017005 11.582132
[19] 7.925322 6.197638
> colMax(tmp5,na.rm=TRUE)
[1] 463.25018 84.81013 77.24704 82.45337 76.97134 80.98311 76.85223
[8] 80.26852 83.49923 85.55303 83.09465 85.82169 79.21237 83.81299
[15] 86.76396 83.10615 91.60362 90.37551 84.42726 82.62850
> colMin(tmp5,na.rm=TRUE)
[1] 55.52356 62.26867 57.60429 52.20824 54.32680 56.68641 52.97474 58.02042
[9] 60.76518 63.49014 55.57238 61.69733 53.75305 57.95162 58.16525 58.51749
[17] 54.83856 54.38114 59.87862 63.98257
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.76488 72.27994 68.22508 66.88068 68.94328 71.56415 71.82903 70.17189
[9] 70.16759 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1755.298 1445.599 1364.502 1337.614 1378.866 1431.283 1436.581 1403.438
[9] 1403.352 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7869.01371 86.89682 56.94472 80.09287 95.37801 69.83126
[7] 58.80680 47.21894 91.78459 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 88.707461 9.321846 7.546173 8.949462 9.766166 8.356510 7.668559
[8] 6.871604 9.580428 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 463.25018 91.60362 85.65767 90.37551 83.49923 84.81013 85.82169
[8] 82.86908 85.55303 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 52.20824 57.60429 54.66362 53.75305 53.58064 55.57238 58.16525 59.91913
[9] 52.97474 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] NaN 69.09429 66.31349 70.28812 64.79601 68.63721 70.23929 65.98280
[9] 71.91326 75.11679 66.41509 74.90642 69.77503 65.56407 69.47218 70.85414
[17] 71.28715 72.83058 72.25177 70.99746
> colSums(tmp5,na.rm=TRUE)
[1] 0.0000 621.8486 596.8214 632.5931 583.1641 617.7349 632.1536 593.8452
[9] 647.2193 676.0511 597.7358 674.1578 627.9753 590.0766 625.2496 637.6873
[17] 641.5844 655.4753 650.2659 638.9771
> colVars(tmp5,na.rm=TRUE)
[1] NA 50.31589 58.80899 140.32978 62.94105 85.24703 65.05214
[8] 59.20551 57.75020 64.93641 59.96307 68.90742 72.35906 26.88016
[15] 86.29708 61.54546 108.49672 128.19048 70.54026 41.96485
> colSd(tmp5,na.rm=TRUE)
[1] NA 7.093370 7.668702 11.846087 7.933540 9.232932 8.065491
[8] 7.694512 7.599355 8.058313 7.743582 8.301049 8.506413 5.184608
[15] 9.289622 7.845091 10.416176 11.322123 8.398825 6.478028
> colMax(tmp5,na.rm=TRUE)
[1] -Inf 84.81013 77.24704 82.45337 76.97134 80.98311 76.85223 80.26852
[9] 83.49923 85.55303 83.09465 85.82169 79.21237 73.13444 86.76396 83.10615
[17] 91.60362 90.37551 84.42726 82.62850
> colMin(tmp5,na.rm=TRUE)
[1] Inf 62.26867 57.60429 52.20824 54.32680 56.68641 52.97474 58.02042
[9] 60.76518 63.49014 55.57238 61.69733 53.75305 57.95162 58.16525 58.51749
[17] 54.83856 54.38114 59.87862 63.98257
>
>
>
>
> 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] 203.7240 109.8295 232.1488 150.0108 169.7363 158.4935 241.6431 250.0437
[9] 144.5969 340.2614
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 203.7240 109.8295 232.1488 150.0108 169.7363 158.4935 241.6431 250.0437
[9] 144.5969 340.2614
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 5.684342e-14 7.105427e-14 1.136868e-13 -1.136868e-13 4.263256e-14
[6] 1.705303e-13 1.278977e-13 0.000000e+00 1.136868e-13 -7.105427e-14
[11] -1.136868e-13 1.136868e-13 -1.421085e-14 4.263256e-14 -8.526513e-14
[16] 8.526513e-14 2.842171e-14 -1.136868e-13 -4.263256e-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)
+ }
7 2
8 11
3 2
6 11
6 12
1 13
5 6
2 20
6 11
7 17
1 2
7 12
7 8
9 20
10 4
1 7
6 16
1 1
4 7
1 7
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.405515
> Min(tmp)
[1] -3.102104
> mean(tmp)
[1] -0.08355335
> Sum(tmp)
[1] -8.355335
> Var(tmp)
[1] 0.9149078
>
> rowMeans(tmp)
[1] -0.08355335
> rowSums(tmp)
[1] -8.355335
> rowVars(tmp)
[1] 0.9149078
> rowSd(tmp)
[1] 0.9565081
> rowMax(tmp)
[1] 2.405515
> rowMin(tmp)
[1] -3.102104
>
> colMeans(tmp)
[1] -0.31565604 0.45761572 -0.03718952 0.05860803 0.94050212 1.37757198
[7] 0.70479105 0.22559833 -1.03735153 -1.27560753 0.70360468 0.43303511
[13] -0.67811686 0.33013060 -0.10137082 -0.75133431 0.28512725 0.14609577
[19] 1.24061734 -0.73555575 1.42730328 -0.13799027 0.33271623 -0.05882925
[25] -3.10210407 1.24184704 -0.04991791 -0.38812578 1.83171967 0.16065829
[31] 0.21209298 -1.46863022 -0.45710461 -0.85975513 0.67752078 0.17469076
[37] -0.16570238 0.68869225 0.69486629 -0.32594895 -0.50122599 -0.14149166
[43] -0.14754880 -0.59304288 -1.04567685 1.10954370 0.56006195 0.53080094
[49] -0.96297307 -1.02724310 -0.38802992 -2.28966332 2.40551511 -0.56126848
[55] -0.66981088 -0.11881495 -0.37630147 -0.50361688 -0.57376409 0.48239684
[61] 0.71672106 1.20972435 0.88741964 -1.33415527 0.11808767 1.02371915
[67] -0.73633946 -1.39148506 -0.01429348 -0.10313091 0.02887144 0.78649224
[73] -0.26783936 -0.95397180 -0.17863471 1.12854113 0.87738514 1.89424527
[79] 1.03897811 0.60105957 1.24694867 -0.34222911 0.46791144 -0.33436496
[85] -0.59008786 -0.32512054 -0.47872467 0.71595218 -0.88576628 -0.35336540
[91] -1.04248131 -1.25267583 0.20095782 -0.74469019 -2.11343661 -1.52911329
[97] -0.65212392 -2.47879840 -1.61912278 0.83664028
> colSums(tmp)
[1] -0.31565604 0.45761572 -0.03718952 0.05860803 0.94050212 1.37757198
[7] 0.70479105 0.22559833 -1.03735153 -1.27560753 0.70360468 0.43303511
[13] -0.67811686 0.33013060 -0.10137082 -0.75133431 0.28512725 0.14609577
[19] 1.24061734 -0.73555575 1.42730328 -0.13799027 0.33271623 -0.05882925
[25] -3.10210407 1.24184704 -0.04991791 -0.38812578 1.83171967 0.16065829
[31] 0.21209298 -1.46863022 -0.45710461 -0.85975513 0.67752078 0.17469076
[37] -0.16570238 0.68869225 0.69486629 -0.32594895 -0.50122599 -0.14149166
[43] -0.14754880 -0.59304288 -1.04567685 1.10954370 0.56006195 0.53080094
[49] -0.96297307 -1.02724310 -0.38802992 -2.28966332 2.40551511 -0.56126848
[55] -0.66981088 -0.11881495 -0.37630147 -0.50361688 -0.57376409 0.48239684
[61] 0.71672106 1.20972435 0.88741964 -1.33415527 0.11808767 1.02371915
[67] -0.73633946 -1.39148506 -0.01429348 -0.10313091 0.02887144 0.78649224
[73] -0.26783936 -0.95397180 -0.17863471 1.12854113 0.87738514 1.89424527
[79] 1.03897811 0.60105957 1.24694867 -0.34222911 0.46791144 -0.33436496
[85] -0.59008786 -0.32512054 -0.47872467 0.71595218 -0.88576628 -0.35336540
[91] -1.04248131 -1.25267583 0.20095782 -0.74469019 -2.11343661 -1.52911329
[97] -0.65212392 -2.47879840 -1.61912278 0.83664028
> 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.31565604 0.45761572 -0.03718952 0.05860803 0.94050212 1.37757198
[7] 0.70479105 0.22559833 -1.03735153 -1.27560753 0.70360468 0.43303511
[13] -0.67811686 0.33013060 -0.10137082 -0.75133431 0.28512725 0.14609577
[19] 1.24061734 -0.73555575 1.42730328 -0.13799027 0.33271623 -0.05882925
[25] -3.10210407 1.24184704 -0.04991791 -0.38812578 1.83171967 0.16065829
[31] 0.21209298 -1.46863022 -0.45710461 -0.85975513 0.67752078 0.17469076
[37] -0.16570238 0.68869225 0.69486629 -0.32594895 -0.50122599 -0.14149166
[43] -0.14754880 -0.59304288 -1.04567685 1.10954370 0.56006195 0.53080094
[49] -0.96297307 -1.02724310 -0.38802992 -2.28966332 2.40551511 -0.56126848
[55] -0.66981088 -0.11881495 -0.37630147 -0.50361688 -0.57376409 0.48239684
[61] 0.71672106 1.20972435 0.88741964 -1.33415527 0.11808767 1.02371915
[67] -0.73633946 -1.39148506 -0.01429348 -0.10313091 0.02887144 0.78649224
[73] -0.26783936 -0.95397180 -0.17863471 1.12854113 0.87738514 1.89424527
[79] 1.03897811 0.60105957 1.24694867 -0.34222911 0.46791144 -0.33436496
[85] -0.59008786 -0.32512054 -0.47872467 0.71595218 -0.88576628 -0.35336540
[91] -1.04248131 -1.25267583 0.20095782 -0.74469019 -2.11343661 -1.52911329
[97] -0.65212392 -2.47879840 -1.61912278 0.83664028
> colMin(tmp)
[1] -0.31565604 0.45761572 -0.03718952 0.05860803 0.94050212 1.37757198
[7] 0.70479105 0.22559833 -1.03735153 -1.27560753 0.70360468 0.43303511
[13] -0.67811686 0.33013060 -0.10137082 -0.75133431 0.28512725 0.14609577
[19] 1.24061734 -0.73555575 1.42730328 -0.13799027 0.33271623 -0.05882925
[25] -3.10210407 1.24184704 -0.04991791 -0.38812578 1.83171967 0.16065829
[31] 0.21209298 -1.46863022 -0.45710461 -0.85975513 0.67752078 0.17469076
[37] -0.16570238 0.68869225 0.69486629 -0.32594895 -0.50122599 -0.14149166
[43] -0.14754880 -0.59304288 -1.04567685 1.10954370 0.56006195 0.53080094
[49] -0.96297307 -1.02724310 -0.38802992 -2.28966332 2.40551511 -0.56126848
[55] -0.66981088 -0.11881495 -0.37630147 -0.50361688 -0.57376409 0.48239684
[61] 0.71672106 1.20972435 0.88741964 -1.33415527 0.11808767 1.02371915
[67] -0.73633946 -1.39148506 -0.01429348 -0.10313091 0.02887144 0.78649224
[73] -0.26783936 -0.95397180 -0.17863471 1.12854113 0.87738514 1.89424527
[79] 1.03897811 0.60105957 1.24694867 -0.34222911 0.46791144 -0.33436496
[85] -0.59008786 -0.32512054 -0.47872467 0.71595218 -0.88576628 -0.35336540
[91] -1.04248131 -1.25267583 0.20095782 -0.74469019 -2.11343661 -1.52911329
[97] -0.65212392 -2.47879840 -1.61912278 0.83664028
> colMedians(tmp)
[1] -0.31565604 0.45761572 -0.03718952 0.05860803 0.94050212 1.37757198
[7] 0.70479105 0.22559833 -1.03735153 -1.27560753 0.70360468 0.43303511
[13] -0.67811686 0.33013060 -0.10137082 -0.75133431 0.28512725 0.14609577
[19] 1.24061734 -0.73555575 1.42730328 -0.13799027 0.33271623 -0.05882925
[25] -3.10210407 1.24184704 -0.04991791 -0.38812578 1.83171967 0.16065829
[31] 0.21209298 -1.46863022 -0.45710461 -0.85975513 0.67752078 0.17469076
[37] -0.16570238 0.68869225 0.69486629 -0.32594895 -0.50122599 -0.14149166
[43] -0.14754880 -0.59304288 -1.04567685 1.10954370 0.56006195 0.53080094
[49] -0.96297307 -1.02724310 -0.38802992 -2.28966332 2.40551511 -0.56126848
[55] -0.66981088 -0.11881495 -0.37630147 -0.50361688 -0.57376409 0.48239684
[61] 0.71672106 1.20972435 0.88741964 -1.33415527 0.11808767 1.02371915
[67] -0.73633946 -1.39148506 -0.01429348 -0.10313091 0.02887144 0.78649224
[73] -0.26783936 -0.95397180 -0.17863471 1.12854113 0.87738514 1.89424527
[79] 1.03897811 0.60105957 1.24694867 -0.34222911 0.46791144 -0.33436496
[85] -0.59008786 -0.32512054 -0.47872467 0.71595218 -0.88576628 -0.35336540
[91] -1.04248131 -1.25267583 0.20095782 -0.74469019 -2.11343661 -1.52911329
[97] -0.65212392 -2.47879840 -1.61912278 0.83664028
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.315656 0.4576157 -0.03718952 0.05860803 0.9405021 1.377572 0.7047911
[2,] -0.315656 0.4576157 -0.03718952 0.05860803 0.9405021 1.377572 0.7047911
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.2255983 -1.037352 -1.275608 0.7036047 0.4330351 -0.6781169 0.3301306
[2,] 0.2255983 -1.037352 -1.275608 0.7036047 0.4330351 -0.6781169 0.3301306
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.1013708 -0.7513343 0.2851272 0.1460958 1.240617 -0.7355557 1.427303
[2,] -0.1013708 -0.7513343 0.2851272 0.1460958 1.240617 -0.7355557 1.427303
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.1379903 0.3327162 -0.05882925 -3.102104 1.241847 -0.04991791 -0.3881258
[2,] -0.1379903 0.3327162 -0.05882925 -3.102104 1.241847 -0.04991791 -0.3881258
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.83172 0.1606583 0.212093 -1.46863 -0.4571046 -0.8597551 0.6775208
[2,] 1.83172 0.1606583 0.212093 -1.46863 -0.4571046 -0.8597551 0.6775208
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.1746908 -0.1657024 0.6886923 0.6948663 -0.3259489 -0.501226 -0.1414917
[2,] 0.1746908 -0.1657024 0.6886923 0.6948663 -0.3259489 -0.501226 -0.1414917
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.1475488 -0.5930429 -1.045677 1.109544 0.560062 0.5308009 -0.9629731
[2,] -0.1475488 -0.5930429 -1.045677 1.109544 0.560062 0.5308009 -0.9629731
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.027243 -0.3880299 -2.289663 2.405515 -0.5612685 -0.6698109 -0.118815
[2,] -1.027243 -0.3880299 -2.289663 2.405515 -0.5612685 -0.6698109 -0.118815
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.3763015 -0.5036169 -0.5737641 0.4823968 0.7167211 1.209724 0.8874196
[2,] -0.3763015 -0.5036169 -0.5737641 0.4823968 0.7167211 1.209724 0.8874196
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.334155 0.1180877 1.023719 -0.7363395 -1.391485 -0.01429348 -0.1031309
[2,] -1.334155 0.1180877 1.023719 -0.7363395 -1.391485 -0.01429348 -0.1031309
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.02887144 0.7864922 -0.2678394 -0.9539718 -0.1786347 1.128541 0.8773851
[2,] 0.02887144 0.7864922 -0.2678394 -0.9539718 -0.1786347 1.128541 0.8773851
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.894245 1.038978 0.6010596 1.246949 -0.3422291 0.4679114 -0.334365
[2,] 1.894245 1.038978 0.6010596 1.246949 -0.3422291 0.4679114 -0.334365
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.5900879 -0.3251205 -0.4787247 0.7159522 -0.8857663 -0.3533654 -1.042481
[2,] -0.5900879 -0.3251205 -0.4787247 0.7159522 -0.8857663 -0.3533654 -1.042481
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.252676 0.2009578 -0.7446902 -2.113437 -1.529113 -0.6521239 -2.478798
[2,] -1.252676 0.2009578 -0.7446902 -2.113437 -1.529113 -0.6521239 -2.478798
[,99] [,100]
[1,] -1.619123 0.8366403
[2,] -1.619123 0.8366403
>
>
> Max(tmp2)
[1] 3.610398
> Min(tmp2)
[1] -1.889143
> mean(tmp2)
[1] 0.08696171
> Sum(tmp2)
[1] 8.696171
> Var(tmp2)
[1] 0.9943307
>
> rowMeans(tmp2)
[1] 0.091474755 0.355404403 0.686985895 -0.159692650 -0.890271144
[6] -1.415505987 0.862433593 0.357109763 0.976542100 1.838390293
[11] -1.889142775 0.529587664 0.775396887 1.479514381 3.610397893
[16] -0.584076153 -0.636673630 0.415288680 -1.488828350 0.620113417
[21] -0.397192228 -0.681144976 1.463673029 -0.490701495 -1.459303640
[26] -0.043033986 0.249662459 -0.701780338 0.768828747 0.017488739
[31] 1.091561572 -0.425737800 0.686145068 0.769099076 0.356875855
[36] -0.452212237 -0.046734556 1.586672355 -1.718043477 -1.434241372
[41] -1.164922019 0.665441912 0.341261945 -0.601404822 -1.382447225
[46] 1.543439984 0.806403642 0.363927857 -1.113170433 0.793432195
[51] -1.124441834 -0.156200307 -0.513815057 0.293895841 0.809003326
[56] -0.922063310 0.536679751 0.017263592 1.413839705 0.380568620
[61] 0.138392642 1.162493114 0.821296869 1.897483042 -0.712886469
[66] 0.987259613 0.567048175 -0.159363888 -1.672657546 0.100907340
[71] 0.630862784 0.994147796 -0.017048463 -1.571233482 0.258431309
[76] -1.537939040 1.216819417 1.151764523 -1.545508875 0.619556629
[81] 0.132665007 -0.945944261 -0.344552134 0.657820047 -0.226415172
[86] 0.074983954 0.281214926 -0.637849050 -0.002011386 -0.110940978
[91] 0.541600062 -0.482492761 1.300751658 -0.454714357 -1.552276101
[96] -0.616776607 0.976717826 1.648726542 -1.448925113 0.913739908
> rowSums(tmp2)
[1] 0.091474755 0.355404403 0.686985895 -0.159692650 -0.890271144
[6] -1.415505987 0.862433593 0.357109763 0.976542100 1.838390293
[11] -1.889142775 0.529587664 0.775396887 1.479514381 3.610397893
[16] -0.584076153 -0.636673630 0.415288680 -1.488828350 0.620113417
[21] -0.397192228 -0.681144976 1.463673029 -0.490701495 -1.459303640
[26] -0.043033986 0.249662459 -0.701780338 0.768828747 0.017488739
[31] 1.091561572 -0.425737800 0.686145068 0.769099076 0.356875855
[36] -0.452212237 -0.046734556 1.586672355 -1.718043477 -1.434241372
[41] -1.164922019 0.665441912 0.341261945 -0.601404822 -1.382447225
[46] 1.543439984 0.806403642 0.363927857 -1.113170433 0.793432195
[51] -1.124441834 -0.156200307 -0.513815057 0.293895841 0.809003326
[56] -0.922063310 0.536679751 0.017263592 1.413839705 0.380568620
[61] 0.138392642 1.162493114 0.821296869 1.897483042 -0.712886469
[66] 0.987259613 0.567048175 -0.159363888 -1.672657546 0.100907340
[71] 0.630862784 0.994147796 -0.017048463 -1.571233482 0.258431309
[76] -1.537939040 1.216819417 1.151764523 -1.545508875 0.619556629
[81] 0.132665007 -0.945944261 -0.344552134 0.657820047 -0.226415172
[86] 0.074983954 0.281214926 -0.637849050 -0.002011386 -0.110940978
[91] 0.541600062 -0.482492761 1.300751658 -0.454714357 -1.552276101
[96] -0.616776607 0.976717826 1.648726542 -1.448925113 0.913739908
> 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.091474755 0.355404403 0.686985895 -0.159692650 -0.890271144
[6] -1.415505987 0.862433593 0.357109763 0.976542100 1.838390293
[11] -1.889142775 0.529587664 0.775396887 1.479514381 3.610397893
[16] -0.584076153 -0.636673630 0.415288680 -1.488828350 0.620113417
[21] -0.397192228 -0.681144976 1.463673029 -0.490701495 -1.459303640
[26] -0.043033986 0.249662459 -0.701780338 0.768828747 0.017488739
[31] 1.091561572 -0.425737800 0.686145068 0.769099076 0.356875855
[36] -0.452212237 -0.046734556 1.586672355 -1.718043477 -1.434241372
[41] -1.164922019 0.665441912 0.341261945 -0.601404822 -1.382447225
[46] 1.543439984 0.806403642 0.363927857 -1.113170433 0.793432195
[51] -1.124441834 -0.156200307 -0.513815057 0.293895841 0.809003326
[56] -0.922063310 0.536679751 0.017263592 1.413839705 0.380568620
[61] 0.138392642 1.162493114 0.821296869 1.897483042 -0.712886469
[66] 0.987259613 0.567048175 -0.159363888 -1.672657546 0.100907340
[71] 0.630862784 0.994147796 -0.017048463 -1.571233482 0.258431309
[76] -1.537939040 1.216819417 1.151764523 -1.545508875 0.619556629
[81] 0.132665007 -0.945944261 -0.344552134 0.657820047 -0.226415172
[86] 0.074983954 0.281214926 -0.637849050 -0.002011386 -0.110940978
[91] 0.541600062 -0.482492761 1.300751658 -0.454714357 -1.552276101
[96] -0.616776607 0.976717826 1.648726542 -1.448925113 0.913739908
> rowMin(tmp2)
[1] 0.091474755 0.355404403 0.686985895 -0.159692650 -0.890271144
[6] -1.415505987 0.862433593 0.357109763 0.976542100 1.838390293
[11] -1.889142775 0.529587664 0.775396887 1.479514381 3.610397893
[16] -0.584076153 -0.636673630 0.415288680 -1.488828350 0.620113417
[21] -0.397192228 -0.681144976 1.463673029 -0.490701495 -1.459303640
[26] -0.043033986 0.249662459 -0.701780338 0.768828747 0.017488739
[31] 1.091561572 -0.425737800 0.686145068 0.769099076 0.356875855
[36] -0.452212237 -0.046734556 1.586672355 -1.718043477 -1.434241372
[41] -1.164922019 0.665441912 0.341261945 -0.601404822 -1.382447225
[46] 1.543439984 0.806403642 0.363927857 -1.113170433 0.793432195
[51] -1.124441834 -0.156200307 -0.513815057 0.293895841 0.809003326
[56] -0.922063310 0.536679751 0.017263592 1.413839705 0.380568620
[61] 0.138392642 1.162493114 0.821296869 1.897483042 -0.712886469
[66] 0.987259613 0.567048175 -0.159363888 -1.672657546 0.100907340
[71] 0.630862784 0.994147796 -0.017048463 -1.571233482 0.258431309
[76] -1.537939040 1.216819417 1.151764523 -1.545508875 0.619556629
[81] 0.132665007 -0.945944261 -0.344552134 0.657820047 -0.226415172
[86] 0.074983954 0.281214926 -0.637849050 -0.002011386 -0.110940978
[91] 0.541600062 -0.482492761 1.300751658 -0.454714357 -1.552276101
[96] -0.616776607 0.976717826 1.648726542 -1.448925113 0.913739908
>
> colMeans(tmp2)
[1] 0.08696171
> colSums(tmp2)
[1] 8.696171
> colVars(tmp2)
[1] 0.9943307
> colSd(tmp2)
[1] 0.9971613
> colMax(tmp2)
[1] 3.610398
> colMin(tmp2)
[1] -1.889143
> colMedians(tmp2)
[1] 0.1355288
> colRanges(tmp2)
[,1]
[1,] -1.889143
[2,] 3.610398
>
> 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] -3.5789811 -8.9710480 -5.5290064 2.3931834 -2.9171751 0.3161476
[7] -2.4493233 -5.7958591 5.5944828 -3.4259555
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1523040
[2,] -0.9591263
[3,] -0.7924500
[4,] 0.3365988
[5,] 0.9643242
>
> rowApply(tmp,sum)
[1] -2.17750574 -1.65880690 -3.44748561 -0.55528212 -5.90270739 -2.99732937
[7] -1.10081452 -2.37432004 -4.23091865 0.08163566
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 8 3 3 3 8 2 4 6 7
[2,] 1 2 8 2 7 7 3 3 1 3
[3,] 3 10 4 4 5 9 1 2 2 5
[4,] 4 6 9 5 8 2 7 8 9 9
[5,] 2 1 6 9 4 3 10 9 7 4
[6,] 5 9 10 10 9 4 4 1 8 8
[7,] 6 3 1 8 6 5 9 5 4 10
[8,] 8 7 2 1 1 1 6 6 5 1
[9,] 10 4 7 6 10 10 8 10 10 6
[10,] 7 5 5 7 2 6 5 7 3 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.42755966 -1.53001772 -2.17611408 -0.05428251 1.53240017 -4.62711707
[7] -1.71772517 -1.03149517 -4.30969093 -1.30532877 -2.45125760 2.54351499
[13] 0.72674619 0.13449975 -0.50336314 -2.83175631 -0.98692644 -0.88046887
[19] -2.93751569 -3.88571085
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4340738
[2,] -0.8171198
[3,] -0.3406143
[4,] 0.1993053
[5,] 0.9649429
>
> rowApply(tmp,sum)
[1] -6.259434 -8.762685 -7.363750 -1.816352 -3.516948
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 15 4 17 10
[2,] 10 3 14 10 13
[3,] 4 8 6 18 12
[4,] 17 18 8 15 1
[5,] 11 19 17 14 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.8171198 0.004142077 -1.1150303 0.5412376 0.005899753 -2.3678360
[2,] 0.1993053 -1.593210935 -1.0129430 0.4162948 1.002557463 -1.5134306
[3,] -1.4340738 0.130469218 -0.9057715 -0.3394620 0.573804241 0.8924154
[4,] 0.9649429 -0.106199031 1.1083141 0.5748231 0.349923840 -0.9120194
[5,] -0.3406143 0.034780951 -0.2506834 -1.2471761 -0.399785127 -0.7262464
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.3413506 -2.393012309 1.3451037 0.2497880 0.4600644 2.03964094
[2,] 0.1215602 0.001708757 -2.5308550 -1.4344609 -0.5068066 0.22114252
[3,] -0.1424581 -1.627300000 -1.4212720 0.2163577 0.2105393 0.01462355
[4,] -2.1063198 1.112642896 -1.2907245 0.3433002 -3.1800298 -0.16229085
[5,] 0.7508431 1.874465486 -0.4119431 -0.6803137 0.5649751 0.43039884
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.7080786 0.18976174 -1.09998107 -0.4058164 0.2253056 -0.6887420
[2,] -1.2185552 0.08911879 -0.03600781 -2.2784631 0.1837011 1.8439964
[3,] 2.0547875 -0.17193838 -1.60040443 0.7123952 -0.1897631 -0.7645671
[4,] -0.3560603 -0.10087585 2.06653455 -0.5326150 -0.2907975 -0.2134662
[5,] -0.4615044 0.12843345 0.16649563 -0.3272570 -0.9153725 -1.0576899
[,19] [,20]
[1,] 0.1317403 -2.931308019
[2,] 0.3800612 -1.097398899
[3,] -3.4566890 -0.115442334
[4,] 0.9099841 0.004581094
[5,] -0.9026122 0.253857313
>
>
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 561 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -1.789387 0.7421983 -0.3462697 -0.7458131 0.04973629 -1.141928 0.1545424
col8 col9 col10 col11 col12 col13 col14
row1 0.5568238 -0.5015344 -1.273656 2.10287 1.346177 0.5390292 0.1632895
col15 col16 col17 col18 col19 col20
row1 0.7401637 0.4501622 -0.8110331 0.4941988 -1.555902 0.4290574
> tmp[,"col10"]
col10
row1 -1.273655850
row2 -0.581335684
row3 0.801187876
row4 0.390569805
row5 0.008803217
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -1.789387 0.7421983 -0.3462697 -0.7458131 0.04973629 -1.14192773 0.1545424
row5 1.622317 0.4272135 -0.1910982 0.6806470 0.33698622 0.04371118 0.8152757
col8 col9 col10 col11 col12 col13
row1 0.5568238 -0.5015344 -1.273655850 2.10286992 1.3461765 0.5390292
row5 0.6678452 -0.6578411 0.008803217 -0.06321493 0.6474388 2.1533033
col14 col15 col16 col17 col18 col19 col20
row1 0.1632895 0.7401637 0.4501622 -0.8110331 0.4941988 -1.555902 0.4290574
row5 0.6804081 -0.3117101 -0.9363060 1.5254020 1.3082054 -1.013511 -0.3530156
> tmp[,c("col6","col20")]
col6 col20
row1 -1.14192773 0.4290574
row2 -1.16742686 -0.9268756
row3 2.34395608 -0.5796772
row4 2.25833920 0.7361871
row5 0.04371118 -0.3530156
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.14192773 0.4290574
row5 0.04371118 -0.3530156
>
>
>
>
> 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.98655 50.81524 48.32011 51.68348 48.64323 104.8558 50.53289 47.54093
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41496 49.52779 51.32985 52.36915 49.92174 51.24502 50.17163 51.01345
col17 col18 col19 col20
row1 51.25 49.00978 50.47611 105.6324
> tmp[,"col10"]
col10
row1 49.52779
row2 28.53290
row3 29.46708
row4 30.58249
row5 49.81856
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.98655 50.81524 48.32011 51.68348 48.64323 104.8558 50.53289 47.54093
row5 49.26079 49.36999 50.32618 51.50254 48.96970 104.8406 49.38083 50.33489
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41496 49.52779 51.32985 52.36915 49.92174 51.24502 50.17163 51.01345
row5 51.43761 49.81856 50.66470 49.10757 47.34399 50.51160 51.11693 50.57015
col17 col18 col19 col20
row1 51.25000 49.00978 50.47611 105.6324
row5 49.93558 50.25069 49.53340 105.6124
> tmp[,c("col6","col20")]
col6 col20
row1 104.85584 105.63237
row2 74.65871 74.84877
row3 75.45007 74.17587
row4 73.62442 74.21217
row5 104.84061 105.61237
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.8558 105.6324
row5 104.8406 105.6124
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.8558 105.6324
row5 104.8406 105.6124
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.5799362
[2,] 0.1514108
[3,] -0.4926836
[4,] 0.1183229
[5,] 0.3067414
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.4440021 0.9854558
[2,] 1.1341263 -0.3370042
[3,] -1.0667332 0.3459246
[4,] -1.1421860 -0.8218847
[5,] -0.1244951 -2.6715408
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.2067817 -0.3448362
[2,] 1.1306980 1.3573936
[3,] -1.5388047 -0.1740354
[4,] 0.2048820 -0.1809327
[5,] 0.1975081 -1.3061139
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.2067817
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.2067817
[2,] 1.1306980
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.3730287 -2.304879 0.2895689 -0.9964212 -0.7172006 -0.006899709
row1 1.6958446 0.675390 -0.5907249 -0.1174894 0.6979693 -1.050287256
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.23664441 1.6776487 -0.3001488 0.4635228 -0.01852827 -0.4458641
row1 -0.01122373 0.7644419 -0.5244532 -0.5225188 1.60881483 2.8984342
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -0.2032802 -0.8450445 -0.8276558 0.05205667 -0.1077175 0.4931186
row1 1.0563431 -0.6730495 -1.5232573 0.33630525 2.2539580 0.9411403
[,19] [,20]
row3 0.4756364 0.8167669
row1 -0.1771942 1.0394075
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.007362 1.191318 -0.4231617 0.0786174 0.8732434 0.8579652 -0.07314863
[,8] [,9] [,10]
row2 1.015552 1.64368 -0.5030894
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.769752 1.331883 1.211755 -0.1919472 2.396388 0.4253523 -1.045713
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.5073033 0.5672611 0.7727841 0.3316247 2.449178 0.6051327 1.602306
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.320331 0.8925206 -0.6143023 0.3654283 0.4455747 -1.538466
>
>
> 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: 0x600003dcc000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d384aeea3"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d3f792c34"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d2c452a7a"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d70e7c64a"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d8b5e2f"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d3dd45ff0"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d41e6a546"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7dd6cb877"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d5cc29383"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d6a62ad08"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d744e1ec8"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d34c7181f"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d7b00b64a"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d6bbff35c"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8d7d7025448"
>
>
> ### 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: 0x600003d0c0c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003d0c0c0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003d0c0c0>
> rowMedians(tmp)
[1] 0.247171370 0.055712516 -0.391946140 -0.025963224 -0.087612832
[6] 0.756588139 0.590361691 0.238914681 0.349769940 0.299636877
[11] 0.023861677 0.120433434 0.666037139 -0.501450527 -0.027623197
[16] 0.082308751 -0.432231066 -0.018899173 0.329426024 -0.005236868
[21] -0.241092305 0.020791036 0.331672491 -0.632303239 -0.169087085
[26] -0.011621176 0.011561775 0.050896130 -0.187063482 0.015205729
[31] 0.139008223 0.071509026 0.353686474 0.271258431 0.011150941
[36] 0.118592047 -0.323064776 -0.118563452 0.225988194 -0.072912617
[41] 0.191831536 -0.445058741 -0.194677587 -0.028543935 -0.417805924
[46] -0.406070696 0.148964309 -0.133429073 -0.447502271 -0.159355452
[51] -0.763681387 -0.194006846 -0.116691495 0.005451798 -0.039139930
[56] 0.492403282 -0.018981255 -0.157994566 -0.103635204 -0.117291278
[61] 0.039045889 -0.087779301 0.125567676 0.303312141 0.035501830
[66] -0.013494734 -0.204200304 -0.022892364 -1.032752015 0.042091380
[71] -0.363922452 -0.168727216 0.125042482 0.526858509 0.338607845
[76] 0.043653270 0.450794822 0.011679528 0.506589067 -0.477435309
[81] -0.316498009 0.165346745 0.107731272 -0.471240269 0.622793533
[86] 0.540990909 -0.278418801 0.494137198 -0.263589952 -0.601264779
[91] 0.094907950 0.019875185 -0.284449645 0.069935465 -0.325645697
[96] -0.299792089 -0.551865188 0.264851886 -0.310632200 -0.972887559
[101] -0.717728221 -0.466168033 -0.385688731 -0.027828374 0.051798132
[106] 0.021672081 -0.200645656 0.222103188 -0.130787519 -0.085073856
[111] -0.278970781 -0.473118459 0.182553346 -0.135471345 0.041653165
[116] 0.280720259 -0.090352776 -0.216335000 0.302173558 0.177948128
[121] -0.230763226 -0.083876317 0.120103468 -0.476493850 -0.124591459
[126] 0.306510631 0.288880728 0.302120149 -0.050717801 0.673132636
[131] 0.429539416 0.763636330 -0.169548518 0.691475182 -0.174810106
[136] 0.343994381 0.097021783 -0.083933485 -0.205249167 -0.442585186
[141] 0.180420898 -0.171691395 0.219458841 0.005692936 0.141390472
[146] -0.132394623 0.351532260 -0.120465381 0.627874022 0.484755726
[151] 0.107740816 0.316874510 0.422586134 -0.042817097 -0.364423791
[156] -0.422261922 -0.035167242 -0.142119578 0.207551426 0.049964894
[161] -0.546741424 -0.265004255 0.245846316 0.032808091 -0.051818823
[166] 0.199009269 -0.120343475 0.143889923 -0.033074036 -0.039476211
[171] 0.415785155 -0.108424892 0.249717921 -0.176010264 -0.018578032
[176] 0.667485331 0.011911688 0.251608220 -0.257678939 0.211634104
[181] -0.188757960 0.182809666 -0.405947012 -0.138794104 0.098360870
[186] 0.819933851 0.371233875 0.031881149 -0.829282170 0.587241164
[191] -0.340168162 -0.022930934 -0.066202261 0.177130899 -0.155647332
[196] -0.235539056 0.421224764 0.226627016 0.217475344 0.328205679
[201] -0.207326841 -0.287555775 -0.318670831 0.095673147 0.060414869
[206] -0.092832989 0.081443643 0.515994928 -0.537246428 -0.425239270
[211] 0.796402148 -0.136574648 -0.162936250 -0.734928181 0.534816213
[216] -0.014967852 -0.317632119 0.264694885 0.302095127 -0.411362087
[221] -0.085223550 -0.180178443 0.127575892 -0.007438688 -0.049446637
[226] 0.289769198 -0.176326676 -0.593764601 -0.246954279 -0.129488471
>
> proc.time()
user system elapsed
2.471 14.098 17.024
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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: 0x600000444000>
> .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: 0x600000444000>
> .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: 0x600000444000>
> .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: 0x600000444000>
> 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: 0x60000040c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000040c000>
> .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: 0x60000040c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000040c000>
> .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: 0x60000040c000>
> 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: 0x60000040c180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000040c180>
> .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: 0x60000040c180>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000040c180>
> .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: 0x60000040c180>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x60000040c180>
> .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: 0x60000040c180>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x60000040c180>
> .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: 0x60000040c180>
> 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: 0x60000040c360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60000040c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000040c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000040c360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile90de25b0fbf1" "BufferedMatrixFile90de7c241833"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile90de25b0fbf1" "BufferedMatrixFile90de7c241833"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000404000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000404000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000404000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000404000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000404000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000404000>
> .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: 0x60000041c060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000041c060>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000041c060>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000041c060>
> 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: 0x600000474000>
> .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: 0x600000474000>
> rm(P)
>
> proc.time()
user system elapsed
0.312 0.140 0.440
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.315 0.085 0.397