| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-11 11:37 -0400 (Sat, 11 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 alpha (2026-04-05 r89794) | 4919 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-04-08 r89818) | 4631 |
| 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 259/2390 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-04-10 19:05:33 -0400 (Fri, 10 Apr 2026) |
| EndedAt: 2026-04-10 19:05:53 -0400 (Fri, 10 Apr 2026) |
| EllapsedTime: 20.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-08 r89818)
* using platform: aarch64-apple-darwin23
* R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-04-10 23:05:33 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6/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.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.125 0.050 0.172
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 484141 25.9 1067261 57 NA 631997 33.8
Vcells 896965 6.9 8388608 64 196608 2112521 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Apr 10 19:05:43 2026"
> 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] "Fri Apr 10 19:05:43 2026"
>
>
> 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: 0x104115720>
>
>
>
> 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] "Fri Apr 10 19:05:45 2026"
> 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] "Fri Apr 10 19:05:45 2026"
>
> ColMode(tmp2)
<pointer: 0x104115720>
>
>
>
> ### 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.1030001 -0.1298224 0.6234864 1.2184644
[2,] -1.2219341 0.8683268 1.2259069 0.8508863
[3,] 1.1683555 1.2471198 -0.1441910 0.6949762
[4,] -0.7032551 -0.5571536 0.4300864 0.2114723
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.1030001 0.1298224 0.6234864 1.2184644
[2,] 1.2219341 0.8683268 1.2259069 0.8508863
[3,] 1.1683555 1.2471198 0.1441910 0.6949762
[4,] 0.7032551 0.5571536 0.4300864 0.2114723
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0051487 0.3603087 0.7896116 1.1038407
[2,] 1.1054113 0.9318405 1.1072068 0.9224350
[3,] 1.0809049 1.1167452 0.3797249 0.8336523
[4,] 0.8386031 0.7464272 0.6558097 0.4598612
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.15449 28.73291 33.51960 37.25687
[2,] 37.27605 35.18673 37.29798 35.07524
[3,] 36.97740 37.41457 28.94144 34.03150
[4,] 34.08929 33.02143 31.98818 29.81008
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x104115630>
> exp(tmp5)
<pointer: 0x104115630>
> log(tmp5,2)
<pointer: 0x104115630>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.6296
> Min(tmp5)
[1] 54.11476
> mean(tmp5)
[1] 72.07136
> Sum(tmp5)
[1] 14414.27
> Var(tmp5)
[1] 862.6398
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.31597 71.13020 69.64669 70.05359 73.93441 71.12879 67.18714 71.36483
[9] 68.65426 69.29773
> rowSums(tmp5)
[1] 1766.319 1422.604 1392.934 1401.072 1478.688 1422.576 1343.743 1427.297
[9] 1373.085 1385.955
> rowVars(tmp5)
[1] 8117.69386 73.77963 53.35550 57.35682 81.98347 43.34384
[7] 78.15347 90.11812 52.52893 46.90557
> rowSd(tmp5)
[1] 90.098246 8.589507 7.304485 7.573429 9.054473 6.583604 8.840445
[8] 9.493057 7.247684 6.848764
> rowMax(tmp5)
[1] 468.62956 88.80823 85.01979 87.83557 88.02738 85.23409 84.75826
[8] 85.91126 81.97040 80.86644
> rowMin(tmp5)
[1] 55.57707 59.57360 57.97060 60.26585 57.76158 57.92486 54.11476 55.69097
[9] 56.36823 55.80202
>
> colMeans(tmp5)
[1] 116.35109 67.01757 69.40683 70.32625 71.58660 70.07229 72.41266
[8] 63.94643 72.09860 69.97270 66.84434 71.56280 66.13521 71.25853
[15] 67.36514 70.45286 72.59697 72.79485 68.79394 70.43157
> colSums(tmp5)
[1] 1163.5109 670.1757 694.0683 703.2625 715.8660 700.7229 724.1266
[8] 639.4643 720.9860 699.7270 668.4434 715.6280 661.3521 712.5853
[15] 673.6514 704.5286 725.9697 727.9485 687.9394 704.3157
> colVars(tmp5)
[1] 15366.28484 46.86914 72.91195 25.08380 113.50401 90.15948
[7] 76.39669 61.12843 25.98196 59.10469 93.25631 46.53030
[13] 41.72430 107.09067 90.36092 70.79914 73.52142 112.79227
[19] 51.03765 34.24722
> colSd(tmp5)
[1] 123.960820 6.846104 8.538849 5.008373 10.653826 9.495235
[7] 8.740520 7.818467 5.097251 7.687957 9.656931 6.821312
[13] 6.459435 10.348462 9.505836 8.414222 8.574463 10.620370
[19] 7.144064 5.852112
> colMax(tmp5)
[1] 468.62956 77.87353 85.23409 77.54530 95.67690 85.01979 85.91126
[8] 80.86644 79.46344 85.66430 87.83557 85.61852 78.24255 87.35802
[15] 83.82392 83.63629 88.80823 82.24539 82.71777 77.14219
> colMin(tmp5)
[1] 68.15295 56.58421 58.46985 62.04579 59.28150 54.20461 59.57360 55.69097
[9] 60.66145 56.55935 59.05289 62.68957 55.57707 54.11476 55.80202 57.92486
[17] 63.18593 56.36823 61.42078 57.97060
>
>
> ### 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] 88.31597 71.13020 69.64669 70.05359 73.93441 71.12879 67.18714 71.36483
[9] NA 69.29773
> rowSums(tmp5)
[1] 1766.319 1422.604 1392.934 1401.072 1478.688 1422.576 1343.743 1427.297
[9] NA 1385.955
> rowVars(tmp5)
[1] 8117.69386 73.77963 53.35550 57.35682 81.98347 43.34384
[7] 78.15347 90.11812 53.69851 46.90557
> rowSd(tmp5)
[1] 90.098246 8.589507 7.304485 7.573429 9.054473 6.583604 8.840445
[8] 9.493057 7.327927 6.848764
> rowMax(tmp5)
[1] 468.62956 88.80823 85.01979 87.83557 88.02738 85.23409 84.75826
[8] 85.91126 NA 80.86644
> rowMin(tmp5)
[1] 55.57707 59.57360 57.97060 60.26585 57.76158 57.92486 54.11476 55.69097
[9] NA 55.80202
>
> colMeans(tmp5)
[1] 116.35109 67.01757 69.40683 70.32625 71.58660 70.07229 72.41266
[8] 63.94643 72.09860 69.97270 66.84434 71.56280 66.13521 71.25853
[15] 67.36514 70.45286 NA 72.79485 68.79394 70.43157
> colSums(tmp5)
[1] 1163.5109 670.1757 694.0683 703.2625 715.8660 700.7229 724.1266
[8] 639.4643 720.9860 699.7270 668.4434 715.6280 661.3521 712.5853
[15] 673.6514 704.5286 NA 727.9485 687.9394 704.3157
> colVars(tmp5)
[1] 15366.28484 46.86914 72.91195 25.08380 113.50401 90.15948
[7] 76.39669 61.12843 25.98196 59.10469 93.25631 46.53030
[13] 41.72430 107.09067 90.36092 70.79914 NA 112.79227
[19] 51.03765 34.24722
> colSd(tmp5)
[1] 123.960820 6.846104 8.538849 5.008373 10.653826 9.495235
[7] 8.740520 7.818467 5.097251 7.687957 9.656931 6.821312
[13] 6.459435 10.348462 9.505836 8.414222 NA 10.620370
[19] 7.144064 5.852112
> colMax(tmp5)
[1] 468.62956 77.87353 85.23409 77.54530 95.67690 85.01979 85.91126
[8] 80.86644 79.46344 85.66430 87.83557 85.61852 78.24255 87.35802
[15] 83.82392 83.63629 NA 82.24539 82.71777 77.14219
> colMin(tmp5)
[1] 68.15295 56.58421 58.46985 62.04579 59.28150 54.20461 59.57360 55.69097
[9] 60.66145 56.55935 59.05289 62.68957 55.57707 54.11476 55.80202 57.92486
[17] NA 56.36823 61.42078 57.97060
>
> Max(tmp5,na.rm=TRUE)
[1] 468.6296
> Min(tmp5,na.rm=TRUE)
[1] 54.11476
> mean(tmp5,na.rm=TRUE)
[1] 72.11601
> Sum(tmp5,na.rm=TRUE)
[1] 14351.09
> Var(tmp5,na.rm=TRUE)
[1] 866.5958
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.31597 71.13020 69.64669 70.05359 73.93441 71.12879 67.18714 71.36483
[9] 68.94207 69.29773
> rowSums(tmp5,na.rm=TRUE)
[1] 1766.319 1422.604 1392.934 1401.072 1478.688 1422.576 1343.743 1427.297
[9] 1309.899 1385.955
> rowVars(tmp5,na.rm=TRUE)
[1] 8117.69386 73.77963 53.35550 57.35682 81.98347 43.34384
[7] 78.15347 90.11812 53.69851 46.90557
> rowSd(tmp5,na.rm=TRUE)
[1] 90.098246 8.589507 7.304485 7.573429 9.054473 6.583604 8.840445
[8] 9.493057 7.327927 6.848764
> rowMax(tmp5,na.rm=TRUE)
[1] 468.62956 88.80823 85.01979 87.83557 88.02738 85.23409 84.75826
[8] 85.91126 81.97040 80.86644
> rowMin(tmp5,na.rm=TRUE)
[1] 55.57707 59.57360 57.97060 60.26585 57.76158 57.92486 54.11476 55.69097
[9] 56.36823 55.80202
>
> colMeans(tmp5,na.rm=TRUE)
[1] 116.35109 67.01757 69.40683 70.32625 71.58660 70.07229 72.41266
[8] 63.94643 72.09860 69.97270 66.84434 71.56280 66.13521 71.25853
[15] 67.36514 70.45286 73.64265 72.79485 68.79394 70.43157
> colSums(tmp5,na.rm=TRUE)
[1] 1163.5109 670.1757 694.0683 703.2625 715.8660 700.7229 724.1266
[8] 639.4643 720.9860 699.7270 668.4434 715.6280 661.3521 712.5853
[15] 673.6514 704.5286 662.7838 727.9485 687.9394 704.3157
> colVars(tmp5,na.rm=TRUE)
[1] 15366.28484 46.86914 72.91195 25.08380 113.50401 90.15948
[7] 76.39669 61.12843 25.98196 59.10469 93.25631 46.53030
[13] 41.72430 107.09067 90.36092 70.79914 70.41053 112.79227
[19] 51.03765 34.24722
> colSd(tmp5,na.rm=TRUE)
[1] 123.960820 6.846104 8.538849 5.008373 10.653826 9.495235
[7] 8.740520 7.818467 5.097251 7.687957 9.656931 6.821312
[13] 6.459435 10.348462 9.505836 8.414222 8.391098 10.620370
[19] 7.144064 5.852112
> colMax(tmp5,na.rm=TRUE)
[1] 468.62956 77.87353 85.23409 77.54530 95.67690 85.01979 85.91126
[8] 80.86644 79.46344 85.66430 87.83557 85.61852 78.24255 87.35802
[15] 83.82392 83.63629 88.80823 82.24539 82.71777 77.14219
> colMin(tmp5,na.rm=TRUE)
[1] 68.15295 56.58421 58.46985 62.04579 59.28150 54.20461 59.57360 55.69097
[9] 60.66145 56.55935 59.05289 62.68957 55.57707 54.11476 55.80202 57.92486
[17] 64.36713 56.36823 61.42078 57.97060
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.31597 71.13020 69.64669 70.05359 73.93441 71.12879 67.18714 71.36483
[9] NaN 69.29773
> rowSums(tmp5,na.rm=TRUE)
[1] 1766.319 1422.604 1392.934 1401.072 1478.688 1422.576 1343.743 1427.297
[9] 0.000 1385.955
> rowVars(tmp5,na.rm=TRUE)
[1] 8117.69386 73.77963 53.35550 57.35682 81.98347 43.34384
[7] 78.15347 90.11812 NA 46.90557
> rowSd(tmp5,na.rm=TRUE)
[1] 90.098246 8.589507 7.304485 7.573429 9.054473 6.583604 8.840445
[8] 9.493057 NA 6.848764
> rowMax(tmp5,na.rm=TRUE)
[1] 468.62956 88.80823 85.01979 87.83557 88.02738 85.23409 84.75826
[8] 85.91126 NA 80.86644
> rowMin(tmp5,na.rm=TRUE)
[1] 55.57707 59.57360 57.97060 60.26585 57.76158 57.92486 54.11476 55.69097
[9] NA 55.80202
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 121.27130 67.75679 70.07710 70.97965 70.43285 70.43533 71.70463
[8] 64.04327 72.04381 69.92859 65.28417 71.24912 65.97815 70.59989
[15] 68.05122 71.15718 NaN 74.62003 69.33415 70.43092
> colSums(tmp5,na.rm=TRUE)
[1] 1091.4417 609.8111 630.6939 638.8169 633.8956 633.9180 645.3417
[8] 576.3894 648.3943 629.3573 587.5575 641.2420 593.8033 635.3990
[15] 612.4609 640.4146 0.0000 671.5803 624.0073 633.8783
> colVars(tmp5,na.rm=TRUE)
[1] 17014.72465 46.58019 76.97172 23.41631 112.71658 99.94667
[7] 80.30656 68.66398 29.19594 66.47088 77.52921 51.23961
[13] 46.66231 115.59671 96.36064 74.06831 NA 89.41439
[19] 54.13435 38.52811
> colSd(tmp5,na.rm=TRUE)
[1] 130.440502 6.824968 8.773353 4.839040 10.616806 9.997333
[7] 8.961393 8.286373 5.403327 8.152968 8.805067 7.158185
[13] 6.830982 10.751591 9.816345 8.606295 NA 9.455918
[19] 7.357605 6.207102
> colMax(tmp5,na.rm=TRUE)
[1] 468.62956 77.87353 85.23409 77.54530 95.67690 85.01979 85.91126
[8] 80.86644 79.46344 85.66430 87.83557 85.61852 78.24255 87.35802
[15] 83.82392 83.63629 -Inf 82.24539 82.71777 77.14219
> colMin(tmp5,na.rm=TRUE)
[1] 68.15295 56.58421 58.46985 62.04579 59.28150 54.20461 59.57360 55.69097
[9] 60.66145 56.55935 59.05289 62.68957 55.57707 54.11476 55.80202 57.92486
[17] Inf 57.38912 61.42078 57.97060
>
>
>
>
> 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] 199.9386 249.5600 262.5957 187.8266 304.3885 269.0950 176.0394 191.8803
[9] 313.1566 200.6479
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 199.9386 249.5600 262.5957 187.8266 304.3885 269.0950 176.0394 191.8803
[9] 313.1566 200.6479
>
>
>
> 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] 0.000000e+00 5.684342e-14 5.684342e-14 -7.105427e-14 0.000000e+00
[6] 1.136868e-13 -2.842171e-14 -1.705303e-13 5.684342e-14 1.705303e-13
[11] 2.273737e-13 1.705303e-13 0.000000e+00 2.273737e-13 -1.136868e-13
[16] 0.000000e+00 -1.421085e-13 -1.136868e-13 -8.526513e-14 -1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
5 13
8 5
3 4
5 18
5 5
2 11
2 9
1 4
6 7
3 11
6 12
6 10
7 4
5 4
6 1
9 4
2 6
1 18
2 10
9 16
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.596238
> Min(tmp)
[1] -2.226612
> mean(tmp)
[1] 0.02413483
> Sum(tmp)
[1] 2.413483
> Var(tmp)
[1] 0.8153963
>
> rowMeans(tmp)
[1] 0.02413483
> rowSums(tmp)
[1] 2.413483
> rowVars(tmp)
[1] 0.8153963
> rowSd(tmp)
[1] 0.902993
> rowMax(tmp)
[1] 2.596238
> rowMin(tmp)
[1] -2.226612
>
> colMeans(tmp)
[1] -0.68319481 0.20282128 -0.30872528 0.17508296 -0.64098942 0.42185275
[7] -0.49455994 1.69650195 0.60881685 -0.73443724 0.29332005 0.66782773
[13] 1.58399377 -1.72850480 -1.12774946 0.86858506 2.04122768 -0.31372954
[19] -0.07532281 -1.27026840 0.15533713 0.30602451 1.43917104 -0.86778058
[25] 0.08579306 1.29859712 -0.43023164 -0.68891586 -0.31236271 -0.24882124
[31] 0.58380661 -1.10470423 0.49398378 0.54053934 -0.05111469 0.38097250
[37] 0.28254852 0.30427106 -0.46253310 -0.86303350 -0.31763224 0.03237495
[43] 0.04747826 -0.41167659 0.57481566 1.01399583 0.96027401 -0.16776243
[49] 0.58768400 -0.52111695 -0.74679522 -0.44053304 -0.37844172 -1.30187042
[55] 0.28297879 1.36987698 -0.37578926 0.87376089 1.05821926 -0.87229146
[61] -1.92181170 -0.83244912 1.76837361 0.23521397 0.45096174 0.36663967
[67] -1.68782240 -0.89297870 0.61453945 -0.08625998 0.69649800 -0.05090327
[73] -0.04580107 1.04914627 -1.16496673 0.89534649 -2.22661225 -1.21189435
[79] 0.51813519 1.44417646 -1.03171564 0.06937243 0.50077874 1.57607417
[85] -0.51437505 -0.05256397 1.09463949 0.73577044 0.73328155 0.07855372
[91] -0.58519340 0.53213425 -0.13536768 -1.23915936 2.59623804 -0.82624039
[97] -0.66380231 -0.55932677 -1.01935643 -0.08543483
> colSums(tmp)
[1] -0.68319481 0.20282128 -0.30872528 0.17508296 -0.64098942 0.42185275
[7] -0.49455994 1.69650195 0.60881685 -0.73443724 0.29332005 0.66782773
[13] 1.58399377 -1.72850480 -1.12774946 0.86858506 2.04122768 -0.31372954
[19] -0.07532281 -1.27026840 0.15533713 0.30602451 1.43917104 -0.86778058
[25] 0.08579306 1.29859712 -0.43023164 -0.68891586 -0.31236271 -0.24882124
[31] 0.58380661 -1.10470423 0.49398378 0.54053934 -0.05111469 0.38097250
[37] 0.28254852 0.30427106 -0.46253310 -0.86303350 -0.31763224 0.03237495
[43] 0.04747826 -0.41167659 0.57481566 1.01399583 0.96027401 -0.16776243
[49] 0.58768400 -0.52111695 -0.74679522 -0.44053304 -0.37844172 -1.30187042
[55] 0.28297879 1.36987698 -0.37578926 0.87376089 1.05821926 -0.87229146
[61] -1.92181170 -0.83244912 1.76837361 0.23521397 0.45096174 0.36663967
[67] -1.68782240 -0.89297870 0.61453945 -0.08625998 0.69649800 -0.05090327
[73] -0.04580107 1.04914627 -1.16496673 0.89534649 -2.22661225 -1.21189435
[79] 0.51813519 1.44417646 -1.03171564 0.06937243 0.50077874 1.57607417
[85] -0.51437505 -0.05256397 1.09463949 0.73577044 0.73328155 0.07855372
[91] -0.58519340 0.53213425 -0.13536768 -1.23915936 2.59623804 -0.82624039
[97] -0.66380231 -0.55932677 -1.01935643 -0.08543483
> 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.68319481 0.20282128 -0.30872528 0.17508296 -0.64098942 0.42185275
[7] -0.49455994 1.69650195 0.60881685 -0.73443724 0.29332005 0.66782773
[13] 1.58399377 -1.72850480 -1.12774946 0.86858506 2.04122768 -0.31372954
[19] -0.07532281 -1.27026840 0.15533713 0.30602451 1.43917104 -0.86778058
[25] 0.08579306 1.29859712 -0.43023164 -0.68891586 -0.31236271 -0.24882124
[31] 0.58380661 -1.10470423 0.49398378 0.54053934 -0.05111469 0.38097250
[37] 0.28254852 0.30427106 -0.46253310 -0.86303350 -0.31763224 0.03237495
[43] 0.04747826 -0.41167659 0.57481566 1.01399583 0.96027401 -0.16776243
[49] 0.58768400 -0.52111695 -0.74679522 -0.44053304 -0.37844172 -1.30187042
[55] 0.28297879 1.36987698 -0.37578926 0.87376089 1.05821926 -0.87229146
[61] -1.92181170 -0.83244912 1.76837361 0.23521397 0.45096174 0.36663967
[67] -1.68782240 -0.89297870 0.61453945 -0.08625998 0.69649800 -0.05090327
[73] -0.04580107 1.04914627 -1.16496673 0.89534649 -2.22661225 -1.21189435
[79] 0.51813519 1.44417646 -1.03171564 0.06937243 0.50077874 1.57607417
[85] -0.51437505 -0.05256397 1.09463949 0.73577044 0.73328155 0.07855372
[91] -0.58519340 0.53213425 -0.13536768 -1.23915936 2.59623804 -0.82624039
[97] -0.66380231 -0.55932677 -1.01935643 -0.08543483
> colMin(tmp)
[1] -0.68319481 0.20282128 -0.30872528 0.17508296 -0.64098942 0.42185275
[7] -0.49455994 1.69650195 0.60881685 -0.73443724 0.29332005 0.66782773
[13] 1.58399377 -1.72850480 -1.12774946 0.86858506 2.04122768 -0.31372954
[19] -0.07532281 -1.27026840 0.15533713 0.30602451 1.43917104 -0.86778058
[25] 0.08579306 1.29859712 -0.43023164 -0.68891586 -0.31236271 -0.24882124
[31] 0.58380661 -1.10470423 0.49398378 0.54053934 -0.05111469 0.38097250
[37] 0.28254852 0.30427106 -0.46253310 -0.86303350 -0.31763224 0.03237495
[43] 0.04747826 -0.41167659 0.57481566 1.01399583 0.96027401 -0.16776243
[49] 0.58768400 -0.52111695 -0.74679522 -0.44053304 -0.37844172 -1.30187042
[55] 0.28297879 1.36987698 -0.37578926 0.87376089 1.05821926 -0.87229146
[61] -1.92181170 -0.83244912 1.76837361 0.23521397 0.45096174 0.36663967
[67] -1.68782240 -0.89297870 0.61453945 -0.08625998 0.69649800 -0.05090327
[73] -0.04580107 1.04914627 -1.16496673 0.89534649 -2.22661225 -1.21189435
[79] 0.51813519 1.44417646 -1.03171564 0.06937243 0.50077874 1.57607417
[85] -0.51437505 -0.05256397 1.09463949 0.73577044 0.73328155 0.07855372
[91] -0.58519340 0.53213425 -0.13536768 -1.23915936 2.59623804 -0.82624039
[97] -0.66380231 -0.55932677 -1.01935643 -0.08543483
> colMedians(tmp)
[1] -0.68319481 0.20282128 -0.30872528 0.17508296 -0.64098942 0.42185275
[7] -0.49455994 1.69650195 0.60881685 -0.73443724 0.29332005 0.66782773
[13] 1.58399377 -1.72850480 -1.12774946 0.86858506 2.04122768 -0.31372954
[19] -0.07532281 -1.27026840 0.15533713 0.30602451 1.43917104 -0.86778058
[25] 0.08579306 1.29859712 -0.43023164 -0.68891586 -0.31236271 -0.24882124
[31] 0.58380661 -1.10470423 0.49398378 0.54053934 -0.05111469 0.38097250
[37] 0.28254852 0.30427106 -0.46253310 -0.86303350 -0.31763224 0.03237495
[43] 0.04747826 -0.41167659 0.57481566 1.01399583 0.96027401 -0.16776243
[49] 0.58768400 -0.52111695 -0.74679522 -0.44053304 -0.37844172 -1.30187042
[55] 0.28297879 1.36987698 -0.37578926 0.87376089 1.05821926 -0.87229146
[61] -1.92181170 -0.83244912 1.76837361 0.23521397 0.45096174 0.36663967
[67] -1.68782240 -0.89297870 0.61453945 -0.08625998 0.69649800 -0.05090327
[73] -0.04580107 1.04914627 -1.16496673 0.89534649 -2.22661225 -1.21189435
[79] 0.51813519 1.44417646 -1.03171564 0.06937243 0.50077874 1.57607417
[85] -0.51437505 -0.05256397 1.09463949 0.73577044 0.73328155 0.07855372
[91] -0.58519340 0.53213425 -0.13536768 -1.23915936 2.59623804 -0.82624039
[97] -0.66380231 -0.55932677 -1.01935643 -0.08543483
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.6831948 0.2028213 -0.3087253 0.175083 -0.6409894 0.4218527 -0.4945599
[2,] -0.6831948 0.2028213 -0.3087253 0.175083 -0.6409894 0.4218527 -0.4945599
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.696502 0.6088168 -0.7344372 0.29332 0.6678277 1.583994 -1.728505
[2,] 1.696502 0.6088168 -0.7344372 0.29332 0.6678277 1.583994 -1.728505
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.127749 0.8685851 2.041228 -0.3137295 -0.07532281 -1.270268 0.1553371
[2,] -1.127749 0.8685851 2.041228 -0.3137295 -0.07532281 -1.270268 0.1553371
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.3060245 1.439171 -0.8677806 0.08579306 1.298597 -0.4302316 -0.6889159
[2,] 0.3060245 1.439171 -0.8677806 0.08579306 1.298597 -0.4302316 -0.6889159
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.3123627 -0.2488212 0.5838066 -1.104704 0.4939838 0.5405393 -0.05111469
[2,] -0.3123627 -0.2488212 0.5838066 -1.104704 0.4939838 0.5405393 -0.05111469
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.3809725 0.2825485 0.3042711 -0.4625331 -0.8630335 -0.3176322 0.03237495
[2,] 0.3809725 0.2825485 0.3042711 -0.4625331 -0.8630335 -0.3176322 0.03237495
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.04747826 -0.4116766 0.5748157 1.013996 0.960274 -0.1677624 0.587684
[2,] 0.04747826 -0.4116766 0.5748157 1.013996 0.960274 -0.1677624 0.587684
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.521117 -0.7467952 -0.440533 -0.3784417 -1.30187 0.2829788 1.369877
[2,] -0.521117 -0.7467952 -0.440533 -0.3784417 -1.30187 0.2829788 1.369877
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.3757893 0.8737609 1.058219 -0.8722915 -1.921812 -0.8324491 1.768374
[2,] -0.3757893 0.8737609 1.058219 -0.8722915 -1.921812 -0.8324491 1.768374
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.235214 0.4509617 0.3666397 -1.687822 -0.8929787 0.6145394 -0.08625998
[2,] 0.235214 0.4509617 0.3666397 -1.687822 -0.8929787 0.6145394 -0.08625998
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.696498 -0.05090327 -0.04580107 1.049146 -1.164967 0.8953465 -2.226612
[2,] 0.696498 -0.05090327 -0.04580107 1.049146 -1.164967 0.8953465 -2.226612
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.211894 0.5181352 1.444176 -1.031716 0.06937243 0.5007787 1.576074
[2,] -1.211894 0.5181352 1.444176 -1.031716 0.06937243 0.5007787 1.576074
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.514375 -0.05256397 1.094639 0.7357704 0.7332815 0.07855372 -0.5851934
[2,] -0.514375 -0.05256397 1.094639 0.7357704 0.7332815 0.07855372 -0.5851934
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.5321343 -0.1353677 -1.239159 2.596238 -0.8262404 -0.6638023 -0.5593268
[2,] 0.5321343 -0.1353677 -1.239159 2.596238 -0.8262404 -0.6638023 -0.5593268
[,99] [,100]
[1,] -1.019356 -0.08543483
[2,] -1.019356 -0.08543483
>
>
> Max(tmp2)
[1] 2.477879
> Min(tmp2)
[1] -1.906299
> mean(tmp2)
[1] -0.0369344
> Sum(tmp2)
[1] -3.69344
> Var(tmp2)
[1] 0.7552316
>
> rowMeans(tmp2)
[1] 1.040417621 -1.187642126 -0.136560658 0.167470111 0.852878396
[6] 0.070689749 0.331213104 -1.072715265 0.754938553 -0.917569003
[11] -0.213057894 -0.032281714 1.204752173 0.942816655 -0.391951465
[16] 0.472006948 0.635592334 2.477878926 0.908089056 -0.912243034
[21] -1.801351141 -0.630164919 0.947419486 0.066304253 0.615659386
[26] 0.033155542 0.642916921 0.645553754 -0.138989595 -0.183995177
[31] -0.317680820 -0.001520873 -1.184076889 -0.122781121 0.563939045
[36] -0.213274384 0.281476424 0.131167136 -1.287961038 -0.532332750
[41] -0.396957625 -0.625304290 0.104598632 1.281981436 -0.235444284
[46] -1.666397336 0.711738567 0.895437234 -0.756376325 0.724934807
[51] 0.114462442 -1.620236223 1.838103346 -0.490430537 -0.363350469
[56] -1.906298825 -1.223976656 -1.438691183 1.550945353 -0.777426335
[61] 0.061822991 0.058548749 -0.669332797 0.339072349 1.663525217
[66] -0.456838614 0.990369476 -0.517801736 -1.514725232 -0.393270749
[71] 1.422814381 0.384732648 -0.105744664 -0.694801065 -0.362273173
[76] -0.735594135 0.582963379 1.086267156 -0.321381491 -1.184485883
[81] -1.434133679 0.419590867 0.408559239 -0.079497071 0.130663674
[86] -0.799409239 0.380901979 -0.929817536 -0.002818443 0.064061536
[91] 1.500545984 0.450755131 -1.256117606 0.897016796 -0.446050500
[96] 0.579266851 0.201038189 -0.398361769 -0.307134064 -0.935864736
> rowSums(tmp2)
[1] 1.040417621 -1.187642126 -0.136560658 0.167470111 0.852878396
[6] 0.070689749 0.331213104 -1.072715265 0.754938553 -0.917569003
[11] -0.213057894 -0.032281714 1.204752173 0.942816655 -0.391951465
[16] 0.472006948 0.635592334 2.477878926 0.908089056 -0.912243034
[21] -1.801351141 -0.630164919 0.947419486 0.066304253 0.615659386
[26] 0.033155542 0.642916921 0.645553754 -0.138989595 -0.183995177
[31] -0.317680820 -0.001520873 -1.184076889 -0.122781121 0.563939045
[36] -0.213274384 0.281476424 0.131167136 -1.287961038 -0.532332750
[41] -0.396957625 -0.625304290 0.104598632 1.281981436 -0.235444284
[46] -1.666397336 0.711738567 0.895437234 -0.756376325 0.724934807
[51] 0.114462442 -1.620236223 1.838103346 -0.490430537 -0.363350469
[56] -1.906298825 -1.223976656 -1.438691183 1.550945353 -0.777426335
[61] 0.061822991 0.058548749 -0.669332797 0.339072349 1.663525217
[66] -0.456838614 0.990369476 -0.517801736 -1.514725232 -0.393270749
[71] 1.422814381 0.384732648 -0.105744664 -0.694801065 -0.362273173
[76] -0.735594135 0.582963379 1.086267156 -0.321381491 -1.184485883
[81] -1.434133679 0.419590867 0.408559239 -0.079497071 0.130663674
[86] -0.799409239 0.380901979 -0.929817536 -0.002818443 0.064061536
[91] 1.500545984 0.450755131 -1.256117606 0.897016796 -0.446050500
[96] 0.579266851 0.201038189 -0.398361769 -0.307134064 -0.935864736
> 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.040417621 -1.187642126 -0.136560658 0.167470111 0.852878396
[6] 0.070689749 0.331213104 -1.072715265 0.754938553 -0.917569003
[11] -0.213057894 -0.032281714 1.204752173 0.942816655 -0.391951465
[16] 0.472006948 0.635592334 2.477878926 0.908089056 -0.912243034
[21] -1.801351141 -0.630164919 0.947419486 0.066304253 0.615659386
[26] 0.033155542 0.642916921 0.645553754 -0.138989595 -0.183995177
[31] -0.317680820 -0.001520873 -1.184076889 -0.122781121 0.563939045
[36] -0.213274384 0.281476424 0.131167136 -1.287961038 -0.532332750
[41] -0.396957625 -0.625304290 0.104598632 1.281981436 -0.235444284
[46] -1.666397336 0.711738567 0.895437234 -0.756376325 0.724934807
[51] 0.114462442 -1.620236223 1.838103346 -0.490430537 -0.363350469
[56] -1.906298825 -1.223976656 -1.438691183 1.550945353 -0.777426335
[61] 0.061822991 0.058548749 -0.669332797 0.339072349 1.663525217
[66] -0.456838614 0.990369476 -0.517801736 -1.514725232 -0.393270749
[71] 1.422814381 0.384732648 -0.105744664 -0.694801065 -0.362273173
[76] -0.735594135 0.582963379 1.086267156 -0.321381491 -1.184485883
[81] -1.434133679 0.419590867 0.408559239 -0.079497071 0.130663674
[86] -0.799409239 0.380901979 -0.929817536 -0.002818443 0.064061536
[91] 1.500545984 0.450755131 -1.256117606 0.897016796 -0.446050500
[96] 0.579266851 0.201038189 -0.398361769 -0.307134064 -0.935864736
> rowMin(tmp2)
[1] 1.040417621 -1.187642126 -0.136560658 0.167470111 0.852878396
[6] 0.070689749 0.331213104 -1.072715265 0.754938553 -0.917569003
[11] -0.213057894 -0.032281714 1.204752173 0.942816655 -0.391951465
[16] 0.472006948 0.635592334 2.477878926 0.908089056 -0.912243034
[21] -1.801351141 -0.630164919 0.947419486 0.066304253 0.615659386
[26] 0.033155542 0.642916921 0.645553754 -0.138989595 -0.183995177
[31] -0.317680820 -0.001520873 -1.184076889 -0.122781121 0.563939045
[36] -0.213274384 0.281476424 0.131167136 -1.287961038 -0.532332750
[41] -0.396957625 -0.625304290 0.104598632 1.281981436 -0.235444284
[46] -1.666397336 0.711738567 0.895437234 -0.756376325 0.724934807
[51] 0.114462442 -1.620236223 1.838103346 -0.490430537 -0.363350469
[56] -1.906298825 -1.223976656 -1.438691183 1.550945353 -0.777426335
[61] 0.061822991 0.058548749 -0.669332797 0.339072349 1.663525217
[66] -0.456838614 0.990369476 -0.517801736 -1.514725232 -0.393270749
[71] 1.422814381 0.384732648 -0.105744664 -0.694801065 -0.362273173
[76] -0.735594135 0.582963379 1.086267156 -0.321381491 -1.184485883
[81] -1.434133679 0.419590867 0.408559239 -0.079497071 0.130663674
[86] -0.799409239 0.380901979 -0.929817536 -0.002818443 0.064061536
[91] 1.500545984 0.450755131 -1.256117606 0.897016796 -0.446050500
[96] 0.579266851 0.201038189 -0.398361769 -0.307134064 -0.935864736
>
> colMeans(tmp2)
[1] -0.0369344
> colSums(tmp2)
[1] -3.69344
> colVars(tmp2)
[1] 0.7552316
> colSd(tmp2)
[1] 0.8690406
> colMax(tmp2)
[1] 2.477879
> colMin(tmp2)
[1] -1.906299
> colMedians(tmp2)
[1] -0.01755008
> colRanges(tmp2)
[,1]
[1,] -1.906299
[2,] 2.477879
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 3.3384198 2.1732132 0.8354120 2.8233566 3.4019222 -1.4958025
[7] -1.7808872 -3.0022950 0.4041708 -0.7535923
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.79016322
[2,] -0.09111321
[3,] 0.24516800
[4,] 0.92717476
[5,] 1.46857146
>
> rowApply(tmp,sum)
[1] 1.00608296 -0.44691795 -0.07808167 1.36549969 -0.45359402 0.53539743
[7] 0.25349386 3.95499639 -3.23940369 3.04644456
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 7 2 5 10 10 7 5 4 9 3
[2,] 6 9 6 5 9 3 9 7 8 4
[3,] 4 5 9 1 4 6 2 2 10 6
[4,] 8 6 10 4 5 9 4 6 5 5
[5,] 9 4 8 9 6 8 1 10 1 9
[6,] 3 1 7 7 8 5 10 5 2 2
[7,] 1 7 3 2 2 1 8 8 3 10
[8,] 5 8 1 8 1 4 7 1 4 8
[9,] 2 10 2 6 7 10 6 9 6 1
[10,] 10 3 4 3 3 2 3 3 7 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.35953031 -5.06687873 2.61360587 0.28512703 -0.90606898 -0.45217860
[7] 0.04019339 0.33176310 -1.07143196 -1.84899843 -5.01508182 0.50752888
[13] -0.21210332 -1.02046306 -3.23129527 2.38065660 -0.20285882 0.10741951
[19] 0.67789236 0.27448917
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.9263050
[2,] 0.2200119
[3,] 0.7433391
[4,] 1.0841187
[5,] 1.2383656
>
> rowApply(tmp,sum)
[1] 1.163850 2.324887 2.043676 -1.695098 -13.286468
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 14 15 14 7
[2,] 6 2 6 2 11
[3,] 18 12 18 6 18
[4,] 16 20 8 13 2
[5,] 9 7 2 16 19
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.2383656 -0.5268811 1.3387336 0.92796259 -0.2049830 -0.39826513
[2,] 0.7433391 -2.1153656 0.4459225 1.89527999 -0.3122397 -0.98834272
[3,] 1.0841187 -0.5525715 1.1817004 -0.15346992 -1.5713797 0.13597936
[4,] 0.2200119 -1.4749988 -0.6429035 -0.04128618 0.4359748 0.81528405
[5,] -0.9263050 -0.3970618 0.2901528 -2.34335945 0.7465585 -0.01683415
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.09424529 -0.1242989 1.4387491 0.3744230 -1.3345230 0.71145907
[2,] 0.82916565 -0.4427749 -0.7411246 1.0492215 -0.2721629 0.62938950
[3,] 0.08035636 0.1440232 -0.5607275 -1.1361513 -2.8625939 0.72870543
[4,] -0.63535690 1.7897546 -0.3053793 -0.3391674 -0.7060739 -1.57729645
[5,] 0.86027357 -1.0349408 -0.9029497 -1.7973242 0.1602719 0.01527132
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.3127526 -2.46496776 -0.8651070 2.6131488 0.2913961 -0.2432752
[2,] 0.1442662 1.83634032 -2.2459062 -0.3075565 -0.8448851 1.3606134
[3,] 0.9970251 -0.07859195 1.1512459 -0.6209776 1.2365750 1.0956919
[4,] 0.3396991 -0.11687941 -0.7477077 0.9730089 1.5782501 -0.1527376
[5,] -2.0058463 -0.19636427 -0.5238203 -0.2769670 -2.4641949 -1.9528730
[,19] [,20]
[1,] -0.1368421 -0.68975189
[2,] 0.3425823 1.31912500
[3,] 1.9311992 -0.18648117
[4,] -1.0493739 -0.05792042
[5,] -0.4096731 -0.11048235
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 561 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -1.232997 -0.08099759 0.4220196 0.5363974 -1.492912 -0.6567768 0.4715976
col8 col9 col10 col11 col12 col13 col14
row1 -0.02599407 -0.03974306 0.7067138 -0.7524302 1.370755 -1.00349 -1.545314
col15 col16 col17 col18 col19 col20
row1 1.021753 1.321795 -0.827205 -0.7774115 1.460358 1.210778
> tmp[,"col10"]
col10
row1 0.7067138
row2 2.0665153
row3 0.6380167
row4 -0.6166555
row5 1.7025861
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -1.2329973 -0.08099759 0.4220196 0.5363974 -1.492912 -0.6567768
row5 -0.8311918 0.72918667 0.5285092 -0.5558308 -1.147214 -1.9384603
col7 col8 col9 col10 col11 col12
row1 0.47159762 -0.02599407 -0.03974306 0.7067138 -0.7524302 1.370755
row5 -0.07130335 -1.01376779 -0.46014630 1.7025861 -0.7216348 1.120769
col13 col14 col15 col16 col17 col18
row1 -1.0034902 -1.545314 1.0217526 1.3217953 -0.82720498 -0.77741151
row5 -0.7335344 -1.468890 -0.4717668 0.6345757 0.08637144 -0.08211649
col19 col20
row1 1.46035843 1.210778
row5 -0.01387043 -1.565439
> tmp[,c("col6","col20")]
col6 col20
row1 -0.6567768 1.2107782
row2 0.5954523 0.1341563
row3 0.9096660 0.3237709
row4 -1.0579362 -0.5837138
row5 -1.9384603 -1.5654391
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.6567768 1.210778
row5 -1.9384603 -1.565439
>
>
>
>
> 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.54611 48.91478 49.9845 51.58439 48.8969 106.7585 49.54131 49.64189
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.66121 51.70756 48.96321 51.02117 50.30262 50.25489 50.70358 48.38453
col17 col18 col19 col20
row1 51.71734 50.5989 50.53481 103.7482
> tmp[,"col10"]
col10
row1 51.70756
row2 29.63260
row3 30.55324
row4 29.93682
row5 50.65554
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.54611 48.91478 49.98450 51.58439 48.89690 106.7585 49.54131 49.64189
row5 48.61724 47.90907 50.08898 49.86910 49.37998 104.2193 50.86496 49.21236
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.66121 51.70756 48.96321 51.02117 50.30262 50.25489 50.70358 48.38453
row5 50.31012 50.65554 50.00572 50.31614 48.57380 49.22004 50.05414 49.22071
col17 col18 col19 col20
row1 51.71734 50.59890 50.53481 103.7482
row5 50.10977 49.83765 48.28716 104.9955
> tmp[,c("col6","col20")]
col6 col20
row1 106.75847 103.74816
row2 74.92411 75.60215
row3 74.28894 75.03019
row4 76.38562 74.76367
row5 104.21930 104.99551
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.7585 103.7482
row5 104.2193 104.9955
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.7585 103.7482
row5 104.2193 104.9955
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.5556316
[2,] -0.2159494
[3,] -0.4205906
[4,] 0.2505176
[5,] 0.1670301
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.4973448 -0.58492397
[2,] 0.2957521 -0.96196429
[3,] -0.7895194 -0.51230329
[4,] -0.2883188 0.22723698
[5,] -0.5918754 0.01452311
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.5695599 0.8014378
[2,] 0.2855050 -2.1879975
[3,] 0.1558764 1.3258599
[4,] 0.2125956 -0.1799527
[5,] -1.3323256 -0.2070622
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.5695599
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.5695599
[2,] 0.2855050
>
>
>
> 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.057130 -0.1632440 -0.4873416 0.4882728 -0.2832495 -1.0399620 0.2292659
row1 -1.765444 0.4529879 -0.1973507 0.3176330 0.5875539 -0.1042732 0.7770163
[,8] [,9] [,10] [,11] [,12] [,13]
row3 1.141750 -2.1072956 -0.05708582 -0.07250593 0.9199125 0.07223863
row1 1.297616 -0.7212941 -0.85381315 1.06258190 -0.5936682 1.71281326
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.4229688 0.1471700 0.06774475 -2.3530046 0.08260783 -0.5375955
row1 0.9928472 0.4888838 -0.57187177 -0.7014184 -0.23546861 0.1068056
[,20]
row3 0.1510085
row1 -0.2566765
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.697624 1.375461 0.3571018 -1.628799 0.1225859 -1.482782 -2.212508
[,8] [,9] [,10]
row2 0.3373629 0.729598 -0.9740664
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.8017248 1.733504 -0.9513972 0.8479944 1.90932 -0.7796954 0.2964269
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.4937064 0.4551278 -0.9378721 -0.3358893 0.6916312 0.4437392 0.1669331
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.8911917 -1.807282 1.071871 0.4574728 0.06356113 -1.604059
>
>
> 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: 0xb73918540>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a71c5f47c1"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a7335fde74"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a75b05ac05"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a75160aaf2"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a721771f9b"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a713bc0a47"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a71e46c570"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a7384c4b97"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a718f6c361"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a770952214"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a74ef088ca"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a711a4ae43"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a752acb9c1"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a749d7584e"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM91a758e68ec1"
>
>
> ### 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: 0xb73919020>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xb73919020>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xb73919020>
> rowMedians(tmp)
[1] -0.479516354 0.474587860 -0.340182559 -0.732101908 0.175945432
[6] -0.104869347 -0.291465454 0.086185290 -0.115756319 -0.039045125
[11] 0.350935108 0.471508611 0.718523743 -0.438316678 -0.131053438
[16] 0.326108435 0.100702284 -0.646657448 0.045687009 0.164193063
[21] 0.375623861 -0.181194599 0.056943446 -0.436862067 -0.053220161
[26] -0.051990699 -0.210307585 0.018789023 0.090140641 0.132995505
[31] -0.066477001 0.015123618 -0.202417566 -0.100567330 0.255877347
[36] 0.120606511 0.044398643 0.208072045 0.048374652 -0.285219197
[41] 0.338126038 -0.099154369 -0.106024319 0.153338975 -0.391522651
[46] 0.033615028 -0.391460948 0.131384514 0.295081685 -0.023066940
[51] -0.359674653 -0.089207565 -0.598386320 0.790676606 0.171216162
[56] -0.334334969 -0.034516450 -0.048294008 -0.043621684 -0.427871377
[61] 0.099454941 -0.490536185 0.055680857 -0.003944767 -0.546460525
[66] 0.409766689 -0.429920079 0.080350475 -0.061139325 -0.123760230
[71] 0.706961879 -0.093638155 -0.196842428 0.306689307 -0.247783612
[76] -0.038997745 -0.464989350 0.054351065 -0.053046040 -0.209810292
[81] -0.021338809 -0.104115329 0.137218783 0.343515593 0.019662706
[86] -0.353687064 -0.400416746 0.183913824 -0.002605302 -0.399961901
[91] -0.187396792 -0.037829919 0.603001750 -0.098625864 -0.128769429
[96] -0.072531312 0.545653752 0.100877381 0.475944117 -0.211139525
[101] 0.205510979 -0.207720554 -0.145929621 -0.115144845 -0.129148757
[106] 0.132521970 0.278228551 0.601809490 0.215486331 -0.054612482
[111] -0.753689706 0.370587785 0.267243718 0.544850445 0.235102717
[116] -0.362717077 -0.625320444 -0.052929360 -0.385378675 -0.075049428
[121] -0.258822320 0.065387236 -0.098550198 0.518699422 -0.163857829
[126] 0.120447202 -0.213597937 0.454092386 -0.225088489 -0.025339096
[131] 0.241570286 0.244721137 0.073328014 0.246036569 -0.543458128
[136] -0.546183393 -0.322368498 -0.038333655 -0.024809538 0.067007257
[141] 0.208579679 0.408610851 0.255007252 -0.135274778 0.218429300
[146] -0.352528655 -0.108505897 -0.089207209 0.207250197 -0.413484350
[151] -0.040008869 0.241622569 0.289395883 0.256847407 0.021035145
[156] -0.215982404 -0.295943603 -0.355720328 0.034490854 0.065153950
[161] 0.204615901 -0.358949678 -0.253251548 -0.207774298 -0.080541525
[166] -0.126643820 -0.062941454 -0.044107146 -0.012185419 0.033214370
[171] 0.271614317 0.578941017 0.114317857 0.149737864 0.120648711
[176] 0.174093596 -0.064029857 -0.318329309 -0.485115252 0.087686281
[181] 0.101035479 -0.201232787 -0.385491821 0.111092735 -0.064139117
[186] -0.518189422 -0.439882148 0.123257049 0.257777109 0.441114995
[191] 0.249572511 0.274693344 0.163285576 -0.148886424 -0.371905374
[196] 0.326988308 -0.379883931 0.044915486 0.183703689 0.046601033
[201] -0.302306937 -0.493325569 0.056724543 -0.335517273 0.127906095
[206] 0.449288512 0.178102608 0.020648746 -0.091804181 -0.094082829
[211] 0.069616976 0.009560600 0.077793985 0.136581148 -0.371435628
[216] 0.292178002 -0.010906953 -0.231763026 0.193688630 -0.470453133
[221] 0.240415369 0.393987656 0.111068582 0.079689842 -0.045424775
[226] 0.181446822 -0.122301348 -0.430519232 0.532501294 -0.452715729
>
> proc.time()
user system elapsed
0.792 5.300 6.197
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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: 0x101231ab0>
> .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: 0x101231ab0>
> .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: 0x101231ab0>
> .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: 0x101231ab0>
> 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: 0xbcb8d8600>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d8600>
> .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: 0xbcb8d8600>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d8600>
> .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: 0xbcb8d8600>
> 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: 0xbcb8d87e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d87e0>
> .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: 0xbcb8d87e0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xbcb8d87e0>
> .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: 0xbcb8d87e0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0xbcb8d87e0>
> .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: 0xbcb8d87e0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0xbcb8d87e0>
> .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: 0xbcb8d87e0>
> 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: 0xbcb8d89c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xbcb8d89c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d89c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d89c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile941922d31dc2" "BufferedMatrixFile94195246bd6a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile941922d31dc2" "BufferedMatrixFile94195246bd6a"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d8c60>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d8c60>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xbcb8d8c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xbcb8d8c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xbcb8d8c60>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xbcb8d8c60>
> .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: 0xbcb8d8e40>
> .Call("R_bm_AddColumn",P)
<pointer: 0xbcb8d8e40>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xbcb8d8e40>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xbcb8d8e40>
> 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: 0xbcb8d9020>
> .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: 0xbcb8d9020>
> rm(P)
>
> proc.time()
user system elapsed
0.147 0.056 0.203
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.125 0.030 0.152