Skip to content

Commit

Permalink
paste0 for paste(sep="")
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 10, 2012
1 parent 7d3cb81 commit 3c6595c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions R/GRangesList-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,13 @@ setMethod("show", "GRangesList",
cat("<0 elements>\n\n")
} else if ((k == 1L) || ((k <= 3L) && (N <= 20L))) {
nms <- names(object)
defnms <- paste("[[", seq_len(k), "]]", sep="")
defnms <- paste0("[[", seq_len(k), "]]")
if (is.null(nms)) {
nms <- defnms
} else {
empty <- nchar(nms) == 0L
nms[empty] <- defnms[empty]
nms[!empty] <- paste("$", nms[!empty], sep="")
nms[!empty] <- paste0("$", nms[!empty])
}
for (i in seq_len(k)) {
cat(nms[i], "\n")
Expand All @@ -594,13 +594,13 @@ setMethod("show", "GRangesList",
showK <- 1
diffK <- k - showK
nms <- names(object)[seq_len(showK)]
defnms <- paste("[[", seq_len(showK), "]]", sep="")
defnms <- paste0("[[", seq_len(showK), "]]")
if (is.null(nms)) {
nms <- defnms
} else {
empty <- nchar(nms) == 0L
nms[empty] <- defnms[empty]
nms[!empty] <- paste("$", nms[!empty], sep="")
nms[!empty] <- paste0("$", nms[!empty])
}
for (i in seq_len(showK)) {
cat(nms[i], "\n")
Expand Down
2 changes: 1 addition & 1 deletion R/GappedAlignmentPairs-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ showGappedAlignmentPairs <- function(x, margin="",
out <- rbind(classinfo, out)
}
if (nrow(out) != 0L)
rownames(out) <- paste(margin, rownames(out), sep="")
rownames(out) <- paste0(margin, rownames(out))
print(out, quote=FALSE, right=TRUE)
if (print.seqlengths) {
cat(margin, "---\n", sep="")
Expand Down
2 changes: 1 addition & 1 deletion R/GappedAlignments-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ showGappedAlignments <- function(x, margin="",
out <- rbind(classinfo, out)
}
if (nrow(out) != 0L)
rownames(out) <- paste(margin, rownames(out), sep="")
rownames(out) <- paste0(margin, rownames(out))
print(out, quote=FALSE, right=TRUE)
if (print.seqlengths) {
cat(margin, "---\n", sep="")
Expand Down
6 changes: 3 additions & 3 deletions R/GenomicRanges-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ setMethod("elementMetadata", "GenomicRanges",
!identical(levels(runValue(strand(x))), levels(strand())))
{
msg <- c("'strand' should be a 'factor' Rle with levels c(",
paste('"', levels(strand()), '"', sep="", collapse=", "),
paste0('"', levels(strand()), '"', collapse=", "),
")")
return(paste(msg, collapse=""))
}
Expand All @@ -134,7 +134,7 @@ INVALID.GR.COLNAMES <- c("seqnames", "ranges", "strand",
{
if (any(INVALID.GR.COLNAMES %in% colnames(elementMetadata(x)))) {
msg <- c("slot 'elementMetadata' cannot use",
paste("\"", INVALID.GR.COLNAMES, "\"", sep="", collapse=", "),
paste0("\"", INVALID.GR.COLNAMES, "\"", collapse=", "),
"as column names")
return(paste(msg, collapse=" "))
}
Expand Down Expand Up @@ -710,7 +710,7 @@ showGenomicRanges <- function(x, margin="",
out <- rbind(classinfo, out)
}
if (nrow(out) != 0L)
rownames(out) <- paste(margin, rownames(out), sep="")
rownames(out) <- paste0(margin, rownames(out))
print(out, quote=FALSE, right=TRUE)
if (print.seqlengths) {
cat(margin, "---\n", sep="")
Expand Down
2 changes: 1 addition & 1 deletion R/Seqinfo-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ showCompactDataFrame <- function(x, rownames.label="", left.margin="")
showme <- .showOutputAsCharacter(compactdf)
if (label_nchar != 0L)
substr(showme[1L], 1L, label_nchar) <- rownames.label
cat(paste(left.margin, showme, sep=""), sep="\n")
cat(paste0(left.margin, showme), sep="\n")
}

setMethod("show", "Seqinfo",
Expand Down
6 changes: 3 additions & 3 deletions R/constraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ suppressWarnings(
for (i in seq_len(nrow(signatures))) {
sig <- signatures[i, ]
sigString <- paste(names(sig),
paste("\"", sig, "\"", sep=""),
paste0('"', sig, '"'),
sep="=", collapse=", ")
if (verbose)
message("Calling \"checkConstraint\" method for\n",
" ", sigString)
method <- getMethod("checkConstraint", sig)
errors <- method(x, constraint)
if (length(errors) != 0L) {
errors <- paste("from \"checkConstraint\" method for c(",
sigString, "): ", errors, sep="")
errors <- paste0("from \"checkConstraint\" method for c(",
sigString, "): ", errors)
## If a constraint is not satisfied, we don't check the
## remaining constraints (so when implementing a constraint
## a developper can assume that the less specific constraints
Expand Down
10 changes: 5 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ makePrettyMatrixForCompactPrinting <- function(x, makeNakedMat.FUN)
} else if (lx == 0L) {
ans_rownames <- character(0)
} else {
ans_rownames <- paste("[", seq_len(lx), "]", sep="")
ans_rownames <- paste0("[", seq_len(lx), "]")
}
} else {
top_idx <- 1:9
Expand All @@ -34,9 +34,9 @@ makePrettyMatrixForCompactPrinting <- function(x, makeNakedMat.FUN)
if (!is.null(nms)) {
ans_rownames <- c(nms[top_idx], "...", nms[bottom_idx])
} else {
ans_rownames <- c(paste("[", top_idx, "]", sep=""),
ans_rownames <- c(paste0("[", top_idx, "]"),
"...",
paste("[", bottom_idx, "]", sep=""))
paste0("[", bottom_idx, "]"))
}
}
rownames(ans) <- format(ans_rownames, justify="right")
Expand All @@ -51,11 +51,11 @@ makeClassinfoRowForCompactPrinting <- function(x, col2class)
left_brackets <- right_brackets <- character(length(col2class))
left_brackets[!no_bracket] <- "<"
right_brackets[!no_bracket] <- ">"
ans <- paste(left_brackets, col2class, right_brackets, sep="")
ans <- paste0(left_brackets, col2class, right_brackets)
names(ans) <- ans_names
if (ncol(elementMetadata(x)) > 0L) {
tmp <- sapply(elementMetadata(x),
function(xx) paste("<", class(xx), ">", sep=""))
function(xx) paste0("<", class(xx), ">"))
ans <- c(ans, `|`="|", tmp)
}
matrix(ans, nrow=1L, dimnames=list("", names(ans)))
Expand Down

0 comments on commit 3c6595c

Please sign in to comment.