| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-27 12:02 -0500 (Thu, 27 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" | 4876 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4656 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4602 |
| 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-25 01:33:23 -0500 (Tue, 25 Nov 2025) |
| EndedAt: 2025-11-25 01:34:35 -0500 (Tue, 25 Nov 2025) |
| EllapsedTime: 72.1 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-05 r88990)
* 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 Patched (2025-11-05 r88990) -- "[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.585 0.204 0.780
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[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 480715 25.7 1056237 56.5 NA 634468 33.9
Vcells 890621 6.8 8388608 64.0 65536 2108742 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 25 01:33:57 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 25 01:33:57 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: 0x6000029e0000>
>
>
>
> 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 25 01:34:03 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 25 01:34:06 2025"
>
> ColMode(tmp2)
<pointer: 0x6000029e0000>
>
>
>
> ### 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.2165923 0.5291927 -1.584264276 -0.0007844913
[2,] 0.6704568 1.0928181 -0.705290285 -0.3237608458
[3,] -0.8886938 0.7044872 -1.749728776 0.2771581755
[4,] -0.2126370 0.2476680 -0.004163753 0.1456777150
> 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,] 98.2165923 0.5291927 1.584264276 0.0007844913
[2,] 0.6704568 1.0928181 0.705290285 0.3237608458
[3,] 0.8886938 0.7044872 1.749728776 0.2771581755
[4,] 0.2126370 0.2476680 0.004163753 0.1456777150
> 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,] 9.9104285 0.7274563 1.25867560 0.02800877
[2,] 0.8188142 1.0453794 0.83981563 0.56899986
[3,] 0.9427056 0.8393374 1.32277314 0.52645814
[4,] 0.4611258 0.4976625 0.06452715 0.38167750
>
> 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,] 222.32088 32.80376 39.17102 25.28087
[2,] 33.85860 36.54661 34.10345 31.01376
[3,] 35.31575 34.09786 39.97746 30.54174
[4,] 29.82389 30.22429 25.64944 28.96245
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000029c8120>
> exp(tmp5)
<pointer: 0x6000029c8120>
> log(tmp5,2)
<pointer: 0x6000029c8120>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.7318
> Min(tmp5)
[1] 52.61882
> mean(tmp5)
[1] 71.59586
> Sum(tmp5)
[1] 14319.17
> Var(tmp5)
[1] 836.3136
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.22149 67.32482 70.74770 70.81529 68.63623 69.46517 71.13547 68.36401
[9] 71.29123 67.95716
> rowSums(tmp5)
[1] 1804.430 1346.496 1414.954 1416.306 1372.725 1389.303 1422.709 1367.280
[9] 1425.825 1359.143
> rowVars(tmp5)
[1] 7761.75179 53.29275 57.58375 88.01826 68.15142 77.60358
[7] 62.16362 50.67514 55.12868 59.89048
> rowSd(tmp5)
[1] 88.100805 7.300189 7.588396 9.381804 8.255388 8.809290 7.884391
[8] 7.118647 7.424869 7.738894
> rowMax(tmp5)
[1] 462.73178 81.35944 83.20785 87.56536 89.12017 87.01426 84.51457
[8] 86.91568 83.64743 89.22831
> rowMin(tmp5)
[1] 52.61882 53.95866 57.39862 53.38594 57.13641 56.70619 56.23121 54.63741
[9] 60.44943 56.16344
>
> colMeans(tmp5)
[1] 108.51403 69.22400 73.75368 65.51772 69.19890 75.11563 67.01028
[8] 71.10341 70.68045 71.07180 63.68967 68.59545 70.74369 70.65188
[15] 70.49464 71.14282 69.17534 69.59780 70.94629 65.68966
> colSums(tmp5)
[1] 1085.1403 692.2400 737.5368 655.1772 691.9890 751.1563 670.1028
[8] 711.0341 706.8045 710.7180 636.8967 685.9545 707.4369 706.5188
[15] 704.9464 711.4282 691.7534 695.9780 709.4629 656.8966
> colVars(tmp5)
[1] 15557.07063 48.46144 84.06724 111.58203 67.77002 83.62647
[7] 63.27856 35.47469 78.08804 41.52644 25.37083 103.73738
[13] 41.86139 64.18290 42.76889 74.70243 90.68989 50.03057
[19] 58.84927 23.79942
> colSd(tmp5)
[1] 124.727987 6.961425 9.168819 10.563240 8.232255 9.144751
[7] 7.954782 5.956063 8.836744 6.444101 5.036946 10.185155
[13] 6.470038 8.011423 6.539793 8.643057 9.523124 7.073229
[19] 7.671328 4.878465
> colMax(tmp5)
[1] 462.73178 77.60211 83.68673 85.18017 78.16446 89.22831 82.89756
[8] 84.50516 84.24912 81.56737 69.72053 87.56536 82.18560 84.51457
[15] 80.34339 87.01426 86.16122 76.90102 81.27029 78.80480
> colMin(tmp5)
[1] 60.47093 58.59350 53.38594 52.61882 57.39862 59.46245 57.35365 63.28296
[9] 60.44943 61.64400 56.16344 56.70619 62.53866 60.36243 62.92371 61.96478
[17] 54.63741 53.95866 58.49327 61.50371
>
>
> ### 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] NA 67.32482 70.74770 70.81529 68.63623 69.46517 71.13547 68.36401
[9] 71.29123 67.95716
> rowSums(tmp5)
[1] NA 1346.496 1414.954 1416.306 1372.725 1389.303 1422.709 1367.280
[9] 1425.825 1359.143
> rowVars(tmp5)
[1] 8145.77833 53.29275 57.58375 88.01826 68.15142 77.60358
[7] 62.16362 50.67514 55.12868 59.89048
> rowSd(tmp5)
[1] 90.253966 7.300189 7.588396 9.381804 8.255388 8.809290 7.884391
[8] 7.118647 7.424869 7.738894
> rowMax(tmp5)
[1] NA 81.35944 83.20785 87.56536 89.12017 87.01426 84.51457 86.91568
[9] 83.64743 89.22831
> rowMin(tmp5)
[1] NA 53.95866 57.39862 53.38594 57.13641 56.70619 56.23121 54.63741
[9] 60.44943 56.16344
>
> colMeans(tmp5)
[1] 108.51403 69.22400 73.75368 65.51772 69.19890 75.11563 67.01028
[8] 71.10341 70.68045 71.07180 63.68967 NA 70.74369 70.65188
[15] 70.49464 71.14282 69.17534 69.59780 70.94629 65.68966
> colSums(tmp5)
[1] 1085.1403 692.2400 737.5368 655.1772 691.9890 751.1563 670.1028
[8] 711.0341 706.8045 710.7180 636.8967 NA 707.4369 706.5188
[15] 704.9464 711.4282 691.7534 695.9780 709.4629 656.8966
> colVars(tmp5)
[1] 15557.07063 48.46144 84.06724 111.58203 67.77002 83.62647
[7] 63.27856 35.47469 78.08804 41.52644 25.37083 NA
[13] 41.86139 64.18290 42.76889 74.70243 90.68989 50.03057
[19] 58.84927 23.79942
> colSd(tmp5)
[1] 124.727987 6.961425 9.168819 10.563240 8.232255 9.144751
[7] 7.954782 5.956063 8.836744 6.444101 5.036946 NA
[13] 6.470038 8.011423 6.539793 8.643057 9.523124 7.073229
[19] 7.671328 4.878465
> colMax(tmp5)
[1] 462.73178 77.60211 83.68673 85.18017 78.16446 89.22831 82.89756
[8] 84.50516 84.24912 81.56737 69.72053 NA 82.18560 84.51457
[15] 80.34339 87.01426 86.16122 76.90102 81.27029 78.80480
> colMin(tmp5)
[1] 60.47093 58.59350 53.38594 52.61882 57.39862 59.46245 57.35365 63.28296
[9] 60.44943 61.64400 56.16344 NA 62.53866 60.36243 62.92371 61.96478
[17] 54.63741 53.95866 58.49327 61.50371
>
> Max(tmp5,na.rm=TRUE)
[1] 462.7318
> Min(tmp5,na.rm=TRUE)
[1] 52.61882
> mean(tmp5,na.rm=TRUE)
[1] 71.645
> Sum(tmp5,na.rm=TRUE)
[1] 14257.35
> Var(tmp5,na.rm=TRUE)
[1] 840.052
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.71646 67.32482 70.74770 70.81529 68.63623 69.46517 71.13547 68.36401
[9] 71.29123 67.95716
> rowSums(tmp5,na.rm=TRUE)
[1] 1742.613 1346.496 1414.954 1416.306 1372.725 1389.303 1422.709 1367.280
[9] 1425.825 1359.143
> rowVars(tmp5,na.rm=TRUE)
[1] 8145.77833 53.29275 57.58375 88.01826 68.15142 77.60358
[7] 62.16362 50.67514 55.12868 59.89048
> rowSd(tmp5,na.rm=TRUE)
[1] 90.253966 7.300189 7.588396 9.381804 8.255388 8.809290 7.884391
[8] 7.118647 7.424869 7.738894
> rowMax(tmp5,na.rm=TRUE)
[1] 462.73178 81.35944 83.20785 87.56536 89.12017 87.01426 84.51457
[8] 86.91568 83.64743 89.22831
> rowMin(tmp5,na.rm=TRUE)
[1] 52.61882 53.95866 57.39862 53.38594 57.13641 56.70619 56.23121 54.63741
[9] 60.44943 56.16344
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.51403 69.22400 73.75368 65.51772 69.19890 75.11563 67.01028
[8] 71.10341 70.68045 71.07180 63.68967 69.34861 70.74369 70.65188
[15] 70.49464 71.14282 69.17534 69.59780 70.94629 65.68966
> colSums(tmp5,na.rm=TRUE)
[1] 1085.1403 692.2400 737.5368 655.1772 691.9890 751.1563 670.1028
[8] 711.0341 706.8045 710.7180 636.8967 624.1375 707.4369 706.5188
[15] 704.9464 711.4282 691.7534 695.9780 709.4629 656.8966
> colVars(tmp5,na.rm=TRUE)
[1] 15557.07063 48.46144 84.06724 111.58203 67.77002 83.62647
[7] 63.27856 35.47469 78.08804 41.52644 25.37083 110.32313
[13] 41.86139 64.18290 42.76889 74.70243 90.68989 50.03057
[19] 58.84927 23.79942
> colSd(tmp5,na.rm=TRUE)
[1] 124.727987 6.961425 9.168819 10.563240 8.232255 9.144751
[7] 7.954782 5.956063 8.836744 6.444101 5.036946 10.503482
[13] 6.470038 8.011423 6.539793 8.643057 9.523124 7.073229
[19] 7.671328 4.878465
> colMax(tmp5,na.rm=TRUE)
[1] 462.73178 77.60211 83.68673 85.18017 78.16446 89.22831 82.89756
[8] 84.50516 84.24912 81.56737 69.72053 87.56536 82.18560 84.51457
[15] 80.34339 87.01426 86.16122 76.90102 81.27029 78.80480
> colMin(tmp5,na.rm=TRUE)
[1] 60.47093 58.59350 53.38594 52.61882 57.39862 59.46245 57.35365 63.28296
[9] 60.44943 61.64400 56.16344 56.70619 62.53866 60.36243 62.92371 61.96478
[17] 54.63741 53.95866 58.49327 61.50371
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] NaN 67.32482 70.74770 70.81529 68.63623 69.46517 71.13547 68.36401
[9] 71.29123 67.95716
> rowSums(tmp5,na.rm=TRUE)
[1] 0.000 1346.496 1414.954 1416.306 1372.725 1389.303 1422.709 1367.280
[9] 1425.825 1359.143
> rowVars(tmp5,na.rm=TRUE)
[1] NA 53.29275 57.58375 88.01826 68.15142 77.60358 62.16362 50.67514
[9] 55.12868 59.89048
> rowSd(tmp5,na.rm=TRUE)
[1] NA 7.300189 7.588396 9.381804 8.255388 8.809290 7.884391 7.118647
[9] 7.424869 7.738894
> rowMax(tmp5,na.rm=TRUE)
[1] NA 81.35944 83.20785 87.56536 89.12017 87.01426 84.51457 86.91568
[9] 83.64743 89.22831
> rowMin(tmp5,na.rm=TRUE)
[1] NA 53.95866 57.39862 53.38594 57.13641 56.70619 56.23121 54.63741
[9] 60.44943 56.16344
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 69.15650 69.32925 72.88972 66.95093 68.20273 76.85488 67.05932 69.61433
[9] 70.16472 69.90563 63.55342 NaN 70.97384 69.94950 70.36830 72.08246
[17] 69.49500 68.91433 69.79918 65.91422
> colSums(tmp5,na.rm=TRUE)
[1] 622.4085 623.9632 656.0074 602.5584 613.8246 691.6939 603.5338 626.5290
[9] 631.4825 629.1506 571.9808 0.0000 638.7646 629.5455 633.3147 648.7421
[17] 625.4550 620.2290 628.1926 593.2280
> colVars(tmp5,na.rm=TRUE)
[1] 75.28614 54.39449 86.17829 102.42123 65.07723 60.04891 71.16133
[8] 14.96363 84.85681 31.41767 28.33333 NA 46.49818 66.65572
[15] 47.93544 74.10734 100.87662 51.02911 51.40196 26.20704
> colSd(tmp5,na.rm=TRUE)
[1] 8.676758 7.375262 9.283226 10.120337 8.067046 7.749123 8.435717
[8] 3.868285 9.211776 5.605146 5.322906 NA 6.818957 8.164295
[15] 6.923543 8.608562 10.043735 7.143467 7.169516 5.119281
> colMax(tmp5,na.rm=TRUE)
[1] 89.12017 77.60211 83.68673 85.18017 77.75805 89.22831 82.89756 75.63595
[9] 84.24912 77.34407 69.72053 -Inf 82.18560 84.51457 80.34339 87.01426
[17] 86.16122 76.90102 78.88989 78.80480
> colMin(tmp5,na.rm=TRUE)
[1] 60.47093 58.59350 53.38594 56.23121 57.39862 67.10251 57.35365 63.28296
[9] 60.44943 61.64400 56.16344 Inf 62.53866 60.36243 62.92371 61.96478
[17] 54.63741 53.95866 58.49327 61.50371
>
>
>
>
> 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] 261.1024 306.1472 254.4121 112.3933 209.4791 298.1872 188.9112 212.9273
[9] 338.2610 228.2920
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 261.1024 306.1472 254.4121 112.3933 209.4791 298.1872 188.9112 212.9273
[9] 338.2610 228.2920
>
>
>
> 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.705303e-13 2.273737e-13 0.000000e+00 3.552714e-14 -2.131628e-14
[6] -1.136868e-13 0.000000e+00 0.000000e+00 0.000000e+00 -5.684342e-14
[11] -7.389644e-13 5.684342e-14 0.000000e+00 -5.684342e-14 -1.136868e-13
[16] 5.684342e-14 -7.105427e-14 1.136868e-13 2.842171e-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 19
5 14
2 4
10 1
6 17
8 4
4 5
1 16
4 8
5 9
4 17
3 9
1 16
10 11
7 12
1 19
10 9
7 10
4 18
3 8
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 3.427367
> Min(tmp)
[1] -1.72109
> mean(tmp)
[1] 0.133234
> Sum(tmp)
[1] 13.3234
> Var(tmp)
[1] 0.9578244
>
> rowMeans(tmp)
[1] 0.133234
> rowSums(tmp)
[1] 13.3234
> rowVars(tmp)
[1] 0.9578244
> rowSd(tmp)
[1] 0.978685
> rowMax(tmp)
[1] 3.427367
> rowMin(tmp)
[1] -1.72109
>
> colMeans(tmp)
[1] -0.281997608 -1.053325455 -0.222060718 0.997848051 3.427366911
[6] -0.212056651 -1.096338378 1.087569643 -0.099736674 -0.702200159
[11] 0.199863447 1.209994832 -0.710811946 -0.623807769 1.383922492
[16] 0.993061741 0.832710469 -0.988527897 -1.596557505 0.420077842
[21] -1.382502291 0.150327654 -1.698460019 1.316136863 -0.289701201
[26] 0.846011967 0.601696011 0.003891645 -1.001879767 0.120570217
[31] 1.249198486 0.864508460 0.753306947 -0.268624976 0.313197782
[36] 0.044828867 0.549924529 -0.152942616 -0.455340401 0.888301402
[41] -1.035759468 -0.160428027 0.168518940 -0.189625152 -0.965353214
[46] 0.571363470 0.609888550 -0.058754034 0.095361656 0.738089861
[51] 0.176140227 1.247588655 -0.587748541 -0.438235082 0.630507452
[56] 1.774386706 0.618525403 -1.664572933 -0.254105426 -0.894692803
[61] -0.261009121 -0.254949221 0.792046547 -0.919051434 1.441233977
[66] -0.655653861 1.606611624 1.524529232 0.824731933 -1.529455372
[71] -0.898480934 0.289904161 -0.163662011 0.400780319 2.088448423
[76] 0.792535555 -0.653571690 0.599966989 -0.776892433 2.368941003
[81] -1.721090322 0.386163169 -0.182925258 1.483882226 0.774114115
[86] 1.479363470 -0.019013702 -0.740599163 -1.473407606 0.644174418
[91] -1.117757599 1.230353425 0.864079161 0.304601839 -0.603642643
[96] 0.428977128 1.110839165 -0.034692545 -1.320660862 -0.584904455
> colSums(tmp)
[1] -0.281997608 -1.053325455 -0.222060718 0.997848051 3.427366911
[6] -0.212056651 -1.096338378 1.087569643 -0.099736674 -0.702200159
[11] 0.199863447 1.209994832 -0.710811946 -0.623807769 1.383922492
[16] 0.993061741 0.832710469 -0.988527897 -1.596557505 0.420077842
[21] -1.382502291 0.150327654 -1.698460019 1.316136863 -0.289701201
[26] 0.846011967 0.601696011 0.003891645 -1.001879767 0.120570217
[31] 1.249198486 0.864508460 0.753306947 -0.268624976 0.313197782
[36] 0.044828867 0.549924529 -0.152942616 -0.455340401 0.888301402
[41] -1.035759468 -0.160428027 0.168518940 -0.189625152 -0.965353214
[46] 0.571363470 0.609888550 -0.058754034 0.095361656 0.738089861
[51] 0.176140227 1.247588655 -0.587748541 -0.438235082 0.630507452
[56] 1.774386706 0.618525403 -1.664572933 -0.254105426 -0.894692803
[61] -0.261009121 -0.254949221 0.792046547 -0.919051434 1.441233977
[66] -0.655653861 1.606611624 1.524529232 0.824731933 -1.529455372
[71] -0.898480934 0.289904161 -0.163662011 0.400780319 2.088448423
[76] 0.792535555 -0.653571690 0.599966989 -0.776892433 2.368941003
[81] -1.721090322 0.386163169 -0.182925258 1.483882226 0.774114115
[86] 1.479363470 -0.019013702 -0.740599163 -1.473407606 0.644174418
[91] -1.117757599 1.230353425 0.864079161 0.304601839 -0.603642643
[96] 0.428977128 1.110839165 -0.034692545 -1.320660862 -0.584904455
> 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.281997608 -1.053325455 -0.222060718 0.997848051 3.427366911
[6] -0.212056651 -1.096338378 1.087569643 -0.099736674 -0.702200159
[11] 0.199863447 1.209994832 -0.710811946 -0.623807769 1.383922492
[16] 0.993061741 0.832710469 -0.988527897 -1.596557505 0.420077842
[21] -1.382502291 0.150327654 -1.698460019 1.316136863 -0.289701201
[26] 0.846011967 0.601696011 0.003891645 -1.001879767 0.120570217
[31] 1.249198486 0.864508460 0.753306947 -0.268624976 0.313197782
[36] 0.044828867 0.549924529 -0.152942616 -0.455340401 0.888301402
[41] -1.035759468 -0.160428027 0.168518940 -0.189625152 -0.965353214
[46] 0.571363470 0.609888550 -0.058754034 0.095361656 0.738089861
[51] 0.176140227 1.247588655 -0.587748541 -0.438235082 0.630507452
[56] 1.774386706 0.618525403 -1.664572933 -0.254105426 -0.894692803
[61] -0.261009121 -0.254949221 0.792046547 -0.919051434 1.441233977
[66] -0.655653861 1.606611624 1.524529232 0.824731933 -1.529455372
[71] -0.898480934 0.289904161 -0.163662011 0.400780319 2.088448423
[76] 0.792535555 -0.653571690 0.599966989 -0.776892433 2.368941003
[81] -1.721090322 0.386163169 -0.182925258 1.483882226 0.774114115
[86] 1.479363470 -0.019013702 -0.740599163 -1.473407606 0.644174418
[91] -1.117757599 1.230353425 0.864079161 0.304601839 -0.603642643
[96] 0.428977128 1.110839165 -0.034692545 -1.320660862 -0.584904455
> colMin(tmp)
[1] -0.281997608 -1.053325455 -0.222060718 0.997848051 3.427366911
[6] -0.212056651 -1.096338378 1.087569643 -0.099736674 -0.702200159
[11] 0.199863447 1.209994832 -0.710811946 -0.623807769 1.383922492
[16] 0.993061741 0.832710469 -0.988527897 -1.596557505 0.420077842
[21] -1.382502291 0.150327654 -1.698460019 1.316136863 -0.289701201
[26] 0.846011967 0.601696011 0.003891645 -1.001879767 0.120570217
[31] 1.249198486 0.864508460 0.753306947 -0.268624976 0.313197782
[36] 0.044828867 0.549924529 -0.152942616 -0.455340401 0.888301402
[41] -1.035759468 -0.160428027 0.168518940 -0.189625152 -0.965353214
[46] 0.571363470 0.609888550 -0.058754034 0.095361656 0.738089861
[51] 0.176140227 1.247588655 -0.587748541 -0.438235082 0.630507452
[56] 1.774386706 0.618525403 -1.664572933 -0.254105426 -0.894692803
[61] -0.261009121 -0.254949221 0.792046547 -0.919051434 1.441233977
[66] -0.655653861 1.606611624 1.524529232 0.824731933 -1.529455372
[71] -0.898480934 0.289904161 -0.163662011 0.400780319 2.088448423
[76] 0.792535555 -0.653571690 0.599966989 -0.776892433 2.368941003
[81] -1.721090322 0.386163169 -0.182925258 1.483882226 0.774114115
[86] 1.479363470 -0.019013702 -0.740599163 -1.473407606 0.644174418
[91] -1.117757599 1.230353425 0.864079161 0.304601839 -0.603642643
[96] 0.428977128 1.110839165 -0.034692545 -1.320660862 -0.584904455
> colMedians(tmp)
[1] -0.281997608 -1.053325455 -0.222060718 0.997848051 3.427366911
[6] -0.212056651 -1.096338378 1.087569643 -0.099736674 -0.702200159
[11] 0.199863447 1.209994832 -0.710811946 -0.623807769 1.383922492
[16] 0.993061741 0.832710469 -0.988527897 -1.596557505 0.420077842
[21] -1.382502291 0.150327654 -1.698460019 1.316136863 -0.289701201
[26] 0.846011967 0.601696011 0.003891645 -1.001879767 0.120570217
[31] 1.249198486 0.864508460 0.753306947 -0.268624976 0.313197782
[36] 0.044828867 0.549924529 -0.152942616 -0.455340401 0.888301402
[41] -1.035759468 -0.160428027 0.168518940 -0.189625152 -0.965353214
[46] 0.571363470 0.609888550 -0.058754034 0.095361656 0.738089861
[51] 0.176140227 1.247588655 -0.587748541 -0.438235082 0.630507452
[56] 1.774386706 0.618525403 -1.664572933 -0.254105426 -0.894692803
[61] -0.261009121 -0.254949221 0.792046547 -0.919051434 1.441233977
[66] -0.655653861 1.606611624 1.524529232 0.824731933 -1.529455372
[71] -0.898480934 0.289904161 -0.163662011 0.400780319 2.088448423
[76] 0.792535555 -0.653571690 0.599966989 -0.776892433 2.368941003
[81] -1.721090322 0.386163169 -0.182925258 1.483882226 0.774114115
[86] 1.479363470 -0.019013702 -0.740599163 -1.473407606 0.644174418
[91] -1.117757599 1.230353425 0.864079161 0.304601839 -0.603642643
[96] 0.428977128 1.110839165 -0.034692545 -1.320660862 -0.584904455
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.2819976 -1.053325 -0.2220607 0.9978481 3.427367 -0.2120567 -1.096338
[2,] -0.2819976 -1.053325 -0.2220607 0.9978481 3.427367 -0.2120567 -1.096338
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.08757 -0.09973667 -0.7022002 0.1998634 1.209995 -0.7108119 -0.6238078
[2,] 1.08757 -0.09973667 -0.7022002 0.1998634 1.209995 -0.7108119 -0.6238078
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.383922 0.9930617 0.8327105 -0.9885279 -1.596558 0.4200778 -1.382502
[2,] 1.383922 0.9930617 0.8327105 -0.9885279 -1.596558 0.4200778 -1.382502
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.1503277 -1.69846 1.316137 -0.2897012 0.846012 0.601696 0.003891645
[2,] 0.1503277 -1.69846 1.316137 -0.2897012 0.846012 0.601696 0.003891645
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.00188 0.1205702 1.249198 0.8645085 0.7533069 -0.268625 0.3131978
[2,] -1.00188 0.1205702 1.249198 0.8645085 0.7533069 -0.268625 0.3131978
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.04482887 0.5499245 -0.1529426 -0.4553404 0.8883014 -1.035759 -0.160428
[2,] 0.04482887 0.5499245 -0.1529426 -0.4553404 0.8883014 -1.035759 -0.160428
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.1685189 -0.1896252 -0.9653532 0.5713635 0.6098885 -0.05875403 0.09536166
[2,] 0.1685189 -0.1896252 -0.9653532 0.5713635 0.6098885 -0.05875403 0.09536166
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.7380899 0.1761402 1.247589 -0.5877485 -0.4382351 0.6305075 1.774387
[2,] 0.7380899 0.1761402 1.247589 -0.5877485 -0.4382351 0.6305075 1.774387
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.6185254 -1.664573 -0.2541054 -0.8946928 -0.2610091 -0.2549492 0.7920465
[2,] 0.6185254 -1.664573 -0.2541054 -0.8946928 -0.2610091 -0.2549492 0.7920465
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.9190514 1.441234 -0.6556539 1.606612 1.524529 0.8247319 -1.529455
[2,] -0.9190514 1.441234 -0.6556539 1.606612 1.524529 0.8247319 -1.529455
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.8984809 0.2899042 -0.163662 0.4007803 2.088448 0.7925356 -0.6535717
[2,] -0.8984809 0.2899042 -0.163662 0.4007803 2.088448 0.7925356 -0.6535717
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.599967 -0.7768924 2.368941 -1.72109 0.3861632 -0.1829253 1.483882
[2,] 0.599967 -0.7768924 2.368941 -1.72109 0.3861632 -0.1829253 1.483882
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.7741141 1.479363 -0.0190137 -0.7405992 -1.473408 0.6441744 -1.117758
[2,] 0.7741141 1.479363 -0.0190137 -0.7405992 -1.473408 0.6441744 -1.117758
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.230353 0.8640792 0.3046018 -0.6036426 0.4289771 1.110839 -0.03469254
[2,] 1.230353 0.8640792 0.3046018 -0.6036426 0.4289771 1.110839 -0.03469254
[,99] [,100]
[1,] -1.320661 -0.5849045
[2,] -1.320661 -0.5849045
>
>
> Max(tmp2)
[1] 2.447726
> Min(tmp2)
[1] -2.464817
> mean(tmp2)
[1] -0.1030266
> Sum(tmp2)
[1] -10.30266
> Var(tmp2)
[1] 0.8750945
>
> rowMeans(tmp2)
[1] -0.26723189 0.99099369 -1.19392434 -0.38628024 -2.46481720 1.39742725
[7] -0.80611579 0.30152614 0.08338566 0.28055126 -0.39658119 -0.44685559
[13] -0.16621762 -0.59349207 -0.82119003 -1.85288083 0.04786057 0.27917084
[19] 0.33843770 0.93828957 -0.37148154 0.10691995 0.20881178 0.52150235
[25] -0.17616412 0.54023800 0.45216220 1.05588315 -1.67941534 0.34127296
[31] -1.50104427 1.28019358 -0.83868788 0.32750178 0.86435700 0.57210526
[37] 0.17552175 -1.49037374 -0.94661504 0.60728245 -0.65352805 -0.63562725
[43] 0.69374824 -1.50439402 -1.35761992 -0.35444227 0.66426562 0.30090872
[49] -0.72216203 1.65622167 0.20932901 -1.08570282 -0.64428254 1.35630966
[55] 0.50557921 0.59531152 2.44772614 -0.65203088 0.76733437 -1.60264053
[61] -0.40775514 0.89392805 -1.83386427 -1.09638406 0.19791140 -0.28419172
[67] -1.86116320 0.39944393 1.58574419 -0.09442086 0.54827426 -1.51195087
[73] -1.16532312 -0.41799540 0.26473989 -0.54953001 0.53812826 -1.32572783
[79] 1.36481116 -1.46241131 0.24108886 -0.50527128 -1.39330631 0.61525763
[85] -0.05733861 0.56432196 1.46920523 -1.03355925 -0.55764632 1.01260461
[91] 0.01214464 0.42625659 -0.09867937 -0.41806555 -0.99643905 -0.43400384
[97] 0.42177819 1.07861985 -0.15775604 0.42953119
> rowSums(tmp2)
[1] -0.26723189 0.99099369 -1.19392434 -0.38628024 -2.46481720 1.39742725
[7] -0.80611579 0.30152614 0.08338566 0.28055126 -0.39658119 -0.44685559
[13] -0.16621762 -0.59349207 -0.82119003 -1.85288083 0.04786057 0.27917084
[19] 0.33843770 0.93828957 -0.37148154 0.10691995 0.20881178 0.52150235
[25] -0.17616412 0.54023800 0.45216220 1.05588315 -1.67941534 0.34127296
[31] -1.50104427 1.28019358 -0.83868788 0.32750178 0.86435700 0.57210526
[37] 0.17552175 -1.49037374 -0.94661504 0.60728245 -0.65352805 -0.63562725
[43] 0.69374824 -1.50439402 -1.35761992 -0.35444227 0.66426562 0.30090872
[49] -0.72216203 1.65622167 0.20932901 -1.08570282 -0.64428254 1.35630966
[55] 0.50557921 0.59531152 2.44772614 -0.65203088 0.76733437 -1.60264053
[61] -0.40775514 0.89392805 -1.83386427 -1.09638406 0.19791140 -0.28419172
[67] -1.86116320 0.39944393 1.58574419 -0.09442086 0.54827426 -1.51195087
[73] -1.16532312 -0.41799540 0.26473989 -0.54953001 0.53812826 -1.32572783
[79] 1.36481116 -1.46241131 0.24108886 -0.50527128 -1.39330631 0.61525763
[85] -0.05733861 0.56432196 1.46920523 -1.03355925 -0.55764632 1.01260461
[91] 0.01214464 0.42625659 -0.09867937 -0.41806555 -0.99643905 -0.43400384
[97] 0.42177819 1.07861985 -0.15775604 0.42953119
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.26723189 0.99099369 -1.19392434 -0.38628024 -2.46481720 1.39742725
[7] -0.80611579 0.30152614 0.08338566 0.28055126 -0.39658119 -0.44685559
[13] -0.16621762 -0.59349207 -0.82119003 -1.85288083 0.04786057 0.27917084
[19] 0.33843770 0.93828957 -0.37148154 0.10691995 0.20881178 0.52150235
[25] -0.17616412 0.54023800 0.45216220 1.05588315 -1.67941534 0.34127296
[31] -1.50104427 1.28019358 -0.83868788 0.32750178 0.86435700 0.57210526
[37] 0.17552175 -1.49037374 -0.94661504 0.60728245 -0.65352805 -0.63562725
[43] 0.69374824 -1.50439402 -1.35761992 -0.35444227 0.66426562 0.30090872
[49] -0.72216203 1.65622167 0.20932901 -1.08570282 -0.64428254 1.35630966
[55] 0.50557921 0.59531152 2.44772614 -0.65203088 0.76733437 -1.60264053
[61] -0.40775514 0.89392805 -1.83386427 -1.09638406 0.19791140 -0.28419172
[67] -1.86116320 0.39944393 1.58574419 -0.09442086 0.54827426 -1.51195087
[73] -1.16532312 -0.41799540 0.26473989 -0.54953001 0.53812826 -1.32572783
[79] 1.36481116 -1.46241131 0.24108886 -0.50527128 -1.39330631 0.61525763
[85] -0.05733861 0.56432196 1.46920523 -1.03355925 -0.55764632 1.01260461
[91] 0.01214464 0.42625659 -0.09867937 -0.41806555 -0.99643905 -0.43400384
[97] 0.42177819 1.07861985 -0.15775604 0.42953119
> rowMin(tmp2)
[1] -0.26723189 0.99099369 -1.19392434 -0.38628024 -2.46481720 1.39742725
[7] -0.80611579 0.30152614 0.08338566 0.28055126 -0.39658119 -0.44685559
[13] -0.16621762 -0.59349207 -0.82119003 -1.85288083 0.04786057 0.27917084
[19] 0.33843770 0.93828957 -0.37148154 0.10691995 0.20881178 0.52150235
[25] -0.17616412 0.54023800 0.45216220 1.05588315 -1.67941534 0.34127296
[31] -1.50104427 1.28019358 -0.83868788 0.32750178 0.86435700 0.57210526
[37] 0.17552175 -1.49037374 -0.94661504 0.60728245 -0.65352805 -0.63562725
[43] 0.69374824 -1.50439402 -1.35761992 -0.35444227 0.66426562 0.30090872
[49] -0.72216203 1.65622167 0.20932901 -1.08570282 -0.64428254 1.35630966
[55] 0.50557921 0.59531152 2.44772614 -0.65203088 0.76733437 -1.60264053
[61] -0.40775514 0.89392805 -1.83386427 -1.09638406 0.19791140 -0.28419172
[67] -1.86116320 0.39944393 1.58574419 -0.09442086 0.54827426 -1.51195087
[73] -1.16532312 -0.41799540 0.26473989 -0.54953001 0.53812826 -1.32572783
[79] 1.36481116 -1.46241131 0.24108886 -0.50527128 -1.39330631 0.61525763
[85] -0.05733861 0.56432196 1.46920523 -1.03355925 -0.55764632 1.01260461
[91] 0.01214464 0.42625659 -0.09867937 -0.41806555 -0.99643905 -0.43400384
[97] 0.42177819 1.07861985 -0.15775604 0.42953119
>
> colMeans(tmp2)
[1] -0.1030266
> colSums(tmp2)
[1] -10.30266
> colVars(tmp2)
[1] 0.8750945
> colSd(tmp2)
[1] 0.9354649
> colMax(tmp2)
[1] 2.447726
> colMin(tmp2)
[1] -2.464817
> colMedians(tmp2)
[1] -0.02259699
> colRanges(tmp2)
[,1]
[1,] -2.464817
[2,] 2.447726
>
> 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.129366 -3.760466 3.874634 -3.515954 -4.672844 4.907251 3.677012
[8] -3.761106 3.523889 -1.588576
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8063912
[2,] -0.5695186
[3,] -0.4117189
[4,] 0.3045868
[5,] 1.0621526
>
> rowApply(tmp,sum)
[1] 1.7408751 7.4269469 -1.7051758 -1.4782424 2.5824453 -4.1020592
[7] -4.6627804 0.1914697 1.5834250 -4.0224294
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 5 5 9 8 5 4 3 4 5
[2,] 5 7 4 10 4 2 2 10 3 1
[3,] 10 8 6 8 1 9 10 1 5 10
[4,] 8 9 1 7 5 6 3 8 2 2
[5,] 7 1 2 1 10 3 5 5 6 3
[6,] 3 6 10 4 9 7 8 9 8 7
[7,] 6 10 9 5 7 8 6 7 7 4
[8,] 1 4 8 2 3 1 9 2 1 9
[9,] 9 3 3 3 6 10 7 6 9 6
[10,] 4 2 7 6 2 4 1 4 10 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.954069078 -1.677486341 -0.130859334 1.942226591 -3.511837900
[6] -0.017930486 6.175217952 3.682417266 3.035413581 -0.476156191
[11] -2.554734456 1.675730990 0.081053338 -0.115023744 0.894031391
[16] -0.004638486 -4.437391195 -5.110246291 -1.349709696 0.116622902
> colApply(tmp,quantile)[,1]
[,1]
[1,] -3.06662474
[2,] -0.42184161
[3,] -0.05071208
[4,] 0.73649147
[5,] 0.84861789
>
> rowApply(tmp,sum)
[1] -6.6837281 -3.1622329 1.5561421 -0.6590026 5.2114523
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 18 10 8 1 14
[2,] 16 6 1 16 12
[3,] 13 18 6 8 3
[4,] 11 14 14 17 8
[5,] 9 13 3 2 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.73649147 0.2359916 -0.02990766 -0.316592241 -0.4697900 -0.8196139
[2,] -0.05071208 -0.9680166 0.77066637 0.395393915 0.3786901 1.4024196
[3,] -0.42184161 -1.8461477 -0.62813506 0.776227519 -1.1772182 0.9726997
[4,] -3.06662474 0.6339338 0.23396362 1.091817869 -2.3526970 0.2964923
[5,] 0.84861789 0.2667525 -0.47744661 -0.004620472 0.1091770 -1.8699281
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.5344559 1.2220984 0.9205847 -0.1063020 -0.82299680 0.1586627
[2,] 0.4777536 -1.8437607 0.2031043 0.1819037 -0.33136483 -0.1667393
[3,] 1.2771151 -0.2227928 0.3727073 1.5125989 -1.45312551 1.5317322
[4,] 2.3213150 2.2344976 1.3371329 0.2605143 0.14822806 0.3804728
[5,] 1.5645783 2.2923747 0.2018845 -2.3248710 -0.09547537 -0.2283975
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.04037008 -1.07266294 -0.8638062 -0.7349253 0.09137697 -2.73122167
[2,] 0.70911123 -0.06020780 0.6730444 -1.3213399 -1.78167166 -1.44888804
[3,] 0.02034018 0.67329462 -0.4538793 1.4286511 -1.07085528 1.05874156
[4,] -0.80790442 0.43431800 0.3082965 0.2656162 -1.39549672 -2.03926141
[5,] 1.19987643 -0.08976563 1.2303760 0.3573594 -0.28074450 0.05038327
[,19] [,20]
[1,] -1.22872117 -0.3464800
[2,] -1.57263454 1.1910154
[3,] 0.06968652 -0.8636571
[4,] 0.49783622 -1.4414535
[5,] 0.88412327 1.5771982
>
>
> 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 0.854164 1.984075 0.04193207 1.243072 -2.088964 -0.7981198 0.4476677
col8 col9 col10 col11 col12 col13 col14
row1 -1.455057 -0.5823175 0.119217 -2.059731 1.484568 -0.02828198 -0.6070863
col15 col16 col17 col18 col19 col20
row1 1.067878 -1.613506 0.1816702 -0.9832806 -0.3229439 -0.7106797
> tmp[,"col10"]
col10
row1 0.1192170
row2 0.8843961
row3 -0.1750205
row4 0.5580265
row5 -0.6447405
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.854164 1.9840754 0.04193207 1.243072 -2.08896436 -0.7981198 0.4476677
row5 1.932111 0.6349834 0.19304990 -1.445509 0.09614974 -0.2276034 1.1074133
col8 col9 col10 col11 col12 col13
row1 -1.4550565 -0.58231746 0.1192170 -2.059731 1.4845677 -0.02828198
row5 0.1891626 0.06812996 -0.6447405 1.293784 -0.2192044 0.58939954
col14 col15 col16 col17 col18 col19
row1 -0.6070863 1.067878 -1.6135056 0.1816702 -0.9832806 -0.3229439
row5 -0.4461199 -1.208179 -0.5036007 -0.6283297 -0.6783137 0.5710514
col20
row1 -0.7106797
row5 0.5365789
> tmp[,c("col6","col20")]
col6 col20
row1 -0.7981198 -0.7106797
row2 -1.7664681 0.1990765
row3 0.3263434 0.3453711
row4 -0.4875592 -0.9058154
row5 -0.2276034 0.5365789
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.7981198 -0.7106797
row5 -0.2276034 0.5365789
>
>
>
>
> 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 50.09211 48.76021 48.80165 48.78718 50.6912 105.6885 51.07338 50.20926
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.78004 49.93865 50.90753 49.28253 49.81626 50.66594 51.91253 49.65683
col17 col18 col19 col20
row1 49.99723 50.22107 48.84393 105.8801
> tmp[,"col10"]
col10
row1 49.93865
row2 30.90365
row3 30.74201
row4 32.51039
row5 51.20666
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.09211 48.76021 48.80165 48.78718 50.69120 105.6885 51.07338 50.20926
row5 49.77479 50.48984 50.86113 49.57309 50.75544 104.7815 48.13740 49.42873
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.78004 49.93865 50.90753 49.28253 49.81626 50.66594 51.91253 49.65683
row5 50.36469 51.20666 48.72491 50.23537 50.67266 51.37424 48.28924 52.00860
col17 col18 col19 col20
row1 49.99723 50.22107 48.84393 105.8801
row5 49.15891 49.66097 49.62188 104.5291
> tmp[,c("col6","col20")]
col6 col20
row1 105.68855 105.88009
row2 74.60972 74.98065
row3 75.62787 75.89866
row4 74.67684 73.75828
row5 104.78145 104.52912
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.6885 105.8801
row5 104.7815 104.5291
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.6885 105.8801
row5 104.7815 104.5291
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.1555825
[2,] 1.5529192
[3,] -0.8295893
[4,] -0.1902921
[5,] 2.2277138
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.12032306 1.6235598
[2,] 0.06349268 0.8431135
[3,] -1.07998231 0.3823475
[4,] 0.69782716 0.7886045
[5,] 0.83053710 -1.2501767
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.6404813 0.96516787
[2,] 0.7475983 1.80518965
[3,] -0.3645940 1.38608694
[4,] -0.4730125 -1.56220461
[5,] 0.9935557 0.02157174
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.6404813
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.6404813
[2,] 0.7475983
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -0.21349549 0.1554647 0.9138648 0.67216749 -0.3706876 0.9667588
row1 -0.05116692 -0.4240872 0.5640653 0.03131609 0.2935647 -1.0870294
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -1.30924433 0.8077403 -1.2646263 -0.1949749 0.4950292 -0.7380018
row1 0.04634184 1.1723727 0.6007623 -0.7038584 0.2276176 0.6892531
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.8810397 -0.9600549 -1.554823 -0.09515882 1.068940 -0.5411968 -1.0152225
row1 -2.4812975 -1.2978100 1.326661 -0.40432616 1.569354 -0.1943030 0.1981656
[,20]
row3 1.3830819
row1 0.6194402
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.061787 0.5254268 -1.610664 -1.442716 0.151383 0.9995368 -1.318897
[,8] [,9] [,10]
row2 0.3335098 2.596009 -1.017385
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.8327014 -0.2244364 0.6394877 0.04512117 1.355574 -0.8475935 -1.35423
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.6904871 -0.7309418 0.9594845 0.392583 -0.02664989 0.95667 1.001681
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.7391336 0.1281437 -0.663207 2.85286 -0.74507 0.3867371
>
>
> 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: 0x6000029d00c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7615fafd"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a762310f816"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a762f0f7e56"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a76222f583d"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a76524a1e53"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a76d055a"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7656da57bc"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7618b62430"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a765e01d7fc"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a764b0b119b"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7643b0fd9a"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7618d9ac2e"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a767ab70cc0"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a767a65031"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a7637dac4e3"
>
>
> ### 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: 0x600002980060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002980060>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600002980060>
> rowMedians(tmp)
[1] -0.376246464 0.165557691 0.580471230 0.042072087 -0.175282157
[6] -0.496165468 0.659235833 0.071122312 -0.266689019 -0.119346099
[11] 0.418994970 -0.430596996 0.268399180 -0.066326316 -0.447790895
[16] -0.432644933 -0.152081437 0.236891552 0.565871595 0.048626059
[21] -0.410820854 0.148537925 -0.114898655 -0.345030392 -0.049014808
[26] 0.081860060 -0.262976327 -0.160995100 -0.451433059 -0.237429995
[31] -0.277774954 -0.065720712 -0.199049955 0.467784570 -0.349597448
[36] 0.297356553 -0.338650742 0.358944955 0.489929629 -0.178751779
[41] -0.113251310 -0.640507305 -0.311491983 -0.226974516 -0.230858722
[46] -0.193926044 -0.033179607 -0.330869783 -0.286214830 -0.188285931
[51] 0.013663141 -0.084612878 -0.011222256 0.136930567 -0.180034872
[56] -0.410300590 -0.121684450 -0.598987459 -0.635590526 -0.050539713
[61] -0.239095607 0.088564788 0.460758073 0.239007024 0.516683990
[66] -0.261062635 0.628118752 -0.184695137 0.213858000 0.040762447
[71] -0.069767793 0.011720408 0.228787676 -0.057479666 0.181092376
[76] 0.288197116 0.406088638 -0.235699444 0.046764276 0.193685245
[81] -0.008712422 0.368778571 0.160059496 0.012614430 -0.087409228
[86] -0.306257529 -0.004288630 0.297929683 -0.026970046 -0.038968286
[91] 0.279740175 -0.487274723 -0.496253891 0.168100284 0.010135476
[96] -0.620691911 0.262404723 0.117499597 -0.070482927 -0.097279707
[101] 0.262241656 0.347300591 0.282356116 -0.664274203 0.060815417
[106] -0.199747574 -0.058696174 0.726121860 0.047002443 0.244681861
[111] 0.581146176 0.059304815 -0.295923802 -0.412159278 -0.219114608
[116] 0.239245452 0.379025030 0.294061443 0.413169725 0.206165166
[121] 0.189088276 0.555340545 0.273495836 0.005231463 -0.214886561
[126] 0.421379773 -0.080621850 -0.036389900 -0.335009328 -0.488392443
[131] 0.015258788 -0.053305206 0.207679537 0.248234219 0.041177847
[136] 0.444716616 -0.328392702 -0.096524911 -0.438060858 -0.074419589
[141] 0.208003756 -0.207335707 0.428572203 0.071857919 0.334344052
[146] -0.329505090 -0.332812888 -0.150027619 0.102432912 0.454222101
[151] -0.023677130 -0.256887553 0.281858102 0.138171127 0.516189091
[156] 0.244549206 0.153739479 0.139735603 -0.163683415 -0.103642645
[161] -0.123608190 0.241662978 -0.092405697 0.313518606 0.484671414
[166] 0.224425143 0.159386888 0.209920549 -0.322601519 -0.243541053
[171] 0.089632232 0.534602850 0.075265059 0.408137226 0.238866421
[176] 0.378826941 -0.214350513 0.080951832 -0.174320384 -0.101585371
[181] -0.324030527 -0.640193475 0.256986841 0.564191717 0.307074046
[186] 0.043552417 0.104565860 0.328006993 0.118815579 -0.476821388
[191] 0.295104700 0.090482374 0.128238136 -0.288132514 -0.189304684
[196] 0.140324136 -0.098460784 -0.002130785 0.028533806 0.245381238
[201] -0.020251654 -0.020798446 0.045730773 -0.241605427 0.125507795
[206] 0.042404967 0.348344458 0.576437013 -0.456802575 0.519970770
[211] -0.462680597 0.080521364 -0.212088179 -0.595612704 0.084517109
[216] -0.265271840 0.427638141 0.264500453 -0.024957848 -0.460490824
[221] 0.251431458 0.366913452 -0.569099320 -0.254510603 0.493961180
[226] -0.649247813 -0.562857598 -0.293234347 0.128597461 -0.330981636
>
> proc.time()
user system elapsed
5.090 18.666 26.702
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[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: 0x600003b40060>
> .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: 0x600003b40060>
> .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: 0x600003b40060>
> .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: 0x600003b40060>
> 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: 0x600003b78000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b78000>
> .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: 0x600003b78000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b78000>
> .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: 0x600003b78000>
> 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: 0x600003b408a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b408a0>
> .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: 0x600003b408a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003b408a0>
> .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: 0x600003b408a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600003b408a0>
> .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: 0x600003b408a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600003b408a0>
> .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: 0x600003b408a0>
> 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: 0x600003b7c000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003b7c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b7c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b7c000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13fb930f4d31" "BufferedMatrixFile13fb96194cd88"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13fb930f4d31" "BufferedMatrixFile13fb96194cd88"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b4c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b4c000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003b4c000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003b4c000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003b4c000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003b4c000>
> .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: 0x600003b70000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003b70000>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003b70000>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003b70000>
> 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: 0x600003b70180>
> .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: 0x600003b70180>
> rm(P)
>
> proc.time()
user system elapsed
0.591 0.214 0.801
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[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.587 0.137 0.716