@@ -67,14 +67,19 @@ status <- function(status, date = Sys.Date(), comments = "") {
67
67
if (tolower(status ) == tolower(guess )) {
68
68
status <- guess
69
69
} else {
70
- stop(status , " is not a known status. " ,
71
- " Did you mean " , amatch_status(status ), " ?" ,
70
+ stop(
71
+ status ,
72
+ " is not a known status. " ,
73
+ " Did you mean " ,
74
+ amatch_status(status ),
75
+ " ?" ,
72
76
call. = FALSE
73
77
)
74
78
}
75
79
}
76
80
77
- structure(list (date = date , status = status , comments = comments ),
81
+ structure(
82
+ list (date = date , status = status , comments = comments ),
78
83
class = " status"
79
84
)
80
85
}
@@ -100,7 +105,10 @@ c.status <- c.status_list <- function(..., recursive = FALSE) {
100
105
101
106
# ' @export
102
107
format.status <- function (x , ... ) {
103
- paste(format(x $ date ), " " , x $ status ,
108
+ paste(
109
+ format(x $ date ),
110
+ " " ,
111
+ x $ status ,
104
112
if (! empty(x $ comments )) paste(" [" , x $ comments , " ]" , sep = " " ),
105
113
sep = " "
106
114
)
@@ -110,8 +118,11 @@ print.status <- function(x, ...) cat(format(x), "\n")
110
118
111
119
# ' @importFrom utils adist
112
120
amatch_status <- function (status ) {
113
- ldist <- adist(status , valid_status ,
114
- ignore.case = TRUE , partial = FALSE ,
121
+ ldist <- adist(
122
+ status ,
123
+ valid_status ,
124
+ ignore.case = TRUE ,
125
+ partial = FALSE ,
115
126
costs = c(ins = 0.5 , sub = 1 , del = 2 )
116
127
)[1 , ]
117
128
valid_status [which.min(ldist )]
@@ -132,29 +143,37 @@ todo <- function(x) {
132
143
133
144
status <- last_status(x )$ status
134
145
status_date <- last_status(x )$ date
135
- if (status == " resubmission" ) {
136
- # Sent back to author to fix before allocating an editor
146
+ if (
147
+ status %in%
148
+ c(
149
+ " resubmission" ,
150
+ " reject and resubmit" ,
151
+ " major revision" ,
152
+ " minor revision" ,
153
+ " accepted" ,
154
+ " copy edited"
155
+ )
156
+ ) {
137
157
" waiting (author)"
138
- } else if (empty(x $ editor ) |
139
- status == " submitted" |
140
- (status == " revision received" & status_date > " 2025-01-01" )
141
- ) {
158
+ } else if (
159
+ empty(x $ editor ) |
160
+ status == " submitted" |
161
+ (status == " revision received" & status_date > " 2025-01-01" )
162
+ ) {
142
163
# Needs an editor, or needs an acknowledgement.
143
164
# Ignore unacknowledged revisions before 2025
144
165
" waiting (editor-in-chief)"
145
- } else if (status == " with AE" ) {
166
+ } else if (status == " with AE" ) {
146
167
" waiting (AE)"
147
168
} else if (empty(x $ reviewers )) {
148
169
" waiting (editor)"
149
- } else if (status == " out for review" & completed_reviews(x ) > = 2 ) {
150
- " waiting (editor)"
170
+ } else if (status == " out for review" & completed_reviews(x ) > = 2 ) {
171
+ " waiting (editor)"
151
172
} else {
152
- switch (status ,
153
- " major revision" = " waiting (author)" ,
154
- " minor revision" = " waiting (author)" ,
173
+ switch (
174
+ status ,
155
175
" out for review" = " waiting (reviewers)" ,
156
176
" updated" = " waiting (editor)" ,
157
- " reject and resubmit" = " waiting (author)" ,
158
177
" published" = " needs removal (editor)" ,
159
178
" withdrawn" = " needs removal (editor)" ,
160
179
" rejected" = " needs removal (editor)" ,
@@ -163,10 +182,8 @@ todo <- function(x) {
163
182
" AE: minor revision" = " waiting (editor)" ,
164
183
" AE: accept" = " waiting (editor)" ,
165
184
" AE: reject" = " waiting (editor)" ,
166
- " accepted" = " waiting (author)" ,
167
185
" style checked" = " needs online (editor-in-chief)" ,
168
186
" online" = " needs copy-editing (editor)" ,
169
- " copy edited" = " waiting (author)" ,
170
187
" proofed" = " ready for publication (editor-in-chief)" ,
171
188
" acknowledged" = " needs reviewers (editor)" ,
172
189
stop(" Unknown status: " , status )
@@ -239,7 +256,8 @@ parse_status <- function(x) {
239
256
if (! stringr :: str_detect(x , re )) {
240
257
# NM added line
241
258
cat(" bad status:" , x , " \n " )
242
- stop(" Status must have form 'yyyy-mm-dd status [optional comments]'" ,
259
+ stop(
260
+ " Status must have form 'yyyy-mm-dd status [optional comments]'" ,
243
261
call. = FALSE
244
262
)
245
263
}
0 commit comments