We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f9c173 commit 154126dCopy full SHA for 154126d
1 file changed
R/world_gen.R
@@ -101,10 +101,10 @@ world_gen = function(template,
101
rulevars = NULL
102
if (asp_check) {
103
asp_map = template_clean[[which(var_names == "asp_rule")]][3] # get rule map/value
104
- if (!is.numeric(asp_map)) { # if it's a map
+ if (suppressWarnings(any(is.na(as.numeric(asp_map))))) { # if it's a map
105
asp_mapdata = map_df[asp_map]
106
- } else if (is.numeric(asp_map)) { # if is a single number
107
- asp_mapdata = asp_map
+ } else if (suppressWarnings(all(!is.na(as.numeric(asp_map))))) { # if is a single number
+ asp_mapdata = as.numeric(asp_map)
108
}
109
rulevars = aspatial_patches(asprules = asprules, asp_mapdata = asp_mapdata)
110
0 commit comments