| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-11 12:04 -0500 (Thu, 11 Dec 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" | 4879 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4670 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4604 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4669 |
| 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-12-09 01:55:45 -0500 (Tue, 09 Dec 2025) |
| EndedAt: 2025-12-09 01:57:00 -0500 (Tue, 09 Dec 2025) |
| EllapsedTime: 74.6 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 (2025-10-31)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.589 0.210 0.790
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480714 25.7 1056242 56.5 NA 634451 33.9
Vcells 890616 6.8 8388608 64.0 65536 2108808 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 Dec 9 01:56:20 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 Dec 9 01:56:20 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: 0x600003234000>
>
>
>
> 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 Dec 9 01:56:26 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 Dec 9 01:56:29 2025"
>
> ColMode(tmp2)
<pointer: 0x600003234000>
>
>
>
> ### 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,] 100.2211435 -0.8321602 1.1910764 -0.5769564
[2,] -0.7760561 -1.2570614 0.6732470 -1.5485320
[3,] -1.5549264 -0.3868585 -1.0379433 -0.1189803
[4,] -2.1916737 1.1019546 -0.3312243 0.2769839
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.2211435 0.8321602 1.1910764 0.5769564
[2,] 0.7760561 1.2570614 0.6732470 1.5485320
[3,] 1.5549264 0.3868585 1.0379433 0.1189803
[4,] 2.1916737 1.1019546 0.3312243 0.2769839
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0110511 0.9122282 1.0913645 0.7595765
[2,] 0.8809405 1.1211875 0.8205163 1.2444003
[3,] 1.2469669 0.6219795 1.0187950 0.3449352
[4,] 1.4804303 1.0497402 0.5755209 0.5262926
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.33165 34.95444 37.10472 33.17272
[2,] 34.58546 37.46894 33.87841 38.99253
[3,] 39.02460 31.60665 36.22589 28.56833
[4,] 41.99598 36.59936 31.08643 30.53991
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000032200c0>
> exp(tmp5)
<pointer: 0x6000032200c0>
> log(tmp5,2)
<pointer: 0x6000032200c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.9983
> Min(tmp5)
[1] 52.31343
> mean(tmp5)
[1] 72.70153
> Sum(tmp5)
[1] 14540.31
> Var(tmp5)
[1] 855.2941
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.07989 70.53678 69.53228 70.65242 72.10957 71.20045 71.80774 69.23391
[9] 71.38935 69.47285
> rowSums(tmp5)
[1] 1821.598 1410.736 1390.646 1413.048 1442.191 1424.009 1436.155 1384.678
[9] 1427.787 1389.457
> rowVars(tmp5)
[1] 7971.01195 42.50618 87.27078 63.94635 47.33423 85.93428
[7] 50.51882 60.78342 69.16883 75.11469
> rowSd(tmp5)
[1] 89.280524 6.519677 9.341883 7.996646 6.879987 9.270074 7.107659
[8] 7.796372 8.316780 8.666873
> rowMax(tmp5)
[1] 468.99832 81.35821 86.32643 88.31330 82.69197 94.49292 85.14314
[8] 82.28760 84.63302 89.29561
> rowMin(tmp5)
[1] 55.62517 60.96275 55.38103 54.55824 55.23081 53.38238 59.90862 52.31343
[9] 58.17353 57.42998
>
> colMeans(tmp5)
[1] 115.89145 74.63723 72.06736 69.99500 71.98741 73.22695 69.39601
[8] 69.69565 68.31505 70.94383 72.45125 66.24150 66.89092 68.58380
[15] 73.32484 70.91506 66.74166 74.37149 72.22069 66.13335
> colSums(tmp5)
[1] 1158.9145 746.3723 720.6736 699.9500 719.8741 732.2695 693.9601
[8] 696.9565 683.1505 709.4383 724.5125 662.4150 668.9092 685.8380
[15] 733.2484 709.1506 667.4166 743.7149 722.2069 661.3335
> colVars(tmp5)
[1] 15435.02919 28.37655 28.11372 59.35462 56.57306 88.88417
[7] 99.46045 76.65108 57.10683 45.47507 51.90730 22.85245
[13] 62.32544 121.47936 33.44203 95.69884 62.45512 49.52883
[19] 77.61019 28.40448
> colSd(tmp5)
[1] 124.237793 5.326965 5.302237 7.704195 7.521507 9.427840
[7] 9.972986 8.755060 7.556906 6.743521 7.204672 4.780424
[13] 7.894647 11.021767 5.782908 9.782578 7.902855 7.037672
[19] 8.809665 5.329585
> colMax(tmp5)
[1] 468.99832 83.12381 78.33243 82.07726 85.14314 94.49292 86.32643
[8] 81.35821 84.73746 81.01113 84.20631 75.41820 80.14910 85.79668
[15] 81.93557 89.29561 80.87487 83.27983 88.31330 72.57811
> colMin(tmp5)
[1] 65.46941 65.78511 63.14739 59.46124 60.48515 58.17353 53.38238 54.55824
[9] 59.53902 61.68910 59.08103 59.90862 55.56726 55.38103 61.69469 55.62517
[17] 52.31343 60.96275 64.17917 55.23081
>
>
> ### 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] 91.07989 70.53678 69.53228 70.65242 72.10957 71.20045 71.80774 NA
[9] 71.38935 69.47285
> rowSums(tmp5)
[1] 1821.598 1410.736 1390.646 1413.048 1442.191 1424.009 1436.155 NA
[9] 1427.787 1389.457
> rowVars(tmp5)
[1] 7971.01195 42.50618 87.27078 63.94635 47.33423 85.93428
[7] 50.51882 61.48692 69.16883 75.11469
> rowSd(tmp5)
[1] 89.280524 6.519677 9.341883 7.996646 6.879987 9.270074 7.107659
[8] 7.841360 8.316780 8.666873
> rowMax(tmp5)
[1] 468.99832 81.35821 86.32643 88.31330 82.69197 94.49292 85.14314
[8] NA 84.63302 89.29561
> rowMin(tmp5)
[1] 55.62517 60.96275 55.38103 54.55824 55.23081 53.38238 59.90862 NA
[9] 58.17353 57.42998
>
> colMeans(tmp5)
[1] 115.89145 74.63723 72.06736 69.99500 71.98741 73.22695 NA
[8] 69.69565 68.31505 70.94383 72.45125 66.24150 66.89092 68.58380
[15] 73.32484 70.91506 66.74166 74.37149 72.22069 66.13335
> colSums(tmp5)
[1] 1158.9145 746.3723 720.6736 699.9500 719.8741 732.2695 NA
[8] 696.9565 683.1505 709.4383 724.5125 662.4150 668.9092 685.8380
[15] 733.2484 709.1506 667.4166 743.7149 722.2069 661.3335
> colVars(tmp5)
[1] 15435.02919 28.37655 28.11372 59.35462 56.57306 88.88417
[7] NA 76.65108 57.10683 45.47507 51.90730 22.85245
[13] 62.32544 121.47936 33.44203 95.69884 62.45512 49.52883
[19] 77.61019 28.40448
> colSd(tmp5)
[1] 124.237793 5.326965 5.302237 7.704195 7.521507 9.427840
[7] NA 8.755060 7.556906 6.743521 7.204672 4.780424
[13] 7.894647 11.021767 5.782908 9.782578 7.902855 7.037672
[19] 8.809665 5.329585
> colMax(tmp5)
[1] 468.99832 83.12381 78.33243 82.07726 85.14314 94.49292 NA
[8] 81.35821 84.73746 81.01113 84.20631 75.41820 80.14910 85.79668
[15] 81.93557 89.29561 80.87487 83.27983 88.31330 72.57811
> colMin(tmp5)
[1] 65.46941 65.78511 63.14739 59.46124 60.48515 58.17353 NA 54.55824
[9] 59.53902 61.68910 59.08103 59.90862 55.56726 55.38103 61.69469 55.62517
[17] 52.31343 60.96275 64.17917 55.23081
>
> Max(tmp5,na.rm=TRUE)
[1] 468.9983
> Min(tmp5,na.rm=TRUE)
[1] 52.31343
> mean(tmp5,na.rm=TRUE)
[1] 72.75293
> Sum(tmp5,na.rm=TRUE)
[1] 14477.83
> Var(tmp5,na.rm=TRUE)
[1] 859.0827
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.07989 70.53678 69.53228 70.65242 72.10957 71.20045 71.80774 69.58977
[9] 71.38935 69.47285
> rowSums(tmp5,na.rm=TRUE)
[1] 1821.598 1410.736 1390.646 1413.048 1442.191 1424.009 1436.155 1322.206
[9] 1427.787 1389.457
> rowVars(tmp5,na.rm=TRUE)
[1] 7971.01195 42.50618 87.27078 63.94635 47.33423 85.93428
[7] 50.51882 61.48692 69.16883 75.11469
> rowSd(tmp5,na.rm=TRUE)
[1] 89.280524 6.519677 9.341883 7.996646 6.879987 9.270074 7.107659
[8] 7.841360 8.316780 8.666873
> rowMax(tmp5,na.rm=TRUE)
[1] 468.99832 81.35821 86.32643 88.31330 82.69197 94.49292 85.14314
[8] 82.28760 84.63302 89.29561
> rowMin(tmp5,na.rm=TRUE)
[1] 55.62517 60.96275 55.38103 54.55824 55.23081 53.38238 59.90862 52.31343
[9] 58.17353 57.42998
>
> colMeans(tmp5,na.rm=TRUE)
[1] 115.89145 74.63723 72.06736 69.99500 71.98741 73.22695 70.16527
[8] 69.69565 68.31505 70.94383 72.45125 66.24150 66.89092 68.58380
[15] 73.32484 70.91506 66.74166 74.37149 72.22069 66.13335
> colSums(tmp5,na.rm=TRUE)
[1] 1158.9145 746.3723 720.6736 699.9500 719.8741 732.2695 631.4874
[8] 696.9565 683.1505 709.4383 724.5125 662.4150 668.9092 685.8380
[15] 733.2484 709.1506 667.4166 743.7149 722.2069 661.3335
> colVars(tmp5,na.rm=TRUE)
[1] 15435.02919 28.37655 28.11372 59.35462 56.57306 88.88417
[7] 105.23570 76.65108 57.10683 45.47507 51.90730 22.85245
[13] 62.32544 121.47936 33.44203 95.69884 62.45512 49.52883
[19] 77.61019 28.40448
> colSd(tmp5,na.rm=TRUE)
[1] 124.237793 5.326965 5.302237 7.704195 7.521507 9.427840
[7] 10.258445 8.755060 7.556906 6.743521 7.204672 4.780424
[13] 7.894647 11.021767 5.782908 9.782578 7.902855 7.037672
[19] 8.809665 5.329585
> colMax(tmp5,na.rm=TRUE)
[1] 468.99832 83.12381 78.33243 82.07726 85.14314 94.49292 86.32643
[8] 81.35821 84.73746 81.01113 84.20631 75.41820 80.14910 85.79668
[15] 81.93557 89.29561 80.87487 83.27983 88.31330 72.57811
> colMin(tmp5,na.rm=TRUE)
[1] 65.46941 65.78511 63.14739 59.46124 60.48515 58.17353 53.38238 54.55824
[9] 59.53902 61.68910 59.08103 59.90862 55.56726 55.38103 61.69469 55.62517
[17] 52.31343 60.96275 64.17917 55.23081
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.07989 70.53678 69.53228 70.65242 72.10957 71.20045 71.80774 NaN
[9] 71.38935 69.47285
> rowSums(tmp5,na.rm=TRUE)
[1] 1821.598 1410.736 1390.646 1413.048 1442.191 1424.009 1436.155 0.000
[9] 1427.787 1389.457
> rowVars(tmp5,na.rm=TRUE)
[1] 7971.01195 42.50618 87.27078 63.94635 47.33423 85.93428
[7] 50.51882 NA 69.16883 75.11469
> rowSd(tmp5,na.rm=TRUE)
[1] 89.280524 6.519677 9.341883 7.996646 6.879987 9.270074 7.107659
[8] NA 8.316780 8.666873
> rowMax(tmp5,na.rm=TRUE)
[1] 468.99832 81.35821 86.32643 88.31330 82.69197 94.49292 85.14314
[8] NA 84.63302 89.29561
> rowMin(tmp5,na.rm=TRUE)
[1] 55.62517 60.96275 55.38103 54.55824 55.23081 53.38238 59.90862 NA
[9] 58.17353 57.42998
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 121.49390 74.49674 72.37248 70.31001 72.47632 73.86464 NaN
[8] 68.48980 67.78868 71.00179 72.55402 66.00054 66.64392 69.91554
[15] 73.44922 69.65144 68.34480 74.61275 71.18132 66.92313
> colSums(tmp5,na.rm=TRUE)
[1] 1093.4451 670.4706 651.3523 632.7901 652.2869 664.7818 0.0000
[8] 616.4082 610.0981 639.0161 652.9861 594.0049 599.7953 629.2399
[15] 661.0430 626.8630 615.1032 671.5147 640.6319 602.3082
> colVars(tmp5,na.rm=TRUE)
[1] 17011.29916 31.70158 30.58061 65.65759 60.95557 95.41986
[7] NA 69.87406 61.12819 51.12165 58.27690 25.05580
[13] 69.42977 116.71190 37.44825 89.69805 41.34895 55.06513
[19] 75.15809 24.93778
> colSd(tmp5,na.rm=TRUE)
[1] 130.427371 5.630416 5.529974 8.102937 7.807405 9.768309
[7] NA 8.359071 7.818452 7.149941 7.633931 5.005577
[13] 8.332453 10.803328 6.119498 9.470905 6.430315 7.420588
[19] 8.669376 4.993774
> colMax(tmp5,na.rm=TRUE)
[1] 468.99832 83.12381 78.33243 82.07726 85.14314 94.49292 -Inf
[8] 81.35821 84.73746 81.01113 84.20631 75.41820 80.14910 85.79668
[15] 81.93557 89.29561 80.87487 83.27983 88.31330 72.57811
> colMin(tmp5,na.rm=TRUE)
[1] 71.98511 65.78511 63.14739 59.46124 60.48515 58.17353 Inf 54.55824
[9] 59.53902 61.68910 59.08103 59.90862 55.56726 55.38103 61.69469 55.62517
[17] 58.88472 60.96275 64.17917 55.23081
>
>
>
>
> 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] 360.7420 115.7835 251.4235 101.9015 230.0991 358.6127 264.1344 185.6121
[9] 282.1269 172.2338
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 360.7420 115.7835 251.4235 101.9015 230.0991 358.6127 264.1344 185.6121
[9] 282.1269 172.2338
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -5.684342e-14 -4.263256e-14 -2.842171e-14 2.842171e-14 0.000000e+00
[6] 0.000000e+00 -1.136868e-13 5.684342e-14 -1.136868e-13 -8.526513e-14
[11] 0.000000e+00 8.526513e-14 1.136868e-13 -8.526513e-14 -5.684342e-14
[16] -5.684342e-14 1.136868e-13 1.136868e-13 -1.705303e-13 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
4 18
10 8
6 7
1 11
9 7
4 12
1 3
6 11
7 6
4 1
8 14
7 1
1 19
7 15
6 8
8 3
5 3
1 1
7 20
5 19
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.616623
> Min(tmp)
[1] -2.254673
> mean(tmp)
[1] 0.1346688
> Sum(tmp)
[1] 13.46688
> Var(tmp)
[1] 1.043909
>
> rowMeans(tmp)
[1] 0.1346688
> rowSums(tmp)
[1] 13.46688
> rowVars(tmp)
[1] 1.043909
> rowSd(tmp)
[1] 1.021719
> rowMax(tmp)
[1] 2.616623
> rowMin(tmp)
[1] -2.254673
>
> colMeans(tmp)
[1] -0.33233580 -0.30507824 0.91856884 -0.15127662 0.14491348 -0.36127710
[7] 0.35980833 1.12679764 1.66331860 -0.51519845 0.97512242 2.28736783
[13] 1.20373432 1.46272902 0.69819392 1.05689272 -0.29838454 -0.45589507
[19] -0.79655512 0.98068673 -0.02181048 -2.25467252 -1.60525043 0.97347144
[25] 0.79600592 0.88409016 0.38507851 -1.16705879 0.40183546 1.25941454
[31] 0.43463692 -0.52665770 -1.97938965 0.35453829 0.05875863 1.01227456
[37] -0.55783432 -1.08526337 -1.12459790 -0.84071973 1.00825668 -0.56115731
[43] 0.63231284 1.22163390 -1.06928508 1.67047790 1.03366591 0.42941111
[49] -0.24363432 1.36562974 1.03195410 0.88731253 0.43590746 -1.03992240
[55] -1.19729014 1.38319010 -0.20304344 0.70501909 1.17396675 -0.97312983
[61] 0.20062621 0.91779292 0.21895564 0.62222656 -0.71785189 0.45737518
[67] -1.59982823 -1.79832583 -0.07209265 1.96337343 2.40005548 0.34394308
[73] 0.38480974 -1.30188834 -1.52459200 0.69795347 0.00797502 -0.20340330
[79] 0.15499392 0.80414100 -2.03610763 0.76102583 -0.25188097 -0.83589601
[85] 1.03023167 0.20848638 -0.22172064 -1.16423460 -0.96325323 0.33141596
[91] 0.85497135 -1.10535112 -0.98127103 -0.24206025 0.74411119 0.48565241
[97] 0.66972299 2.61662259 -1.12037707 -0.01970101
> colSums(tmp)
[1] -0.33233580 -0.30507824 0.91856884 -0.15127662 0.14491348 -0.36127710
[7] 0.35980833 1.12679764 1.66331860 -0.51519845 0.97512242 2.28736783
[13] 1.20373432 1.46272902 0.69819392 1.05689272 -0.29838454 -0.45589507
[19] -0.79655512 0.98068673 -0.02181048 -2.25467252 -1.60525043 0.97347144
[25] 0.79600592 0.88409016 0.38507851 -1.16705879 0.40183546 1.25941454
[31] 0.43463692 -0.52665770 -1.97938965 0.35453829 0.05875863 1.01227456
[37] -0.55783432 -1.08526337 -1.12459790 -0.84071973 1.00825668 -0.56115731
[43] 0.63231284 1.22163390 -1.06928508 1.67047790 1.03366591 0.42941111
[49] -0.24363432 1.36562974 1.03195410 0.88731253 0.43590746 -1.03992240
[55] -1.19729014 1.38319010 -0.20304344 0.70501909 1.17396675 -0.97312983
[61] 0.20062621 0.91779292 0.21895564 0.62222656 -0.71785189 0.45737518
[67] -1.59982823 -1.79832583 -0.07209265 1.96337343 2.40005548 0.34394308
[73] 0.38480974 -1.30188834 -1.52459200 0.69795347 0.00797502 -0.20340330
[79] 0.15499392 0.80414100 -2.03610763 0.76102583 -0.25188097 -0.83589601
[85] 1.03023167 0.20848638 -0.22172064 -1.16423460 -0.96325323 0.33141596
[91] 0.85497135 -1.10535112 -0.98127103 -0.24206025 0.74411119 0.48565241
[97] 0.66972299 2.61662259 -1.12037707 -0.01970101
> 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.33233580 -0.30507824 0.91856884 -0.15127662 0.14491348 -0.36127710
[7] 0.35980833 1.12679764 1.66331860 -0.51519845 0.97512242 2.28736783
[13] 1.20373432 1.46272902 0.69819392 1.05689272 -0.29838454 -0.45589507
[19] -0.79655512 0.98068673 -0.02181048 -2.25467252 -1.60525043 0.97347144
[25] 0.79600592 0.88409016 0.38507851 -1.16705879 0.40183546 1.25941454
[31] 0.43463692 -0.52665770 -1.97938965 0.35453829 0.05875863 1.01227456
[37] -0.55783432 -1.08526337 -1.12459790 -0.84071973 1.00825668 -0.56115731
[43] 0.63231284 1.22163390 -1.06928508 1.67047790 1.03366591 0.42941111
[49] -0.24363432 1.36562974 1.03195410 0.88731253 0.43590746 -1.03992240
[55] -1.19729014 1.38319010 -0.20304344 0.70501909 1.17396675 -0.97312983
[61] 0.20062621 0.91779292 0.21895564 0.62222656 -0.71785189 0.45737518
[67] -1.59982823 -1.79832583 -0.07209265 1.96337343 2.40005548 0.34394308
[73] 0.38480974 -1.30188834 -1.52459200 0.69795347 0.00797502 -0.20340330
[79] 0.15499392 0.80414100 -2.03610763 0.76102583 -0.25188097 -0.83589601
[85] 1.03023167 0.20848638 -0.22172064 -1.16423460 -0.96325323 0.33141596
[91] 0.85497135 -1.10535112 -0.98127103 -0.24206025 0.74411119 0.48565241
[97] 0.66972299 2.61662259 -1.12037707 -0.01970101
> colMin(tmp)
[1] -0.33233580 -0.30507824 0.91856884 -0.15127662 0.14491348 -0.36127710
[7] 0.35980833 1.12679764 1.66331860 -0.51519845 0.97512242 2.28736783
[13] 1.20373432 1.46272902 0.69819392 1.05689272 -0.29838454 -0.45589507
[19] -0.79655512 0.98068673 -0.02181048 -2.25467252 -1.60525043 0.97347144
[25] 0.79600592 0.88409016 0.38507851 -1.16705879 0.40183546 1.25941454
[31] 0.43463692 -0.52665770 -1.97938965 0.35453829 0.05875863 1.01227456
[37] -0.55783432 -1.08526337 -1.12459790 -0.84071973 1.00825668 -0.56115731
[43] 0.63231284 1.22163390 -1.06928508 1.67047790 1.03366591 0.42941111
[49] -0.24363432 1.36562974 1.03195410 0.88731253 0.43590746 -1.03992240
[55] -1.19729014 1.38319010 -0.20304344 0.70501909 1.17396675 -0.97312983
[61] 0.20062621 0.91779292 0.21895564 0.62222656 -0.71785189 0.45737518
[67] -1.59982823 -1.79832583 -0.07209265 1.96337343 2.40005548 0.34394308
[73] 0.38480974 -1.30188834 -1.52459200 0.69795347 0.00797502 -0.20340330
[79] 0.15499392 0.80414100 -2.03610763 0.76102583 -0.25188097 -0.83589601
[85] 1.03023167 0.20848638 -0.22172064 -1.16423460 -0.96325323 0.33141596
[91] 0.85497135 -1.10535112 -0.98127103 -0.24206025 0.74411119 0.48565241
[97] 0.66972299 2.61662259 -1.12037707 -0.01970101
> colMedians(tmp)
[1] -0.33233580 -0.30507824 0.91856884 -0.15127662 0.14491348 -0.36127710
[7] 0.35980833 1.12679764 1.66331860 -0.51519845 0.97512242 2.28736783
[13] 1.20373432 1.46272902 0.69819392 1.05689272 -0.29838454 -0.45589507
[19] -0.79655512 0.98068673 -0.02181048 -2.25467252 -1.60525043 0.97347144
[25] 0.79600592 0.88409016 0.38507851 -1.16705879 0.40183546 1.25941454
[31] 0.43463692 -0.52665770 -1.97938965 0.35453829 0.05875863 1.01227456
[37] -0.55783432 -1.08526337 -1.12459790 -0.84071973 1.00825668 -0.56115731
[43] 0.63231284 1.22163390 -1.06928508 1.67047790 1.03366591 0.42941111
[49] -0.24363432 1.36562974 1.03195410 0.88731253 0.43590746 -1.03992240
[55] -1.19729014 1.38319010 -0.20304344 0.70501909 1.17396675 -0.97312983
[61] 0.20062621 0.91779292 0.21895564 0.62222656 -0.71785189 0.45737518
[67] -1.59982823 -1.79832583 -0.07209265 1.96337343 2.40005548 0.34394308
[73] 0.38480974 -1.30188834 -1.52459200 0.69795347 0.00797502 -0.20340330
[79] 0.15499392 0.80414100 -2.03610763 0.76102583 -0.25188097 -0.83589601
[85] 1.03023167 0.20848638 -0.22172064 -1.16423460 -0.96325323 0.33141596
[91] 0.85497135 -1.10535112 -0.98127103 -0.24206025 0.74411119 0.48565241
[97] 0.66972299 2.61662259 -1.12037707 -0.01970101
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.3323358 -0.3050782 0.9185688 -0.1512766 0.1449135 -0.3612771 0.3598083
[2,] -0.3323358 -0.3050782 0.9185688 -0.1512766 0.1449135 -0.3612771 0.3598083
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.126798 1.663319 -0.5151984 0.9751224 2.287368 1.203734 1.462729
[2,] 1.126798 1.663319 -0.5151984 0.9751224 2.287368 1.203734 1.462729
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.6981939 1.056893 -0.2983845 -0.4558951 -0.7965551 0.9806867 -0.02181048
[2,] 0.6981939 1.056893 -0.2983845 -0.4558951 -0.7965551 0.9806867 -0.02181048
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -2.254673 -1.60525 0.9734714 0.7960059 0.8840902 0.3850785 -1.167059
[2,] -2.254673 -1.60525 0.9734714 0.7960059 0.8840902 0.3850785 -1.167059
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.4018355 1.259415 0.4346369 -0.5266577 -1.97939 0.3545383 0.05875863
[2,] 0.4018355 1.259415 0.4346369 -0.5266577 -1.97939 0.3545383 0.05875863
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.012275 -0.5578343 -1.085263 -1.124598 -0.8407197 1.008257 -0.5611573
[2,] 1.012275 -0.5578343 -1.085263 -1.124598 -0.8407197 1.008257 -0.5611573
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.6323128 1.221634 -1.069285 1.670478 1.033666 0.4294111 -0.2436343
[2,] 0.6323128 1.221634 -1.069285 1.670478 1.033666 0.4294111 -0.2436343
[,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57]
[1,] 1.36563 1.031954 0.8873125 0.4359075 -1.039922 -1.19729 1.38319 -0.2030434
[2,] 1.36563 1.031954 0.8873125 0.4359075 -1.039922 -1.19729 1.38319 -0.2030434
[,58] [,59] [,60] [,61] [,62] [,63] [,64]
[1,] 0.7050191 1.173967 -0.9731298 0.2006262 0.9177929 0.2189556 0.6222266
[2,] 0.7050191 1.173967 -0.9731298 0.2006262 0.9177929 0.2189556 0.6222266
[,65] [,66] [,67] [,68] [,69] [,70] [,71]
[1,] -0.7178519 0.4573752 -1.599828 -1.798326 -0.07209265 1.963373 2.400055
[2,] -0.7178519 0.4573752 -1.599828 -1.798326 -0.07209265 1.963373 2.400055
[,72] [,73] [,74] [,75] [,76] [,77] [,78]
[1,] 0.3439431 0.3848097 -1.301888 -1.524592 0.6979535 0.00797502 -0.2034033
[2,] 0.3439431 0.3848097 -1.301888 -1.524592 0.6979535 0.00797502 -0.2034033
[,79] [,80] [,81] [,82] [,83] [,84] [,85]
[1,] 0.1549939 0.804141 -2.036108 0.7610258 -0.251881 -0.835896 1.030232
[2,] 0.1549939 0.804141 -2.036108 0.7610258 -0.251881 -0.835896 1.030232
[,86] [,87] [,88] [,89] [,90] [,91] [,92]
[1,] 0.2084864 -0.2217206 -1.164235 -0.9632532 0.331416 0.8549714 -1.105351
[2,] 0.2084864 -0.2217206 -1.164235 -0.9632532 0.331416 0.8549714 -1.105351
[,93] [,94] [,95] [,96] [,97] [,98] [,99]
[1,] -0.981271 -0.2420602 0.7441112 0.4856524 0.669723 2.616623 -1.120377
[2,] -0.981271 -0.2420602 0.7441112 0.4856524 0.669723 2.616623 -1.120377
[,100]
[1,] -0.01970101
[2,] -0.01970101
>
>
> Max(tmp2)
[1] 1.770409
> Min(tmp2)
[1] -2.831713
> mean(tmp2)
[1] 0.01168675
> Sum(tmp2)
[1] 1.168675
> Var(tmp2)
[1] 0.7959213
>
> rowMeans(tmp2)
[1] 1.2033078381 0.4979867122 1.3019932219 -0.0128224369 -0.9844096950
[6] 0.3086177146 0.3410593518 -0.9476898088 -0.1354687260 -0.1629677596
[11] 0.3189822128 -1.4794687076 1.0059020963 0.6931251058 1.1948282955
[16] 0.7108717954 -2.6023867508 0.8611507806 0.9814358783 0.5670642161
[21] 0.8817619522 -0.7042896920 -0.9393002724 0.0456612273 0.0990757140
[26] -1.2303539584 -0.6624155426 -1.0218604530 -0.4808359997 -0.8140610783
[31] 0.0350666546 -1.2134645191 0.4632929586 1.0740493841 0.4762934065
[36] -1.2144927415 -0.9102325905 -0.5407555630 -0.6304723021 -0.0841243899
[41] -0.2351991104 1.0624212006 0.3035962837 1.3111956577 0.2062986046
[46] 1.1010452407 0.1683890456 0.4176442123 0.5008239368 -0.9638959029
[51] -0.2749995562 0.3281971651 -0.4436516012 0.2453788098 -0.3462001031
[56] -0.0004764418 0.3380583993 -0.3210392457 -0.1031723613 -2.2828787987
[61] 0.3197729294 -0.2090242443 -1.0439509433 -2.8317132823 0.0647572647
[66] -0.5362298423 0.5262442342 1.7704085434 -0.1996620094 0.5094263947
[71] -0.2187489499 0.1913470047 -1.1521144268 1.6582803560 -1.3582054096
[76] 1.1675341446 0.0567922795 1.0261986919 -0.5992535903 -0.1966630280
[81] -0.4107114425 0.5413334494 -0.7329612524 0.1604989206 -0.3312210269
[86] -0.7911379485 1.0993196429 1.1068262198 1.0120131715 -1.9630866174
[91] -0.0418340591 0.6316337453 0.9477147475 0.1322444125 0.2540980105
[96] 0.4680755025 0.5807031641 0.5927072550 0.5238295073 1.1422444705
> rowSums(tmp2)
[1] 1.2033078381 0.4979867122 1.3019932219 -0.0128224369 -0.9844096950
[6] 0.3086177146 0.3410593518 -0.9476898088 -0.1354687260 -0.1629677596
[11] 0.3189822128 -1.4794687076 1.0059020963 0.6931251058 1.1948282955
[16] 0.7108717954 -2.6023867508 0.8611507806 0.9814358783 0.5670642161
[21] 0.8817619522 -0.7042896920 -0.9393002724 0.0456612273 0.0990757140
[26] -1.2303539584 -0.6624155426 -1.0218604530 -0.4808359997 -0.8140610783
[31] 0.0350666546 -1.2134645191 0.4632929586 1.0740493841 0.4762934065
[36] -1.2144927415 -0.9102325905 -0.5407555630 -0.6304723021 -0.0841243899
[41] -0.2351991104 1.0624212006 0.3035962837 1.3111956577 0.2062986046
[46] 1.1010452407 0.1683890456 0.4176442123 0.5008239368 -0.9638959029
[51] -0.2749995562 0.3281971651 -0.4436516012 0.2453788098 -0.3462001031
[56] -0.0004764418 0.3380583993 -0.3210392457 -0.1031723613 -2.2828787987
[61] 0.3197729294 -0.2090242443 -1.0439509433 -2.8317132823 0.0647572647
[66] -0.5362298423 0.5262442342 1.7704085434 -0.1996620094 0.5094263947
[71] -0.2187489499 0.1913470047 -1.1521144268 1.6582803560 -1.3582054096
[76] 1.1675341446 0.0567922795 1.0261986919 -0.5992535903 -0.1966630280
[81] -0.4107114425 0.5413334494 -0.7329612524 0.1604989206 -0.3312210269
[86] -0.7911379485 1.0993196429 1.1068262198 1.0120131715 -1.9630866174
[91] -0.0418340591 0.6316337453 0.9477147475 0.1322444125 0.2540980105
[96] 0.4680755025 0.5807031641 0.5927072550 0.5238295073 1.1422444705
> 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.2033078381 0.4979867122 1.3019932219 -0.0128224369 -0.9844096950
[6] 0.3086177146 0.3410593518 -0.9476898088 -0.1354687260 -0.1629677596
[11] 0.3189822128 -1.4794687076 1.0059020963 0.6931251058 1.1948282955
[16] 0.7108717954 -2.6023867508 0.8611507806 0.9814358783 0.5670642161
[21] 0.8817619522 -0.7042896920 -0.9393002724 0.0456612273 0.0990757140
[26] -1.2303539584 -0.6624155426 -1.0218604530 -0.4808359997 -0.8140610783
[31] 0.0350666546 -1.2134645191 0.4632929586 1.0740493841 0.4762934065
[36] -1.2144927415 -0.9102325905 -0.5407555630 -0.6304723021 -0.0841243899
[41] -0.2351991104 1.0624212006 0.3035962837 1.3111956577 0.2062986046
[46] 1.1010452407 0.1683890456 0.4176442123 0.5008239368 -0.9638959029
[51] -0.2749995562 0.3281971651 -0.4436516012 0.2453788098 -0.3462001031
[56] -0.0004764418 0.3380583993 -0.3210392457 -0.1031723613 -2.2828787987
[61] 0.3197729294 -0.2090242443 -1.0439509433 -2.8317132823 0.0647572647
[66] -0.5362298423 0.5262442342 1.7704085434 -0.1996620094 0.5094263947
[71] -0.2187489499 0.1913470047 -1.1521144268 1.6582803560 -1.3582054096
[76] 1.1675341446 0.0567922795 1.0261986919 -0.5992535903 -0.1966630280
[81] -0.4107114425 0.5413334494 -0.7329612524 0.1604989206 -0.3312210269
[86] -0.7911379485 1.0993196429 1.1068262198 1.0120131715 -1.9630866174
[91] -0.0418340591 0.6316337453 0.9477147475 0.1322444125 0.2540980105
[96] 0.4680755025 0.5807031641 0.5927072550 0.5238295073 1.1422444705
> rowMin(tmp2)
[1] 1.2033078381 0.4979867122 1.3019932219 -0.0128224369 -0.9844096950
[6] 0.3086177146 0.3410593518 -0.9476898088 -0.1354687260 -0.1629677596
[11] 0.3189822128 -1.4794687076 1.0059020963 0.6931251058 1.1948282955
[16] 0.7108717954 -2.6023867508 0.8611507806 0.9814358783 0.5670642161
[21] 0.8817619522 -0.7042896920 -0.9393002724 0.0456612273 0.0990757140
[26] -1.2303539584 -0.6624155426 -1.0218604530 -0.4808359997 -0.8140610783
[31] 0.0350666546 -1.2134645191 0.4632929586 1.0740493841 0.4762934065
[36] -1.2144927415 -0.9102325905 -0.5407555630 -0.6304723021 -0.0841243899
[41] -0.2351991104 1.0624212006 0.3035962837 1.3111956577 0.2062986046
[46] 1.1010452407 0.1683890456 0.4176442123 0.5008239368 -0.9638959029
[51] -0.2749995562 0.3281971651 -0.4436516012 0.2453788098 -0.3462001031
[56] -0.0004764418 0.3380583993 -0.3210392457 -0.1031723613 -2.2828787987
[61] 0.3197729294 -0.2090242443 -1.0439509433 -2.8317132823 0.0647572647
[66] -0.5362298423 0.5262442342 1.7704085434 -0.1996620094 0.5094263947
[71] -0.2187489499 0.1913470047 -1.1521144268 1.6582803560 -1.3582054096
[76] 1.1675341446 0.0567922795 1.0261986919 -0.5992535903 -0.1966630280
[81] -0.4107114425 0.5413334494 -0.7329612524 0.1604989206 -0.3312210269
[86] -0.7911379485 1.0993196429 1.1068262198 1.0120131715 -1.9630866174
[91] -0.0418340591 0.6316337453 0.9477147475 0.1322444125 0.2540980105
[96] 0.4680755025 0.5807031641 0.5927072550 0.5238295073 1.1422444705
>
> colMeans(tmp2)
[1] 0.01168675
> colSums(tmp2)
[1] 1.168675
> colVars(tmp2)
[1] 0.7959213
> colSd(tmp2)
[1] 0.8921442
> colMax(tmp2)
[1] 1.770409
> colMin(tmp2)
[1] -2.831713
> colMedians(tmp2)
[1] 0.1156601
> colRanges(tmp2)
[,1]
[1,] -2.831713
[2,] 1.770409
>
> 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] -6.0075026 4.5138589 -1.6438560 -0.6902971 3.9070692 1.3194176
[7] 2.1602569 -4.1696849 -3.2885215 4.8526506
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.595696
[2,] -1.332834
[3,] -0.866970
[4,] -0.249916
[5,] 1.910544
>
> rowApply(tmp,sum)
[1] -1.9121522 -3.5153004 -0.4354216 2.4850449 -3.3801096 0.2649693
[7] 6.4293761 0.4576098 3.0262202 -2.4668455
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 7 3 2 4 1 10 2 6 1
[2,] 10 8 7 10 10 2 9 4 2 7
[3,] 9 9 8 1 5 4 4 1 10 4
[4,] 3 4 1 9 8 9 1 6 4 6
[5,] 6 5 5 8 2 7 8 9 8 5
[6,] 7 10 10 7 6 6 2 3 1 10
[7,] 5 3 2 5 9 8 5 10 5 9
[8,] 4 1 4 4 3 3 3 7 9 3
[9,] 2 6 6 3 1 5 7 5 7 2
[10,] 8 2 9 6 7 10 6 8 3 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.1780608 -4.0593055 -5.7156547 0.7598437 1.8876732 -1.6836242
[7] 2.1732752 3.5752447 -4.5363071 -6.1014464 3.8409602 0.0673352
[13] 0.7732075 0.4419580 -1.8021578 0.4375297 -1.8835641 7.3485302
[19] 3.8844307 1.1884463
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2061917
[2,] -0.6373864
[3,] -0.1216124
[4,] 0.7624745
[5,] 1.3807768
>
> rowApply(tmp,sum)
[1] 0.4807306 1.6457162 2.0393902 -4.5302416 1.1388400
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 4 5 16 9
[2,] 6 3 8 3 7
[3,] 1 5 11 12 1
[4,] 14 6 15 10 8
[5,] 10 7 17 20 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.3807768 -0.3479903 -2.95628900 0.7729926 0.02507081 -0.733425663
[2,] -1.2061917 -1.4192137 -1.17947249 -0.6700878 -0.34952226 -0.006756672
[3,] -0.6373864 -0.3612272 0.08582641 0.9545233 1.34057814 -0.412050128
[4,] 0.7624745 -1.6464668 -0.01580657 -0.1300377 1.44675162 0.629396394
[5,] -0.1216124 -0.2844075 -1.64991302 -0.1675468 -0.57520512 -1.160788155
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.0387304 0.4778069 -1.9756338 -0.2327567 0.28951134 -0.1930873
[2,] 2.2947241 0.7132099 -0.0774414 -0.3371543 1.19104920 -1.4813198
[3,] 1.0533113 1.7889979 -0.6400693 -2.3252452 2.47971036 0.1404759
[4,] -0.8609062 0.9381321 -1.3330679 -1.9425312 -0.05813884 0.2434845
[5,] 0.7248763 -0.3429021 -0.5100946 -1.2637589 -0.06117185 1.3577818
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.1261306 -0.4732361 0.8275350 0.93997614 0.6410214 1.0721781
[2,] 0.2799297 1.5087921 -1.5409716 -0.12840956 0.1674669 2.7255297
[3,] -0.3832468 -0.3276642 -0.1834140 0.43002478 -1.9709912 0.7306214
[4,] -0.4491373 -0.5177224 -1.2280200 -0.88409449 -1.7484683 1.4421058
[5,] 0.1995313 0.2517885 0.3227129 0.08003283 1.0274071 1.3780952
[,19] [,20]
[1,] 1.051646065 -0.17276592
[2,] 0.385781530 0.77577455
[3,] 1.646429868 -1.36981469
[4,] 0.797990164 0.02382089
[5,] 0.002583098 1.93143147
>
>
> 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 : 655 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 : 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.672693 -0.4588072 1.072432 0.6768841 -0.8803894 -1.319337 0.2388502
col8 col9 col10 col11 col12 col13 col14
row1 -0.5464724 -0.675257 0.01286756 0.9080689 0.2586395 -0.8415021 0.327998
col15 col16 col17 col18 col19 col20
row1 0.2253706 0.7169749 -0.8223227 -1.23299 0.3366451 0.7972903
> tmp[,"col10"]
col10
row1 0.01286756
row2 -0.29961045
row3 -1.00995985
row4 1.21009418
row5 1.14551842
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 1.6726934 -0.4588072 1.0724316 0.6768841 -0.88038945 -1.3193366
row5 -0.9408243 1.4971197 -0.3464465 -0.4752349 -0.06939581 0.7379675
col7 col8 col9 col10 col11 col12
row1 0.2388502 -0.5464724 -0.675257 0.01286756 0.90806892 0.2586395
row5 1.2789422 -0.8505135 -1.047355 1.14551842 -0.05922143 0.5613507
col13 col14 col15 col16 col17 col18 col19
row1 -0.84150208 0.327998 0.2253706 0.7169749 -0.8223227 -1.2329902 0.3366451
row5 -0.03237938 1.925440 -0.7937455 -0.9424877 -0.6679683 0.1669878 0.2574490
col20
row1 0.7972903
row5 0.3477149
> tmp[,c("col6","col20")]
col6 col20
row1 -1.319336557 0.7972903
row2 -1.507448647 -0.2308194
row3 0.008945324 -0.8022057
row4 -0.272891989 -2.6578244
row5 0.737967523 0.3477149
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.3193366 0.7972903
row5 0.7379675 0.3477149
>
>
>
>
> 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.76104 49.73968 50.70222 50.03649 49.20186 104.9768 49.7744 50.55195
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.39055 49.65116 48.26903 50.02297 49.87878 48.19693 48.90654 50.00586
col17 col18 col19 col20
row1 49.16631 49.26754 50.7036 103.923
> tmp[,"col10"]
col10
row1 49.65116
row2 29.73316
row3 30.03303
row4 30.87582
row5 50.72222
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.76104 49.73968 50.70222 50.03649 49.20186 104.9768 49.77440 50.55195
row5 50.35457 50.26722 50.05947 49.17759 49.34707 103.2574 47.91493 51.78152
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.39055 49.65116 48.26903 50.02297 49.87878 48.19693 48.90654 50.00586
row5 50.61893 50.72222 50.00447 50.13732 48.87094 51.31337 50.79531 49.83054
col17 col18 col19 col20
row1 49.16631 49.26754 50.70360 103.9230
row5 51.81047 49.95885 50.64847 106.6615
> tmp[,c("col6","col20")]
col6 col20
row1 104.97682 103.92305
row2 75.56891 74.92899
row3 73.99695 75.40486
row4 74.50141 78.10020
row5 103.25735 106.66149
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.9768 103.9230
row5 103.2574 106.6615
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.9768 103.9230
row5 103.2574 106.6615
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.5299215
[2,] 1.1752203
[3,] 0.1610218
[4,] 0.5910940
[5,] 0.8267722
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.4518700 1.0256842
[2,] 0.8212244 0.5159558
[3,] -1.1371954 -0.3799111
[4,] -0.7112306 0.6775045
[5,] -0.1028557 -0.4651739
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.6603309 -0.75918722
[2,] 1.3319496 -2.02477884
[3,] -0.4589143 2.00039503
[4,] 1.0450293 -0.07117689
[5,] -1.1716905 0.30062441
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.6603309
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.6603309
[2,] 1.3319496
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -1.716628 -0.7685038 1.43985329 0.5891328 -0.3677414 0.8704036 -0.4076673
row1 -0.110428 -0.8059202 0.08499009 0.7829098 -0.2251451 0.3599629 -0.1668124
[,8] [,9] [,10] [,11] [,12] [,13]
row3 1.5435026 -0.1626239 -0.6173281 -0.2739857 1.9773295 0.8956841
row1 -0.4220285 -1.0181620 -0.5450381 -1.8054477 0.8805996 -0.6874205
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.4539845 0.7524504 -0.1405931 0.4313688 -0.1820656 -0.8130173
row1 -1.1229565 0.1141047 -0.4742707 -0.2275639 -1.8945617 1.5441397
[,20]
row3 1.8191617
row1 -0.4409403
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.5688998 -1.324348 1.85521 -1.592225 -1.207578 0.8089494 0.1549433
[,8] [,9] [,10]
row2 0.7081351 -0.6035456 -0.3301233
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.439745 0.09525002 0.4518931 0.6169793 -0.884533 -0.7731044 0.1200306
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -2.476217 0.2302004 0.5801844 0.513849 0.9303291 1.237443 0.5318537
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.8226381 -0.5023086 1.320455 0.4949784 -0.2285296 0.475904
>
>
> 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: 0x60000322c4e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab57ceb7d7"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab4487b14a"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab2888946c"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab1ec8533e"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab71d11b3b"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab5752f8dd"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab850a1f5"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab65b8e016"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab4c7ff886"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab65954ca6"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab2cdb5a64"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab750b723d"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab42793ed3"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab260bb0bd"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM101ab49805bce"
>
>
> ### 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: 0x600003238000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003238000>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003238000>
> rowMedians(tmp)
[1] 0.1519256282 -0.0111380358 0.2511581757 0.0678129096 0.3002009103
[6] -0.0184567217 -0.6246421498 -0.5430973409 0.0495808081 -0.2883724875
[11] -0.0467816999 0.3120910586 0.1818837360 -0.0358472804 -0.2737043713
[16] 1.0364638069 0.3248158793 0.2499646056 -0.4882711308 0.0008042866
[21] 0.0638816145 -0.3954366140 -0.3144026778 -0.2645521479 0.3250377110
[26] 0.0107780471 -0.4820174441 -0.3665877530 -0.6167012310 0.0422556670
[31] 0.0391175835 0.3287152917 0.3332368315 0.1252089812 -0.4207589133
[36] -0.7076573026 -0.2651828998 0.3392072030 -0.2685174707 0.2051332817
[41] -0.1507120218 -0.1185921527 -0.2133762542 0.2796843036 0.0493957986
[46] -0.3374100587 -0.0371020891 -0.2304781780 0.2429442731 -0.4355503472
[51] 0.1345452536 -0.0006549656 -0.0706625609 -0.0954992862 -0.3402909543
[56] 0.3559739680 -0.0892901102 0.6252405595 -0.1498398491 0.2094515231
[61] 0.5100689761 -0.1985684067 -0.1653579923 -0.0986293063 -0.0724243034
[66] 0.0219470256 0.0653870859 -0.3116446545 0.2063004507 -0.1543868034
[71] 0.1164108714 0.0274923464 -0.1098811180 -0.5014859174 -0.8216814263
[76] -0.1312858667 0.1768839237 0.7249249266 0.4172232201 -0.3240950948
[81] -0.0907439173 -0.0177981062 -0.1771449811 -0.5382840778 0.0668487919
[86] 0.0485833246 -0.1030037811 -0.5229366780 0.2755473696 -0.1699520066
[91] -0.6948430659 0.0577222637 -0.1935797499 -0.1704466413 0.1100290602
[96] 0.3023512632 0.2547301384 -0.1136579931 0.6475748485 0.1659948636
[101] -0.2665636476 -0.1033457435 0.0112755248 0.3828029876 -0.1444824578
[106] -0.1938996436 0.2722177500 0.1278320218 0.3374544875 -0.1558526567
[111] -0.2988483831 0.1369482687 -0.2061675886 0.2007145596 0.0639002501
[116] 0.4683733468 -0.6547899245 -0.1957267821 0.0547848113 -0.4210579207
[121] -0.0432010670 0.1564299346 0.4302263639 0.0163942505 0.2161049767
[126] -0.1077263961 -0.0048814940 -0.5751682574 -0.2414758766 0.3237703736
[131] 0.3282789254 -0.4216813682 -0.3110065285 0.3960122168 -0.1444282307
[136] 0.0824939825 -0.0222651702 -0.0017480192 -0.2212134792 0.1786234335
[141] -0.1125205984 0.7703153544 0.1631098378 0.3878191474 -0.3589504118
[146] 0.2667011387 -0.0959693130 -0.2266801418 0.3248279154 0.7027235091
[151] -0.1170626926 0.1158301594 0.4623998340 0.0389610437 -0.1245685669
[156] -0.3087363115 0.6815246725 0.0525181384 0.2675950017 -0.5061911691
[161] 0.5913058707 -0.5083931827 0.0419841324 -0.6392194224 -0.3266397953
[166] 0.0163240345 -0.2276345812 0.4683173758 -0.1090558723 -0.2757193136
[171] -0.1886388222 -0.0715780800 0.2798899064 0.2303194113 0.1383364054
[176] 0.1065591287 0.6695468120 -0.5246774551 0.1624256889 -0.3482716926
[181] -0.3045539345 -0.0585339629 -0.2132818044 -0.0951428808 -0.0570404376
[186] -0.2701897211 0.2632917223 0.2770404849 -0.2106910693 0.1640528369
[191] 0.1702525927 -0.5107137924 0.4747709925 -0.3074781855 -0.4410840264
[196] -0.4645271408 0.9469351527 -0.5645319612 -0.5635660600 -0.1292543559
[201] 0.0796877653 0.1312495985 0.1724675625 -0.1253993010 0.0402959523
[206] 0.2683190160 0.4564159109 -0.1457377886 0.2040990605 0.3207592971
[211] -0.3143762431 0.0994976987 0.0436416971 -0.3658367166 0.0459322510
[216] 0.1412015806 -1.2175928705 0.0973805063 0.2039488729 -0.3254338515
[221] 0.0920074289 -0.2668003043 -0.3376196768 -0.5151301580 0.3076306009
[226] -0.2884406815 -0.0177191012 0.1160461770 0.6452071443 0.4421564823
>
> proc.time()
user system elapsed
5.086 18.807 27.624
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002fdc000>
> .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: 0x600002fdc000>
> .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: 0x600002fdc000>
> .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: 0x600002fdc000>
> 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: 0x600002fe0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe0000>
> .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: 0x600002fe0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe0000>
> .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: 0x600002fe0000>
> 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: 0x600002fe4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe4000>
> .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: 0x600002fe4000>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002fe4000>
> .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: 0x600002fe4000>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002fe4000>
> .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: 0x600002fe4000>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002fe4000>
> .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: 0x600002fe4000>
> 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: 0x600002fd0120>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002fd0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fd0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fd0120>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile107c325046773" "BufferedMatrixFile107c34423c201"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile107c325046773" "BufferedMatrixFile107c34423c201"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe8000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002fe8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002fe8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002fe8000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002fe8000>
> .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: 0x600002fe8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002fe8180>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002fe8180>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002fe8180>
> 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: 0x600002fe8360>
> .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: 0x600002fe8360>
> rm(P)
>
> proc.time()
user system elapsed
0.595 0.218 0.809
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.586 0.136 0.706