Skip to content

Commit 7b5327c

Browse files
Merge pull request #1217 from r-lib/saf
2 parents 790d45b + 434cbc5 commit 7b5327c

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

.lintr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ linters: all_linters(
1414
todo_comment_linter = NULL,
1515
nonportable_path_linter = NULL,
1616
string_boundary_linter = NULL,
17+
strings_as_factors_linter = NULL, # since we use R >= 4.0
1718
undesirable_function_linter = NULL,
1819
undesirable_operator_linter = NULL
1920
)

R/token-define.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ token <- rbind.data.frame(
2323
c("if", "cond", "IF"),
2424
c("else", "cond", "ELSE"),
2525
c("in", "loop_cond", "IN"),
26-
c("while", "loop_cond", "WHILE"),
27-
stringsAsFactors = FALSE
26+
c("while", "loop_cond", "WHILE")
2827
)
2928
# styler: on
3029

R/ui-caching.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ cache_info <- function(cache_name = NULL, format = "both") {
104104
last_modified = suppressWarnings(max(file_info$mtime)),
105105
created = file.info(path_cache)$ctime,
106106
location = path_cache,
107-
activated = cache_is_activated(cache_name),
108-
stringsAsFactors = FALSE
107+
activated = cache_is_activated(cache_name)
109108
)
110109

111110
if (any(c("lucid", "both") == format)) {

R/utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ re_match <- function(text, pattern) {
4444
end <- start + length - 1L
4545
matchstr <- substring(text, start, end)
4646
matchstr[start == -1L] <- NA_character_
47-
res <- data.frame(stringsAsFactors = FALSE, .text = text, .match = matchstr)
47+
res <- data.frame(.text = text, .match = matchstr)
4848

4949
gstart <- attr(match, "capture.start")
5050
glength <- attr(match, "capture.length")
5151
gend <- gstart + glength - 1L
5252
groupstr <- substring(text, gstart, gend)
5353
groupstr[gstart == -1L] <- NA_character_
5454
dim(groupstr) <- dim(gstart)
55-
res <- cbind(groupstr, res, stringsAsFactors = FALSE)
55+
res <- cbind(groupstr, res)
5656

5757
names(res) <- c(attr(match, "capture.names"), ".text", ".match")
5858
res

0 commit comments

Comments
 (0)