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
c0476862
Commit
c0476862
authored
Feb 05, 2019
by
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
Changes
2
Show whitespace changes
Inline
Side-by-side
R/NcReadDims.R
View file @
c0476862
...
...
@@ -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
...
...
R/Utils.R
View file @
c0476862
...
...
@@ -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
...
...
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