| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-20 12:05 -0500 (Thu, 20 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4615 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4610 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4598 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| 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 | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | 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-18 03:27:18 -0500 (Tue, 18 Nov 2025) |
| EndedAt: 2025-11-18 03:27:38 -0500 (Tue, 18 Nov 2025) |
| EllapsedTime: 20.2 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.2 Patched (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.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 15.0.0 (clang-1500.0.40.1)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
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.5-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 version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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.125 0.041 0.178
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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.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 480695 25.7 1056222 56.5 NA 634382 33.9
Vcells 890561 6.8 8388608 64.0 65536 2109354 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] "Tue Nov 18 03:27:28 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 03:27:28 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: 0x6000023ac060>
>
>
>
> 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 03:27:29 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 03:27:30 2025"
>
> ColMode(tmp2)
<pointer: 0x6000023ac060>
>
>
>
> ### 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.6669564 0.8070602 0.44642797 -0.3588797
[2,] -0.7054420 -0.3477885 0.74820135 -0.1000222
[3,] -0.9139560 -0.6228093 0.77573660 -0.2024172
[4,] -0.7929975 0.6085014 0.07818589 0.8566882
> 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.6669564 0.8070602 0.44642797 0.3588797
[2,] 0.7054420 0.3477885 0.74820135 0.1000222
[3,] 0.9139560 0.6228093 0.77573660 0.2024172
[4,] 0.7929975 0.6085014 0.07818589 0.8566882
> 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.9331242 0.8983653 0.6681527 0.5990657
[2,] 0.8399059 0.5897360 0.8649863 0.3162628
[3,] 0.9560105 0.7891827 0.8807591 0.4499080
[4,] 0.8905041 0.7800650 0.2796174 0.9255745
>
> 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.99820 34.79071 32.12795 31.34954
[2,] 34.10450 31.24515 34.39806 28.26265
[3,] 35.47406 33.51464 34.58333 29.70150
[4,] 34.69804 33.40915 27.87436 35.11243
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000023b4000>
> exp(tmp5)
<pointer: 0x6000023b4000>
> log(tmp5,2)
<pointer: 0x6000023b4000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.1415
> Min(tmp5)
[1] 52.34023
> mean(tmp5)
[1] 72.3439
> Sum(tmp5)
[1] 14468.78
> Var(tmp5)
[1] 850.1413
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.94179 70.47971 73.52806 68.51543 70.39865 71.66224 70.58417 67.78250
[9] 69.40237 71.14410
> rowSums(tmp5)
[1] 1798.836 1409.594 1470.561 1370.309 1407.973 1433.245 1411.683 1355.650
[9] 1388.047 1422.882
> rowVars(tmp5)
[1] 7804.68947 56.84830 116.10016 46.58812 97.50355 77.99555
[7] 34.62772 111.90388 93.48494 77.56514
> rowSd(tmp5)
[1] 88.344154 7.539781 10.774979 6.825549 9.874388 8.831509 5.884532
[8] 10.578463 9.668761 8.807107
> rowMax(tmp5)
[1] 464.14153 86.33020 90.67908 81.40216 87.75559 84.93703 80.78917
[8] 89.62738 86.14846 90.22464
> rowMin(tmp5)
[1] 61.42559 58.82500 52.34023 56.36170 53.44591 53.00572 59.00963 53.81128
[9] 53.19806 59.64815
>
> colMeans(tmp5)
[1] 112.48083 69.49083 67.14905 65.23448 72.23467 66.32148 72.66087
[8] 68.77689 71.31267 67.67448 73.87356 68.13583 73.37796 73.95120
[15] 71.65618 70.04703 75.13170 69.40443 71.42003 66.54388
> colSums(tmp5)
[1] 1124.8083 694.9083 671.4905 652.3448 722.3467 663.2148 726.6087
[8] 687.7689 713.1267 676.7448 738.7356 681.3583 733.7796 739.5120
[15] 716.5618 700.4703 751.3170 694.0443 714.2003 665.4388
> colVars(tmp5)
[1] 15315.54052 28.09863 85.66817 40.37905 34.88769 62.69232
[7] 82.07853 111.41747 82.92280 57.80565 71.02245 90.80099
[13] 117.89268 26.48406 124.03323 55.32896 117.15130 89.99344
[19] 85.12793 63.83036
> colSd(tmp5)
[1] 123.755972 5.300814 9.255710 6.354452 5.906580 7.917848
[7] 9.059720 10.555448 9.106195 7.603002 8.427482 9.528955
[13] 10.857840 5.146266 11.137021 7.438344 10.823645 9.486487
[19] 9.226480 7.989390
> colMax(tmp5)
[1] 464.14153 76.72649 85.37012 73.85804 86.14846 80.78917 85.22378
[8] 89.83984 88.76466 81.07992 86.73305 83.54004 90.22464 80.66803
[15] 85.54825 81.75911 90.67908 82.77927 89.62738 81.43369
> colMin(tmp5)
[1] 60.41554 60.60089 53.19806 54.87203 65.28659 53.81128 53.82548 60.27459
[9] 60.43701 56.36170 58.86607 53.44591 59.21560 67.02373 52.34023 56.85356
[17] 63.59649 53.00572 61.07205 57.11111
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 89.94179 70.47971 73.52806 68.51543 70.39865 71.66224 70.58417 67.78250
[9] NA 71.14410
> rowSums(tmp5)
[1] 1798.836 1409.594 1470.561 1370.309 1407.973 1433.245 1411.683 1355.650
[9] NA 1422.882
> rowVars(tmp5)
[1] 7804.68947 56.84830 116.10016 46.58812 97.50355 77.99555
[7] 34.62772 111.90388 92.61011 77.56514
> rowSd(tmp5)
[1] 88.344154 7.539781 10.774979 6.825549 9.874388 8.831509 5.884532
[8] 10.578463 9.623415 8.807107
> rowMax(tmp5)
[1] 464.14153 86.33020 90.67908 81.40216 87.75559 84.93703 80.78917
[8] 89.62738 NA 90.22464
> rowMin(tmp5)
[1] 61.42559 58.82500 52.34023 56.36170 53.44591 53.00572 59.00963 53.81128
[9] NA 59.64815
>
> colMeans(tmp5)
[1] 112.48083 69.49083 67.14905 65.23448 72.23467 66.32148 72.66087
[8] 68.77689 71.31267 67.67448 73.87356 68.13583 NA 73.95120
[15] 71.65618 70.04703 75.13170 69.40443 71.42003 66.54388
> colSums(tmp5)
[1] 1124.8083 694.9083 671.4905 652.3448 722.3467 663.2148 726.6087
[8] 687.7689 713.1267 676.7448 738.7356 681.3583 NA 739.5120
[15] 716.5618 700.4703 751.3170 694.0443 714.2003 665.4388
> colVars(tmp5)
[1] 15315.54052 28.09863 85.66817 40.37905 34.88769 62.69232
[7] 82.07853 111.41747 82.92280 57.80565 71.02245 90.80099
[13] NA 26.48406 124.03323 55.32896 117.15130 89.99344
[19] 85.12793 63.83036
> colSd(tmp5)
[1] 123.755972 5.300814 9.255710 6.354452 5.906580 7.917848
[7] 9.059720 10.555448 9.106195 7.603002 8.427482 9.528955
[13] NA 5.146266 11.137021 7.438344 10.823645 9.486487
[19] 9.226480 7.989390
> colMax(tmp5)
[1] 464.14153 76.72649 85.37012 73.85804 86.14846 80.78917 85.22378
[8] 89.83984 88.76466 81.07992 86.73305 83.54004 NA 80.66803
[15] 85.54825 81.75911 90.67908 82.77927 89.62738 81.43369
> colMin(tmp5)
[1] 60.41554 60.60089 53.19806 54.87203 65.28659 53.81128 53.82548 60.27459
[9] 60.43701 56.36170 58.86607 53.44591 NA 67.02373 52.34023 56.85356
[17] 63.59649 53.00572 61.07205 57.11111
>
> Max(tmp5,na.rm=TRUE)
[1] 464.1415
> Min(tmp5,na.rm=TRUE)
[1] 52.34023
> mean(tmp5,na.rm=TRUE)
[1] 72.40987
> Sum(tmp5,na.rm=TRUE)
[1] 14409.56
> Var(tmp5,na.rm=TRUE)
[1] 853.5601
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.94179 70.47971 73.52806 68.51543 70.39865 71.66224 70.58417 67.78250
[9] 69.93852 71.14410
> rowSums(tmp5,na.rm=TRUE)
[1] 1798.836 1409.594 1470.561 1370.309 1407.973 1433.245 1411.683 1355.650
[9] 1328.832 1422.882
> rowVars(tmp5,na.rm=TRUE)
[1] 7804.68947 56.84830 116.10016 46.58812 97.50355 77.99555
[7] 34.62772 111.90388 92.61011 77.56514
> rowSd(tmp5,na.rm=TRUE)
[1] 88.344154 7.539781 10.774979 6.825549 9.874388 8.831509 5.884532
[8] 10.578463 9.623415 8.807107
> rowMax(tmp5,na.rm=TRUE)
[1] 464.14153 86.33020 90.67908 81.40216 87.75559 84.93703 80.78917
[8] 89.62738 86.14846 90.22464
> rowMin(tmp5,na.rm=TRUE)
[1] 61.42559 58.82500 52.34023 56.36170 53.44591 53.00572 59.00963 53.81128
[9] 53.19806 59.64815
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.48083 69.49083 67.14905 65.23448 72.23467 66.32148 72.66087
[8] 68.77689 71.31267 67.67448 73.87356 68.13583 74.95156 73.95120
[15] 71.65618 70.04703 75.13170 69.40443 71.42003 66.54388
> colSums(tmp5,na.rm=TRUE)
[1] 1124.8083 694.9083 671.4905 652.3448 722.3467 663.2148 726.6087
[8] 687.7689 713.1267 676.7448 738.7356 681.3583 674.5640 739.5120
[15] 716.5618 700.4703 751.3170 694.0443 714.2003 665.4388
> colVars(tmp5,na.rm=TRUE)
[1] 15315.54052 28.09863 85.66817 40.37905 34.88769 62.69232
[7] 82.07853 111.41747 82.92280 57.80565 71.02245 90.80099
[13] 104.77199 26.48406 124.03323 55.32896 117.15130 89.99344
[19] 85.12793 63.83036
> colSd(tmp5,na.rm=TRUE)
[1] 123.755972 5.300814 9.255710 6.354452 5.906580 7.917848
[7] 9.059720 10.555448 9.106195 7.603002 8.427482 9.528955
[13] 10.235819 5.146266 11.137021 7.438344 10.823645 9.486487
[19] 9.226480 7.989390
> colMax(tmp5,na.rm=TRUE)
[1] 464.14153 76.72649 85.37012 73.85804 86.14846 80.78917 85.22378
[8] 89.83984 88.76466 81.07992 86.73305 83.54004 90.22464 80.66803
[15] 85.54825 81.75911 90.67908 82.77927 89.62738 81.43369
> colMin(tmp5,na.rm=TRUE)
[1] 60.41554 60.60089 53.19806 54.87203 65.28659 53.81128 53.82548 60.27459
[9] 60.43701 56.36170 58.86607 53.44591 60.12042 67.02373 52.34023 56.85356
[17] 63.59649 53.00572 61.07205 57.11111
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.94179 70.47971 73.52806 68.51543 70.39865 71.66224 70.58417 67.78250
[9] NaN 71.14410
> rowSums(tmp5,na.rm=TRUE)
[1] 1798.836 1409.594 1470.561 1370.309 1407.973 1433.245 1411.683 1355.650
[9] 0.000 1422.882
> rowVars(tmp5,na.rm=TRUE)
[1] 7804.68947 56.84830 116.10016 46.58812 97.50355 77.99555
[7] 34.62772 111.90388 NA 77.56514
> rowSd(tmp5,na.rm=TRUE)
[1] 88.344154 7.539781 10.774979 6.825549 9.874388 8.831509 5.884532
[8] 10.578463 NA 8.807107
> rowMax(tmp5,na.rm=TRUE)
[1] 464.14153 86.33020 90.67908 81.40216 87.75559 84.93703 80.78917
[8] 89.62738 NA 90.22464
> rowMin(tmp5,na.rm=TRUE)
[1] 61.42559 58.82500 52.34023 56.36170 53.44591 53.00572 59.00963 53.81128
[9] NA 59.64815
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 117.05989 69.53081 68.69915 64.39820 70.68869 66.10697 72.70709
[8] 69.34576 70.76652 67.44077 74.23874 69.37044 NaN 73.20659
[15] 70.11261 71.51297 76.23318 69.18589 70.26697 67.59197
> colSums(tmp5,na.rm=TRUE)
[1] 1053.5390 625.7773 618.2924 579.5838 636.1983 594.9627 654.3638
[8] 624.1118 636.8987 606.9669 668.1487 624.3340 0.0000 658.8593
[15] 631.0135 643.6167 686.0987 622.6730 632.4027 608.3277
> colVars(tmp5,na.rm=TRUE)
[1] 16994.09537 31.59297 69.34476 37.55850 12.36066 70.01117
[7] 92.31431 121.70408 89.93253 64.41688 78.39997 85.00310
[13] NA 23.55714 112.73325 38.06901 118.14585 100.70531
[19] 80.81134 59.45120
> colSd(tmp5,na.rm=TRUE)
[1] 130.361403 5.620763 8.327350 6.128499 3.515773 8.367268
[7] 9.608034 11.031957 9.483276 8.026013 8.854376 9.219713
[13] NA 4.853569 10.617592 6.170009 10.869492 10.035203
[19] 8.989513 7.710461
> colMax(tmp5,na.rm=TRUE)
[1] 464.14153 76.72649 85.37012 73.85804 74.95977 80.78917 85.22378
[8] 89.83984 88.76466 81.07992 86.73305 83.54004 -Inf 80.66803
[15] 84.08776 81.75911 90.67908 82.77927 89.62738 81.43369
> colMin(tmp5,na.rm=TRUE)
[1] 60.41554 60.60089 58.01683 54.87203 65.28659 53.81128 53.82548 60.27459
[9] 60.43701 56.36170 58.86607 53.44591 Inf 67.02373 52.34023 63.88541
[17] 63.59649 53.00572 61.07205 59.00963
>
>
>
>
> 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] 303.6835 267.1297 180.0233 238.9500 156.9376 229.6712 266.0592 180.7358
[9] 211.7822 177.7093
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 303.6835 267.1297 180.0233 238.9500 156.9376 229.6712 266.0592 180.7358
[9] 211.7822 177.7093
>
>
>
> 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.563194e-13 1.705303e-13 1.421085e-13 -8.526513e-14 1.421085e-14
[6] 1.705303e-13 -1.136868e-13 1.136868e-13 -2.842171e-13 1.705303e-13
[11] 1.136868e-13 -1.136868e-13 -9.947598e-14 -1.421085e-13 -5.684342e-14
[16] 0.000000e+00 0.000000e+00 2.273737e-13 5.684342e-14 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
3 2
9 20
10 13
2 6
8 7
4 8
8 3
9 10
9 8
3 4
8 15
7 15
2 20
10 10
4 1
6 4
10 8
7 7
6 9
2 18
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.598493
> Min(tmp)
[1] -2.338456
> mean(tmp)
[1] -0.0247314
> Sum(tmp)
[1] -2.47314
> Var(tmp)
[1] 1.045411
>
> rowMeans(tmp)
[1] -0.0247314
> rowSums(tmp)
[1] -2.47314
> rowVars(tmp)
[1] 1.045411
> rowSd(tmp)
[1] 1.022454
> rowMax(tmp)
[1] 2.598493
> rowMin(tmp)
[1] -2.338456
>
> colMeans(tmp)
[1] -0.07581973 -0.76120447 0.48575799 -0.39226535 0.23330314 0.75450024
[7] -0.21851113 -0.13914656 -0.42652929 0.22420503 0.14298615 -0.05090905
[13] -1.17151152 -0.13311718 2.27547237 -0.02271889 -0.47192461 -0.55645514
[19] -0.59157996 -0.85931497 0.31045621 0.87864651 0.77593241 0.49606138
[25] -1.29350730 -1.88598969 -0.46880617 -0.47767091 -0.25071500 -1.17748828
[31] 1.54572755 -0.08276629 0.08111508 0.87587420 -0.23464452 1.16787638
[37] 1.06244082 -0.59949338 1.06490897 2.12495002 -0.32751817 0.24441361
[43] -1.10931475 1.53286005 -0.17520818 0.58878205 -0.98820041 0.40956377
[49] -0.91377854 -0.18351445 -0.23262882 0.00828949 0.53692184 -0.24274410
[55] -0.21724343 -0.44922154 2.59849320 0.81470116 1.51678341 -0.63643280
[61] -0.21847749 -1.18879288 -1.44372053 -1.66963369 -0.71940082 -2.03352928
[67] -0.48353411 1.11351160 0.64121637 -1.01941156 0.05101326 0.21969690
[73] 0.15841979 0.32676230 -1.74210292 -0.04259030 -0.01285365 -2.33845611
[79] 0.64152575 0.57510033 1.85345689 0.85976656 2.30446379 -0.45480503
[85] 2.18654339 0.23593024 -1.45018951 -0.05014092 0.73212405 -1.27369486
[91] -0.67519765 -2.29363957 -0.36368033 -0.10629991 -0.47967249 -0.65011746
[97] -1.88037107 1.21552784 0.74507972 1.32390507
> colSums(tmp)
[1] -0.07581973 -0.76120447 0.48575799 -0.39226535 0.23330314 0.75450024
[7] -0.21851113 -0.13914656 -0.42652929 0.22420503 0.14298615 -0.05090905
[13] -1.17151152 -0.13311718 2.27547237 -0.02271889 -0.47192461 -0.55645514
[19] -0.59157996 -0.85931497 0.31045621 0.87864651 0.77593241 0.49606138
[25] -1.29350730 -1.88598969 -0.46880617 -0.47767091 -0.25071500 -1.17748828
[31] 1.54572755 -0.08276629 0.08111508 0.87587420 -0.23464452 1.16787638
[37] 1.06244082 -0.59949338 1.06490897 2.12495002 -0.32751817 0.24441361
[43] -1.10931475 1.53286005 -0.17520818 0.58878205 -0.98820041 0.40956377
[49] -0.91377854 -0.18351445 -0.23262882 0.00828949 0.53692184 -0.24274410
[55] -0.21724343 -0.44922154 2.59849320 0.81470116 1.51678341 -0.63643280
[61] -0.21847749 -1.18879288 -1.44372053 -1.66963369 -0.71940082 -2.03352928
[67] -0.48353411 1.11351160 0.64121637 -1.01941156 0.05101326 0.21969690
[73] 0.15841979 0.32676230 -1.74210292 -0.04259030 -0.01285365 -2.33845611
[79] 0.64152575 0.57510033 1.85345689 0.85976656 2.30446379 -0.45480503
[85] 2.18654339 0.23593024 -1.45018951 -0.05014092 0.73212405 -1.27369486
[91] -0.67519765 -2.29363957 -0.36368033 -0.10629991 -0.47967249 -0.65011746
[97] -1.88037107 1.21552784 0.74507972 1.32390507
> 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.07581973 -0.76120447 0.48575799 -0.39226535 0.23330314 0.75450024
[7] -0.21851113 -0.13914656 -0.42652929 0.22420503 0.14298615 -0.05090905
[13] -1.17151152 -0.13311718 2.27547237 -0.02271889 -0.47192461 -0.55645514
[19] -0.59157996 -0.85931497 0.31045621 0.87864651 0.77593241 0.49606138
[25] -1.29350730 -1.88598969 -0.46880617 -0.47767091 -0.25071500 -1.17748828
[31] 1.54572755 -0.08276629 0.08111508 0.87587420 -0.23464452 1.16787638
[37] 1.06244082 -0.59949338 1.06490897 2.12495002 -0.32751817 0.24441361
[43] -1.10931475 1.53286005 -0.17520818 0.58878205 -0.98820041 0.40956377
[49] -0.91377854 -0.18351445 -0.23262882 0.00828949 0.53692184 -0.24274410
[55] -0.21724343 -0.44922154 2.59849320 0.81470116 1.51678341 -0.63643280
[61] -0.21847749 -1.18879288 -1.44372053 -1.66963369 -0.71940082 -2.03352928
[67] -0.48353411 1.11351160 0.64121637 -1.01941156 0.05101326 0.21969690
[73] 0.15841979 0.32676230 -1.74210292 -0.04259030 -0.01285365 -2.33845611
[79] 0.64152575 0.57510033 1.85345689 0.85976656 2.30446379 -0.45480503
[85] 2.18654339 0.23593024 -1.45018951 -0.05014092 0.73212405 -1.27369486
[91] -0.67519765 -2.29363957 -0.36368033 -0.10629991 -0.47967249 -0.65011746
[97] -1.88037107 1.21552784 0.74507972 1.32390507
> colMin(tmp)
[1] -0.07581973 -0.76120447 0.48575799 -0.39226535 0.23330314 0.75450024
[7] -0.21851113 -0.13914656 -0.42652929 0.22420503 0.14298615 -0.05090905
[13] -1.17151152 -0.13311718 2.27547237 -0.02271889 -0.47192461 -0.55645514
[19] -0.59157996 -0.85931497 0.31045621 0.87864651 0.77593241 0.49606138
[25] -1.29350730 -1.88598969 -0.46880617 -0.47767091 -0.25071500 -1.17748828
[31] 1.54572755 -0.08276629 0.08111508 0.87587420 -0.23464452 1.16787638
[37] 1.06244082 -0.59949338 1.06490897 2.12495002 -0.32751817 0.24441361
[43] -1.10931475 1.53286005 -0.17520818 0.58878205 -0.98820041 0.40956377
[49] -0.91377854 -0.18351445 -0.23262882 0.00828949 0.53692184 -0.24274410
[55] -0.21724343 -0.44922154 2.59849320 0.81470116 1.51678341 -0.63643280
[61] -0.21847749 -1.18879288 -1.44372053 -1.66963369 -0.71940082 -2.03352928
[67] -0.48353411 1.11351160 0.64121637 -1.01941156 0.05101326 0.21969690
[73] 0.15841979 0.32676230 -1.74210292 -0.04259030 -0.01285365 -2.33845611
[79] 0.64152575 0.57510033 1.85345689 0.85976656 2.30446379 -0.45480503
[85] 2.18654339 0.23593024 -1.45018951 -0.05014092 0.73212405 -1.27369486
[91] -0.67519765 -2.29363957 -0.36368033 -0.10629991 -0.47967249 -0.65011746
[97] -1.88037107 1.21552784 0.74507972 1.32390507
> colMedians(tmp)
[1] -0.07581973 -0.76120447 0.48575799 -0.39226535 0.23330314 0.75450024
[7] -0.21851113 -0.13914656 -0.42652929 0.22420503 0.14298615 -0.05090905
[13] -1.17151152 -0.13311718 2.27547237 -0.02271889 -0.47192461 -0.55645514
[19] -0.59157996 -0.85931497 0.31045621 0.87864651 0.77593241 0.49606138
[25] -1.29350730 -1.88598969 -0.46880617 -0.47767091 -0.25071500 -1.17748828
[31] 1.54572755 -0.08276629 0.08111508 0.87587420 -0.23464452 1.16787638
[37] 1.06244082 -0.59949338 1.06490897 2.12495002 -0.32751817 0.24441361
[43] -1.10931475 1.53286005 -0.17520818 0.58878205 -0.98820041 0.40956377
[49] -0.91377854 -0.18351445 -0.23262882 0.00828949 0.53692184 -0.24274410
[55] -0.21724343 -0.44922154 2.59849320 0.81470116 1.51678341 -0.63643280
[61] -0.21847749 -1.18879288 -1.44372053 -1.66963369 -0.71940082 -2.03352928
[67] -0.48353411 1.11351160 0.64121637 -1.01941156 0.05101326 0.21969690
[73] 0.15841979 0.32676230 -1.74210292 -0.04259030 -0.01285365 -2.33845611
[79] 0.64152575 0.57510033 1.85345689 0.85976656 2.30446379 -0.45480503
[85] 2.18654339 0.23593024 -1.45018951 -0.05014092 0.73212405 -1.27369486
[91] -0.67519765 -2.29363957 -0.36368033 -0.10629991 -0.47967249 -0.65011746
[97] -1.88037107 1.21552784 0.74507972 1.32390507
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.07581973 -0.7612045 0.485758 -0.3922653 0.2333031 0.7545002 -0.2185111
[2,] -0.07581973 -0.7612045 0.485758 -0.3922653 0.2333031 0.7545002 -0.2185111
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.1391466 -0.4265293 0.224205 0.1429862 -0.05090905 -1.171512 -0.1331172
[2,] -0.1391466 -0.4265293 0.224205 0.1429862 -0.05090905 -1.171512 -0.1331172
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 2.275472 -0.02271889 -0.4719246 -0.5564551 -0.59158 -0.859315 0.3104562
[2,] 2.275472 -0.02271889 -0.4719246 -0.5564551 -0.59158 -0.859315 0.3104562
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.8786465 0.7759324 0.4960614 -1.293507 -1.88599 -0.4688062 -0.4776709
[2,] 0.8786465 0.7759324 0.4960614 -1.293507 -1.88599 -0.4688062 -0.4776709
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.250715 -1.177488 1.545728 -0.08276629 0.08111508 0.8758742 -0.2346445
[2,] -0.250715 -1.177488 1.545728 -0.08276629 0.08111508 0.8758742 -0.2346445
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.167876 1.062441 -0.5994934 1.064909 2.12495 -0.3275182 0.2444136
[2,] 1.167876 1.062441 -0.5994934 1.064909 2.12495 -0.3275182 0.2444136
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.109315 1.53286 -0.1752082 0.588782 -0.9882004 0.4095638 -0.9137785
[2,] -1.109315 1.53286 -0.1752082 0.588782 -0.9882004 0.4095638 -0.9137785
[,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.1835145 -0.2326288 0.00828949 0.5369218 -0.2427441 -0.2172434
[2,] -0.1835145 -0.2326288 0.00828949 0.5369218 -0.2427441 -0.2172434
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.4492215 2.598493 0.8147012 1.516783 -0.6364328 -0.2184775 -1.188793
[2,] -0.4492215 2.598493 0.8147012 1.516783 -0.6364328 -0.2184775 -1.188793
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -1.443721 -1.669634 -0.7194008 -2.033529 -0.4835341 1.113512 0.6412164
[2,] -1.443721 -1.669634 -0.7194008 -2.033529 -0.4835341 1.113512 0.6412164
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -1.019412 0.05101326 0.2196969 0.1584198 0.3267623 -1.742103 -0.0425903
[2,] -1.019412 0.05101326 0.2196969 0.1584198 0.3267623 -1.742103 -0.0425903
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -0.01285365 -2.338456 0.6415258 0.5751003 1.853457 0.8597666 2.304464
[2,] -0.01285365 -2.338456 0.6415258 0.5751003 1.853457 0.8597666 2.304464
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -0.454805 2.186543 0.2359302 -1.45019 -0.05014092 0.7321241 -1.273695
[2,] -0.454805 2.186543 0.2359302 -1.45019 -0.05014092 0.7321241 -1.273695
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] -0.6751977 -2.29364 -0.3636803 -0.1062999 -0.4796725 -0.6501175 -1.880371
[2,] -0.6751977 -2.29364 -0.3636803 -0.1062999 -0.4796725 -0.6501175 -1.880371
[,98] [,99] [,100]
[1,] 1.215528 0.7450797 1.323905
[2,] 1.215528 0.7450797 1.323905
>
>
> Max(tmp2)
[1] 3.526148
> Min(tmp2)
[1] -2.434421
> mean(tmp2)
[1] 0.1542828
> Sum(tmp2)
[1] 15.42828
> Var(tmp2)
[1] 1.349175
>
> rowMeans(tmp2)
[1] -1.645209671 -0.068289735 -1.670251173 0.104490734 -1.506168269
[6] 0.424503815 -0.573725056 -0.907246508 0.908270912 -1.586240801
[11] -0.822282964 3.526148318 -1.175013620 -0.186221796 -0.606321591
[16] -0.001948822 -1.952455928 0.567257020 1.190363694 1.402929993
[21] -0.401070274 -0.456168375 -0.035510383 -0.843223595 0.230797943
[26] -0.462162223 0.583213488 -1.022195388 -2.117898059 -0.185610365
[31] 0.425856965 0.318008035 -0.169587778 0.624199185 0.753337384
[36] -1.320372177 1.071804447 -2.434420594 -0.413611505 0.963633777
[41] -0.650219813 -0.747502632 -1.522974998 1.702085930 0.717466621
[46] 0.016602598 1.951124139 0.285576570 1.229835460 -0.106469856
[51] 0.659231797 -0.669097307 2.680146413 1.110567516 1.615446418
[56] 0.223486236 2.838654157 -0.219734712 0.744480529 -0.346898749
[61] 1.564391537 0.330833039 -0.983891285 -0.183109153 -0.877291279
[66] -0.731148635 1.413882290 -0.777747713 2.029707589 2.019686225
[71] 0.503410530 0.899327114 2.174293388 0.504241761 -1.124499914
[76] 0.019143719 2.397368685 -0.383245138 0.316896786 -0.611031460
[81] 0.622002219 0.277944372 -1.476411530 -0.670309259 -0.819892285
[86] 2.383380248 -0.979592063 0.589338734 -0.038770223 0.662907851
[91] 1.290162789 -0.162584764 0.795419474 0.284700898 1.379463250
[96] 1.465664012 -1.066452157 0.886342868 0.329233213 -0.868905652
> rowSums(tmp2)
[1] -1.645209671 -0.068289735 -1.670251173 0.104490734 -1.506168269
[6] 0.424503815 -0.573725056 -0.907246508 0.908270912 -1.586240801
[11] -0.822282964 3.526148318 -1.175013620 -0.186221796 -0.606321591
[16] -0.001948822 -1.952455928 0.567257020 1.190363694 1.402929993
[21] -0.401070274 -0.456168375 -0.035510383 -0.843223595 0.230797943
[26] -0.462162223 0.583213488 -1.022195388 -2.117898059 -0.185610365
[31] 0.425856965 0.318008035 -0.169587778 0.624199185 0.753337384
[36] -1.320372177 1.071804447 -2.434420594 -0.413611505 0.963633777
[41] -0.650219813 -0.747502632 -1.522974998 1.702085930 0.717466621
[46] 0.016602598 1.951124139 0.285576570 1.229835460 -0.106469856
[51] 0.659231797 -0.669097307 2.680146413 1.110567516 1.615446418
[56] 0.223486236 2.838654157 -0.219734712 0.744480529 -0.346898749
[61] 1.564391537 0.330833039 -0.983891285 -0.183109153 -0.877291279
[66] -0.731148635 1.413882290 -0.777747713 2.029707589 2.019686225
[71] 0.503410530 0.899327114 2.174293388 0.504241761 -1.124499914
[76] 0.019143719 2.397368685 -0.383245138 0.316896786 -0.611031460
[81] 0.622002219 0.277944372 -1.476411530 -0.670309259 -0.819892285
[86] 2.383380248 -0.979592063 0.589338734 -0.038770223 0.662907851
[91] 1.290162789 -0.162584764 0.795419474 0.284700898 1.379463250
[96] 1.465664012 -1.066452157 0.886342868 0.329233213 -0.868905652
> 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] -1.645209671 -0.068289735 -1.670251173 0.104490734 -1.506168269
[6] 0.424503815 -0.573725056 -0.907246508 0.908270912 -1.586240801
[11] -0.822282964 3.526148318 -1.175013620 -0.186221796 -0.606321591
[16] -0.001948822 -1.952455928 0.567257020 1.190363694 1.402929993
[21] -0.401070274 -0.456168375 -0.035510383 -0.843223595 0.230797943
[26] -0.462162223 0.583213488 -1.022195388 -2.117898059 -0.185610365
[31] 0.425856965 0.318008035 -0.169587778 0.624199185 0.753337384
[36] -1.320372177 1.071804447 -2.434420594 -0.413611505 0.963633777
[41] -0.650219813 -0.747502632 -1.522974998 1.702085930 0.717466621
[46] 0.016602598 1.951124139 0.285576570 1.229835460 -0.106469856
[51] 0.659231797 -0.669097307 2.680146413 1.110567516 1.615446418
[56] 0.223486236 2.838654157 -0.219734712 0.744480529 -0.346898749
[61] 1.564391537 0.330833039 -0.983891285 -0.183109153 -0.877291279
[66] -0.731148635 1.413882290 -0.777747713 2.029707589 2.019686225
[71] 0.503410530 0.899327114 2.174293388 0.504241761 -1.124499914
[76] 0.019143719 2.397368685 -0.383245138 0.316896786 -0.611031460
[81] 0.622002219 0.277944372 -1.476411530 -0.670309259 -0.819892285
[86] 2.383380248 -0.979592063 0.589338734 -0.038770223 0.662907851
[91] 1.290162789 -0.162584764 0.795419474 0.284700898 1.379463250
[96] 1.465664012 -1.066452157 0.886342868 0.329233213 -0.868905652
> rowMin(tmp2)
[1] -1.645209671 -0.068289735 -1.670251173 0.104490734 -1.506168269
[6] 0.424503815 -0.573725056 -0.907246508 0.908270912 -1.586240801
[11] -0.822282964 3.526148318 -1.175013620 -0.186221796 -0.606321591
[16] -0.001948822 -1.952455928 0.567257020 1.190363694 1.402929993
[21] -0.401070274 -0.456168375 -0.035510383 -0.843223595 0.230797943
[26] -0.462162223 0.583213488 -1.022195388 -2.117898059 -0.185610365
[31] 0.425856965 0.318008035 -0.169587778 0.624199185 0.753337384
[36] -1.320372177 1.071804447 -2.434420594 -0.413611505 0.963633777
[41] -0.650219813 -0.747502632 -1.522974998 1.702085930 0.717466621
[46] 0.016602598 1.951124139 0.285576570 1.229835460 -0.106469856
[51] 0.659231797 -0.669097307 2.680146413 1.110567516 1.615446418
[56] 0.223486236 2.838654157 -0.219734712 0.744480529 -0.346898749
[61] 1.564391537 0.330833039 -0.983891285 -0.183109153 -0.877291279
[66] -0.731148635 1.413882290 -0.777747713 2.029707589 2.019686225
[71] 0.503410530 0.899327114 2.174293388 0.504241761 -1.124499914
[76] 0.019143719 2.397368685 -0.383245138 0.316896786 -0.611031460
[81] 0.622002219 0.277944372 -1.476411530 -0.670309259 -0.819892285
[86] 2.383380248 -0.979592063 0.589338734 -0.038770223 0.662907851
[91] 1.290162789 -0.162584764 0.795419474 0.284700898 1.379463250
[96] 1.465664012 -1.066452157 0.886342868 0.329233213 -0.868905652
>
> colMeans(tmp2)
[1] 0.1542828
> colSums(tmp2)
[1] 15.42828
> colVars(tmp2)
[1] 1.349175
> colSd(tmp2)
[1] 1.16154
> colMax(tmp2)
[1] 3.526148
> colMin(tmp2)
[1] -2.434421
> colMedians(tmp2)
[1] 0.06181723
> colRanges(tmp2)
[,1]
[1,] -2.434421
[2,] 3.526148
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.2934903 2.9273759 -3.9696611 -1.4719979 -3.0953346 0.7387777
[7] -1.4798744 6.4877916 -5.3948164 -5.9007446
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.67236268
[2,] -1.06582260
[3,] -0.07505462
[4,] 0.51236370
[5,] 2.13926308
>
> rowApply(tmp,sum)
[1] 0.362824 -7.521162 -4.079169 -1.098247 2.147407 -2.236392 2.600372
[8] -1.135453 -3.189564 1.697410
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 3 3 6 10 3 3 8 9 4
[2,] 9 7 8 10 3 5 9 6 5 6
[3,] 7 2 6 3 5 10 2 1 3 9
[4,] 4 6 10 1 6 6 6 3 8 2
[5,] 8 9 1 5 8 2 7 5 1 5
[6,] 5 4 2 4 4 9 10 10 6 7
[7,] 3 5 5 8 9 4 1 9 10 3
[8,] 10 10 9 9 7 8 4 4 2 10
[9,] 2 1 4 2 2 7 8 7 4 8
[10,] 6 8 7 7 1 1 5 2 7 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.9988863 0.7924403 2.7085343 -3.7866604 -1.6892890 0.9928565
[7] -1.5074890 1.4814742 -1.9111166 -1.4541277 -1.0336686 -4.8318458
[13] 0.5879785 5.1739144 -1.6361800 -2.1927446 -0.2327197 -0.7842613
[19] 1.7199382 3.1377764
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.76017346
[2,] -0.64173725
[3,] -0.18049992
[4,] 0.03380008
[5,] 0.54972422
>
> rowApply(tmp,sum)
[1] 6.873116 -4.340157 -5.397041 -2.337606 -1.262388
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 14 3 10 14 3
[2,] 12 8 15 12 13
[3,] 16 16 6 16 15
[4,] 4 6 3 2 14
[5,] 10 15 2 3 16
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.54972422 0.4405849 1.6365547 -0.9151920 0.1937060 -0.1879642
[2,] -1.76017346 -0.1796215 0.6935868 -0.4555468 0.4594374 -0.1071005
[3,] -0.18049992 0.3065629 -0.7321479 -1.7537159 -1.8874637 1.4862963
[4,] 0.03380008 -0.1168555 0.5191611 -1.0994584 -1.0648106 -0.8239511
[5,] -0.64173725 0.3417695 0.5913797 0.4372526 0.6098420 0.6255760
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.8727060 0.15966845 -0.353020955 -1.72562599 -0.5448134 -1.253750536
[2,] -1.8878391 1.02762651 -0.875138980 1.32618174 -1.2845970 -0.005149855
[3,] -1.0283802 0.02982782 -0.004338072 -0.03637942 -0.2499181 -2.225505454
[4,] 0.0868042 -1.18183325 1.191997417 -0.66504003 1.2745770 -0.851832045
[5,] -0.5507798 1.44618466 -1.870615994 -0.35326401 -0.2289172 -0.495607911
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.51551214 2.8246423 -1.5015782 0.5188156 1.9074336 -0.6481534
[2,] 0.08833472 0.8972767 -0.4176270 -0.1386897 -0.1710107 -2.2737526
[3,] -0.61703082 0.9862900 -0.1174207 -0.2892249 -1.3855465 0.8018525
[4,] 0.01828964 -0.3085817 0.8753064 -0.6239549 -0.1246346 -0.3854587
[5,] -0.41712722 0.7742871 -0.4748605 -1.6596906 -0.4589615 1.7212509
[,19] [,20]
[1,] 0.2480520 2.1358150
[2,] 0.8714232 -0.1477771
[3,] 1.0075449 0.4921564
[4,] -0.1316373 1.0405065
[5,] -0.2754446 -0.3829245
>
>
> 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 : 649 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.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 -0.1721908 -0.1957657 0.9632237 1.519463 0.09626402 -0.2834869 -0.8348278
col8 col9 col10 col11 col12 col13 col14
row1 0.01947287 -0.3766485 1.559027 -0.4366982 -1.034737 1.070262 -0.977591
col15 col16 col17 col18 col19 col20
row1 -0.2897985 0.2714634 0.8697123 -1.116402 -1.292341 -0.3342181
> tmp[,"col10"]
col10
row1 1.559027
row2 -1.459784
row3 -0.455805
row4 -1.945708
row5 1.470007
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.1721908 -0.1957657 0.9632237 1.5194632 0.09626402 -0.2834869
row5 1.0322768 0.8827593 -0.5067700 -0.2253133 0.26201341 -1.0622589
col7 col8 col9 col10 col11 col12 col13
row1 -0.8348278 0.01947287 -0.3766485 1.559027 -0.4366982 -1.0347368 1.070262
row5 0.4277143 0.38657973 -0.1278557 1.470007 -2.0949707 0.5622969 0.347666
col14 col15 col16 col17 col18 col19
row1 -0.9775910 -0.2897985 0.2714634 0.8697123 -1.1164017 -1.2923405
row5 0.3219572 -1.9376807 -0.5344655 1.0517446 -0.9706379 -0.4819589
col20
row1 -0.3342181
row5 -1.7050932
> tmp[,c("col6","col20")]
col6 col20
row1 -0.2834869 -0.3342181
row2 0.6465700 0.3280795
row3 -0.8750036 1.3439932
row4 0.2529769 1.1304540
row5 -1.0622589 -1.7050932
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.2834869 -0.3342181
row5 -1.0622589 -1.7050932
>
>
>
>
> 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 52.4229 51.14269 51.9866 48.46421 50.6038 103.0184 50.76336 48.55543
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.16751 49.38129 48.38523 50.50753 49.81855 48.84096 49.93729 48.52537
col17 col18 col19 col20
row1 50.53516 48.93518 48.41559 103.6778
> tmp[,"col10"]
col10
row1 49.38129
row2 30.04526
row3 30.28182
row4 29.34911
row5 48.02081
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 52.42290 51.14269 51.98660 48.46421 50.60380 103.0184 50.76336 48.55543
row5 49.61795 50.10372 49.08363 50.76635 49.25397 104.1262 50.51768 51.33404
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.16751 49.38129 48.38523 50.50753 49.81855 48.84096 49.93729 48.52537
row5 48.58594 48.02081 49.31140 49.76703 49.87236 49.13668 49.40111 50.66912
col17 col18 col19 col20
row1 50.53516 48.93518 48.41559 103.6778
row5 48.67851 50.90396 49.76262 103.6702
> tmp[,c("col6","col20")]
col6 col20
row1 103.01839 103.67780
row2 75.32556 72.78289
row3 75.42032 73.29450
row4 73.66662 76.00517
row5 104.12617 103.67018
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.0184 103.6778
row5 104.1262 103.6702
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.0184 103.6778
row5 104.1262 103.6702
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.6052437
[2,] 0.4773819
[3,] -0.3795610
[4,] -0.7891126
[5,] 0.3559979
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.99213011 -0.2188195
[2,] 0.89753161 -0.8568450
[3,] -0.13919793 -0.0463816
[4,] -0.01403816 0.4816944
[5,] 0.59527216 -0.3915177
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.2545014 -1.0811282
[2,] -0.1518093 0.9662740
[3,] -2.2891813 -1.0574557
[4,] 1.7018194 0.6432555
[5,] -1.6171105 -0.1081024
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.2545014
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.2545014
[2,] -0.1518093
>
>
>
> 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 -1.5411294 -1.1479121 0.1828927 0.1000749 -2.2786891 -2.2374115
row1 0.9713512 -0.8701153 -0.1780837 0.7502161 0.5132858 -0.1911645
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.4754939 -0.4606883 -0.6627859 -1.4347334 0.6126046 0.5838754
row1 -0.3607600 0.6930869 0.7781661 -0.7144245 0.5502421 -1.4202105
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -0.9071809 -1.343834 0.7389386 -1.3827012 -0.2811003570 0.003549308
row1 0.7882712 -0.610729 -1.2071620 -0.4312049 0.0009080309 1.102557596
[,19] [,20]
row3 -0.4732727 0.4149459
row1 1.0604433 -0.2879771
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.136457 -0.7576428 1.244568 0.1942995 -0.3050271 1.503923 -2.674424
[,8] [,9] [,10]
row2 -0.471295 -0.3781012 0.1411503
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.2789328 -1.863013 -0.9485234 1.372085 0.1040517 -1.359818 -0.8549417
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.5935811 1.224695 -0.6833549 -1.619511 -0.4019269 -0.1756879 0.8569449
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.2636775 1.643199 0.1003332 0.9083801 -0.848009 0.2768888
>
>
> 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: 0x6000023a4780>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd07bd90968"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd065f8ca5d"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd030add3f8"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd0643757bf"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd06d61efff"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd038d38673"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd04720052a"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd07332ce1"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd030c76b78"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd07460ac4c"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd076cfed44"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd04ce2484c"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd01bf89d03"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd05f0c3e4d"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMdcd01cce61fb"
>
>
> ### 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: 0x60000238c240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000238c240>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x60000238c240>
> rowMedians(tmp)
[1] -0.1881263613 0.7329031578 0.3093287406 -0.3140753918 -0.0775905307
[6] 0.6121697088 -0.4266856060 -0.0267149888 0.1284451965 0.4272996072
[11] 0.0678465882 0.3003135348 -0.2433561039 -0.1984502780 0.2224936397
[16] 0.0485230054 0.2209982170 -0.3565880536 -0.3354205973 -0.2720023073
[21] 0.4154344706 0.0125093395 -0.4845695307 0.1413791476 0.0254543149
[26] -0.2984534263 0.2112222765 0.2476775811 0.4003431709 -0.1395555321
[31] -0.3294300051 -0.1588840727 0.2771313701 -0.0348064517 0.2559013043
[36] 0.5466814752 -0.1665084310 -0.1381546624 -0.3358610605 0.0742651433
[41] 0.7160503572 -0.4794423786 0.3793438815 0.5378767464 0.0375128287
[46] -0.0011337083 0.0146412460 0.3190625115 -0.3559265475 0.3601399051
[51] -0.7304131436 0.2771943083 0.0198677868 -0.6321014357 -0.0903023513
[56] -0.1946037291 -0.0054854523 0.2935515575 -0.0070476060 -0.4973016542
[61] -0.1085791248 0.3861249689 0.3454812268 -0.0200475838 -0.1252052577
[66] -0.2146026039 0.0947152817 0.2576722169 -0.0193963257 0.3118412856
[71] -0.1090155798 0.3089846138 0.3920113374 0.3385082039 -0.0698421739
[76] 0.4000029624 -0.3436615392 0.5623725484 -0.0474389036 -0.0087856136
[81] 0.5335708094 -0.1167594603 0.3243034684 0.5710308186 0.2104156969
[86] 0.0857075821 -0.2383755493 -0.1093486750 0.3413925000 0.5760699303
[91] 0.0573467735 0.0971890615 0.3041464000 -0.0521608033 0.2172920913
[96] -0.3779455574 -0.4146676823 -0.0035140495 -0.4194376590 -0.3533762246
[101] 0.1886268357 -0.1016355531 -0.2600971359 0.0491208024 0.5663509131
[106] 0.0744839848 0.2530081059 -0.1011239376 -0.0597122458 -0.0892781252
[111] -0.0986268480 -0.0122611218 -0.1961522611 -0.2327662374 -0.2142571425
[116] 0.3910984816 -0.1253379933 0.5230193833 -0.6423610231 -0.4976760911
[121] 0.1021952620 0.3939875256 0.0213443855 0.4389610766 0.4152372759
[126] 0.1513697268 0.1046173637 0.1998504537 -0.3028268092 -0.1631932726
[131] -0.0002119672 0.3175093072 -0.0928031403 -0.4531658370 0.2396138844
[136] 0.2443747186 -0.2923592701 -0.0660373000 -0.1943725433 -0.0948686480
[141] -0.1034107823 0.1315602035 0.0090912940 0.0288878869 0.1277643625
[146] 0.6435194382 0.2008073867 -0.0286369509 -0.0046029620 -0.1288847805
[151] 0.3730543013 0.7626421361 0.0620579441 -0.2416372552 -0.3421272649
[156] 0.1716205722 -0.0287481531 0.1930678836 0.3415574030 -0.2945714158
[161] 0.0535640567 0.4039934580 -0.1868228402 0.3126032600 0.1709980776
[166] 0.1110035498 0.5744505279 -0.1488922996 0.2915609397 0.0777498085
[171] 0.2043340735 0.1261081141 -0.1331514851 -0.5817472363 -0.4765051316
[176] 0.1495994194 -0.0065115735 -0.2558362433 -0.2938626093 0.2471698704
[181] -0.2864282434 0.0625747561 -0.4121675513 -0.2368813008 0.4681465003
[186] 0.1164500672 -0.1461868399 0.1851295594 0.1917187729 0.4198103549
[191] -0.1781754493 -0.1318945560 -0.2223614636 0.3732395708 -0.7124836199
[196] -0.0730930586 -0.0934012632 -0.1955683581 -0.4960094046 0.3021704496
[201] 0.7665123607 0.5468835823 0.4515769627 0.0006617440 -0.3594440319
[206] 0.2503559272 -0.1486724928 -0.2302669848 -0.2758885810 -0.1512287978
[211] -0.2634551200 -0.7141975657 0.2827016801 0.0280482275 -0.2197020970
[216] -0.2541529359 -0.2249086010 0.1723535473 -0.1912888802 -0.4918040942
[221] -0.1693307106 -0.3819850041 0.2313730421 0.1399722146 -0.2534757348
[226] -0.1523029421 0.1397510214 0.0409877544 -0.5447966735 -0.0852397670
>
> proc.time()
user system elapsed
0.727 3.129 4.869
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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: 0x6000038d0000>
> .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: 0x6000038d0000>
> .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: 0x6000038d0000>
> .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: 0x6000038d0000>
> 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: 0x6000038cc7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038cc7e0>
> .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: 0x6000038cc7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038cc7e0>
> .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: 0x6000038cc7e0>
> 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: 0x6000038cc9c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038cc9c0>
> .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: 0x6000038cc9c0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000038cc9c0>
> .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: 0x6000038cc9c0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000038cc9c0>
> .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: 0x6000038cc9c0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000038cc9c0>
> .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: 0x6000038cc9c0>
> 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: 0x6000038ccba0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000038ccba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038ccba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038ccba0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0b4139e4029" "BufferedMatrixFilee0b439ef643e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee0b4139e4029" "BufferedMatrixFilee0b439ef643e"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038d82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038d82a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038d82a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000038d82a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000038d82a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000038d82a0>
> .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: 0x6000038d8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000038d8480>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000038d8480>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000038d8480>
> 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: 0x6000038d8660>
> .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: 0x6000038d8660>
> rm(P)
>
> proc.time()
user system elapsed
0.132 0.047 0.210
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
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.133 0.030 0.195