| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-19 10:14 -0500 (Wed, 19 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" | 4827 |
| lconway | macOS 12.7.6 Monterey | x86_64 | R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" | 4600 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4564 |
| 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 | |||||||||
| 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.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-18 18:57:44 -0500 (Tue, 18 Nov 2025) |
| EndedAt: 2025-11-18 18:58:04 -0500 (Tue, 18 Nov 2025) |
| EllapsedTime: 20.3 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.142 0.070 0.212
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] "Tue Nov 18 18:57:55 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] "Tue Nov 18 18:57:55 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: 0x6000000e8360>
>
>
>
> 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] "Tue Nov 18 18:57:56 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] "Tue Nov 18 18:57:57 2025"
>
> ColMode(tmp2)
<pointer: 0x6000000e8360>
>
>
>
> ### 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,] 101.6950812 1.73316036 0.1387626 -1.20220525
[2,] 1.0186275 1.95625716 0.2416758 0.09033101
[3,] 0.5723744 0.89270491 -0.2390751 0.68590695
[4,] 1.2366143 0.09843718 -0.4248639 0.85721818
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.6950812 1.73316036 0.1387626 1.20220525
[2,] 1.0186275 1.95625716 0.2416758 0.09033101
[3,] 0.5723744 0.89270491 0.2390751 0.68590695
[4,] 1.2366143 0.09843718 0.4248639 0.85721818
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0843979 1.3164955 0.3725085 1.0964512
[2,] 1.0092708 1.3986626 0.4916054 0.3005512
[3,] 0.7565543 0.9448306 0.4889531 0.8281950
[4,] 1.1120316 0.3137470 0.6518158 0.9258608
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 227.53906 39.89812 28.86385 37.16672
[2,] 36.11134 40.94288 30.15773 28.09584
[3,] 33.13792 35.34101 30.12861 33.96786
[4,] 37.35693 28.23591 31.94302 35.11583
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000000ec480>
> exp(tmp5)
<pointer: 0x6000000ec480>
> log(tmp5,2)
<pointer: 0x6000000ec480>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.5927
> Min(tmp5)
[1] 54.63163
> mean(tmp5)
[1] 72.62233
> Sum(tmp5)
[1] 14524.47
> Var(tmp5)
[1] 895.7411
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.17490 70.21072 68.45320 71.13455 73.88046 68.59467 73.69894 68.83019
[9] 68.42236 69.82329
> rowSums(tmp5)
[1] 1863.498 1404.214 1369.064 1422.691 1477.609 1371.893 1473.979 1376.604
[9] 1368.447 1396.466
> rowVars(tmp5)
[1] 8091.63636 68.91685 46.82033 116.56732 103.52554 78.76475
[7] 61.86001 90.28469 95.94285 94.08796
> rowSd(tmp5)
[1] 89.953523 8.301617 6.842538 10.796634 10.174750 8.874951 7.865113
[8] 9.501826 9.795042 9.699895
> rowMax(tmp5)
[1] 473.59274 85.21725 82.67028 95.24620 92.34479 91.91090 90.02645
[8] 88.88144 94.97469 85.93934
> rowMin(tmp5)
[1] 54.71944 57.64493 56.12161 55.97102 54.63163 54.96693 57.52171 55.33173
[9] 54.91532 55.64082
>
> colMeans(tmp5)
[1] 112.32932 73.40902 64.54921 69.17140 69.34764 72.23020 68.94506
[8] 68.76157 68.88186 67.25385 72.20824 71.46734 72.01864 71.26821
[15] 75.15551 67.72808 70.34946 71.15920 71.63626 74.57653
> colSums(tmp5)
[1] 1123.2932 734.0902 645.4921 691.7140 693.4764 722.3020 689.4506
[8] 687.6157 688.8186 672.5385 722.0824 714.6734 720.1864 712.6821
[15] 751.5551 677.2808 703.4946 711.5920 716.3626 745.7653
> colVars(tmp5)
[1] 16158.47061 118.19798 28.93463 35.10525 49.73766 58.11702
[7] 95.53332 130.31885 81.62777 58.66568 77.57900 123.62328
[13] 61.18201 125.64224 70.32627 129.97833 113.08111 116.06778
[19] 32.76472 160.16920
> colSd(tmp5)
[1] 127.115973 10.871889 5.379092 5.924969 7.052493 7.623452
[7] 9.774115 11.415728 9.034809 7.659353 8.807894 11.118601
[13] 7.821893 11.209025 8.386076 11.400804 10.633960 10.773476
[19] 5.724047 12.655797
> colMax(tmp5)
[1] 473.59274 92.34479 72.34048 77.35765 79.60589 83.97121 86.01325
[8] 83.77064 85.79714 78.41954 84.24114 91.26935 83.86398 95.24620
[15] 85.37092 90.02645 88.88144 88.02864 85.93934 94.97469
> colMin(tmp5)
[1] 61.65101 58.76934 57.07688 58.47782 60.68309 62.97635 54.63163 55.33173
[9] 56.75389 56.93865 62.07918 55.49150 58.65113 58.56358 58.97753 54.96693
[17] 54.91532 55.64082 66.03841 54.71944
>
>
> ### 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] 93.17490 70.21072 68.45320 71.13455 NA 68.59467 73.69894 68.83019
[9] 68.42236 69.82329
> rowSums(tmp5)
[1] 1863.498 1404.214 1369.064 1422.691 NA 1371.893 1473.979 1376.604
[9] 1368.447 1396.466
> rowVars(tmp5)
[1] 8091.63636 68.91685 46.82033 116.56732 108.37470 78.76475
[7] 61.86001 90.28469 95.94285 94.08796
> rowSd(tmp5)
[1] 89.953523 8.301617 6.842538 10.796634 10.410317 8.874951 7.865113
[8] 9.501826 9.795042 9.699895
> rowMax(tmp5)
[1] 473.59274 85.21725 82.67028 95.24620 NA 91.91090 90.02645
[8] 88.88144 94.97469 85.93934
> rowMin(tmp5)
[1] 54.71944 57.64493 56.12161 55.97102 NA 54.96693 57.52171 55.33173
[9] 54.91532 55.64082
>
> colMeans(tmp5)
[1] 112.32932 73.40902 64.54921 69.17140 69.34764 72.23020 68.94506
[8] 68.76157 68.88186 67.25385 72.20824 71.46734 72.01864 71.26821
[15] 75.15551 67.72808 70.34946 71.15920 NA 74.57653
> colSums(tmp5)
[1] 1123.2932 734.0902 645.4921 691.7140 693.4764 722.3020 689.4506
[8] 687.6157 688.8186 672.5385 722.0824 714.6734 720.1864 712.6821
[15] 751.5551 677.2808 703.4946 711.5920 NA 745.7653
> colVars(tmp5)
[1] 16158.47061 118.19798 28.93463 35.10525 49.73766 58.11702
[7] 95.53332 130.31885 81.62777 58.66568 77.57900 123.62328
[13] 61.18201 125.64224 70.32627 129.97833 113.08111 116.06778
[19] NA 160.16920
> colSd(tmp5)
[1] 127.115973 10.871889 5.379092 5.924969 7.052493 7.623452
[7] 9.774115 11.415728 9.034809 7.659353 8.807894 11.118601
[13] 7.821893 11.209025 8.386076 11.400804 10.633960 10.773476
[19] NA 12.655797
> colMax(tmp5)
[1] 473.59274 92.34479 72.34048 77.35765 79.60589 83.97121 86.01325
[8] 83.77064 85.79714 78.41954 84.24114 91.26935 83.86398 95.24620
[15] 85.37092 90.02645 88.88144 88.02864 NA 94.97469
> colMin(tmp5)
[1] 61.65101 58.76934 57.07688 58.47782 60.68309 62.97635 54.63163 55.33173
[9] 56.75389 56.93865 62.07918 55.49150 58.65113 58.56358 58.97753 54.96693
[17] 54.91532 55.64082 NA 54.71944
>
> Max(tmp5,na.rm=TRUE)
[1] 473.5927
> Min(tmp5,na.rm=TRUE)
[1] 54.63163
> mean(tmp5,na.rm=TRUE)
[1] 72.63575
> Sum(tmp5,na.rm=TRUE)
[1] 14454.51
> Var(tmp5,na.rm=TRUE)
[1] 900.2289
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.17490 70.21072 68.45320 71.13455 74.08719 68.59467 73.69894 68.83019
[9] 68.42236 69.82329
> rowSums(tmp5,na.rm=TRUE)
[1] 1863.498 1404.214 1369.064 1422.691 1407.657 1371.893 1473.979 1376.604
[9] 1368.447 1396.466
> rowVars(tmp5,na.rm=TRUE)
[1] 8091.63636 68.91685 46.82033 116.56732 108.37470 78.76475
[7] 61.86001 90.28469 95.94285 94.08796
> rowSd(tmp5,na.rm=TRUE)
[1] 89.953523 8.301617 6.842538 10.796634 10.410317 8.874951 7.865113
[8] 9.501826 9.795042 9.699895
> rowMax(tmp5,na.rm=TRUE)
[1] 473.59274 85.21725 82.67028 95.24620 92.34479 91.91090 90.02645
[8] 88.88144 94.97469 85.93934
> rowMin(tmp5,na.rm=TRUE)
[1] 54.71944 57.64493 56.12161 55.97102 54.63163 54.96693 57.52171 55.33173
[9] 54.91532 55.64082
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.32932 73.40902 64.54921 69.17140 69.34764 72.23020 68.94506
[8] 68.76157 68.88186 67.25385 72.20824 71.46734 72.01864 71.26821
[15] 75.15551 67.72808 70.34946 71.15920 71.82335 74.57653
> colSums(tmp5,na.rm=TRUE)
[1] 1123.2932 734.0902 645.4921 691.7140 693.4764 722.3020 689.4506
[8] 687.6157 688.8186 672.5385 722.0824 714.6734 720.1864 712.6821
[15] 751.5551 677.2808 703.4946 711.5920 646.4101 745.7653
> colVars(tmp5,na.rm=TRUE)
[1] 16158.47061 118.19798 28.93463 35.10525 49.73766 58.11702
[7] 95.53332 130.31885 81.62777 58.66568 77.57900 123.62328
[13] 61.18201 125.64224 70.32627 129.97833 113.08111 116.06778
[19] 36.46657 160.16920
> colSd(tmp5,na.rm=TRUE)
[1] 127.115973 10.871889 5.379092 5.924969 7.052493 7.623452
[7] 9.774115 11.415728 9.034809 7.659353 8.807894 11.118601
[13] 7.821893 11.209025 8.386076 11.400804 10.633960 10.773476
[19] 6.038755 12.655797
> colMax(tmp5,na.rm=TRUE)
[1] 473.59274 92.34479 72.34048 77.35765 79.60589 83.97121 86.01325
[8] 83.77064 85.79714 78.41954 84.24114 91.26935 83.86398 95.24620
[15] 85.37092 90.02645 88.88144 88.02864 85.93934 94.97469
> colMin(tmp5,na.rm=TRUE)
[1] 61.65101 58.76934 57.07688 58.47782 60.68309 62.97635 54.63163 55.33173
[9] 56.75389 56.93865 62.07918 55.49150 58.65113 58.56358 58.97753 54.96693
[17] 54.91532 55.64082 66.03841 54.71944
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.17490 70.21072 68.45320 71.13455 NaN 68.59467 73.69894 68.83019
[9] 68.42236 69.82329
> rowSums(tmp5,na.rm=TRUE)
[1] 1863.498 1404.214 1369.064 1422.691 0.000 1371.893 1473.979 1376.604
[9] 1368.447 1396.466
> rowVars(tmp5,na.rm=TRUE)
[1] 8091.63636 68.91685 46.82033 116.56732 NA 78.76475
[7] 61.86001 90.28469 95.94285 94.08796
> rowSd(tmp5,na.rm=TRUE)
[1] 89.953523 8.301617 6.842538 10.796634 NA 8.874951 7.865113
[8] 9.501826 9.795042 9.699895
> rowMax(tmp5,na.rm=TRUE)
[1] 473.59274 85.21725 82.67028 95.24620 NA 91.91090 90.02645
[8] 88.88144 94.97469 85.93934
> rowMin(tmp5,na.rm=TRUE)
[1] 54.71944 57.64493 56.12161 55.97102 NA 54.96693 57.52171 55.33173
[9] 54.91532 55.64082
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.69969 71.30504 64.32306 70.05874 68.24566 72.28728 70.53544
[8] 69.87549 68.46929 66.01321 70.87126 69.26712 70.94858 71.60398
[15] 75.52913 66.64449 69.92332 70.30334 NaN 75.92328
> colSums(tmp5,na.rm=TRUE)
[1] 1041.2972 641.7454 578.9075 630.5287 614.2109 650.5855 634.8189
[8] 628.8794 616.2237 594.1189 637.8413 623.4041 638.5372 644.4359
[15] 679.7622 599.8004 629.3099 632.7300 0.0000 683.3095
> colVars(tmp5,na.rm=TRUE)
[1] 18050.48630 83.17222 31.97607 30.63542 42.29329 65.34499
[7] 79.02024 132.64937 89.91642 48.68325 67.16657 84.61515
[13] 55.94810 140.07911 77.54659 133.01624 125.17330 122.33556
[19] NA 159.78581
> colSd(tmp5,na.rm=TRUE)
[1] 134.352098 9.119881 5.654739 5.534928 6.503329 8.083625
[7] 8.889333 11.517351 9.482427 6.977338 8.195521 9.198649
[13] 7.479846 11.835502 8.806054 11.533267 11.188088 11.060541
[19] NA 12.640641
> colMax(tmp5,na.rm=TRUE)
[1] 473.59274 85.21725 72.34048 77.35765 79.60589 83.97121 86.01325
[8] 83.77064 85.79714 76.19832 82.70091 82.67028 83.86398 95.24620
[15] 85.37092 90.02645 88.88144 88.02864 -Inf 94.97469
> colMin(tmp5,na.rm=TRUE)
[1] 61.65101 58.76934 57.07688 58.47782 60.68309 62.97635 55.97102 55.33173
[9] 56.75389 56.93865 62.07918 55.49150 58.65113 58.56358 58.97753 54.96693
[17] 54.91532 55.64082 Inf 54.71944
>
>
>
>
> 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] 159.6278 169.0889 206.2944 285.9162 162.0465 101.0313 177.2122 297.3145
[9] 126.1871 388.4472
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 159.6278 169.0889 206.2944 285.9162 162.0465 101.0313 177.2122 297.3145
[9] 126.1871 388.4472
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -1.421085e-13 -1.421085e-14 -5.684342e-14 5.684342e-14 -1.136868e-13
[6] 9.947598e-14 1.705303e-13 -1.136868e-13 0.000000e+00 -5.684342e-14
[11] -8.526513e-14 5.684342e-14 7.105427e-14 9.947598e-14 2.842171e-14
[16] 0.000000e+00 1.136868e-13 5.684342e-14 5.684342e-14 -2.842171e-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)
+ }
1 17
2 1
10 6
10 3
2 14
6 16
5 19
6 6
4 3
4 15
5 4
8 15
6 16
9 6
6 1
2 12
6 4
7 18
10 8
10 5
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.442567
> Min(tmp)
[1] -2.151773
> mean(tmp)
[1] -0.04062855
> Sum(tmp)
[1] -4.062855
> Var(tmp)
[1] 1.004726
>
> rowMeans(tmp)
[1] -0.04062855
> rowSums(tmp)
[1] -4.062855
> rowVars(tmp)
[1] 1.004726
> rowSd(tmp)
[1] 1.00236
> rowMax(tmp)
[1] 2.442567
> rowMin(tmp)
[1] -2.151773
>
> colMeans(tmp)
[1] -1.145046788 -2.059648744 0.170744490 0.667224786 0.746210815
[6] -0.231460485 -0.433076493 -0.615174129 -0.426450886 0.359136384
[11] -0.443183400 1.668039457 -0.862146812 0.994475663 2.060426051
[16] -0.755552344 -0.010478020 0.078359979 0.295140432 -0.105698253
[21] 0.235572279 0.070920617 0.152637630 0.364775621 -0.127067263
[26] 0.948366458 -0.603868902 0.494274159 -1.114366672 -0.317280832
[31] 0.661269968 -0.556179878 0.060268633 0.622374459 -0.808483708
[36] -0.951899301 -0.134764152 0.625712942 -1.583918574 0.735519840
[41] 0.525880457 -1.285364345 -1.393732599 -1.449020500 -0.481324786
[46] 0.589509002 -1.937588764 -1.008504600 0.450370733 0.507398134
[51] -0.450361075 2.442567414 -0.906208852 -0.653734415 1.351374573
[56] 0.822241399 1.407687948 0.120455575 -0.211444677 -0.413349008
[61] -1.211083573 -1.849626761 -1.000473764 0.664007917 1.813386778
[66] 0.830226209 -1.204319887 0.130902815 0.218584865 0.694501049
[71] -0.466953770 -0.648967902 -1.327575222 -1.176173873 -1.018702673
[76] 0.993985813 -0.316275796 0.498335004 1.166346019 0.856131069
[81] -1.563952225 1.935205239 2.158259549 0.654674851 -0.606584529
[86] -1.471129613 -0.479587722 0.855748266 -0.617552634 -2.151773271
[91] -1.730098353 0.002855817 0.534990201 0.719528430 1.142944608
[96] 0.687898195 -0.809351309 1.011395489 -0.051935336 1.316798361
> colSums(tmp)
[1] -1.145046788 -2.059648744 0.170744490 0.667224786 0.746210815
[6] -0.231460485 -0.433076493 -0.615174129 -0.426450886 0.359136384
[11] -0.443183400 1.668039457 -0.862146812 0.994475663 2.060426051
[16] -0.755552344 -0.010478020 0.078359979 0.295140432 -0.105698253
[21] 0.235572279 0.070920617 0.152637630 0.364775621 -0.127067263
[26] 0.948366458 -0.603868902 0.494274159 -1.114366672 -0.317280832
[31] 0.661269968 -0.556179878 0.060268633 0.622374459 -0.808483708
[36] -0.951899301 -0.134764152 0.625712942 -1.583918574 0.735519840
[41] 0.525880457 -1.285364345 -1.393732599 -1.449020500 -0.481324786
[46] 0.589509002 -1.937588764 -1.008504600 0.450370733 0.507398134
[51] -0.450361075 2.442567414 -0.906208852 -0.653734415 1.351374573
[56] 0.822241399 1.407687948 0.120455575 -0.211444677 -0.413349008
[61] -1.211083573 -1.849626761 -1.000473764 0.664007917 1.813386778
[66] 0.830226209 -1.204319887 0.130902815 0.218584865 0.694501049
[71] -0.466953770 -0.648967902 -1.327575222 -1.176173873 -1.018702673
[76] 0.993985813 -0.316275796 0.498335004 1.166346019 0.856131069
[81] -1.563952225 1.935205239 2.158259549 0.654674851 -0.606584529
[86] -1.471129613 -0.479587722 0.855748266 -0.617552634 -2.151773271
[91] -1.730098353 0.002855817 0.534990201 0.719528430 1.142944608
[96] 0.687898195 -0.809351309 1.011395489 -0.051935336 1.316798361
> 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] -1.145046788 -2.059648744 0.170744490 0.667224786 0.746210815
[6] -0.231460485 -0.433076493 -0.615174129 -0.426450886 0.359136384
[11] -0.443183400 1.668039457 -0.862146812 0.994475663 2.060426051
[16] -0.755552344 -0.010478020 0.078359979 0.295140432 -0.105698253
[21] 0.235572279 0.070920617 0.152637630 0.364775621 -0.127067263
[26] 0.948366458 -0.603868902 0.494274159 -1.114366672 -0.317280832
[31] 0.661269968 -0.556179878 0.060268633 0.622374459 -0.808483708
[36] -0.951899301 -0.134764152 0.625712942 -1.583918574 0.735519840
[41] 0.525880457 -1.285364345 -1.393732599 -1.449020500 -0.481324786
[46] 0.589509002 -1.937588764 -1.008504600 0.450370733 0.507398134
[51] -0.450361075 2.442567414 -0.906208852 -0.653734415 1.351374573
[56] 0.822241399 1.407687948 0.120455575 -0.211444677 -0.413349008
[61] -1.211083573 -1.849626761 -1.000473764 0.664007917 1.813386778
[66] 0.830226209 -1.204319887 0.130902815 0.218584865 0.694501049
[71] -0.466953770 -0.648967902 -1.327575222 -1.176173873 -1.018702673
[76] 0.993985813 -0.316275796 0.498335004 1.166346019 0.856131069
[81] -1.563952225 1.935205239 2.158259549 0.654674851 -0.606584529
[86] -1.471129613 -0.479587722 0.855748266 -0.617552634 -2.151773271
[91] -1.730098353 0.002855817 0.534990201 0.719528430 1.142944608
[96] 0.687898195 -0.809351309 1.011395489 -0.051935336 1.316798361
> colMin(tmp)
[1] -1.145046788 -2.059648744 0.170744490 0.667224786 0.746210815
[6] -0.231460485 -0.433076493 -0.615174129 -0.426450886 0.359136384
[11] -0.443183400 1.668039457 -0.862146812 0.994475663 2.060426051
[16] -0.755552344 -0.010478020 0.078359979 0.295140432 -0.105698253
[21] 0.235572279 0.070920617 0.152637630 0.364775621 -0.127067263
[26] 0.948366458 -0.603868902 0.494274159 -1.114366672 -0.317280832
[31] 0.661269968 -0.556179878 0.060268633 0.622374459 -0.808483708
[36] -0.951899301 -0.134764152 0.625712942 -1.583918574 0.735519840
[41] 0.525880457 -1.285364345 -1.393732599 -1.449020500 -0.481324786
[46] 0.589509002 -1.937588764 -1.008504600 0.450370733 0.507398134
[51] -0.450361075 2.442567414 -0.906208852 -0.653734415 1.351374573
[56] 0.822241399 1.407687948 0.120455575 -0.211444677 -0.413349008
[61] -1.211083573 -1.849626761 -1.000473764 0.664007917 1.813386778
[66] 0.830226209 -1.204319887 0.130902815 0.218584865 0.694501049
[71] -0.466953770 -0.648967902 -1.327575222 -1.176173873 -1.018702673
[76] 0.993985813 -0.316275796 0.498335004 1.166346019 0.856131069
[81] -1.563952225 1.935205239 2.158259549 0.654674851 -0.606584529
[86] -1.471129613 -0.479587722 0.855748266 -0.617552634 -2.151773271
[91] -1.730098353 0.002855817 0.534990201 0.719528430 1.142944608
[96] 0.687898195 -0.809351309 1.011395489 -0.051935336 1.316798361
> colMedians(tmp)
[1] -1.145046788 -2.059648744 0.170744490 0.667224786 0.746210815
[6] -0.231460485 -0.433076493 -0.615174129 -0.426450886 0.359136384
[11] -0.443183400 1.668039457 -0.862146812 0.994475663 2.060426051
[16] -0.755552344 -0.010478020 0.078359979 0.295140432 -0.105698253
[21] 0.235572279 0.070920617 0.152637630 0.364775621 -0.127067263
[26] 0.948366458 -0.603868902 0.494274159 -1.114366672 -0.317280832
[31] 0.661269968 -0.556179878 0.060268633 0.622374459 -0.808483708
[36] -0.951899301 -0.134764152 0.625712942 -1.583918574 0.735519840
[41] 0.525880457 -1.285364345 -1.393732599 -1.449020500 -0.481324786
[46] 0.589509002 -1.937588764 -1.008504600 0.450370733 0.507398134
[51] -0.450361075 2.442567414 -0.906208852 -0.653734415 1.351374573
[56] 0.822241399 1.407687948 0.120455575 -0.211444677 -0.413349008
[61] -1.211083573 -1.849626761 -1.000473764 0.664007917 1.813386778
[66] 0.830226209 -1.204319887 0.130902815 0.218584865 0.694501049
[71] -0.466953770 -0.648967902 -1.327575222 -1.176173873 -1.018702673
[76] 0.993985813 -0.316275796 0.498335004 1.166346019 0.856131069
[81] -1.563952225 1.935205239 2.158259549 0.654674851 -0.606584529
[86] -1.471129613 -0.479587722 0.855748266 -0.617552634 -2.151773271
[91] -1.730098353 0.002855817 0.534990201 0.719528430 1.142944608
[96] 0.687898195 -0.809351309 1.011395489 -0.051935336 1.316798361
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.145047 -2.059649 0.1707445 0.6672248 0.7462108 -0.2314605 -0.4330765
[2,] -1.145047 -2.059649 0.1707445 0.6672248 0.7462108 -0.2314605 -0.4330765
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.6151741 -0.4264509 0.3591364 -0.4431834 1.668039 -0.8621468 0.9944757
[2,] -0.6151741 -0.4264509 0.3591364 -0.4431834 1.668039 -0.8621468 0.9944757
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 2.060426 -0.7555523 -0.01047802 0.07835998 0.2951404 -0.1056983 0.2355723
[2,] 2.060426 -0.7555523 -0.01047802 0.07835998 0.2951404 -0.1056983 0.2355723
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.07092062 0.1526376 0.3647756 -0.1270673 0.9483665 -0.6038689 0.4942742
[2,] 0.07092062 0.1526376 0.3647756 -0.1270673 0.9483665 -0.6038689 0.4942742
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.114367 -0.3172808 0.66127 -0.5561799 0.06026863 0.6223745 -0.8084837
[2,] -1.114367 -0.3172808 0.66127 -0.5561799 0.06026863 0.6223745 -0.8084837
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.9518993 -0.1347642 0.6257129 -1.583919 0.7355198 0.5258805 -1.285364
[2,] -0.9518993 -0.1347642 0.6257129 -1.583919 0.7355198 0.5258805 -1.285364
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.393733 -1.449021 -0.4813248 0.589509 -1.937589 -1.008505 0.4503707
[2,] -1.393733 -1.449021 -0.4813248 0.589509 -1.937589 -1.008505 0.4503707
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.5073981 -0.4503611 2.442567 -0.9062089 -0.6537344 1.351375 0.8222414
[2,] 0.5073981 -0.4503611 2.442567 -0.9062089 -0.6537344 1.351375 0.8222414
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.407688 0.1204556 -0.2114447 -0.413349 -1.211084 -1.849627 -1.000474
[2,] 1.407688 0.1204556 -0.2114447 -0.413349 -1.211084 -1.849627 -1.000474
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.6640079 1.813387 0.8302262 -1.20432 0.1309028 0.2185849 0.694501
[2,] 0.6640079 1.813387 0.8302262 -1.20432 0.1309028 0.2185849 0.694501
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.4669538 -0.6489679 -1.327575 -1.176174 -1.018703 0.9939858 -0.3162758
[2,] -0.4669538 -0.6489679 -1.327575 -1.176174 -1.018703 0.9939858 -0.3162758
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.498335 1.166346 0.8561311 -1.563952 1.935205 2.15826 0.6546749
[2,] 0.498335 1.166346 0.8561311 -1.563952 1.935205 2.15826 0.6546749
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.6065845 -1.47113 -0.4795877 0.8557483 -0.6175526 -2.151773 -1.730098
[2,] -0.6065845 -1.47113 -0.4795877 0.8557483 -0.6175526 -2.151773 -1.730098
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.002855817 0.5349902 0.7195284 1.142945 0.6878982 -0.8093513 1.011395
[2,] 0.002855817 0.5349902 0.7195284 1.142945 0.6878982 -0.8093513 1.011395
[,99] [,100]
[1,] -0.05193534 1.316798
[2,] -0.05193534 1.316798
>
>
> Max(tmp2)
[1] 2.662525
> Min(tmp2)
[1] -2.995018
> mean(tmp2)
[1] -0.102555
> Sum(tmp2)
[1] -10.2555
> Var(tmp2)
[1] 1.122043
>
> rowMeans(tmp2)
[1] 2.662525191 0.649563551 -1.200822945 0.564440200 -0.695020277
[6] 0.145811342 -1.273219900 -0.395730400 0.277890466 0.235062011
[11] -0.837863930 -2.081455905 -0.769470355 -0.571148620 0.846639941
[16] 1.020975395 0.041511368 0.694978737 -0.975007140 -1.085647562
[21] 0.537626998 0.187958478 0.272865544 0.889507716 0.722071818
[26] 0.150509535 1.147065867 -1.317660142 -1.782322127 0.292236825
[31] -1.013553198 0.961917408 -1.270264585 -0.778055983 -0.545186743
[36] -0.432662201 0.149714777 -1.600660061 1.725876412 1.793870868
[41] 1.502265763 -2.995017548 -1.958434553 -0.867840537 -0.548280007
[46] 0.615202041 0.298913152 -0.332257971 0.608821592 -0.856266992
[51] -0.858134507 -1.372032371 0.111432304 -0.869449389 -0.153220462
[56] 0.353763731 0.691349476 0.372837527 0.060017735 -1.744423893
[61] -0.009238849 1.675289869 1.461215994 -0.210049968 0.270318463
[66] 1.283742925 0.354125042 -0.071590933 -0.710083362 -0.413642201
[71] 1.047806101 -1.233399949 0.991637203 0.173566129 0.489856884
[76] 0.826465329 1.152297790 -0.972497612 -0.936845525 -1.818927377
[81] 0.565573705 -0.414680790 -0.566569144 -2.216983389 -0.825805384
[86] 1.667581701 0.150113513 1.164220833 0.092138350 1.028596682
[91] -2.708270967 0.193717092 -0.894587009 0.192064187 1.363074697
[96] -0.666281855 0.668526303 0.370520719 -1.186750879 -0.985853363
> rowSums(tmp2)
[1] 2.662525191 0.649563551 -1.200822945 0.564440200 -0.695020277
[6] 0.145811342 -1.273219900 -0.395730400 0.277890466 0.235062011
[11] -0.837863930 -2.081455905 -0.769470355 -0.571148620 0.846639941
[16] 1.020975395 0.041511368 0.694978737 -0.975007140 -1.085647562
[21] 0.537626998 0.187958478 0.272865544 0.889507716 0.722071818
[26] 0.150509535 1.147065867 -1.317660142 -1.782322127 0.292236825
[31] -1.013553198 0.961917408 -1.270264585 -0.778055983 -0.545186743
[36] -0.432662201 0.149714777 -1.600660061 1.725876412 1.793870868
[41] 1.502265763 -2.995017548 -1.958434553 -0.867840537 -0.548280007
[46] 0.615202041 0.298913152 -0.332257971 0.608821592 -0.856266992
[51] -0.858134507 -1.372032371 0.111432304 -0.869449389 -0.153220462
[56] 0.353763731 0.691349476 0.372837527 0.060017735 -1.744423893
[61] -0.009238849 1.675289869 1.461215994 -0.210049968 0.270318463
[66] 1.283742925 0.354125042 -0.071590933 -0.710083362 -0.413642201
[71] 1.047806101 -1.233399949 0.991637203 0.173566129 0.489856884
[76] 0.826465329 1.152297790 -0.972497612 -0.936845525 -1.818927377
[81] 0.565573705 -0.414680790 -0.566569144 -2.216983389 -0.825805384
[86] 1.667581701 0.150113513 1.164220833 0.092138350 1.028596682
[91] -2.708270967 0.193717092 -0.894587009 0.192064187 1.363074697
[96] -0.666281855 0.668526303 0.370520719 -1.186750879 -0.985853363
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] 2.662525191 0.649563551 -1.200822945 0.564440200 -0.695020277
[6] 0.145811342 -1.273219900 -0.395730400 0.277890466 0.235062011
[11] -0.837863930 -2.081455905 -0.769470355 -0.571148620 0.846639941
[16] 1.020975395 0.041511368 0.694978737 -0.975007140 -1.085647562
[21] 0.537626998 0.187958478 0.272865544 0.889507716 0.722071818
[26] 0.150509535 1.147065867 -1.317660142 -1.782322127 0.292236825
[31] -1.013553198 0.961917408 -1.270264585 -0.778055983 -0.545186743
[36] -0.432662201 0.149714777 -1.600660061 1.725876412 1.793870868
[41] 1.502265763 -2.995017548 -1.958434553 -0.867840537 -0.548280007
[46] 0.615202041 0.298913152 -0.332257971 0.608821592 -0.856266992
[51] -0.858134507 -1.372032371 0.111432304 -0.869449389 -0.153220462
[56] 0.353763731 0.691349476 0.372837527 0.060017735 -1.744423893
[61] -0.009238849 1.675289869 1.461215994 -0.210049968 0.270318463
[66] 1.283742925 0.354125042 -0.071590933 -0.710083362 -0.413642201
[71] 1.047806101 -1.233399949 0.991637203 0.173566129 0.489856884
[76] 0.826465329 1.152297790 -0.972497612 -0.936845525 -1.818927377
[81] 0.565573705 -0.414680790 -0.566569144 -2.216983389 -0.825805384
[86] 1.667581701 0.150113513 1.164220833 0.092138350 1.028596682
[91] -2.708270967 0.193717092 -0.894587009 0.192064187 1.363074697
[96] -0.666281855 0.668526303 0.370520719 -1.186750879 -0.985853363
> rowMin(tmp2)
[1] 2.662525191 0.649563551 -1.200822945 0.564440200 -0.695020277
[6] 0.145811342 -1.273219900 -0.395730400 0.277890466 0.235062011
[11] -0.837863930 -2.081455905 -0.769470355 -0.571148620 0.846639941
[16] 1.020975395 0.041511368 0.694978737 -0.975007140 -1.085647562
[21] 0.537626998 0.187958478 0.272865544 0.889507716 0.722071818
[26] 0.150509535 1.147065867 -1.317660142 -1.782322127 0.292236825
[31] -1.013553198 0.961917408 -1.270264585 -0.778055983 -0.545186743
[36] -0.432662201 0.149714777 -1.600660061 1.725876412 1.793870868
[41] 1.502265763 -2.995017548 -1.958434553 -0.867840537 -0.548280007
[46] 0.615202041 0.298913152 -0.332257971 0.608821592 -0.856266992
[51] -0.858134507 -1.372032371 0.111432304 -0.869449389 -0.153220462
[56] 0.353763731 0.691349476 0.372837527 0.060017735 -1.744423893
[61] -0.009238849 1.675289869 1.461215994 -0.210049968 0.270318463
[66] 1.283742925 0.354125042 -0.071590933 -0.710083362 -0.413642201
[71] 1.047806101 -1.233399949 0.991637203 0.173566129 0.489856884
[76] 0.826465329 1.152297790 -0.972497612 -0.936845525 -1.818927377
[81] 0.565573705 -0.414680790 -0.566569144 -2.216983389 -0.825805384
[86] 1.667581701 0.150113513 1.164220833 0.092138350 1.028596682
[91] -2.708270967 0.193717092 -0.894587009 0.192064187 1.363074697
[96] -0.666281855 0.668526303 0.370520719 -1.186750879 -0.985853363
>
> colMeans(tmp2)
[1] -0.102555
> colSums(tmp2)
[1] -10.2555
> colVars(tmp2)
[1] 1.122043
> colSd(tmp2)
[1] 1.059265
> colMax(tmp2)
[1] 2.662525
> colMin(tmp2)
[1] -2.995018
> colMedians(tmp2)
[1] 0.1017853
> colRanges(tmp2)
[,1]
[1,] -2.995018
[2,] 2.662525
>
> 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] 0.40681836 0.72218522 -0.03959428 0.03671872 -2.41417448 -3.65218602
[7] -0.43107125 -5.51156560 -1.98946066 1.63216183
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.9049076
[2,] -0.6520269
[3,] -0.1814644
[4,] 0.2369639
[5,] 1.6778469
>
> rowApply(tmp,sum)
[1] -0.9818889 2.5949039 -4.9554111 -1.2560367 0.7914731 -1.5762512
[7] 2.9419271 -5.1300285 -1.3139989 -2.3548571
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 2 3 7 9 4 5 5 10 7
[2,] 4 10 10 2 4 10 3 9 1 3
[3,] 2 4 8 8 6 9 8 4 5 6
[4,] 7 9 1 3 7 7 4 7 7 4
[5,] 10 5 9 1 3 2 1 6 6 10
[6,] 1 8 5 10 5 1 9 8 4 1
[7,] 3 7 6 5 8 3 6 10 9 8
[8,] 6 1 2 6 2 5 2 3 3 5
[9,] 9 3 4 9 1 8 7 1 8 2
[10,] 8 6 7 4 10 6 10 2 2 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.963550177 -0.327266876 2.738957511 0.151146627 2.919455180
[6] -2.417053007 -1.268442626 -5.634975378 -2.840299010 -2.489719887
[11] -0.049787567 -2.712070065 0.619668108 2.659223603 1.201434507
[16] -1.088458400 -2.274303055 -0.008186237 0.577768612 1.395684730
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.4545000
[2,] -0.3734317
[3,] 0.4253350
[4,] 0.9389137
[5,] 1.4272331
>
> rowApply(tmp,sum)
[1] -6.3605984 -3.9126522 -1.3976524 5.1539931 -0.3667632
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 15 17 19 6
[2,] 13 11 5 20 2
[3,] 20 16 13 13 7
[4,] 8 18 4 11 17
[5,] 18 5 18 17 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.4545000 -0.2119279 1.7095257 -0.5665970 1.0875402 -1.62387145
[2,] 0.4253350 -0.2402933 0.4872638 1.0325662 -0.9851152 0.73717022
[3,] 0.9389137 -0.7547522 0.3078948 -0.9694863 0.9988877 -1.75049762
[4,] 1.4272331 1.7207238 0.5511917 0.1600339 1.2081507 0.09356922
[5,] -0.3734317 -0.8410172 -0.3169184 0.4946299 0.6099919 0.12657662
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.5127836 -2.4025972 -0.49103763 -1.7134851 -0.9938959 -0.9700815
[2,] -1.5990401 -3.0482262 -2.05695922 -0.4045572 -1.0334386 -0.5994748
[3,] 0.8601776 -0.1700967 0.07336456 -0.4010091 1.5586382 0.4350537
[4,] -0.1540118 -1.4332687 -0.17741061 -0.1887110 1.4048436 -1.0219460
[5,] 0.1372154 1.4192134 -0.18825611 0.2180424 -0.9859349 -0.5556214
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.6554965 0.85951361 0.41753011 -0.4218649 -1.4140405 0.7495388
[2,] 2.0103711 0.06035702 0.27275310 -0.6495583 -0.2564645 -0.7080534
[3,] -0.4624752 1.66046647 -0.42510216 -0.4278507 0.6693398 -0.6599824
[4,] -0.4303562 0.18217805 1.00844578 1.0633028 -0.6279904 -0.7312737
[5,] 0.1576250 -0.10329155 -0.07219232 -0.6524874 -0.6451475 1.3415844
[,19] [,20]
[1,] 0.13166308 1.116269259
[2,] 0.35875737 2.283954968
[3,] -0.97517347 -1.903963041
[4,] 1.10475209 -0.005463297
[5,] -0.04223046 -0.095113160
>
>
> 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 : 653 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 : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.4427294 0.7186857 0.747699 -0.9073199 -2.048208 0.4765079 0.07217026
col8 col9 col10 col11 col12 col13 col14
row1 0.1564922 1.115052 -1.155832 1.671951 0.2096088 -0.3184283 -0.6229052
col15 col16 col17 col18 col19 col20
row1 1.53944 0.6038705 0.8243856 0.1255928 0.589845 -0.5008107
> tmp[,"col10"]
col10
row1 -1.1558316
row2 1.1014750
row3 -0.3487216
row4 0.1590552
row5 -1.2863592
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.4427294 0.7186857 0.7476990 -0.9073199 -2.0482083 0.4765079 0.07217026
row5 -0.4199905 -1.3929191 0.2447481 1.7732471 0.9238533 0.4142968 1.42391064
col8 col9 col10 col11 col12 col13 col14
row1 0.15649222 1.115052 -1.155832 1.671951 0.2096088 -0.3184283 -0.6229052
row5 0.05769207 -1.577417 -1.286359 1.232415 -0.1086862 -1.2988654 0.1070711
col15 col16 col17 col18 col19 col20
row1 1.539440 0.6038705 0.8243856 0.1255928 0.5898450 -0.5008107
row5 -1.238996 1.2577082 1.7487968 0.6324776 0.9343916 -0.9351372
> tmp[,c("col6","col20")]
col6 col20
row1 0.4765079 -0.5008107
row2 -1.1920315 -0.7995213
row3 0.1865841 -0.4925259
row4 -2.7584958 0.1791658
row5 0.4142968 -0.9351372
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.4765079 -0.5008107
row5 0.4142968 -0.9351372
>
>
>
>
> 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 49.13016 50.45684 51.12876 49.0748 49.33386 107.0429 48.9859 50.76998
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.1807 50.05166 49.29834 48.92695 49.14023 50.11764 50.04059 50.88932
col17 col18 col19 col20
row1 49.92257 48.60022 48.44421 105.5597
> tmp[,"col10"]
col10
row1 50.05166
row2 30.73889
row3 30.01112
row4 29.42619
row5 48.81316
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.13016 50.45684 51.12876 49.07480 49.33386 107.0429 48.98590 50.76998
row5 49.60476 48.53976 50.59359 49.68071 49.45623 105.6703 50.32836 50.50870
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.18070 50.05166 49.29834 48.92695 49.14023 50.11764 50.04059 50.88932
row5 51.30567 48.81316 49.03830 49.17207 50.36134 50.16545 51.05007 49.19120
col17 col18 col19 col20
row1 49.92257 48.60022 48.44421 105.5597
row5 51.12576 49.40057 50.24094 104.3825
> tmp[,c("col6","col20")]
col6 col20
row1 107.04290 105.55970
row2 75.33145 74.04885
row3 75.63832 75.33147
row4 74.90398 74.41058
row5 105.67025 104.38246
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 107.0429 105.5597
row5 105.6703 104.3825
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 107.0429 105.5597
row5 105.6703 104.3825
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.1427352
[2,] -0.5708828
[3,] 0.2302549
[4,] 0.1830142
[5,] -1.7658465
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.8139651 -1.7120291
[2,] -0.6875780 0.6701931
[3,] -0.2912013 1.1629336
[4,] 0.4862802 1.4924188
[5,] 0.1494930 -0.5087658
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 2.19368647 -1.5949626
[2,] 0.09169909 -0.8339813
[3,] 0.18819024 -0.9771335
[4,] -0.72631766 0.7902575
[5,] 0.26867624 -0.1027388
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 2.193686
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 2.19368647
[2,] 0.09169909
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -0.4814912 0.5159903 0.2261019 0.7645918 0.7763392 0.3992366 -0.3555758
row1 0.4003311 -0.9285450 -0.3418244 0.6990960 0.8189570 0.4668328 -0.7832514
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.991137 1.0484087 -1.638726 -0.3492296 -0.4554418 -0.6791113 -0.4755509
row1 0.295082 0.1857809 1.440805 2.2905208 0.8259165 -0.1757283 0.2990213
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.86265368 -0.02754966 -0.3352551 -1.1860332 -0.9989807 0.1538517
row1 0.04944577 0.05664589 -2.3790920 -0.2030493 0.5953603 -3.8517658
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.11611 0.3002371 0.7269462 -0.9178605 -0.5510285 0.0184301 0.3606795
[,8] [,9] [,10]
row2 0.8255673 0.8223056 0.8904947
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.6793358 -0.6597989 -0.0007621012 0.8301839 -1.125122 1.319399 1.682667
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.2682046 0.5258494 -0.6181713 -1.631013 0.5743809 -0.3046106 0.3312224
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.7908681 -0.6147979 -0.1893772 2.014346 -0.2865379 1.627035
>
>
> 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: 0x6000000d0360>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b320ebdff3"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b35dbbdb67"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b358417744"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b331fd3ea0"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b3691a9403"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b34feb86dd"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b36fe34028"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b330893b7b"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b31a02122"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b337df4003"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b321e3a19d"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b367875bcc"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b3679be32d"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b32b5fd47f"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM183b32077f418"
>
>
> ### 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: 0x6000000dc240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000000dc240>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000000dc240>
> rowMedians(tmp)
[1] 0.148261925 0.168672490 -0.132027615 0.468450986 0.698547889
[6] -0.168512614 -0.430917600 -0.159215964 -0.326847618 0.353012489
[11] -0.065863087 -0.759543086 0.174724869 0.560700457 -0.176366181
[16] -0.411058353 -0.379688713 -0.723551124 -0.259892441 0.050463893
[21] 0.425510688 -0.491733994 0.140079615 0.385671356 -0.094875228
[26] -0.074378082 0.215663996 -0.111856462 0.515136726 -0.104511245
[31] 0.218335010 0.181839287 0.174093689 -0.169988682 0.117653497
[36] -0.100764168 0.066006268 -0.167730049 0.252787662 -0.420068835
[41] 0.511063666 0.640472764 0.603428342 -0.087068356 -0.776050487
[46] -0.143155655 0.141604386 -0.108246674 0.151116150 0.108173377
[51] 0.608193163 0.204939382 -0.197335363 0.633593620 0.156519092
[56] 0.431861745 0.328187689 0.196211877 -0.565559516 -0.492407079
[61] 0.290587109 0.199573288 0.037351903 -0.235490106 0.035998258
[66] -0.108794945 -0.359285242 0.136995132 0.388863397 -0.069633959
[71] 0.226859743 -0.007496318 0.116993290 0.230551182 0.450465740
[76] 0.202814222 0.052641712 -0.087271254 -0.536088935 -0.179729372
[81] 0.010464385 -0.289388953 -0.260981899 0.559736681 0.065621179
[86] -0.027044752 0.206365636 0.002857145 0.150529815 -0.460599798
[91] 0.012018963 -0.019757747 -0.278985329 0.481709282 -0.250898187
[96] 0.110571170 0.224301523 -0.087286691 0.085874322 0.209379922
[101] -0.124847674 0.433064348 -0.178507256 -0.317919218 -0.503192836
[106] -0.337906853 -0.064833413 0.010809684 0.051565795 0.567580277
[111] -0.144217298 0.221786804 -0.620412632 0.192612170 -0.420496630
[116] 0.438461100 0.055956671 -0.130180373 0.334703135 -0.075972651
[121] 0.235669455 0.191145723 0.210074487 0.358600920 0.053869785
[126] -0.741445633 -0.031019617 0.147431476 -0.128017707 -0.396440555
[131] -0.167878041 0.114062611 -0.697298189 -0.032802464 0.614058888
[136] 0.014891731 0.184973641 -0.162061658 0.099339255 0.178380558
[141] -0.302492728 -0.221582094 -0.125039129 0.177749563 -0.353388590
[146] 0.176365231 0.133679048 -0.255235039 -0.325740516 0.104332114
[151] 0.050413265 0.063561079 0.171245255 0.054552159 -0.290964637
[156] -0.487197367 -0.017114523 0.067785360 -0.211658640 0.047481433
[161] 0.132184243 -0.187293607 -0.230246435 -0.075069969 0.151111051
[166] 0.147187342 0.389731096 0.353316089 -0.355226884 0.343720424
[171] 0.469690332 0.236113370 -0.167523420 0.115379098 -0.409922212
[176] -0.025048259 0.596348882 -0.463662200 -0.373927056 -0.035606429
[181] 0.405465054 0.235765066 -0.189034110 -0.000815446 -0.422633331
[186] -0.350594505 0.617959351 0.257679988 0.488691907 0.242161879
[191] -0.227730165 -0.023661679 -0.056873528 -0.313370208 0.033633430
[196] 0.845867360 -0.316836858 -0.129463628 0.032564747 0.281769037
[201] 0.786507141 0.099738796 -0.620822733 0.121614035 0.081663177
[206] 0.087279843 0.041047906 -0.492797214 0.248315964 0.283876444
[211] 0.279949090 -0.286980012 0.476372044 -0.445920085 0.396829450
[216] -0.071032293 -0.056664794 -0.235221792 -0.609303058 -0.154225868
[221] 0.051127588 0.405217304 0.193045044 -0.443301619 -0.630984379
[226] 0.221849928 0.155222113 -0.057832059 0.294794524 -0.120139540
>
> proc.time()
user system elapsed
0.685 3.528 4.701
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: 0x6000009480c0>
> .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: 0x6000009480c0>
> .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: 0x6000009480c0>
> .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: 0x6000009480c0>
> 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: 0x6000009700c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000009700c0>
> .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: 0x6000009700c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000009700c0>
> .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: 0x6000009700c0>
> 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: 0x600000970240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000970240>
> .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: 0x600000970240>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000970240>
> .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: 0x600000970240>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600000970240>
> .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: 0x600000970240>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600000970240>
> .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: 0x600000970240>
> 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: 0x600000970420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000970420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000970420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000970420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14a416d6564" "BufferedMatrixFile14a751ba9ca"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14a416d6564" "BufferedMatrixFile14a751ba9ca"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000009706c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000009706c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000009706c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000009706c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000009706c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000009706c0>
> .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: 0x6000009708a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000009708a0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000009708a0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000009708a0>
> 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: 0x600000944000>
> .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: 0x600000944000>
> rm(P)
>
> proc.time()
user system elapsed
0.135 0.055 0.194
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.134 0.037 0.166