Skip to content

Commit

Permalink
Namespacing for "base" packages
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Aug 26, 2015
1 parent b651b61 commit 1c30691
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ importFrom(parallel,makeForkCluster)
importFrom(parallel,makePSOCKcluster)
importFrom(parallel,stopCluster)
importFrom(stats,lag)
importFrom(stats,setNames)
importFrom(stats,update)
importFrom(utils,head)
importFrom(utils,tail)
useDynLib(dplyr)
2 changes: 1 addition & 1 deletion R/data-lahman.r
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ copy_lahman <- function(src, ...) {
}
# Get list of all non-label data frames in package
lahman_tables <- function() {
tables <- data(package = "Lahman")$results[, 3]
tables <- utils::data(package = "Lahman")$results[, 3]
tables[!grepl("Labels", tables)]
}

Expand Down
2 changes: 1 addition & 1 deletion R/data-nycflights13.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ nycflights13_postgres <- function(dbname = "nycflights13", ...) {
#' @export
#' @rdname nycflights13
copy_nycflights13 <- function(src, ...) {
all <- data(package = "nycflights13")$results[, 3]
all <- utils::data(package = "nycflights13")$results[, 3]
index <- list(
airlines = list("carrier"),
airports = list("faa"),
Expand Down
1 change: 1 addition & 0 deletions R/dplyr.r
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
#' @import assertthat
#' @importFrom utils head tail
#' @importFrom Rcpp cppFunction Rcpp.plugin.maker
#' @importFrom stats setNames update
NULL
2 changes: 1 addition & 1 deletion R/progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ cat_line <- function(...) {
msg <- paste(..., sep = "", collapse = "")
gap <- max(c(0, getOption("width") - nchar(msg, "width")))
cat("\r", msg, rep.int(" ", gap), sep = "")
flush.console()
utils::flush.console()
}

str_rep <- function(x, i) {
Expand Down
2 changes: 1 addition & 1 deletion R/src-local.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ src_local <- function(tbl, pkg = NULL, env = NULL) {
env <- getNamespaceInfo(pkg, "lazydata")
name <- paste0("<package: ", pkg, ">")
} else {
name <- capture.output(print(env))
name <- utils::capture.output(print(env))
}

structure(
Expand Down
4 changes: 2 additions & 2 deletions R/src-mysql.r
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ db_commit.MySQLConnection <- function(con, ...) {
db_explain.MySQLConnection <- function(con, sql, ...) {
exsql <- build_sql("EXPLAIN ", sql, con = con)
expl <- dbGetQuery(con, exsql)
out <- capture.output(print(expl))
out <- utils::capture.output(print(expl))

paste(out, collapse = "\n")
}
Expand All @@ -199,7 +199,7 @@ db_insert_into.MySQLConnection <- function(con, table, values, ...) {
values[is_char] <- lapply(values[is_char], encodeString)

tmp <- tempfile(fileext = ".csv")
write.table(values, tmp, sep = "\t", quote = FALSE, qmethod = "escape",
utils::write.table(values, tmp, sep = "\t", quote = FALSE, qmethod = "escape",
row.names = FALSE, col.names = FALSE)

sql <- build_sql("LOAD DATA LOCAL INFILE ", encodeString(tmp), " INTO TABLE ",
Expand Down
2 changes: 1 addition & 1 deletion R/src-sqlite.r
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ db_explain.SQLiteConnection <- function(con, sql, ...) {
exsql <- build_sql("EXPLAIN QUERY PLAN ", sql)
expl <- DBI::dbGetQuery(con, exsql)
rownames(expl) <- NULL
out <- capture.output(print(expl))
out <- utils::capture.output(print(expl))

paste(out, collapse = "\n")
}
Expand Down
2 changes: 1 addition & 1 deletion R/tbl-cube.r
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ as.tbl_cube.array <- function(x, met_name = deparse(substitute(x)),
force(met_name)

dims <- dimnames(x)
dims <- lapply(dims, type.convert, as.is = TRUE)
dims <- lapply(dims, utils::type.convert, as.is = TRUE)

if (is.table(x)) {
class(x) <- setdiff(class(x), "table")
Expand Down
4 changes: 2 additions & 2 deletions R/utils-format.r
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ obj_type.default <- function(x) {
} else if (!isS4(x)) {
paste0("<S3:", paste0(class(x), collapse = ", "), ">")
} else {
paste0("<S4:", paste0(is(x), collapse = ", "), ">")
paste0("<S4:", paste0(methods::is(x), collapse = ", "), ">")
}
}

Expand All @@ -184,7 +184,7 @@ obj_type.data_frame <- function(x) {

# function for the thousand separator,
# returns "," unless it's used for the decimal point, in which case returns "."
big_mark <- function(x, ...) {
big_mark <- function(x, ...) {
mark <- if (identical(getOption("OutDec"), ",")) "." else ","
formatC(x, big.mark = mark, ...)
}

0 comments on commit 1c30691

Please sign in to comment.