File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -62,16 +62,19 @@ read_profile <- function(path) {
62
62
63
63
if (length(which(ncols == 2 )) > 0 ) {
64
64
idx_obsnodes <- which(ncols == 2 )
65
- if (any( idx_obsnodes < length( ncols ))) {
65
+ obsnodes $ n <- as.integer( dat [ idx_obsnodes [ 1 ]])
66
66
67
- n_obsnodes <- as.integer(dat [idx_obsnodes [- length(idx_obsnodes )]])
68
- obs_node_ids <- stringr :: str_split(dat [idx_obsnodes [length(idx_obsnodes )]],
67
+ if (stringr :: str_length(dat [idx_obsnodes [1 ]+ 1 ]) > 0 ) {
68
+
69
+ obsnodes $ ids <- stringr :: str_split(dat [idx_obsnodes [1 ]+ 1 ],
69
70
pattern = " ," ,
70
71
simplify = TRUE ) %> %
71
72
as.integer()
72
73
73
- obsnodes <- list (n = n_obsnodes ,
74
- ids = obs_node_ids )
74
+ } else {
75
+ stop(" Check stucture of input file %s. Missing ids for %d specified observation points!" ,
76
+ path ,
77
+ obsnodes $ n )
75
78
}
76
79
}
77
80
You can’t perform that action at this time.
0 commit comments