Commit 09274934 authored by Nicolau Manubens's avatar Nicolau Manubens
Browse files

Returned dimensions as requested in dim_indices. Fixes #2.

parent 24920257
......@@ -223,7 +223,7 @@ NcToArray <- function(file_to_read, dim_indices = NULL, vars_to_read = NULL,
reorder_back <- NULL
indices_dims <- names(dim_indices)[which(names(dim_indices) %in% names(dim(var_result)))]
if (length(indices_dims) > 0) {
if (any(names(dim(var_result))[-which(names(dim(var_result)) %in% names(extra_dims))] != indices_dims)) {
if (any(setdiff(names(dim(var_result)), names(extra_dims)) != indices_dims)) {
reorder_back <- 1:length(dim(var_result))
dims_to_reorder <- which(!(names(dim(var_result)) %in% names(extra_dims)))
reorder_back[dims_to_reorder] <- dims_to_reorder[sapply(indices_dims,
......
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