Skip to content

Commit 85ec622

Browse files
Apply suggestions from code review
Co-authored-by: Michael Chirico <[email protected]>
1 parent a969843 commit 85ec622

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/froll.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ frolladapt = function(x, n, align="right", partial=FALSE, give.names=FALSE) {
135135
if (!identical(align, "right"))
136136
stopf("'align' other than 'right' has not yet been implemented")
137137
if (!isTRUEorFALSE(partial))
138-
stopf("'partial' must be TRUE or FALSE")
138+
stopf("'%s' must be TRUE or FALSE", "partial")
139139
if (!isTRUEorFALSE(give.names))
140-
stopf("'give.names' must be TRUE or FALSE")
140+
stopf("'%s' must be TRUE or FALSE", "give.names")
141141

142142
if (length(n) == 1L) {
143143
ans = .Call(Cfrolladapt, x, n, partial)

src/frollR.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ SEXP frolladapt(SEXP xobj, SEXP kobj, SEXP partial) {
216216
int n = INTEGER(kobj)[0];
217217
if (n < 1L)
218218
error(_("'n' must be positive integer values (>= 1)"));
219-
int *x = INTEGER(xobj);
219+
int *x = INTEGER_RO(xobj);
220220
int64_t len = XLENGTH(xobj); // can be 0
221221

222222
if (len && x[0] == NA_INTEGER)

0 commit comments

Comments
 (0)