| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-01 11:35 -0500 (Thu, 01 Jan 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" | 4808 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4593 |
| 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 253/2332 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-12-31 18:48:35 -0500 (Wed, 31 Dec 2025) |
| EndedAt: 2025-12-31 18:48:56 -0500 (Wed, 31 Dec 2025) |
| EllapsedTime: 20.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.115 0.043 0.164
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481248 25.8 1058085 56.6 NA 633817 33.9
Vcells 891449 6.9 8388608 64.0 196608 2110969 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Dec 31 18:48:46 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] "Wed Dec 31 18:48:46 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: 0x600003e080c0>
>
>
>
> 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] "Wed Dec 31 18:48:47 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] "Wed Dec 31 18:48:48 2025"
>
> ColMode(tmp2)
<pointer: 0x600003e080c0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.35709731 -0.2070828 0.6939781 0.4059907
[2,] -0.19144938 0.2758098 -0.2164807 -1.1384039
[3,] 0.04679987 -1.5608529 -0.6154991 -1.9271290
[4,] 0.64404708 1.9885878 2.4981303 0.9059093
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.35709731 0.2070828 0.6939781 0.4059907
[2,] 0.19144938 0.2758098 0.2164807 1.1384039
[3,] 0.04679987 1.5608529 0.6154991 1.9271290
[4,] 0.64404708 1.9885878 2.4981303 0.9059093
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0676262 0.4550635 0.8330535 0.6371740
[2,] 0.4375493 0.5251760 0.4652748 1.0669601
[3,] 0.2163328 1.2493410 0.7845375 1.3882107
[4,] 0.8025254 1.4101730 1.5805475 0.9517927
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 227.03336 29.75772 34.02451 31.77773
[2,] 29.56694 30.52757 29.86923 36.80800
[3,] 27.21013 39.05426 33.46087 40.80924
[4,] 33.66930 41.09032 43.30361 35.42384
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003e24000>
> exp(tmp5)
<pointer: 0x600003e24000>
> log(tmp5,2)
<pointer: 0x600003e24000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.5402
> Min(tmp5)
[1] 54.66654
> mean(tmp5)
[1] 72.97492
> Sum(tmp5)
[1] 14594.98
> Var(tmp5)
[1] 880.0021
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.54005 69.01269 73.69013 74.74865 71.97788 68.73668 69.10008 69.79304
[9] 72.13873 70.01131
> rowSums(tmp5)
[1] 1810.801 1380.254 1473.803 1494.973 1439.558 1374.734 1382.002 1395.861
[9] 1442.775 1400.226
> rowVars(tmp5)
[1] 8167.72641 50.80668 101.87499 62.70256 72.98801 87.61322
[7] 47.50697 80.57869 75.90457 67.61645
> rowSd(tmp5)
[1] 90.375475 7.127880 10.093314 7.918495 8.543302 9.360193 6.892530
[8] 8.976563 8.712323 8.222922
> rowMax(tmp5)
[1] 472.54019 84.12784 92.24260 90.13078 85.12832 85.98969 85.99961
[8] 84.34828 86.79765 89.85244
> rowMin(tmp5)
[1] 54.66654 58.10087 56.63432 59.44956 58.22834 55.92954 57.77362 55.42291
[9] 60.38478 58.70441
>
> colMeans(tmp5)
[1] 104.34545 70.35423 73.72261 73.51071 73.75414 70.34958 72.05165
[8] 70.95193 69.84702 75.34791 70.26377 69.47773 71.01589 66.75981
[15] 71.88020 71.37059 73.47967 71.10606 69.47310 70.43643
> colSums(tmp5)
[1] 1043.4545 703.5423 737.2261 735.1071 737.5414 703.4958 720.5165
[8] 709.5193 698.4702 753.4791 702.6377 694.7773 710.1589 667.5981
[15] 718.8020 713.7059 734.7967 711.0606 694.7310 704.3643
> colVars(tmp5)
[1] 16763.94472 119.18364 95.34872 67.24229 76.46602 38.93522
[7] 57.13942 60.40731 29.77896 71.26381 107.65134 90.35619
[13] 75.36709 48.24949 104.31556 44.14206 111.83578 92.79439
[19] 81.10485 91.23566
> colSd(tmp5)
[1] 129.475653 10.917126 9.764667 8.200139 8.744485 6.239809
[7] 7.559062 7.772214 5.457011 8.441789 10.375516 9.505587
[13] 8.681422 6.946185 10.213499 6.643949 10.575244 9.632984
[19] 9.005823 9.551736
> colMax(tmp5)
[1] 472.54019 85.99961 90.13078 84.93908 89.85244 81.41254 84.05724
[8] 84.15102 78.42478 88.98329 84.36786 83.96682 85.98969 80.25443
[15] 86.23796 81.65880 92.24260 87.90959 82.30506 84.12784
> colMin(tmp5)
[1] 56.63432 60.38478 60.74458 58.16828 60.56145 61.98597 60.53056 59.44956
[9] 61.32844 65.59224 55.55955 54.66654 55.42291 59.16762 55.92954 63.02871
[17] 58.68870 58.52460 59.53223 57.77362
>
>
> ### 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] 90.54005 69.01269 73.69013 74.74865 71.97788 NA 69.10008 69.79304
[9] 72.13873 70.01131
> rowSums(tmp5)
[1] 1810.801 1380.254 1473.803 1494.973 1439.558 NA 1382.002 1395.861
[9] 1442.775 1400.226
> rowVars(tmp5)
[1] 8167.72641 50.80668 101.87499 62.70256 72.98801 88.57218
[7] 47.50697 80.57869 75.90457 67.61645
> rowSd(tmp5)
[1] 90.375475 7.127880 10.093314 7.918495 8.543302 9.411279 6.892530
[8] 8.976563 8.712323 8.222922
> rowMax(tmp5)
[1] 472.54019 84.12784 92.24260 90.13078 85.12832 NA 85.99961
[8] 84.34828 86.79765 89.85244
> rowMin(tmp5)
[1] 54.66654 58.10087 56.63432 59.44956 58.22834 NA 57.77362 55.42291
[9] 60.38478 58.70441
>
> colMeans(tmp5)
[1] 104.34545 70.35423 73.72261 73.51071 NA 70.34958 72.05165
[8] 70.95193 69.84702 75.34791 70.26377 69.47773 71.01589 66.75981
[15] 71.88020 71.37059 73.47967 71.10606 69.47310 70.43643
> colSums(tmp5)
[1] 1043.4545 703.5423 737.2261 735.1071 NA 703.4958 720.5165
[8] 709.5193 698.4702 753.4791 702.6377 694.7773 710.1589 667.5981
[15] 718.8020 713.7059 734.7967 711.0606 694.7310 704.3643
> colVars(tmp5)
[1] 16763.94472 119.18364 95.34872 67.24229 NA 38.93522
[7] 57.13942 60.40731 29.77896 71.26381 107.65134 90.35619
[13] 75.36709 48.24949 104.31556 44.14206 111.83578 92.79439
[19] 81.10485 91.23566
> colSd(tmp5)
[1] 129.475653 10.917126 9.764667 8.200139 NA 6.239809
[7] 7.559062 7.772214 5.457011 8.441789 10.375516 9.505587
[13] 8.681422 6.946185 10.213499 6.643949 10.575244 9.632984
[19] 9.005823 9.551736
> colMax(tmp5)
[1] 472.54019 85.99961 90.13078 84.93908 NA 81.41254 84.05724
[8] 84.15102 78.42478 88.98329 84.36786 83.96682 85.98969 80.25443
[15] 86.23796 81.65880 92.24260 87.90959 82.30506 84.12784
> colMin(tmp5)
[1] 56.63432 60.38478 60.74458 58.16828 NA 61.98597 60.53056 59.44956
[9] 61.32844 65.59224 55.55955 54.66654 55.42291 59.16762 55.92954 63.02871
[17] 58.68870 58.52460 59.53223 57.77362
>
> Max(tmp5,na.rm=TRUE)
[1] 472.5402
> Min(tmp5,na.rm=TRUE)
[1] 54.66654
> mean(tmp5,na.rm=TRUE)
[1] 73.0373
> Sum(tmp5,na.rm=TRUE)
[1] 14534.42
> Var(tmp5,na.rm=TRUE)
[1] 883.6644
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.54005 69.01269 73.69013 74.74865 71.97788 69.16696 69.10008 69.79304
[9] 72.13873 70.01131
> rowSums(tmp5,na.rm=TRUE)
[1] 1810.801 1380.254 1473.803 1494.973 1439.558 1314.172 1382.002 1395.861
[9] 1442.775 1400.226
> rowVars(tmp5,na.rm=TRUE)
[1] 8167.72641 50.80668 101.87499 62.70256 72.98801 88.57218
[7] 47.50697 80.57869 75.90457 67.61645
> rowSd(tmp5,na.rm=TRUE)
[1] 90.375475 7.127880 10.093314 7.918495 8.543302 9.411279 6.892530
[8] 8.976563 8.712323 8.222922
> rowMax(tmp5,na.rm=TRUE)
[1] 472.54019 84.12784 92.24260 90.13078 85.12832 85.98969 85.99961
[8] 84.34828 86.79765 89.85244
> rowMin(tmp5,na.rm=TRUE)
[1] 54.66654 58.10087 56.63432 59.44956 58.22834 55.92954 57.77362 55.42291
[9] 60.38478 58.70441
>
> colMeans(tmp5,na.rm=TRUE)
[1] 104.34545 70.35423 73.72261 73.51071 75.21999 70.34958 72.05165
[8] 70.95193 69.84702 75.34791 70.26377 69.47773 71.01589 66.75981
[15] 71.88020 71.37059 73.47967 71.10606 69.47310 70.43643
> colSums(tmp5,na.rm=TRUE)
[1] 1043.4545 703.5423 737.2261 735.1071 676.9799 703.4958 720.5165
[8] 709.5193 698.4702 753.4791 702.6377 694.7773 710.1589 667.5981
[15] 718.8020 713.7059 734.7967 711.0606 694.7310 704.3643
> colVars(tmp5,na.rm=TRUE)
[1] 16763.94472 119.18364 95.34872 67.24229 61.85109 38.93522
[7] 57.13942 60.40731 29.77896 71.26381 107.65134 90.35619
[13] 75.36709 48.24949 104.31556 44.14206 111.83578 92.79439
[19] 81.10485 91.23566
> colSd(tmp5,na.rm=TRUE)
[1] 129.475653 10.917126 9.764667 8.200139 7.864546 6.239809
[7] 7.559062 7.772214 5.457011 8.441789 10.375516 9.505587
[13] 8.681422 6.946185 10.213499 6.643949 10.575244 9.632984
[19] 9.005823 9.551736
> colMax(tmp5,na.rm=TRUE)
[1] 472.54019 85.99961 90.13078 84.93908 89.85244 81.41254 84.05724
[8] 84.15102 78.42478 88.98329 84.36786 83.96682 85.98969 80.25443
[15] 86.23796 81.65880 92.24260 87.90959 82.30506 84.12784
> colMin(tmp5,na.rm=TRUE)
[1] 56.63432 60.38478 60.74458 58.16828 65.47278 61.98597 60.53056 59.44956
[9] 61.32844 65.59224 55.55955 54.66654 55.42291 59.16762 55.92954 63.02871
[17] 58.68870 58.52460 59.53223 57.77362
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.54005 69.01269 73.69013 74.74865 71.97788 NaN 69.10008 69.79304
[9] 72.13873 70.01131
> rowSums(tmp5,na.rm=TRUE)
[1] 1810.801 1380.254 1473.803 1494.973 1439.558 0.000 1382.002 1395.861
[9] 1442.775 1400.226
> rowVars(tmp5,na.rm=TRUE)
[1] 8167.72641 50.80668 101.87499 62.70256 72.98801 NA
[7] 47.50697 80.57869 75.90457 67.61645
> rowSd(tmp5,na.rm=TRUE)
[1] 90.375475 7.127880 10.093314 7.918495 8.543302 NA 6.892530
[8] 8.976563 8.712323 8.222922
> rowMax(tmp5,na.rm=TRUE)
[1] 472.54019 84.12784 92.24260 90.13078 85.12832 NA 85.99961
[8] 84.34828 86.79765 89.85244
> rowMin(tmp5,na.rm=TRUE)
[1] 54.66654 58.10087 56.63432 59.44956 58.22834 NA 57.77362 55.42291
[9] 60.38478 58.70441
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 107.97735 71.40907 75.16462 73.17767 NaN 69.12036 71.81676
[8] 70.98145 70.40712 76.14608 71.03546 68.65284 69.35213 67.17914
[15] 73.65250 70.38765 75.12311 69.83358 70.57764 71.70225
> colSums(tmp5,na.rm=TRUE)
[1] 971.7961 642.6817 676.4815 658.5991 0.0000 622.0833 646.3509 638.8331
[9] 633.6641 685.3147 639.3192 617.8755 624.1692 604.6123 662.8725 633.4889
[17] 676.1080 628.5023 635.1988 645.3203
> colVars(tmp5,na.rm=TRUE)
[1] 18711.04248 121.56387 83.87433 74.39980 NA 26.80363
[7] 63.66118 67.94842 29.97198 73.00476 114.40837 93.99567
[13] 53.64703 52.30244 82.01839 38.79056 95.43014 86.17774
[19] 77.51784 84.61429
> colSd(tmp5,na.rm=TRUE)
[1] 136.788313 11.025601 9.158293 8.625532 NA 5.177222
[7] 7.978795 8.243083 5.474667 8.544282 10.696185 9.695136
[13] 7.324414 7.232043 9.056401 6.228206 9.768835 9.283197
[19] 8.804422 9.198603
> colMax(tmp5,na.rm=TRUE)
[1] 472.54019 85.99961 90.13078 84.93908 -Inf 78.17627 84.05724
[8] 84.15102 78.42478 88.98329 84.36786 83.96682 80.61463 80.25443
[15] 86.23796 81.65880 92.24260 87.90959 82.30506 84.12784
> colMin(tmp5,na.rm=TRUE)
[1] 56.63432 60.38478 62.16889 58.16828 Inf 61.98597 60.53056 59.44956
[9] 61.32844 65.59224 55.55955 54.66654 55.42291 59.16762 58.10087 63.02871
[17] 61.08532 58.52460 60.60459 57.77362
>
>
>
>
> 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] 297.3735 336.0052 173.9811 406.0047 304.8506 196.2624 280.0391 173.4446
[9] 172.3293 146.1266
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 297.3735 336.0052 173.9811 406.0047 304.8506 196.2624 280.0391 173.4446
[9] 172.3293 146.1266
>
>
>
> 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] -8.526513e-14 2.842171e-14 -7.105427e-14 -2.842171e-14 -5.684342e-14
[6] 1.705303e-13 -8.526513e-14 0.000000e+00 -1.421085e-13 2.842171e-14
[11] -1.136868e-13 -8.526513e-14 3.410605e-13 -5.684342e-14 1.705303e-13
[16] -5.684342e-14 -5.684342e-14 -1.136868e-13 5.684342e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
2 20
5 13
10 18
5 17
1 13
4 3
9 20
1 14
10 18
1 3
9 4
5 4
6 20
1 14
2 2
5 13
8 1
10 20
4 3
1 18
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 1.805953
> Min(tmp)
[1] -2.496075
> mean(tmp)
[1] -0.1535236
> Sum(tmp)
[1] -15.35236
> Var(tmp)
[1] 0.9029861
>
> rowMeans(tmp)
[1] -0.1535236
> rowSums(tmp)
[1] -15.35236
> rowVars(tmp)
[1] 0.9029861
> rowSd(tmp)
[1] 0.9502558
> rowMax(tmp)
[1] 1.805953
> rowMin(tmp)
[1] -2.496075
>
> colMeans(tmp)
[1] -0.64957469 0.83926357 -0.43199322 0.20565296 -1.40507610 0.72153934
[7] -0.27394353 1.12403664 0.12682465 0.07926006 -1.42094829 0.23864976
[13] -0.27259524 -1.73731123 -0.12471431 -0.01994455 -2.26885117 0.77232846
[19] -0.32119071 -0.06255216 1.80595346 -1.70000153 -0.46608791 0.40693328
[25] -2.03532212 -0.93032403 1.29574803 -1.07962272 -1.03275448 0.18432537
[31] 0.14599623 -0.25001374 0.70418800 -1.60866128 0.70409855 1.45683451
[37] -0.68084615 -0.28678519 0.47954725 0.76640799 0.10909803 -0.24278719
[43] 0.98148749 -1.57563983 -1.49747385 -0.33224615 1.16622123 0.50810470
[49] 0.51458324 0.05902282 -0.06041356 0.58215241 0.39390147 -0.30217724
[55] 1.33418564 -0.52794188 1.31792926 -1.51614788 -1.44116964 -0.91856078
[61] -0.26376300 -2.49607492 0.72527685 -0.11130338 -0.11350589 0.34924976
[67] 1.18645147 0.26461010 1.34282670 -1.63182049 0.11441156 0.34799250
[73] 0.93904347 0.17786023 -0.79500589 -0.38050958 -0.22058828 0.99182209
[79] -0.96361310 1.03331914 0.04225670 0.32066298 0.84656487 0.23757572
[85] 0.09730071 0.74536993 -1.26653185 -1.02217277 -0.96967339 -1.58815309
[91] -0.88311062 -1.79518273 0.45649745 -0.37877853 -0.96605713 0.10788949
[97] -1.00173488 1.46126424 -0.76779361 -1.07583797
> colSums(tmp)
[1] -0.64957469 0.83926357 -0.43199322 0.20565296 -1.40507610 0.72153934
[7] -0.27394353 1.12403664 0.12682465 0.07926006 -1.42094829 0.23864976
[13] -0.27259524 -1.73731123 -0.12471431 -0.01994455 -2.26885117 0.77232846
[19] -0.32119071 -0.06255216 1.80595346 -1.70000153 -0.46608791 0.40693328
[25] -2.03532212 -0.93032403 1.29574803 -1.07962272 -1.03275448 0.18432537
[31] 0.14599623 -0.25001374 0.70418800 -1.60866128 0.70409855 1.45683451
[37] -0.68084615 -0.28678519 0.47954725 0.76640799 0.10909803 -0.24278719
[43] 0.98148749 -1.57563983 -1.49747385 -0.33224615 1.16622123 0.50810470
[49] 0.51458324 0.05902282 -0.06041356 0.58215241 0.39390147 -0.30217724
[55] 1.33418564 -0.52794188 1.31792926 -1.51614788 -1.44116964 -0.91856078
[61] -0.26376300 -2.49607492 0.72527685 -0.11130338 -0.11350589 0.34924976
[67] 1.18645147 0.26461010 1.34282670 -1.63182049 0.11441156 0.34799250
[73] 0.93904347 0.17786023 -0.79500589 -0.38050958 -0.22058828 0.99182209
[79] -0.96361310 1.03331914 0.04225670 0.32066298 0.84656487 0.23757572
[85] 0.09730071 0.74536993 -1.26653185 -1.02217277 -0.96967339 -1.58815309
[91] -0.88311062 -1.79518273 0.45649745 -0.37877853 -0.96605713 0.10788949
[97] -1.00173488 1.46126424 -0.76779361 -1.07583797
> 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.64957469 0.83926357 -0.43199322 0.20565296 -1.40507610 0.72153934
[7] -0.27394353 1.12403664 0.12682465 0.07926006 -1.42094829 0.23864976
[13] -0.27259524 -1.73731123 -0.12471431 -0.01994455 -2.26885117 0.77232846
[19] -0.32119071 -0.06255216 1.80595346 -1.70000153 -0.46608791 0.40693328
[25] -2.03532212 -0.93032403 1.29574803 -1.07962272 -1.03275448 0.18432537
[31] 0.14599623 -0.25001374 0.70418800 -1.60866128 0.70409855 1.45683451
[37] -0.68084615 -0.28678519 0.47954725 0.76640799 0.10909803 -0.24278719
[43] 0.98148749 -1.57563983 -1.49747385 -0.33224615 1.16622123 0.50810470
[49] 0.51458324 0.05902282 -0.06041356 0.58215241 0.39390147 -0.30217724
[55] 1.33418564 -0.52794188 1.31792926 -1.51614788 -1.44116964 -0.91856078
[61] -0.26376300 -2.49607492 0.72527685 -0.11130338 -0.11350589 0.34924976
[67] 1.18645147 0.26461010 1.34282670 -1.63182049 0.11441156 0.34799250
[73] 0.93904347 0.17786023 -0.79500589 -0.38050958 -0.22058828 0.99182209
[79] -0.96361310 1.03331914 0.04225670 0.32066298 0.84656487 0.23757572
[85] 0.09730071 0.74536993 -1.26653185 -1.02217277 -0.96967339 -1.58815309
[91] -0.88311062 -1.79518273 0.45649745 -0.37877853 -0.96605713 0.10788949
[97] -1.00173488 1.46126424 -0.76779361 -1.07583797
> colMin(tmp)
[1] -0.64957469 0.83926357 -0.43199322 0.20565296 -1.40507610 0.72153934
[7] -0.27394353 1.12403664 0.12682465 0.07926006 -1.42094829 0.23864976
[13] -0.27259524 -1.73731123 -0.12471431 -0.01994455 -2.26885117 0.77232846
[19] -0.32119071 -0.06255216 1.80595346 -1.70000153 -0.46608791 0.40693328
[25] -2.03532212 -0.93032403 1.29574803 -1.07962272 -1.03275448 0.18432537
[31] 0.14599623 -0.25001374 0.70418800 -1.60866128 0.70409855 1.45683451
[37] -0.68084615 -0.28678519 0.47954725 0.76640799 0.10909803 -0.24278719
[43] 0.98148749 -1.57563983 -1.49747385 -0.33224615 1.16622123 0.50810470
[49] 0.51458324 0.05902282 -0.06041356 0.58215241 0.39390147 -0.30217724
[55] 1.33418564 -0.52794188 1.31792926 -1.51614788 -1.44116964 -0.91856078
[61] -0.26376300 -2.49607492 0.72527685 -0.11130338 -0.11350589 0.34924976
[67] 1.18645147 0.26461010 1.34282670 -1.63182049 0.11441156 0.34799250
[73] 0.93904347 0.17786023 -0.79500589 -0.38050958 -0.22058828 0.99182209
[79] -0.96361310 1.03331914 0.04225670 0.32066298 0.84656487 0.23757572
[85] 0.09730071 0.74536993 -1.26653185 -1.02217277 -0.96967339 -1.58815309
[91] -0.88311062 -1.79518273 0.45649745 -0.37877853 -0.96605713 0.10788949
[97] -1.00173488 1.46126424 -0.76779361 -1.07583797
> colMedians(tmp)
[1] -0.64957469 0.83926357 -0.43199322 0.20565296 -1.40507610 0.72153934
[7] -0.27394353 1.12403664 0.12682465 0.07926006 -1.42094829 0.23864976
[13] -0.27259524 -1.73731123 -0.12471431 -0.01994455 -2.26885117 0.77232846
[19] -0.32119071 -0.06255216 1.80595346 -1.70000153 -0.46608791 0.40693328
[25] -2.03532212 -0.93032403 1.29574803 -1.07962272 -1.03275448 0.18432537
[31] 0.14599623 -0.25001374 0.70418800 -1.60866128 0.70409855 1.45683451
[37] -0.68084615 -0.28678519 0.47954725 0.76640799 0.10909803 -0.24278719
[43] 0.98148749 -1.57563983 -1.49747385 -0.33224615 1.16622123 0.50810470
[49] 0.51458324 0.05902282 -0.06041356 0.58215241 0.39390147 -0.30217724
[55] 1.33418564 -0.52794188 1.31792926 -1.51614788 -1.44116964 -0.91856078
[61] -0.26376300 -2.49607492 0.72527685 -0.11130338 -0.11350589 0.34924976
[67] 1.18645147 0.26461010 1.34282670 -1.63182049 0.11441156 0.34799250
[73] 0.93904347 0.17786023 -0.79500589 -0.38050958 -0.22058828 0.99182209
[79] -0.96361310 1.03331914 0.04225670 0.32066298 0.84656487 0.23757572
[85] 0.09730071 0.74536993 -1.26653185 -1.02217277 -0.96967339 -1.58815309
[91] -0.88311062 -1.79518273 0.45649745 -0.37877853 -0.96605713 0.10788949
[97] -1.00173488 1.46126424 -0.76779361 -1.07583797
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.6495747 0.8392636 -0.4319932 0.205653 -1.405076 0.7215393 -0.2739435
[2,] -0.6495747 0.8392636 -0.4319932 0.205653 -1.405076 0.7215393 -0.2739435
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.124037 0.1268247 0.07926006 -1.420948 0.2386498 -0.2725952 -1.737311
[2,] 1.124037 0.1268247 0.07926006 -1.420948 0.2386498 -0.2725952 -1.737311
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.1247143 -0.01994455 -2.268851 0.7723285 -0.3211907 -0.06255216 1.805953
[2,] -0.1247143 -0.01994455 -2.268851 0.7723285 -0.3211907 -0.06255216 1.805953
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.700002 -0.4660879 0.4069333 -2.035322 -0.930324 1.295748 -1.079623
[2,] -1.700002 -0.4660879 0.4069333 -2.035322 -0.930324 1.295748 -1.079623
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.032754 0.1843254 0.1459962 -0.2500137 0.704188 -1.608661 0.7040985
[2,] -1.032754 0.1843254 0.1459962 -0.2500137 0.704188 -1.608661 0.7040985
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.456835 -0.6808461 -0.2867852 0.4795472 0.766408 0.109098 -0.2427872
[2,] 1.456835 -0.6808461 -0.2867852 0.4795472 0.766408 0.109098 -0.2427872
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.9814875 -1.57564 -1.497474 -0.3322461 1.166221 0.5081047 0.5145832
[2,] 0.9814875 -1.57564 -1.497474 -0.3322461 1.166221 0.5081047 0.5145832
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.05902282 -0.06041356 0.5821524 0.3939015 -0.3021772 1.334186 -0.5279419
[2,] 0.05902282 -0.06041356 0.5821524 0.3939015 -0.3021772 1.334186 -0.5279419
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.317929 -1.516148 -1.44117 -0.9185608 -0.263763 -2.496075 0.7252769
[2,] 1.317929 -1.516148 -1.44117 -0.9185608 -0.263763 -2.496075 0.7252769
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.1113034 -0.1135059 0.3492498 1.186451 0.2646101 1.342827 -1.63182
[2,] -0.1113034 -0.1135059 0.3492498 1.186451 0.2646101 1.342827 -1.63182
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.1144116 0.3479925 0.9390435 0.1778602 -0.7950059 -0.3805096 -0.2205883
[2,] 0.1144116 0.3479925 0.9390435 0.1778602 -0.7950059 -0.3805096 -0.2205883
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.9918221 -0.9636131 1.033319 0.0422567 0.320663 0.8465649 0.2375757
[2,] 0.9918221 -0.9636131 1.033319 0.0422567 0.320663 0.8465649 0.2375757
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.09730071 0.7453699 -1.266532 -1.022173 -0.9696734 -1.588153 -0.8831106
[2,] 0.09730071 0.7453699 -1.266532 -1.022173 -0.9696734 -1.588153 -0.8831106
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.795183 0.4564975 -0.3787785 -0.9660571 0.1078895 -1.001735 1.461264
[2,] -1.795183 0.4564975 -0.3787785 -0.9660571 0.1078895 -1.001735 1.461264
[,99] [,100]
[1,] -0.7677936 -1.075838
[2,] -0.7677936 -1.075838
>
>
> Max(tmp2)
[1] 3.007208
> Min(tmp2)
[1] -2.746814
> mean(tmp2)
[1] 0.1344827
> Sum(tmp2)
[1] 13.44827
> Var(tmp2)
[1] 1.306198
>
> rowMeans(tmp2)
[1] -2.26233039 -0.76438189 -0.74152081 3.00720761 -1.11770467 -1.47777566
[7] 0.14562865 0.92237828 0.73397005 0.17687658 1.26735553 1.33152853
[13] -0.62826088 -0.48492652 1.37629095 -0.13544375 -0.04592552 0.41546945
[19] 0.94662331 1.44904119 -0.41149178 0.38809852 0.08398255 -0.02225991
[25] 0.06946701 -0.40970000 0.96894554 -0.85757215 2.26918969 -0.47078077
[31] -0.78204453 0.64442130 -0.28148701 0.78343031 -1.68314111 0.15133953
[37] -0.07309244 -0.98178704 -0.86469192 0.61209955 -1.03352244 2.83511014
[43] -0.91765660 1.40804273 1.01008720 0.90725341 0.13311274 -1.26715962
[49] -2.74681391 -0.77491512 -0.19623869 -0.26647628 -1.15895569 -0.12807026
[55] -0.96273673 0.81022011 0.12641883 -0.59556912 0.59657704 1.03595365
[61] -0.19372994 1.44100724 0.89322913 -1.06140059 0.53862462 -0.62928513
[67] 1.52279658 -0.90177289 0.88765275 1.35320511 -0.45841097 -0.38903240
[73] -2.13655121 1.08989827 -0.56808667 -0.14631392 -0.98031779 -0.09962175
[79] -1.92859559 1.78135435 0.28640597 0.55427136 0.31611124 0.72802539
[85] 2.08103581 0.47985211 0.15663312 -0.01056935 -2.47412305 -0.35919721
[91] -1.25215157 2.42044498 0.89638159 0.08759201 1.37893429 0.16872333
[97] 1.58025787 1.26735567 0.18617990 2.87977201
> rowSums(tmp2)
[1] -2.26233039 -0.76438189 -0.74152081 3.00720761 -1.11770467 -1.47777566
[7] 0.14562865 0.92237828 0.73397005 0.17687658 1.26735553 1.33152853
[13] -0.62826088 -0.48492652 1.37629095 -0.13544375 -0.04592552 0.41546945
[19] 0.94662331 1.44904119 -0.41149178 0.38809852 0.08398255 -0.02225991
[25] 0.06946701 -0.40970000 0.96894554 -0.85757215 2.26918969 -0.47078077
[31] -0.78204453 0.64442130 -0.28148701 0.78343031 -1.68314111 0.15133953
[37] -0.07309244 -0.98178704 -0.86469192 0.61209955 -1.03352244 2.83511014
[43] -0.91765660 1.40804273 1.01008720 0.90725341 0.13311274 -1.26715962
[49] -2.74681391 -0.77491512 -0.19623869 -0.26647628 -1.15895569 -0.12807026
[55] -0.96273673 0.81022011 0.12641883 -0.59556912 0.59657704 1.03595365
[61] -0.19372994 1.44100724 0.89322913 -1.06140059 0.53862462 -0.62928513
[67] 1.52279658 -0.90177289 0.88765275 1.35320511 -0.45841097 -0.38903240
[73] -2.13655121 1.08989827 -0.56808667 -0.14631392 -0.98031779 -0.09962175
[79] -1.92859559 1.78135435 0.28640597 0.55427136 0.31611124 0.72802539
[85] 2.08103581 0.47985211 0.15663312 -0.01056935 -2.47412305 -0.35919721
[91] -1.25215157 2.42044498 0.89638159 0.08759201 1.37893429 0.16872333
[97] 1.58025787 1.26735567 0.18617990 2.87977201
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -2.26233039 -0.76438189 -0.74152081 3.00720761 -1.11770467 -1.47777566
[7] 0.14562865 0.92237828 0.73397005 0.17687658 1.26735553 1.33152853
[13] -0.62826088 -0.48492652 1.37629095 -0.13544375 -0.04592552 0.41546945
[19] 0.94662331 1.44904119 -0.41149178 0.38809852 0.08398255 -0.02225991
[25] 0.06946701 -0.40970000 0.96894554 -0.85757215 2.26918969 -0.47078077
[31] -0.78204453 0.64442130 -0.28148701 0.78343031 -1.68314111 0.15133953
[37] -0.07309244 -0.98178704 -0.86469192 0.61209955 -1.03352244 2.83511014
[43] -0.91765660 1.40804273 1.01008720 0.90725341 0.13311274 -1.26715962
[49] -2.74681391 -0.77491512 -0.19623869 -0.26647628 -1.15895569 -0.12807026
[55] -0.96273673 0.81022011 0.12641883 -0.59556912 0.59657704 1.03595365
[61] -0.19372994 1.44100724 0.89322913 -1.06140059 0.53862462 -0.62928513
[67] 1.52279658 -0.90177289 0.88765275 1.35320511 -0.45841097 -0.38903240
[73] -2.13655121 1.08989827 -0.56808667 -0.14631392 -0.98031779 -0.09962175
[79] -1.92859559 1.78135435 0.28640597 0.55427136 0.31611124 0.72802539
[85] 2.08103581 0.47985211 0.15663312 -0.01056935 -2.47412305 -0.35919721
[91] -1.25215157 2.42044498 0.89638159 0.08759201 1.37893429 0.16872333
[97] 1.58025787 1.26735567 0.18617990 2.87977201
> rowMin(tmp2)
[1] -2.26233039 -0.76438189 -0.74152081 3.00720761 -1.11770467 -1.47777566
[7] 0.14562865 0.92237828 0.73397005 0.17687658 1.26735553 1.33152853
[13] -0.62826088 -0.48492652 1.37629095 -0.13544375 -0.04592552 0.41546945
[19] 0.94662331 1.44904119 -0.41149178 0.38809852 0.08398255 -0.02225991
[25] 0.06946701 -0.40970000 0.96894554 -0.85757215 2.26918969 -0.47078077
[31] -0.78204453 0.64442130 -0.28148701 0.78343031 -1.68314111 0.15133953
[37] -0.07309244 -0.98178704 -0.86469192 0.61209955 -1.03352244 2.83511014
[43] -0.91765660 1.40804273 1.01008720 0.90725341 0.13311274 -1.26715962
[49] -2.74681391 -0.77491512 -0.19623869 -0.26647628 -1.15895569 -0.12807026
[55] -0.96273673 0.81022011 0.12641883 -0.59556912 0.59657704 1.03595365
[61] -0.19372994 1.44100724 0.89322913 -1.06140059 0.53862462 -0.62928513
[67] 1.52279658 -0.90177289 0.88765275 1.35320511 -0.45841097 -0.38903240
[73] -2.13655121 1.08989827 -0.56808667 -0.14631392 -0.98031779 -0.09962175
[79] -1.92859559 1.78135435 0.28640597 0.55427136 0.31611124 0.72802539
[85] 2.08103581 0.47985211 0.15663312 -0.01056935 -2.47412305 -0.35919721
[91] -1.25215157 2.42044498 0.89638159 0.08759201 1.37893429 0.16872333
[97] 1.58025787 1.26735567 0.18617990 2.87977201
>
> colMeans(tmp2)
[1] 0.1344827
> colSums(tmp2)
[1] 13.44827
> colVars(tmp2)
[1] 1.306198
> colSd(tmp2)
[1] 1.14289
> colMax(tmp2)
[1] 3.007208
> colMin(tmp2)
[1] -2.746814
> colMedians(tmp2)
[1] 0.1070054
> colRanges(tmp2)
[,1]
[1,] -2.746814
[2,] 3.007208
>
> 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] 4.9367489 3.5259922 -5.3471893 0.8775147 4.2099779 -6.4936770
[7] 0.9098540 -3.2943894 -2.5969284 4.0543534
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.9382234
[2,] -0.2733826
[3,] 0.5571766
[4,] 1.1093371
[5,] 2.5733849
>
> rowApply(tmp,sum)
[1] 1.0066014 -4.2401569 -0.2608341 3.2318023 -7.6615914 4.0440856
[7] 6.9045367 -0.7004799 -1.7144941 0.1727874
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 5 7 8 8 2 4 10 3 10
[2,] 10 8 10 7 7 8 9 5 1 8
[3,] 2 3 2 9 2 9 3 1 9 1
[4,] 1 7 6 6 6 6 8 8 6 4
[5,] 5 4 1 5 10 10 10 3 8 9
[6,] 4 2 5 1 4 1 2 7 4 2
[7,] 3 10 4 10 5 4 1 9 2 5
[8,] 6 9 3 4 1 5 5 2 5 6
[9,] 8 1 8 2 3 3 6 6 7 3
[10,] 7 6 9 3 9 7 7 4 10 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.09614609 2.84405617 -3.48155980 -0.08948422 0.67643725 -0.33068766
[7] 1.99644080 1.12951742 1.05321012 3.77482749 -0.47526434 -1.38761749
[13] 4.04939235 1.29809860 0.05731887 1.30039654 1.01654192 -0.66866747
[19] -0.14918780 -2.24769158
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6495239
[2,] -1.6202384
[3,] 0.4537088
[4,] 0.5584186
[5,] 1.1614888
>
> rowApply(tmp,sum)
[1] -0.07361517 5.87530881 -9.38473944 6.83036497 6.02261191
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 13 2 17 12
[2,] 5 17 9 19 15
[3,] 13 4 1 1 14
[4,] 2 14 17 4 10
[5,] 10 9 15 10 13
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.6495239 -0.5455783 0.1829930 -0.7788231 -0.21816854 0.1463871
[2,] 0.5584186 1.2246888 -0.7295738 0.7931472 0.09363012 -0.8466235
[3,] -1.6202384 -0.6182021 -2.3762001 0.4312538 -0.12271540 0.9956194
[4,] 1.1614888 1.8850383 -1.2544987 -0.7262510 0.24621827 -0.2876000
[5,] 0.4537088 0.8981094 0.6957197 0.1911888 0.67747281 -0.3384708
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.3326393 -0.2537484 0.39546983 1.6572595 0.5615273 -0.7056357
[2,] 0.2258013 1.8955743 -0.09862312 0.9451983 -1.0617627 -0.1199923
[3,] -0.3468486 -0.4368635 0.03912447 -0.9137942 -0.1553938 -1.2091366
[4,] 1.4034736 2.1490376 1.11907223 0.3997141 0.4418839 0.7709271
[5,] 0.3813752 -2.2244825 -0.40183329 1.6864498 -0.2615190 -0.1237801
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.9067349 -0.3854135 0.1752503 -0.45260134 -0.571469363 0.6892185
[2,] 0.4329897 1.4910759 1.4090470 0.94364871 0.248083186 -0.9661024
[3,] 0.6432522 -0.5208934 -0.1596412 -0.88641448 1.453772900 -1.3254944
[4,] 1.1589877 0.9570436 -0.8291814 -0.05217594 -0.107826467 -0.4473994
[5,] 0.9074278 -0.2437139 -0.5381557 1.74793959 -0.006018342 1.3811102
[,19] [,20]
[1,] 0.75241410 -0.31254674
[2,] -0.03747955 -0.52583711
[3,] -0.98702765 -1.26889832
[4,] -1.04920311 -0.10838436
[5,] 1.17210841 -0.03202505
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 567 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.63741 1.77113 -0.1400635 0.1011929 0.1314678 -0.9465538 1.118188
col8 col9 col10 col11 col12 col13 col14
row1 1.088571 -0.794476 -1.664523 0.7249562 -0.4747373 -0.06467885 0.7883808
col15 col16 col17 col18 col19 col20
row1 0.2874503 -0.03720228 0.7195594 0.2396738 -0.6525759 -0.07467552
> tmp[,"col10"]
col10
row1 -1.66452327
row2 -1.41049076
row3 0.64576872
row4 0.01884858
row5 0.64382086
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.6374102 1.771130 -0.1400635 0.1011929 0.1314678 -0.9465538 1.1181882
row5 0.2098643 -1.488975 0.8833072 0.9583851 0.3674498 -1.3718305 0.6966311
col8 col9 col10 col11 col12 col13
row1 1.0885711 -0.7944760 -1.6645233 0.7249562 -0.4747373 -0.06467885
row5 0.5478391 -0.6211687 0.6438209 2.4324697 -3.5489624 0.33831859
col14 col15 col16 col17 col18 col19
row1 0.7883808 0.2874503 -0.03720228 0.7195594 0.2396738 -0.6525759
row5 -0.7018155 1.2893192 -0.28559277 -2.1509484 0.4619228 0.3575220
col20
row1 -0.07467552
row5 0.34156875
> tmp[,c("col6","col20")]
col6 col20
row1 -0.9465538 -0.07467552
row2 0.1864666 0.71765759
row3 -0.1344203 -1.91873135
row4 0.4000561 -2.00974598
row5 -1.3718305 0.34156875
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.9465538 -0.07467552
row5 -1.3718305 0.34156875
>
>
>
>
> 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.58572 49.576 50.51766 48.8674 51.64135 104.2201 50.69927 49.03622
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.34961 52.41319 50.29224 49.75979 49.79345 48.89991 51.0389 48.59138
col17 col18 col19 col20
row1 49.09297 50.70766 51.44625 106.1671
> tmp[,"col10"]
col10
row1 52.41319
row2 28.76118
row3 29.30739
row4 28.65957
row5 49.91104
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.58572 49.57600 50.51766 48.8674 51.64135 104.2201 50.69927 49.03622
row5 51.95945 48.87432 50.36412 49.7155 50.16034 106.5558 51.55753 49.43697
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.34961 52.41319 50.29224 49.75979 49.79345 48.89991 51.03890 48.59138
row5 49.72807 49.91104 49.39022 50.56347 49.82087 50.10261 47.92909 50.37883
col17 col18 col19 col20
row1 49.09297 50.70766 51.44625 106.1671
row5 50.71891 49.81612 50.24409 105.2190
> tmp[,c("col6","col20")]
col6 col20
row1 104.22007 106.16714
row2 75.56472 74.53640
row3 74.52187 75.94456
row4 74.69836 76.20860
row5 106.55581 105.21896
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.2201 106.1671
row5 106.5558 105.2190
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.2201 106.1671
row5 106.5558 105.2190
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.89760930
[2,] -1.23257046
[3,] 0.06655482
[4,] -1.66007855
[5,] 0.65875917
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.3939772 -0.4013733
[2,] -1.9118018 1.3105654
[3,] -0.1035772 0.8535749
[4,] 0.7322288 0.4980854
[5,] -0.9322764 -2.1669060
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.5442509 0.3562754
[2,] 1.5876571 0.4523879
[3,] -0.7688135 1.5190338
[4,] -2.1940116 -0.2908070
[5,] 2.2789030 -1.5354362
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.5442509
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.5442509
[2,] 1.5876571
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 1.01549111 -0.9175402 -0.3847709 1.41461702 -0.2875253 -1.5158313
row1 -0.02958465 -0.3279641 2.3989022 0.09864621 -1.0507131 -0.8781799
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.05349723 -1.8725981 -0.2524964 0.1235900 0.44647016 1.4620770
row1 -0.35859184 -0.5706581 -0.8814480 0.6246359 0.09337355 -0.5086867
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 0.2942504 1.699689 0.1167701 -0.8483722 -1.1662749 0.5468316 0.8163533
row1 1.0166957 1.573554 1.1159235 -0.2558555 -0.5154149 1.2180775 0.4049408
[,20]
row3 -0.2595258
row1 -1.9411095
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.6091414 1.897017 -0.8583975 -0.4835242 0.6807148 -0.4785149 0.5387451
[,8] [,9] [,10]
row2 -0.4923166 -1.198448 -0.6182851
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.177339 0.9613434 0.2825838 0.2865678 -1.130912 0.3942869 -0.3821764
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.06776863 0.9772737 -0.05219594 1.125226 -2.920545 0.7006524 -1.187049
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.007217459 -0.1192202 -0.09802375 -0.8607309 -0.781631 -0.3688588
>
>
> 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: 0x600003e14480>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc5379a36a6"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc56d79e8ce"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc55ea36488"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc5391d4d42"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc532bb4559"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc524c5f014"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc53f14c3e8"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc56c49d4b2"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc5632b29a8"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc526bc0775"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc528da631"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc52199dc46"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc57c4c88e5"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc54afb224"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15bc52ad85be3"
>
>
> ### 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: 0x600003e100c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003e100c0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003e100c0>
> rowMedians(tmp)
[1] 0.212613399 -0.110091516 -0.303424179 -0.353156260 -0.007818376
[6] -0.295662962 0.175718149 0.207981325 0.353539173 -0.096373679
[11] -0.606332169 -0.713171601 -0.364025597 0.606241388 -0.123559004
[16] -0.173064871 -0.555141749 0.165384078 -0.111161467 -0.058129617
[21] 0.149447795 -0.010781333 0.264528040 -0.365829506 0.649243621
[26] -0.403433229 0.138617552 -0.256760091 -0.106883546 0.218366126
[31] -0.130355957 -0.185135562 -0.001885849 0.350297527 -0.026159304
[36] 0.107818968 0.443620583 -0.309385536 0.002589780 -0.003618767
[41] -0.005754642 0.189431963 -0.012338652 0.056564439 0.055094935
[46] 0.020132117 0.274211345 0.730364222 0.022394957 -0.081916842
[51] 0.179973687 -0.487461500 0.328443482 -0.094508092 0.680384692
[56] 0.427399226 -0.238131524 0.206059833 -0.116442902 -0.022245267
[61] 0.256892309 0.098421192 -0.195036277 0.012503150 -0.003125730
[66] -0.182035293 0.403286257 0.291352517 -0.133107638 -0.208994204
[71] -0.230558117 0.535628627 0.164528103 -0.501475464 -0.491313301
[76] 0.188225233 0.028396141 -0.392985103 -0.290224664 -0.102298964
[81] -0.146844431 0.187128058 -0.254504553 0.319858180 0.823330281
[86] 0.087099336 0.220085559 0.320995071 0.017121074 0.084472965
[91] 0.185595448 -0.272442481 -0.237374247 0.794236440 -0.140785023
[96] 0.436203087 -0.220502181 0.352347236 0.104331258 -0.570222244
[101] -0.063230450 0.095584767 0.496554470 -0.466651345 0.239529062
[106] -0.237416537 0.278407246 -0.087568153 -0.271780674 -0.228841776
[111] 0.089961832 -0.189127517 0.676058072 -0.744558002 0.015878005
[116] 0.153293618 0.210848372 0.137953134 0.109327313 -0.280713967
[121] -0.208463096 -0.557552563 0.096034062 0.061549595 -0.082093422
[126] -0.121721742 -0.102943852 -0.458822875 -0.210926308 -0.554501166
[131] -0.078869790 -0.070137353 -0.062194676 -0.173532274 -0.142149654
[136] -0.181121638 -0.093788316 -0.008548858 0.033501670 -0.020034909
[141] -0.852949899 0.023773631 -0.028642329 0.243940516 0.158615572
[146] 0.192382867 -0.112327752 0.104467764 -0.093404775 0.024753490
[151] 0.801845694 -0.200971156 -0.030556101 -0.375488579 -0.278312298
[156] 0.499153828 0.120922416 -0.046963657 -0.150558630 0.136323828
[161] -0.156741010 0.287945200 -0.291511797 0.408397831 -0.639529991
[166] -0.053570934 0.102894307 0.371133807 -0.310290179 -0.423556089
[171] -0.473873679 -0.467989289 -0.214747148 0.007746801 -0.299807325
[176] 0.187226620 0.070274019 -0.035136146 -0.008933681 -0.337962044
[181] -0.036588194 0.446382758 -0.115646536 -0.401280126 -0.251952618
[186] -0.039007372 -0.432944895 0.095358932 -0.424759659 -0.064930119
[191] 0.025519486 0.133022726 -0.039888173 0.130894282 0.577028547
[196] 0.382194309 -0.078459607 -0.402967875 0.761830274 0.063410136
[201] 0.522983338 0.095455036 0.138601095 0.351711424 -0.197462657
[206] -0.224227912 0.266269429 -0.436181277 -0.218099090 0.020273832
[211] -0.186596549 0.060293344 -0.347859470 0.154300040 0.290142713
[216] 0.059687565 -0.524954366 0.023908439 -0.017356064 0.083535203
[221] 0.044620224 -0.476360431 -0.121207354 0.104442611 0.560407436
[226] 0.421786098 0.206308423 -0.048572642 0.354321202 -0.754837459
>
> proc.time()
user system elapsed
0.719 3.692 4.908
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x6000030a4120>
> .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: 0x6000030a4120>
> .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: 0x6000030a4120>
> .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: 0x6000030a4120>
> 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: 0x600003094000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003094000>
> .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: 0x600003094000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003094000>
> .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: 0x600003094000>
> 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: 0x6000030a82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030a82a0>
> .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: 0x6000030a82a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000030a82a0>
> .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: 0x6000030a82a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000030a82a0>
> .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: 0x6000030a82a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000030a82a0>
> .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: 0x6000030a82a0>
> 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: 0x6000030b84e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000030b84e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030b84e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030b84e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15f2c1986fa89" "BufferedMatrixFile15f2c56e2275f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15f2c1986fa89" "BufferedMatrixFile15f2c56e2275f"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030b8720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030b8720>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000030b8720>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000030b8720>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000030b8720>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000030b8720>
> .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: 0x6000030a00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000030a00c0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000030a00c0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000030a00c0>
> 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: 0x6000030a0240>
> .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: 0x6000030a0240>
> rm(P)
>
> proc.time()
user system elapsed
0.141 0.069 0.204
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.130 0.036 0.161