Skip to content

Commit

Permalink
Remove or replace unnecessary paste()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Jul 10, 2024
1 parent be79483 commit 44f17b5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions R/export_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ export_delim <- function(file, x, fwrite = lifecycle::deprecated(), sep = "\t",
message("Columns:")
message(paste0(utils::capture.output(dict), collapse = "\n"))
if (sep == "") {
message(paste0(
message(
"\nRead in with:\n",
'import("', file, '",\n',
" widths = c(", paste0(n, collapse = ","), "),\n",
' col.names = c("', paste0(names(n), collapse = '","'), '"),\n',
' colClasses = c("', paste0(col_classes, collapse = '","'), '"))\n'
), domain = NA)
' colClasses = c("', paste0(col_classes, collapse = '","'), '"))\n',
domain = NA
)
}
}
.write_as_utf8(paste0("#", utils::capture.output(utils::write.csv(dict, row.names = FALSE, quote = FALSE))), file = file, sep = "\n")
Expand Down
2 changes: 1 addition & 1 deletion R/import_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ extract_html_row <- function(x, empty_value) {
# find all tables
tables <- xml2::xml_find_all(xml2::read_html(unclass(file)), ".//table")
if (which > length(tables)) {
stop(paste0("Requested table exceeds number of tables found in file (", length(tables), ")!"))
stop("Requested table exceeds number of tables found in file (", length(tables), ")!")
}
x <- xml2::as_list(tables[[which]])
if ("tbody" %in% names(x)) {
Expand Down
2 changes: 1 addition & 1 deletion R/onLoad.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
w <- uninstalled_formats()
if (length(w)) {
msg <- "The following rio suggested packages are not installed: %s\nUse 'install_formats()' to install them"
packageStartupMessage(sprintf(msg, paste0(sQuote(w), collapse = ", ")))
packageStartupMessage(sprintf(msg, toString(sQuote(w))))
}
}
}
2 changes: 1 addition & 1 deletion R/remote_to_local.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ remote_to_local <- function(file, format) {
if (!length(f)) {
f <- regmatches(h, regexpr("(?<=filename=)(.*)", h, perl = TRUE))
}
f <- paste0(dirname(temp_file), "/", f)
f <- file.path(dirname(temp_file), f)
file.copy(from = temp_file, to = f)
unlink(temp_file)
return(f)
Expand Down

0 comments on commit 44f17b5

Please sign in to comment.