Skip to content

Commit 78b96f1

Browse files
committed
Document update; ready for CRAN
1 parent d0fcebe commit 78b96f1

File tree

8 files changed

+55
-47
lines changed

8 files changed

+55
-47
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: filearray
22
Type: Package
33
Title: File-Backed Array for Out-of-Memory Computation
4-
Version: 0.1.6.9001
4+
Version: 0.1.7
55
Language: en-US
66
Encoding: UTF-8
77
License: LGPL-3

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# filearray 0.1.7
2+
3+
* Removed non-API R C interface
4+
* Allows `subsetAssign` to assign when value length is 1 (thanks `@talegari` issue `#9`)
5+
* Allows more flexible `fwhich` function with functional `val` input and options to include corresponding values as part of return (thanks `@talegari` issue `#10`)
6+
* Fixed `mapreduce` bug when partition length is way larger than the buffer size, causing buffer to stop updating
7+
* Fixed other `C++` issues, such as unused buffer allocation in subset-assign, and `min_` offset in `sub_vec_range`. These issues are not considered bugs since they don't affect the results, but the performance is slightly increased after fix.
8+
* Replaced `dipsaus` with more updated `ravetools` in the vignette performance profiling
9+
* Updated examples to get rid of warning messages and out-dated arguments.
10+
111
# filearray 0.1.6
212

313
* Removed `c++11` from system requirement and `Makevars`

R/load.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#' @examples
5959
#'
6060
#'
61-
#' # Prepare
61+
#' # Prepare
6262
#' library(filearray)
6363
#' filebase <- tempfile()
6464
#' if(file.exists(filebase)){ unlink(filebase, TRUE) }
@@ -88,15 +88,15 @@
8888
#' # check-load, and create a new array if fail
8989
#' x <- filearray_load_or_create(
9090
#' filebase = filebase, dimension = c(200, 30, 8),
91-
#' verbose = TRUE, signature = "henry"
91+
#' verbose = FALSE, signature = "henry"
9292
#' )
9393
#' x$get_header("signature")
9494
#'
9595
#' # check-load with initialization
9696
#' x <- filearray_load_or_create(
97-
#' filebase = filebase,
97+
#' filebase = filebase,
9898
#' dimension = c(3, 4, 5),
99-
#' verbose = TRUE, mode = "readonly",
99+
#' verbose = FALSE, mode = "readonly",
100100
#' on_missing = function(array) {
101101
#' array[] <- seq_len(60)
102102
#' }

R/method-map.R

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@
6262
#' output$delete()
6363
#'
6464
#' # Calculate the maximum of x1/x2 for every 100 elements
65+
#' # total 60 batches/loops (`.buffer_count`)
6566
#' output <- filearray_create(tempfile(), dimension = c(20,3))
6667
#' fmap(list(x1, x2), function(input){
6768
#' max(input[[1]] / input[[2]])
68-
#' }, output, .input_size = 100, .output_size = 1)
69+
#' }, .y = output, .buffer_count = 60)
6970
#'
7071
#' # check
7172
#' range(output[] - apply(x1[] / x2[], c(2,3), max))
@@ -81,48 +82,46 @@
8182
#' Time = 1:301,
8283
#' Location = 1:4
8384
#' )
84-
#'
85+
#'
8586
#' for(i in 1:4){
8687
#' x[,,,i] <- runif(8638700)
8788
#' }
8889
#' # Step 1:
8990
#' # for each location, trial, and marker, calibrate (baseline)
9091
#' # according to first 50 time-points
91-
#'
92+
#'
9293
#' output <- filearray_create(tempfile(), dimension = dim(x))
93-
#'
94+
#'
9495
#' # baseline-percentage change
9596
#' fmap(
96-
#' list(x),
97+
#' list(x),
9798
#' function(input){
9899
#' # get locational data
99100
#' location_data <- input[[1]]
100101
#' dim(location_data) <- c(287, 100, 301)
101-
#'
102-
#' # collapse over first 50 time points for
102+
#'
103+
#' # collapse over first 50 time points for
103104
#' # each trial, and marker
104105
#' baseline <- apply(location_data[,,1:50], c(1,2), mean)
105-
#'
106+
#'
106107
#' # calibrate
107-
#' calibrated <- sweep(location_data, c(1,2), baseline,
108+
#' calibrated <- sweep(location_data, c(1,2), baseline,
108109
#' FUN = function(data, bl){
109110
#' (data / bl - 1) * 100
110111
#' })
111112
#' return(calibrated)
112-
#' },
113-
#'
113+
#' },
114+
#'
114115
#' .y = output,
115-
#'
116+
#'
116117
#' # input dimension is 287 x 100 x 301 for each location
117-
#' .input_size = 8638700,
118-
#'
119-
#' # output dimension is 287 x 100 x 301
120-
#' .output_size = 8638700
118+
#' # hence 4 loops in total
119+
#' .buffer_count = 4
121120
#' )
122-
#'
121+
#'
123122
#' # cleanup
124123
#' x$delete()
125-
#'
124+
#'
126125
#' }
127126
#'
128127
#' # cleanup

R/methods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ subset.FileArray <- function(x, ..., drop = FALSE, .env = parent.frame()){
182182
#' @param x any R vector, matrix, array or file-array
183183
#' @param val values to find, or a function taking one argument (a slice of
184184
#' data vector) and returns either logical vector with the same length as the
185-
#' slice or undex of the slice; see 'Examples'
185+
#' slice or index of the slice; see 'Examples'
186186
#' @param arr.ind logical; should array indices be
187187
#' returned when \code{x} is an array?
188188
#' @param ret.values whether to return the values of corresponding indices as

man/filearray.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmap.Rd

Lines changed: 17 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fwhich.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)