Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Earth Sciences
easyNCDF
Commits
09274934
Commit
09274934
authored
May 29, 2017
by
Nicolau Manubens
Browse files
Returned dimensions as requested in dim_indices. Fixes
#2
.
parent
24920257
Changes
1
Show whitespace changes
Inline
Side-by-side
R/NcToArray.R
View file @
09274934
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment