boB Rudis
5 years ago
5 changed files with 42 additions and 2 deletions
@ -0,0 +1,23 @@ |
|||||
|
#' Find R source files with non-ASCII characters |
||||
|
#' |
||||
|
#' @export |
||||
|
zapGremlins <- function() { |
||||
|
|
||||
|
d <- selectDirectory() |
||||
|
|
||||
|
sapply( |
||||
|
list.files(d, pattern = "[.][Rr]$", full.names = TRUE), |
||||
|
function(.x) { |
||||
|
res <- capture.output(tools::showNonASCIIfile(.x), type = "message") |
||||
|
if (length(res)) { |
||||
|
res <- paste0(c(sprintf("# %s -----------\n", .x), res), collapse="\n") |
||||
|
} |
||||
|
} |
||||
|
) -> out |
||||
|
|
||||
|
out <- paste0(out, collapse = "\n\n") |
||||
|
|
||||
|
rstudioapi::documentNew(out) |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/zap-gremlins.R |
||||
|
\name{zapGremlins} |
||||
|
\alias{zapGremlins} |
||||
|
\title{Find R source files with non-ASCII characters} |
||||
|
\usage{ |
||||
|
zapGremlins() |
||||
|
} |
||||
|
\description{ |
||||
|
Find R source files with non-ASCII characters |
||||
|
} |
Loading…
Reference in new issue