Commit c0476862 authored by Nicolau Manubens Gil's avatar Nicolau Manubens Gil
Browse files

Merge branch 'develop-bugfixes-0.0.6' into 'master'

Develop bugfixes 0.0.6

See merge request !17
parents 324a227e d8291404
......@@ -52,8 +52,7 @@ NcReadDims <- function(file_to_read, var_names = NULL) {
new_dim <- c(var = 1)
found_dims <- c(new_dim, found_dims)
if (!is.null(dims)) {
dims <- .MergeArrayDims(dims, found_dims)
dims <- pmax(dims[[1]], dims[[2]])
dims <- .MergeArrayDims(dims, found_dims)[[3]]
dims['var'] <- dims['var'] + 1
} else {
dims <- found_dims
......
......@@ -131,6 +131,11 @@
# It expects as inputs two named numeric vectors, and it extends them
# with dimensions of length 1 until an ordered common dimension
# format is reached.
# The first output is dims1 extended with 1s.
# The second output is dims2 extended with 1s.
# The third output is a merged dimension vector. If dimensions with
# the same name are found in the two inputs, and they have a different
# length, the maximum is taken.
.MergeArrayDims <- function(dims1, dims2) {
new_dims1 <- c()
new_dims2 <- c()
......@@ -158,7 +163,7 @@
new_dims1 <- c(new_dims1, dims_to_add)
new_dims2 <- c(new_dims2, dims2)
}
list(new_dims1, new_dims2)
list(new_dims1, new_dims2, pmax(new_dims1, new_dims2))
}
# This function takes two named arrays and merges them, filling with
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment