Back to Multiple platform build/check report for BioC 3.13 |
|
This page was generated on 2021-10-15 15:06:30 -0400 (Fri, 15 Oct 2021).
To the developers/maintainers of the BufferedMatrix package: - Please 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 How and When does the builder pull? When will my changes propagate? here for more information. - Make sure to use the following settings in order to reproduce any error or warning you see on this page. |
Package 220/2041 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.56.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 20.04.2 LTS) / x86_64 | OK | OK | OK | |||||||||
tokay2 | Windows Server 2012 R2 Standard / x64 | OK | OK | OK | OK | |||||||||
machv2 | macOS 10.14.6 Mojave / x86_64 | OK | OK | WARNINGS | OK | |||||||||
Package: BufferedMatrix |
Version: 1.56.0 |
Command: /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Versions/Current/Resources/library --no-vignettes --timings BufferedMatrix_1.56.0.tar.gz |
StartedAt: 2021-10-14 16:58:28 -0400 (Thu, 14 Oct 2021) |
EndedAt: 2021-10-14 16:59:17 -0400 (Thu, 14 Oct 2021) |
EllapsedTime: 48.2 seconds |
RetCode: 0 |
Status: WARNINGS |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 1 |
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Versions/Current/Resources/library --no-vignettes --timings BufferedMatrix_1.56.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-apple-darwin17.0 (64-bit) * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.56.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 ... NOTE Found the following hidden files and directories: .git_fetch_output.txt .git_merge_output.txt These were most likely included in error. See section ‘Package structure’ in the ‘Writing R Extensions’ manual. * 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.13-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details. * 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 R 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 prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking compiled code ... NOTE Note: information on .o files is not available * checking sizes of PDF files under ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... NONE * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘Rcodetesting.R’ Running ‘c_code_level_tests.R’ Running ‘objectTesting.R’ Running ‘rawCalltesting.R’ OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... 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, 3 NOTEs See ‘/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library’ * installing *source* package ‘BufferedMatrix’ ... ** using staged installation ** libs clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -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 -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c init_package.c -o init_package.o clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation installing to /Library/Frameworks/R.framework/Versions/4.1/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.1.1 (2021-08-10) -- "Kick Things" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit) 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.380 0.110 0.467
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.1.1 (2021-08-10) -- "Kick Things" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit) 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.13-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 444981 23.8 946241 50.6 NA 650265 34.8 Vcells 804257 6.2 8388608 64.0 65536 2031910 15.6 > > > > > ## > ## 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] "Thu Oct 14 16:58:54 2021" > 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] "Thu Oct 14 16:58:54 2021" > > > 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: 0x7f8438e00170> > > > > 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] "Thu Oct 14 16:58:57 2021" > 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] "Thu Oct 14 16:58:58 2021" > > ColMode(tmp2) <pointer: 0x7f8438e00170> > > > > ### 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.00895543 1.503094 1.5015409 -1.2388777 [2,] 0.09609466 -1.139460 -1.0987646 -0.2503742 [3,] -0.87016456 1.188815 1.1631444 1.1218637 [4,] -0.17469118 -2.234298 -0.2926493 -2.4500911 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.13-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.00895543 1.503094 1.5015409 1.2388777 [2,] 0.09609466 1.139460 1.0987646 0.2503742 [3,] 0.87016456 1.188815 1.1631444 1.1218637 [4,] 0.17469118 2.234298 0.2926493 2.4500911 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.13-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.0004478 1.226007 1.2253738 1.1130488 [2,] 0.3099914 1.067455 1.0482197 0.5003741 [3,] 0.9328261 1.090328 1.0784917 1.0591807 [4,] 0.4179607 1.494757 0.5409707 1.5652767 > > 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.13-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.01343 38.76316 38.75528 37.36937 [2,] 28.19601 36.81401 36.58096 30.25412 [3,] 35.19843 37.09210 36.94806 36.71367 [4,] 29.35430 42.18187 30.70236 43.10286 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x7f84b8e2ae70> > exp(tmp5) <pointer: 0x7f84b8e2ae70> > log(tmp5,2) <pointer: 0x7f84b8e2ae70> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 468.336 > Min(tmp5) [1] 54.88989 > mean(tmp5) [1] 73.2801 > Sum(tmp5) [1] 14656.02 > Var(tmp5) [1] 861.3543 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 92.52986 71.36905 72.67976 70.55839 73.16785 66.79761 70.82397 72.31721 [9] 72.62141 69.93595 > rowSums(tmp5) [1] 1850.597 1427.381 1453.595 1411.168 1463.357 1335.952 1416.479 1446.344 [9] 1452.428 1398.719 > rowVars(tmp5) [1] 7899.50907 93.09099 50.79629 99.65035 72.99097 65.60615 [7] 75.64759 71.72690 64.74070 61.91476 > rowSd(tmp5) [1] 88.879182 9.648367 7.127152 9.982502 8.543475 8.099763 8.697562 [8] 8.469174 8.046161 7.868593 > rowMax(tmp5) [1] 468.33598 91.57692 83.86027 89.71295 87.79962 86.26109 91.65999 [8] 89.30409 88.55575 88.46064 > rowMin(tmp5) [1] 55.76331 58.14810 58.33836 57.24935 57.91612 54.88989 60.23369 56.20838 [9] 55.40825 58.14560 > > colMeans(tmp5) [1] 107.96594 73.14342 71.54774 72.41347 69.55474 70.80251 68.22594 [8] 74.16953 69.11276 71.28699 67.46178 70.95827 69.44038 76.46146 [15] 74.95519 75.65252 69.00214 71.51676 69.81605 72.11450 > colSums(tmp5) [1] 1079.6594 731.4342 715.4774 724.1347 695.5474 708.0251 682.2594 [8] 741.6953 691.1276 712.8699 674.6178 709.5827 694.4038 764.6146 [15] 749.5519 756.5252 690.0214 715.1676 698.1605 721.1450 > colVars(tmp5) [1] 16117.52692 66.68237 32.60980 63.96432 75.00383 44.13498 [7] 51.55439 59.84677 55.59544 85.01799 32.86890 92.76534 [13] 79.32449 107.40529 54.73771 152.63073 64.86730 55.98931 [19] 76.83360 140.71877 > colSd(tmp5) [1] 126.954822 8.165928 5.710499 7.997770 8.660475 6.643417 [7] 7.180139 7.736069 7.456235 9.220520 5.733140 9.631476 [13] 8.906430 10.363652 7.398494 12.354381 8.054024 7.482600 [19] 8.765478 11.862494 > colMax(tmp5) [1] 468.33598 87.79603 80.66403 89.71295 80.75696 78.72992 77.91504 [8] 82.27047 85.42702 85.41962 75.91443 88.86235 81.86920 88.55575 [15] 87.79962 91.57692 82.98615 81.15469 80.81695 91.65999 > colMin(tmp5) [1] 57.31632 62.52896 63.90293 62.96998 58.33836 57.87158 58.14560 58.14810 [9] 61.80409 57.91612 56.20838 58.92506 59.36653 62.08889 58.93940 55.76331 [17] 55.40825 58.98688 54.88989 60.26878 > > > ### 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] 92.52986 71.36905 72.67976 70.55839 73.16785 66.79761 NA 72.31721 [9] 72.62141 69.93595 > rowSums(tmp5) [1] 1850.597 1427.381 1453.595 1411.168 1463.357 1335.952 NA 1446.344 [9] 1452.428 1398.719 > rowVars(tmp5) [1] 7899.50907 93.09099 50.79629 99.65035 72.99097 65.60615 [7] 79.42774 71.72690 64.74070 61.91476 > rowSd(tmp5) [1] 88.879182 9.648367 7.127152 9.982502 8.543475 8.099763 8.912224 [8] 8.469174 8.046161 7.868593 > rowMax(tmp5) [1] 468.33598 91.57692 83.86027 89.71295 87.79962 86.26109 NA [8] 89.30409 88.55575 88.46064 > rowMin(tmp5) [1] 55.76331 58.14810 58.33836 57.24935 57.91612 54.88989 NA 56.20838 [9] 55.40825 58.14560 > > colMeans(tmp5) [1] 107.96594 73.14342 NA 72.41347 69.55474 70.80251 68.22594 [8] 74.16953 69.11276 71.28699 67.46178 70.95827 69.44038 76.46146 [15] 74.95519 75.65252 69.00214 71.51676 69.81605 72.11450 > colSums(tmp5) [1] 1079.6594 731.4342 NA 724.1347 695.5474 708.0251 682.2594 [8] 741.6953 691.1276 712.8699 674.6178 709.5827 694.4038 764.6146 [15] 749.5519 756.5252 690.0214 715.1676 698.1605 721.1450 > colVars(tmp5) [1] 16117.52692 66.68237 NA 63.96432 75.00383 44.13498 [7] 51.55439 59.84677 55.59544 85.01799 32.86890 92.76534 [13] 79.32449 107.40529 54.73771 152.63073 64.86730 55.98931 [19] 76.83360 140.71877 > colSd(tmp5) [1] 126.954822 8.165928 NA 7.997770 8.660475 6.643417 [7] 7.180139 7.736069 7.456235 9.220520 5.733140 9.631476 [13] 8.906430 10.363652 7.398494 12.354381 8.054024 7.482600 [19] 8.765478 11.862494 > colMax(tmp5) [1] 468.33598 87.79603 NA 89.71295 80.75696 78.72992 77.91504 [8] 82.27047 85.42702 85.41962 75.91443 88.86235 81.86920 88.55575 [15] 87.79962 91.57692 82.98615 81.15469 80.81695 91.65999 > colMin(tmp5) [1] 57.31632 62.52896 NA 62.96998 58.33836 57.87158 58.14560 58.14810 [9] 61.80409 57.91612 56.20838 58.92506 59.36653 62.08889 58.93940 55.76331 [17] 55.40825 58.98688 54.88989 60.26878 > > Max(tmp5,na.rm=TRUE) [1] 468.336 > Min(tmp5,na.rm=TRUE) [1] 54.88989 > mean(tmp5,na.rm=TRUE) [1] 73.27894 > Sum(tmp5,na.rm=TRUE) [1] 14582.51 > Var(tmp5,na.rm=TRUE) [1] 865.7043 > > rowMeans(tmp5,na.rm=TRUE) [1] 92.52986 71.36905 72.67976 70.55839 73.16785 66.79761 70.68251 72.31721 [9] 72.62141 69.93595 > rowSums(tmp5,na.rm=TRUE) [1] 1850.597 1427.381 1453.595 1411.168 1463.357 1335.952 1342.968 1446.344 [9] 1452.428 1398.719 > rowVars(tmp5,na.rm=TRUE) [1] 7899.50907 93.09099 50.79629 99.65035 72.99097 65.60615 [7] 79.42774 71.72690 64.74070 61.91476 > rowSd(tmp5,na.rm=TRUE) [1] 88.879182 9.648367 7.127152 9.982502 8.543475 8.099763 8.912224 [8] 8.469174 8.046161 7.868593 > rowMax(tmp5,na.rm=TRUE) [1] 468.33598 91.57692 83.86027 89.71295 87.79962 86.26109 91.65999 [8] 89.30409 88.55575 88.46064 > rowMin(tmp5,na.rm=TRUE) [1] 55.76331 58.14810 58.33836 57.24935 57.91612 54.88989 60.23369 56.20838 [9] 55.40825 58.14560 > > colMeans(tmp5,na.rm=TRUE) [1] 107.96594 73.14342 71.32951 72.41347 69.55474 70.80251 68.22594 [8] 74.16953 69.11276 71.28699 67.46178 70.95827 69.44038 76.46146 [15] 74.95519 75.65252 69.00214 71.51676 69.81605 72.11450 > colSums(tmp5,na.rm=TRUE) [1] 1079.6594 731.4342 641.9656 724.1347 695.5474 708.0251 682.2594 [8] 741.6953 691.1276 712.8699 674.6178 709.5827 694.4038 764.6146 [15] 749.5519 756.5252 690.0214 715.1676 698.1605 721.1450 > colVars(tmp5,na.rm=TRUE) [1] 16117.52692 66.68237 36.15024 63.96432 75.00383 44.13498 [7] 51.55439 59.84677 55.59544 85.01799 32.86890 92.76534 [13] 79.32449 107.40529 54.73771 152.63073 64.86730 55.98931 [19] 76.83360 140.71877 > colSd(tmp5,na.rm=TRUE) [1] 126.954822 8.165928 6.012507 7.997770 8.660475 6.643417 [7] 7.180139 7.736069 7.456235 9.220520 5.733140 9.631476 [13] 8.906430 10.363652 7.398494 12.354381 8.054024 7.482600 [19] 8.765478 11.862494 > colMax(tmp5,na.rm=TRUE) [1] 468.33598 87.79603 80.66403 89.71295 80.75696 78.72992 77.91504 [8] 82.27047 85.42702 85.41962 75.91443 88.86235 81.86920 88.55575 [15] 87.79962 91.57692 82.98615 81.15469 80.81695 91.65999 > colMin(tmp5,na.rm=TRUE) [1] 57.31632 62.52896 63.90293 62.96998 58.33836 57.87158 58.14560 58.14810 [9] 61.80409 57.91612 56.20838 58.92506 59.36653 62.08889 58.93940 55.76331 [17] 55.40825 58.98688 54.88989 60.26878 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 92.52986 71.36905 72.67976 70.55839 73.16785 66.79761 NaN 72.31721 [9] 72.62141 69.93595 > rowSums(tmp5,na.rm=TRUE) [1] 1850.597 1427.381 1453.595 1411.168 1463.357 1335.952 0.000 1446.344 [9] 1452.428 1398.719 > rowVars(tmp5,na.rm=TRUE) [1] 7899.50907 93.09099 50.79629 99.65035 72.99097 65.60615 [7] NA 71.72690 64.74070 61.91476 > rowSd(tmp5,na.rm=TRUE) [1] 88.879182 9.648367 7.127152 9.982502 8.543475 8.099763 NA [8] 8.469174 8.046161 7.868593 > rowMax(tmp5,na.rm=TRUE) [1] 468.33598 91.57692 83.86027 89.71295 87.79962 86.26109 NA [8] 89.30409 88.55575 88.46064 > rowMin(tmp5,na.rm=TRUE) [1] 55.76331 58.14810 58.33836 57.24935 57.91612 54.88989 NA 56.20838 [9] 55.40825 58.14560 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 111.61446 72.62198 NaN 72.96755 68.47736 71.69285 68.08684 [8] 73.72942 69.92483 72.14443 67.09426 71.86106 68.54075 78.05842 [15] 74.48738 76.95259 69.97642 72.76295 68.79437 69.94277 > colSums(tmp5,na.rm=TRUE) [1] 1004.5302 653.5978 0.0000 656.7079 616.2962 645.2356 612.7815 [8] 663.5647 629.3235 649.2999 603.8484 646.7495 616.8668 702.5257 [15] 670.3864 692.5733 629.7878 654.8665 619.1493 629.4850 > colVars(tmp5,na.rm=TRUE) [1] 17982.46094 71.95889 NA 68.50611 71.32073 40.73396 [7] 57.78100 65.14849 55.12589 87.37428 35.45795 95.19202 [13] 80.13505 92.14056 59.11790 152.69509 62.29712 45.51701 [19] 74.69468 105.24942 > colSd(tmp5,na.rm=TRUE) [1] 134.098699 8.482859 NA 8.276842 8.445160 6.382316 [7] 7.601381 8.071461 7.424681 9.347421 5.954658 9.756640 [13] 8.951818 9.598988 7.688816 12.356985 7.892853 6.746629 [19] 8.642609 10.259114 > colMax(tmp5,na.rm=TRUE) [1] 468.33598 87.79603 -Inf 89.71295 80.75696 78.72992 77.91504 [8] 82.27047 85.42702 85.41962 75.91443 88.86235 81.86920 88.55575 [15] 87.79962 91.57692 82.98615 81.15469 80.81695 88.09977 > colMin(tmp5,na.rm=TRUE) [1] 57.31632 62.52896 Inf 62.96998 58.33836 57.87158 58.14560 58.14810 [9] 62.26460 57.91612 56.20838 58.92506 59.36653 63.08126 58.93940 55.76331 [17] 55.40825 58.98688 54.88989 60.26878 > > > > > 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] 264.0402 122.5130 277.5732 248.6836 268.6941 240.6709 293.6865 170.5748 [9] 331.1002 255.9469 > apply(copymatrix,1,var,na.rm=TRUE) [1] 264.0402 122.5130 277.5732 248.6836 268.6941 240.6709 293.6865 170.5748 [9] 331.1002 255.9469 > > > > 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 4.263256e-14 0.000000e+00 8.526513e-14 [6] -1.136868e-13 3.979039e-13 0.000000e+00 1.705303e-13 -7.105427e-14 [11] 0.000000e+00 0.000000e+00 1.421085e-13 0.000000e+00 -1.136868e-13 [16] 9.947598e-14 -2.842171e-13 1.136868e-13 0.000000e+00 1.136868e-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) + } 6 11 2 20 9 13 3 8 5 1 6 17 9 18 5 2 4 5 8 5 3 9 6 7 4 6 10 9 10 10 9 16 7 19 7 13 2 4 4 15 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.854217 > Min(tmp) [1] -2.594872 > mean(tmp) [1] 0.05359051 > Sum(tmp) [1] 5.359051 > Var(tmp) [1] 1.017103 > > rowMeans(tmp) [1] 0.05359051 > rowSums(tmp) [1] 5.359051 > rowVars(tmp) [1] 1.017103 > rowSd(tmp) [1] 1.008515 > rowMax(tmp) [1] 2.854217 > rowMin(tmp) [1] -2.594872 > > colMeans(tmp) [1] -1.593613779 2.854217201 1.247168597 0.871579194 0.843063987 [6] 0.208873861 -0.698235129 -0.416692648 0.804203042 0.316285221 [11] -1.277113917 0.368897159 1.210198090 0.240932761 -0.501137954 [16] -0.109415094 1.201460714 -0.931248370 -0.775094285 -0.345596616 [21] -0.439667257 -0.406866839 -0.790095123 1.176179270 0.295167680 [26] 0.045233621 -0.370925655 -0.432708451 -1.836124430 0.407779395 [31] 1.452527316 -0.137791839 -0.874272937 0.348992911 -0.183879789 [36] -0.327807575 0.326282333 0.627186960 -0.959939739 2.044004527 [41] 2.254643549 0.070493021 0.069533137 1.295083040 0.163832867 [46] 1.168771855 0.084706995 -0.335675682 1.349378574 1.042427150 [51] 0.574327858 1.390658887 1.042792091 -0.018340316 -1.545174891 [56] -0.120226155 -0.008232467 0.184601737 -2.405137406 -0.436854275 [61] -0.217255455 -1.097308797 1.001515161 -1.416649366 1.321995788 [66] -0.687704314 -0.518760742 -0.203040559 0.934939449 -0.549238032 [71] -2.594872015 -0.142837433 -0.957908595 -0.347562627 -1.227870213 [76] -0.981846593 1.298265205 -0.278963139 0.173896212 -1.434710323 [81] 0.681481388 -1.372510296 -0.636480741 1.977499203 0.549193487 [86] 0.263555261 -0.384307060 1.543537386 -0.710969353 0.153539241 [91] -1.203798795 0.562972558 -1.383701468 0.819421123 -0.129938706 [96] -0.693496681 1.444120963 0.771464678 0.842554863 0.887214029 > colSums(tmp) [1] -1.593613779 2.854217201 1.247168597 0.871579194 0.843063987 [6] 0.208873861 -0.698235129 -0.416692648 0.804203042 0.316285221 [11] -1.277113917 0.368897159 1.210198090 0.240932761 -0.501137954 [16] -0.109415094 1.201460714 -0.931248370 -0.775094285 -0.345596616 [21] -0.439667257 -0.406866839 -0.790095123 1.176179270 0.295167680 [26] 0.045233621 -0.370925655 -0.432708451 -1.836124430 0.407779395 [31] 1.452527316 -0.137791839 -0.874272937 0.348992911 -0.183879789 [36] -0.327807575 0.326282333 0.627186960 -0.959939739 2.044004527 [41] 2.254643549 0.070493021 0.069533137 1.295083040 0.163832867 [46] 1.168771855 0.084706995 -0.335675682 1.349378574 1.042427150 [51] 0.574327858 1.390658887 1.042792091 -0.018340316 -1.545174891 [56] -0.120226155 -0.008232467 0.184601737 -2.405137406 -0.436854275 [61] -0.217255455 -1.097308797 1.001515161 -1.416649366 1.321995788 [66] -0.687704314 -0.518760742 -0.203040559 0.934939449 -0.549238032 [71] -2.594872015 -0.142837433 -0.957908595 -0.347562627 -1.227870213 [76] -0.981846593 1.298265205 -0.278963139 0.173896212 -1.434710323 [81] 0.681481388 -1.372510296 -0.636480741 1.977499203 0.549193487 [86] 0.263555261 -0.384307060 1.543537386 -0.710969353 0.153539241 [91] -1.203798795 0.562972558 -1.383701468 0.819421123 -0.129938706 [96] -0.693496681 1.444120963 0.771464678 0.842554863 0.887214029 > 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] -1.593613779 2.854217201 1.247168597 0.871579194 0.843063987 [6] 0.208873861 -0.698235129 -0.416692648 0.804203042 0.316285221 [11] -1.277113917 0.368897159 1.210198090 0.240932761 -0.501137954 [16] -0.109415094 1.201460714 -0.931248370 -0.775094285 -0.345596616 [21] -0.439667257 -0.406866839 -0.790095123 1.176179270 0.295167680 [26] 0.045233621 -0.370925655 -0.432708451 -1.836124430 0.407779395 [31] 1.452527316 -0.137791839 -0.874272937 0.348992911 -0.183879789 [36] -0.327807575 0.326282333 0.627186960 -0.959939739 2.044004527 [41] 2.254643549 0.070493021 0.069533137 1.295083040 0.163832867 [46] 1.168771855 0.084706995 -0.335675682 1.349378574 1.042427150 [51] 0.574327858 1.390658887 1.042792091 -0.018340316 -1.545174891 [56] -0.120226155 -0.008232467 0.184601737 -2.405137406 -0.436854275 [61] -0.217255455 -1.097308797 1.001515161 -1.416649366 1.321995788 [66] -0.687704314 -0.518760742 -0.203040559 0.934939449 -0.549238032 [71] -2.594872015 -0.142837433 -0.957908595 -0.347562627 -1.227870213 [76] -0.981846593 1.298265205 -0.278963139 0.173896212 -1.434710323 [81] 0.681481388 -1.372510296 -0.636480741 1.977499203 0.549193487 [86] 0.263555261 -0.384307060 1.543537386 -0.710969353 0.153539241 [91] -1.203798795 0.562972558 -1.383701468 0.819421123 -0.129938706 [96] -0.693496681 1.444120963 0.771464678 0.842554863 0.887214029 > colMin(tmp) [1] -1.593613779 2.854217201 1.247168597 0.871579194 0.843063987 [6] 0.208873861 -0.698235129 -0.416692648 0.804203042 0.316285221 [11] -1.277113917 0.368897159 1.210198090 0.240932761 -0.501137954 [16] -0.109415094 1.201460714 -0.931248370 -0.775094285 -0.345596616 [21] -0.439667257 -0.406866839 -0.790095123 1.176179270 0.295167680 [26] 0.045233621 -0.370925655 -0.432708451 -1.836124430 0.407779395 [31] 1.452527316 -0.137791839 -0.874272937 0.348992911 -0.183879789 [36] -0.327807575 0.326282333 0.627186960 -0.959939739 2.044004527 [41] 2.254643549 0.070493021 0.069533137 1.295083040 0.163832867 [46] 1.168771855 0.084706995 -0.335675682 1.349378574 1.042427150 [51] 0.574327858 1.390658887 1.042792091 -0.018340316 -1.545174891 [56] -0.120226155 -0.008232467 0.184601737 -2.405137406 -0.436854275 [61] -0.217255455 -1.097308797 1.001515161 -1.416649366 1.321995788 [66] -0.687704314 -0.518760742 -0.203040559 0.934939449 -0.549238032 [71] -2.594872015 -0.142837433 -0.957908595 -0.347562627 -1.227870213 [76] -0.981846593 1.298265205 -0.278963139 0.173896212 -1.434710323 [81] 0.681481388 -1.372510296 -0.636480741 1.977499203 0.549193487 [86] 0.263555261 -0.384307060 1.543537386 -0.710969353 0.153539241 [91] -1.203798795 0.562972558 -1.383701468 0.819421123 -0.129938706 [96] -0.693496681 1.444120963 0.771464678 0.842554863 0.887214029 > colMedians(tmp) [1] -1.593613779 2.854217201 1.247168597 0.871579194 0.843063987 [6] 0.208873861 -0.698235129 -0.416692648 0.804203042 0.316285221 [11] -1.277113917 0.368897159 1.210198090 0.240932761 -0.501137954 [16] -0.109415094 1.201460714 -0.931248370 -0.775094285 -0.345596616 [21] -0.439667257 -0.406866839 -0.790095123 1.176179270 0.295167680 [26] 0.045233621 -0.370925655 -0.432708451 -1.836124430 0.407779395 [31] 1.452527316 -0.137791839 -0.874272937 0.348992911 -0.183879789 [36] -0.327807575 0.326282333 0.627186960 -0.959939739 2.044004527 [41] 2.254643549 0.070493021 0.069533137 1.295083040 0.163832867 [46] 1.168771855 0.084706995 -0.335675682 1.349378574 1.042427150 [51] 0.574327858 1.390658887 1.042792091 -0.018340316 -1.545174891 [56] -0.120226155 -0.008232467 0.184601737 -2.405137406 -0.436854275 [61] -0.217255455 -1.097308797 1.001515161 -1.416649366 1.321995788 [66] -0.687704314 -0.518760742 -0.203040559 0.934939449 -0.549238032 [71] -2.594872015 -0.142837433 -0.957908595 -0.347562627 -1.227870213 [76] -0.981846593 1.298265205 -0.278963139 0.173896212 -1.434710323 [81] 0.681481388 -1.372510296 -0.636480741 1.977499203 0.549193487 [86] 0.263555261 -0.384307060 1.543537386 -0.710969353 0.153539241 [91] -1.203798795 0.562972558 -1.383701468 0.819421123 -0.129938706 [96] -0.693496681 1.444120963 0.771464678 0.842554863 0.887214029 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.593614 2.854217 1.247169 0.8715792 0.843064 0.2088739 -0.6982351 [2,] -1.593614 2.854217 1.247169 0.8715792 0.843064 0.2088739 -0.6982351 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.4166926 0.804203 0.3162852 -1.277114 0.3688972 1.210198 0.2409328 [2,] -0.4166926 0.804203 0.3162852 -1.277114 0.3688972 1.210198 0.2409328 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -0.501138 -0.1094151 1.201461 -0.9312484 -0.7750943 -0.3455966 -0.4396673 [2,] -0.501138 -0.1094151 1.201461 -0.9312484 -0.7750943 -0.3455966 -0.4396673 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.4068668 -0.7900951 1.176179 0.2951677 0.04523362 -0.3709257 -0.4327085 [2,] -0.4068668 -0.7900951 1.176179 0.2951677 0.04523362 -0.3709257 -0.4327085 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -1.836124 0.4077794 1.452527 -0.1377918 -0.8742729 0.3489929 -0.1838798 [2,] -1.836124 0.4077794 1.452527 -0.1377918 -0.8742729 0.3489929 -0.1838798 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] -0.3278076 0.3262823 0.627187 -0.9599397 2.044005 2.254644 0.07049302 [2,] -0.3278076 0.3262823 0.627187 -0.9599397 2.044005 2.254644 0.07049302 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 0.06953314 1.295083 0.1638329 1.168772 0.08470699 -0.3356757 1.349379 [2,] 0.06953314 1.295083 0.1638329 1.168772 0.08470699 -0.3356757 1.349379 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] 1.042427 0.5743279 1.390659 1.042792 -0.01834032 -1.545175 -0.1202262 [2,] 1.042427 0.5743279 1.390659 1.042792 -0.01834032 -1.545175 -0.1202262 [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] -0.008232467 0.1846017 -2.405137 -0.4368543 -0.2172555 -1.097309 1.001515 [2,] -0.008232467 0.1846017 -2.405137 -0.4368543 -0.2172555 -1.097309 1.001515 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [1,] -1.416649 1.321996 -0.6877043 -0.5187607 -0.2030406 0.9349394 -0.549238 [2,] -1.416649 1.321996 -0.6877043 -0.5187607 -0.2030406 0.9349394 -0.549238 [,71] [,72] [,73] [,74] [,75] [,76] [,77] [1,] -2.594872 -0.1428374 -0.9579086 -0.3475626 -1.22787 -0.9818466 1.298265 [2,] -2.594872 -0.1428374 -0.9579086 -0.3475626 -1.22787 -0.9818466 1.298265 [,78] [,79] [,80] [,81] [,82] [,83] [,84] [1,] -0.2789631 0.1738962 -1.43471 0.6814814 -1.37251 -0.6364807 1.977499 [2,] -0.2789631 0.1738962 -1.43471 0.6814814 -1.37251 -0.6364807 1.977499 [,85] [,86] [,87] [,88] [,89] [,90] [,91] [1,] 0.5491935 0.2635553 -0.3843071 1.543537 -0.7109694 0.1535392 -1.203799 [2,] 0.5491935 0.2635553 -0.3843071 1.543537 -0.7109694 0.1535392 -1.203799 [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] 0.5629726 -1.383701 0.8194211 -0.1299387 -0.6934967 1.444121 0.7714647 [2,] 0.5629726 -1.383701 0.8194211 -0.1299387 -0.6934967 1.444121 0.7714647 [,99] [,100] [1,] 0.8425549 0.887214 [2,] 0.8425549 0.887214 > > > Max(tmp2) [1] 2.048832 > Min(tmp2) [1] -2.309902 > mean(tmp2) [1] -0.0549061 > Sum(tmp2) [1] -5.49061 > Var(tmp2) [1] 0.7381462 > > rowMeans(tmp2) [1] -0.098669702 -0.782753021 0.189941070 -0.493822188 -0.445276978 [6] -0.875873271 -0.068427440 0.806051284 -0.499755205 -0.517132849 [11] -0.757779902 0.667985620 -0.347062720 0.795870825 0.033631809 [16] 0.500545248 -1.429790814 -1.232785650 0.001120571 0.154246437 [21] 1.513084584 -1.480149740 0.626636676 -0.056821190 0.810828298 [26] 0.641973671 1.433469362 0.570724976 0.546130943 1.256704168 [31] -0.141769836 0.105995600 1.208907750 -0.454045621 0.971794331 [36] 0.222768331 -0.876896305 -0.063832108 -0.932862542 -1.830635908 [41] -0.025513767 0.099335749 0.205300819 0.819316110 -0.867448223 [46] 0.110306028 1.050687497 0.354906328 0.041595788 -0.200634755 [51] -1.135177831 -1.607559568 -0.988438789 0.444206017 -0.176650889 [56] 0.048333421 -0.100468310 -0.150616460 -0.153452757 0.116246713 [61] 0.625943841 0.763682327 -0.228821084 0.332506453 -0.536312286 [66] 1.156123174 -0.551462062 -1.452021577 -0.450335775 -0.899546619 [71] 2.048832003 0.208858351 0.416672410 1.527734638 -0.517615109 [76] -1.622957245 -0.669131215 -0.315707835 0.433104876 0.754404211 [81] -0.325429697 -0.290138396 1.499697003 -0.945782780 -0.268157569 [86] 1.415599054 -2.309902388 -0.324897358 -1.209742864 -0.837360934 [91] 0.621923782 0.679223629 -1.155098188 -0.404238168 -0.974650791 [96] 0.571827602 1.984344291 -0.889816302 -0.471345425 -0.437157765 > rowSums(tmp2) [1] -0.098669702 -0.782753021 0.189941070 -0.493822188 -0.445276978 [6] -0.875873271 -0.068427440 0.806051284 -0.499755205 -0.517132849 [11] -0.757779902 0.667985620 -0.347062720 0.795870825 0.033631809 [16] 0.500545248 -1.429790814 -1.232785650 0.001120571 0.154246437 [21] 1.513084584 -1.480149740 0.626636676 -0.056821190 0.810828298 [26] 0.641973671 1.433469362 0.570724976 0.546130943 1.256704168 [31] -0.141769836 0.105995600 1.208907750 -0.454045621 0.971794331 [36] 0.222768331 -0.876896305 -0.063832108 -0.932862542 -1.830635908 [41] -0.025513767 0.099335749 0.205300819 0.819316110 -0.867448223 [46] 0.110306028 1.050687497 0.354906328 0.041595788 -0.200634755 [51] -1.135177831 -1.607559568 -0.988438789 0.444206017 -0.176650889 [56] 0.048333421 -0.100468310 -0.150616460 -0.153452757 0.116246713 [61] 0.625943841 0.763682327 -0.228821084 0.332506453 -0.536312286 [66] 1.156123174 -0.551462062 -1.452021577 -0.450335775 -0.899546619 [71] 2.048832003 0.208858351 0.416672410 1.527734638 -0.517615109 [76] -1.622957245 -0.669131215 -0.315707835 0.433104876 0.754404211 [81] -0.325429697 -0.290138396 1.499697003 -0.945782780 -0.268157569 [86] 1.415599054 -2.309902388 -0.324897358 -1.209742864 -0.837360934 [91] 0.621923782 0.679223629 -1.155098188 -0.404238168 -0.974650791 [96] 0.571827602 1.984344291 -0.889816302 -0.471345425 -0.437157765 > rowVars(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowSd(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowMax(tmp2) [1] -0.098669702 -0.782753021 0.189941070 -0.493822188 -0.445276978 [6] -0.875873271 -0.068427440 0.806051284 -0.499755205 -0.517132849 [11] -0.757779902 0.667985620 -0.347062720 0.795870825 0.033631809 [16] 0.500545248 -1.429790814 -1.232785650 0.001120571 0.154246437 [21] 1.513084584 -1.480149740 0.626636676 -0.056821190 0.810828298 [26] 0.641973671 1.433469362 0.570724976 0.546130943 1.256704168 [31] -0.141769836 0.105995600 1.208907750 -0.454045621 0.971794331 [36] 0.222768331 -0.876896305 -0.063832108 -0.932862542 -1.830635908 [41] -0.025513767 0.099335749 0.205300819 0.819316110 -0.867448223 [46] 0.110306028 1.050687497 0.354906328 0.041595788 -0.200634755 [51] -1.135177831 -1.607559568 -0.988438789 0.444206017 -0.176650889 [56] 0.048333421 -0.100468310 -0.150616460 -0.153452757 0.116246713 [61] 0.625943841 0.763682327 -0.228821084 0.332506453 -0.536312286 [66] 1.156123174 -0.551462062 -1.452021577 -0.450335775 -0.899546619 [71] 2.048832003 0.208858351 0.416672410 1.527734638 -0.517615109 [76] -1.622957245 -0.669131215 -0.315707835 0.433104876 0.754404211 [81] -0.325429697 -0.290138396 1.499697003 -0.945782780 -0.268157569 [86] 1.415599054 -2.309902388 -0.324897358 -1.209742864 -0.837360934 [91] 0.621923782 0.679223629 -1.155098188 -0.404238168 -0.974650791 [96] 0.571827602 1.984344291 -0.889816302 -0.471345425 -0.437157765 > rowMin(tmp2) [1] -0.098669702 -0.782753021 0.189941070 -0.493822188 -0.445276978 [6] -0.875873271 -0.068427440 0.806051284 -0.499755205 -0.517132849 [11] -0.757779902 0.667985620 -0.347062720 0.795870825 0.033631809 [16] 0.500545248 -1.429790814 -1.232785650 0.001120571 0.154246437 [21] 1.513084584 -1.480149740 0.626636676 -0.056821190 0.810828298 [26] 0.641973671 1.433469362 0.570724976 0.546130943 1.256704168 [31] -0.141769836 0.105995600 1.208907750 -0.454045621 0.971794331 [36] 0.222768331 -0.876896305 -0.063832108 -0.932862542 -1.830635908 [41] -0.025513767 0.099335749 0.205300819 0.819316110 -0.867448223 [46] 0.110306028 1.050687497 0.354906328 0.041595788 -0.200634755 [51] -1.135177831 -1.607559568 -0.988438789 0.444206017 -0.176650889 [56] 0.048333421 -0.100468310 -0.150616460 -0.153452757 0.116246713 [61] 0.625943841 0.763682327 -0.228821084 0.332506453 -0.536312286 [66] 1.156123174 -0.551462062 -1.452021577 -0.450335775 -0.899546619 [71] 2.048832003 0.208858351 0.416672410 1.527734638 -0.517615109 [76] -1.622957245 -0.669131215 -0.315707835 0.433104876 0.754404211 [81] -0.325429697 -0.290138396 1.499697003 -0.945782780 -0.268157569 [86] 1.415599054 -2.309902388 -0.324897358 -1.209742864 -0.837360934 [91] 0.621923782 0.679223629 -1.155098188 -0.404238168 -0.974650791 [96] 0.571827602 1.984344291 -0.889816302 -0.471345425 -0.437157765 > > colMeans(tmp2) [1] -0.0549061 > colSums(tmp2) [1] -5.49061 > colVars(tmp2) [1] 0.7381462 > colSd(tmp2) [1] 0.8591544 > colMax(tmp2) [1] 2.048832 > colMin(tmp2) [1] -2.309902 > colMedians(tmp2) [1] -0.08354857 > colRanges(tmp2) [,1] [1,] -2.309902 [2,] 2.048832 > > 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.9061179 -4.9106557 -0.2557588 2.9394583 3.3879632 3.3300756 [7] 4.8804918 -8.1412943 10.1016319 -2.9428474 > colApply(tmp,quantile)[,1] [,1] [1,] -3.0651170 [2,] -0.9835717 [3,] -0.2785253 [4,] 0.1738493 [5,] 1.5255357 > > rowApply(tmp,sum) [1] -1.7007120 -0.5575024 0.1634580 -3.2365711 2.3926186 5.3408433 [7] 3.3286105 -2.4766574 -3.4777886 4.7066479 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 8 4 1 10 5 8 2 1 6 5 [2,] 2 8 4 1 1 3 3 2 2 9 [3,] 5 1 6 8 10 4 8 5 7 1 [4,] 4 7 7 6 9 6 7 4 4 7 [5,] 7 6 8 2 8 7 6 3 10 6 [6,] 3 10 2 4 6 9 9 10 3 10 [7,] 6 5 10 9 4 10 4 8 5 8 [8,] 9 2 5 3 3 2 1 6 1 2 [9,] 10 9 9 7 7 5 10 7 8 3 [10,] 1 3 3 5 2 1 5 9 9 4 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 0.1360736 -2.3304683 -3.7507485 0.5901783 -0.1986262 -0.5141691 [7] -2.1572206 -3.0286319 1.4512321 -2.8464908 2.4641650 3.4334746 [13] -3.2040654 -0.4528621 -0.6832508 0.9367146 0.1786159 3.3627700 [19] -0.2050346 -2.0162884 > colApply(tmp,quantile)[,1] [,1] [1,] -0.7290003 [2,] -0.6729072 [3,] 0.2782052 [4,] 0.4372432 [5,] 0.8225326 > > rowApply(tmp,sum) [1] -5.3360696 0.6309990 -0.7973697 -6.3897076 3.0575155 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 8 16 15 8 12 [2,] 11 13 16 6 1 [3,] 1 3 7 1 19 [4,] 14 7 5 17 15 [5,] 18 5 8 11 10 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.6729072 -0.3701290 -2.0315848 -0.03025325 0.947981025 0.5071081 [2,] 0.8225326 0.4306511 -1.2032342 -0.31602378 -0.812369928 1.0521998 [3,] 0.4372432 0.6308204 -0.2904011 -0.66804300 -0.213205725 -1.2452608 [4,] -0.7290003 -1.1708432 -1.6181438 0.66157147 -0.117400590 0.1303969 [5,] 0.2782052 -1.8509677 1.3926154 0.94292685 -0.003631026 -0.9586131 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.61695033 -1.9218129 -0.048423534 -1.6796987 0.6672414 0.4774458 [2,] 0.42809723 -0.2695293 0.709510800 0.7264795 -0.4683054 1.9138495 [3,] -0.56109927 0.6317740 0.001002241 -2.8878894 1.9089326 -1.0141395 [4,] -1.38250565 -1.1017165 0.309027614 -1.5592173 1.4042950 1.0609794 [5,] -0.02476254 -0.3673471 0.480115028 2.5538351 -1.0479987 0.9953393 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -0.7342939 -0.7954236 -0.4565255 -0.75541587 1.90059606 -0.7894805 [2,] -1.1930680 -1.7355434 0.0635474 1.19617377 -0.08895861 0.9865848 [3,] -0.9087543 0.3870384 -0.1018910 -0.07588516 0.29947393 1.8340411 [4,] 0.3952987 0.6782298 -1.3655003 0.32392402 -1.55309175 0.4940176 [5,] -0.7632479 1.0128367 1.1771186 0.24791789 -0.37940369 0.8376069 [,19] [,20] [1,] -0.19408543 1.260542394 [2,] -0.02851667 -1.583078335 [3,] 1.04280975 -0.003936173 [4,] -0.65534553 -0.594683237 [5,] -0.36989674 -1.095133067 > > > 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.13-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.13-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 649 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 562 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -0.387271 -0.3190458 -0.5081571 1.090451 0.6032249 1.045865 -0.275548 col8 col9 col10 col11 col12 col13 col14 row1 0.8077238 2.11468 0.3469113 -0.09686763 2.166145 -1.176741 -1.054877 col15 col16 col17 col18 col19 col20 row1 -0.02741664 -1.258305 -0.2719637 -1.028779 -1.50681 1.071187 > tmp[,"col10"] col10 row1 0.3469113 row2 0.5710962 row3 1.5846396 row4 0.8181018 row5 0.2052924 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 -0.387271 -0.31904578 -0.5081571 1.0904514 0.6032249 1.0458655 row5 1.163295 -0.05227347 -1.0378591 -0.3816918 -1.7543687 -0.3757619 col7 col8 col9 col10 col11 col12 col13 row1 -0.2755480 0.8077238 2.114680 0.3469113 -0.09686763 2.166145 -1.1767408 row5 -0.9384421 -0.9538524 -0.396046 0.2052924 0.91488511 -1.384739 0.9543142 col14 col15 col16 col17 col18 col19 col20 row1 -1.05487654 -0.02741664 -1.258305 -0.2719637 -1.028779 -1.5068103 1.071187 row5 -0.08591915 0.38366197 1.105481 -0.3148217 -1.340607 -0.4204111 0.890663 > tmp[,c("col6","col20")] col6 col20 row1 1.0458655 1.0711865 row2 -0.8177075 -0.5337346 row3 0.6564252 -0.8630079 row4 0.3529561 0.4183610 row5 -0.3757619 0.8906630 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 1.0458655 1.071187 row5 -0.3757619 0.890663 > > > > > 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.43719 50.64455 48.16648 49.70751 50.21079 103.5576 50.03485 48.74071 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.40865 48.25462 49.98823 49.85812 50.19873 48.74809 51.44001 48.97497 col17 col18 col19 col20 row1 48.40002 49.73679 51.79831 104.8869 > tmp[,"col10"] col10 row1 48.25462 row2 31.31681 row3 29.77651 row4 28.54167 row5 50.00946 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.43719 50.64455 48.16648 49.70751 50.21079 103.5576 50.03485 48.74071 row5 49.28379 50.79191 48.06990 50.28759 50.04368 103.5703 50.48875 49.39144 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.40865 48.25462 49.98823 49.85812 50.19873 48.74809 51.44001 48.97497 row5 52.13197 50.00946 49.52012 48.96823 49.88809 50.33315 49.21914 50.57934 col17 col18 col19 col20 row1 48.40002 49.73679 51.79831 104.8869 row5 50.02845 49.14978 48.62764 103.0236 > tmp[,c("col6","col20")] col6 col20 row1 103.55764 104.88694 row2 74.28440 73.25841 row3 74.09905 74.60548 row4 75.84536 74.57261 row5 103.57030 103.02358 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 103.5576 104.8869 row5 103.5703 103.0236 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 103.5576 104.8869 row5 103.5703 103.0236 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] -1.5655991 [2,] -2.1469725 [3,] 0.2685284 [4,] 1.8821973 [5,] 0.8987481 > tmp[,c("col17","col7")] col17 col7 [1,] -0.53468717 -1.1158435 [2,] 2.33234238 -2.0925891 [3,] -0.72963680 -1.4740779 [4,] 0.01177515 0.5399997 [5,] -1.07402695 0.7017694 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] 0.2028665 0.1368238 [2,] 0.9257708 0.9174780 [3,] 1.7477201 -0.1085546 [4,] -1.0754572 -1.3309814 [5,] 0.4466205 0.5197276 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] 0.2028665 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] 0.2028665 [2,] 0.9257708 > > > > 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 -0.3120833 0.537947 0.3111479 -2.0966875 1.0373802 0.3102187 -0.1518581 row1 -0.6391578 -1.115631 0.9484627 -0.9159958 -0.2297394 -0.1675331 1.9077653 [,8] [,9] [,10] [,11] [,12] [,13] row3 1.2075790 0.3615047 -0.3660618 -0.004447542 -0.1515192 0.7497822 row1 -0.2771313 -1.1085767 -1.3338613 0.169074436 -1.4730081 -0.9235517 [,14] [,15] [,16] [,17] [,18] [,19] [,20] row3 0.6500455 0.7125956 0.396779 -1.133735 -1.240717 -0.1892833 0.1318923 row1 -0.7621770 0.7070454 1.175862 0.169157 1.888510 -0.3224016 0.9174619 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.5660985 -0.441919 -2.060597 -0.1326893 0.5553254 2.066147 -0.4743675 [,8] [,9] [,10] row2 -0.7103242 0.1378271 2.198566 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -1.607032 -0.3809175 -0.6866422 -0.8429409 0.9503314 -0.503732 -0.4762729 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -0.5307655 -0.680302 0.1271772 0.8850695 0.1059225 -1.006922 1.729182 [,15] [,16] [,17] [,18] [,19] [,20] row5 0.272161 -0.6136862 -1.117986 -1.753011 -0.1515782 -0.1886351 > > > 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: 0x7f84b8e56080> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e17ef62e79" [2] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e154654b0d" [3] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e146226dc4" [4] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e17e5482d4" [5] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e15e596d17" [6] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e141093165" [7] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e14289ff3e" [8] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e171d46192" [9] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e12e51f2a0" [10] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e160ffe22" [11] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e13f56d4a" [12] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e165da174d" [13] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e1512ff478" [14] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e1235b1bec" [15] "/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests/BM98e132863516" > > > ### 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: 0x7f84a8d2f780> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x7f84a8d2f780> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.13-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x7f84a8d2f780> > rowMedians(tmp) [1] 1.336840e-01 -1.687038e-01 2.137028e-01 3.753906e-01 -1.263233e-01 [6] 3.432693e-02 -1.851465e-01 1.781679e-01 -2.136546e-01 -9.670381e-02 [11] -3.320587e-01 -4.712845e-01 8.631149e-02 8.665318e-02 -3.831289e-01 [16] 6.680628e-02 3.764923e-01 -4.259364e-02 -3.997561e-01 1.968482e-01 [21] 2.173303e-01 3.880409e-01 -1.739062e-01 4.732029e-01 1.965364e-01 [26] 2.595869e-01 -1.564849e-01 -3.349584e-01 9.514689e-02 1.801625e-01 [31] -3.386379e-02 -1.582578e-01 1.842023e-01 -1.203590e-01 5.770693e-01 [36] 2.428382e-01 -5.950015e-01 -3.502182e-02 5.262627e-01 4.429769e-02 [41] -4.343409e-02 2.004642e-01 -4.036115e-01 3.401016e-01 5.789317e-01 [46] -3.061776e-01 -1.679318e-01 5.765535e-02 4.106747e-01 5.868796e-01 [51] 4.313458e-01 -1.047371e-01 6.087986e-01 1.667322e-01 2.499334e-01 [56] -1.409053e-01 4.153048e-01 -2.986759e-01 1.751534e-01 2.064735e-01 [61] -4.906290e-01 3.910875e-01 1.902794e-01 2.435906e-01 -1.680187e-01 [66] -3.444451e-01 -4.914640e-01 -5.834375e-01 -4.522408e-02 2.026038e-01 [71] -5.473720e-01 -6.191928e-01 -2.941324e-01 3.074706e-01 3.656815e-01 [76] 3.520669e-01 -4.067400e-02 3.198329e-01 5.426494e-01 -1.017138e-01 [81] 7.020965e-02 3.315762e-01 1.391527e-02 7.969939e-02 -3.235735e-01 [86] -3.371238e-01 -1.418338e-01 2.564627e-01 -2.447332e-02 4.438233e-01 [91] 7.326780e-02 -3.008331e-01 4.295969e-01 7.867435e-02 8.995391e-02 [96] -1.328212e-01 4.963662e-01 -7.185271e-01 4.204144e-02 2.479638e-01 [101] 1.371115e-01 -2.856755e-02 -1.662092e-01 -6.039884e-02 3.754955e-01 [106] 3.267482e-01 -1.022388e-01 1.175789e-01 3.384106e-01 -2.082997e-01 [111] 1.438999e-01 5.788140e-02 5.855814e-02 -1.289050e-01 -2.868409e-01 [116] 3.202681e-01 2.976415e-01 -6.430121e-01 1.861340e-02 7.617172e-02 [121] 1.350485e-01 -6.322670e-03 -5.636278e-01 -2.145563e-01 2.426933e-01 [126] -2.987183e-01 4.784081e-02 1.315319e-01 -2.414991e-01 -1.206451e-01 [131] -2.246413e-01 -3.728459e-01 -4.554539e-01 3.420031e-02 1.013577e-01 [136] 3.319183e-01 -3.734598e-02 3.859587e-01 1.181859e-01 1.891331e-01 [141] -1.797843e-01 -4.034569e-01 -4.855467e-02 3.201641e-01 7.268357e-01 [146] 1.281703e-01 9.226274e-02 -1.490369e-01 -3.196656e-01 2.708615e-01 [151] 3.026764e-01 3.008291e-01 1.046701e-01 -4.974057e-01 -3.248174e-01 [156] 2.098204e-01 -3.529536e-01 3.464627e-01 -1.801991e-01 -7.982798e-02 [161] -1.788285e-01 1.218321e-01 -9.441655e-02 -2.308996e-01 -1.785236e-01 [166] 2.479880e-01 -1.262552e-01 2.928149e-01 -8.851991e-01 -1.013782e-01 [171] 2.643419e-01 -5.913272e-01 -2.626784e-01 5.776039e-01 6.155484e-01 [176] 4.103950e-01 -3.523398e-01 3.283217e-01 1.001336e-01 4.972872e-01 [181] 3.175426e-01 2.232484e-01 4.914426e-01 2.865109e-01 -4.224682e-01 [186] -1.762073e-01 1.990183e-01 3.836364e-01 -8.312852e-02 -6.056573e-02 [191] -2.967866e-01 -2.911596e-01 -6.270423e-01 -2.854055e-01 -2.527884e-01 [196] 1.395343e-01 5.322299e-02 -1.205604e-01 -2.787495e-01 -2.376941e-01 [201] -1.350357e-01 3.097239e-01 7.898680e-02 2.811195e-01 -1.015707e-01 [206] 1.340828e-01 3.061859e-01 1.873362e-01 -1.943666e-01 3.959050e-01 [211] -6.271216e-01 -5.361609e-01 2.920447e-01 -6.731710e-01 -3.724742e-02 [216] -2.585561e-01 2.205078e-01 -6.484647e-01 -9.678456e-02 -5.263115e-01 [221] 3.705425e-01 -3.617593e-06 1.650818e-01 -4.127120e-01 -3.735706e-01 [226] -4.940711e-02 1.857177e-01 -5.814878e-02 -1.097309e-01 1.112499e-01 > > proc.time() user system elapsed 3.446 10.687 14.419
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.1.1 (2021-08-10) -- "Kick Things" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit) 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: 0x7fba78c6ac80> > .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: 0x7fba78c6ac80> > .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: 0x7fba78c6ac80> > .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: 0x7fba78c6ac80> > 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: 0x7fba3b801ab0> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b801ab0> > .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: 0x7fba3b801ab0> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b801ab0> > .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: 0x7fba3b801ab0> > 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: 0x7fba3b8002d0> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b8002d0> > .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: 0x7fba3b8002d0> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x7fba3b8002d0> > .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: 0x7fba3b8002d0> > > .Call("R_bm_RowMode",P) <pointer: 0x7fba3b8002d0> > .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: 0x7fba3b8002d0> > > .Call("R_bm_ColMode",P) <pointer: 0x7fba3b8002d0> > .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: 0x7fba3b8002d0> > 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: 0x7fba3b802720> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x7fba3b802720> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b802720> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b802720> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile9bcd4350eb07" "BufferedMatrixFile9bcd75763b17" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile9bcd4350eb07" "BufferedMatrixFile9bcd75763b17" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b801180> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b801180> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x7fba3b801180> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x7fba3b801180> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x7fba3b801180> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x7fba3b801180> > .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: 0x7fba3b800ae0> > .Call("R_bm_AddColumn",P) <pointer: 0x7fba3b800ae0> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x7fba3b800ae0> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x7fba3b800ae0> > 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: 0x7fba3b800e60> > .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: 0x7fba3b800e60> > rm(P) > > proc.time() user system elapsed 0.419 0.122 0.520
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.1.1 (2021-08-10) -- "Kick Things" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit) 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.423 0.081 0.483