File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,6 @@ extend <- function(x,
20
20
" Try changing res, xRange or yRange." )
21
21
}
22
22
23
- # reorder first dim of x to match order in coords
24
- posInCoords <- match(sparseCoords , coords )
25
-
26
23
subdims1 <- getSets(x )[grep(" ^d1\\ ." , names(getSets(x )))]
27
24
notCoords <- subdims1 [! subdims1 %in% c(" x" , " y" )]
28
25
@@ -37,7 +34,12 @@ extend <- function(x,
37
34
38
35
getSets(extended ) <- getSets(x )
39
36
37
+ posInCoords <- match(sparseCoords , coords )
38
+
39
+ # fill subdims for dim 1 other than x and y (e.g. country code) if they were set in x
40
40
dimnames(extended )[[1 ]][posInCoords ] <- getItems(x , 1 )
41
+
42
+ # fill extended with data from x where available
41
43
extended [posInCoords , , ] <- x
42
44
43
45
return (extended )
You can’t perform that action at this time.
0 commit comments