Skip to content

Commit 154126d

Browse files
committed
Fixed world gen for numeric asp rule
1 parent 6f9c173 commit 154126d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

R/world_gen.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ world_gen = function(template,
101101
rulevars = NULL
102102
if (asp_check) {
103103
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
104+
if (suppressWarnings(any(is.na(as.numeric(asp_map))))) { # if it's a map
105105
asp_mapdata = map_df[asp_map]
106-
} else if (is.numeric(asp_map)) { # if is a single number
107-
asp_mapdata = asp_map
106+
} else if (suppressWarnings(all(!is.na(as.numeric(asp_map))))) { # if is a single number
107+
asp_mapdata = as.numeric(asp_map)
108108
}
109109
rulevars = aspatial_patches(asprules = asprules, asp_mapdata = asp_mapdata)
110110

0 commit comments

Comments
 (0)