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
8a48c79e
Commit
8a48c79e
authored
Apr 11, 2017
by
Nicolau Manubens
Browse files
Minor fixes.
parent
ded36c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/NcToArray.R
View file @
8a48c79e
...
...
@@ -72,7 +72,6 @@ NcToArray <- function(file_to_read, dim_indices = NULL, vars_to_read = NULL,
# if (!is.character(vars_to_read) && !is.numeric(vars_to_read)) {
# stop("Parameter 'vars_to_read' must be a numeric vector or vector of character strings.")
# }
result_list
<-
NULL
for
(
vars_to_read_vector
in
vars_to_read
)
{
result
<-
NULL
...
...
@@ -94,12 +93,11 @@ NcToArray <- function(file_to_read, dim_indices = NULL, vars_to_read = NULL,
}
#file_object$var[extra_dimvars] <- extra_dimvars_list
#file_object$nvars <- file_object$nvars + length(extra_dimvars)
nmv
<-
numeric_var_indices
<-
which
(
is.numeric
(
vars_to_read_vector
))
if
(
length
(
nmv
)
>
0
)
{
if
(
any
(
vars_to_read_vector
[
nmv
]
>
(
length
(
file_object
$
var
)
+
length
(
extra_dimvars
))))
{
if
(
is.numeric
(
vars_to_read_vector
))
{
if
(
any
(
vars_to_read_vector
>
(
length
(
file_object
$
var
)
+
length
(
extra_dimvars
))))
{
stop
(
"Provided numerical variable indices out of bounds in 'vars_to_read'."
)
}
vars_to_read_vector
[
nmv
]
<-
c
(
sapply
(
file_object
$
var
,
'[['
,
'name'
),
extra_dimvars
)[
vars_to_read_vector
[
nmv
]
]
vars_to_read_vector
<-
c
(
sapply
(
file_object
$
var
,
'[['
,
'name'
),
extra_dimvars
)[
vars_to_read_vector
]
}
for
(
var_name
in
vars_to_read_vector
)
{
if
(
var_name
%in%
extra_dimvars
)
{
...
...
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