Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adjust comments

  • Loading branch information...
commit d965acfa6f0d91b22799ee9eb989cb26b6f4f7ea 1 parent 069e98a
@crowding crowding authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 R/rbind-fill.r
View
13 R/rbind-fill.r
@@ -84,18 +84,17 @@ output_template <- function(dfs, nrows) {
}
allocate_column <- function(example, nrows, dfs, var) {
- #Compute the attributes of the column and allocate.
- #To avoid multiple allocations, never _inspect_ column after allocating
- #it. Inspection, even something as innocuous as is.matrix(column),
- #will setting NAMED to 2 and forcing a copy on the
- #next modification.
+ #Compute the attributes of the column and allocate. Returns a
+ #mutator function f(rows, values) rather than the actual allocated
+ #column.
a <- attributes(example)
type <- typeof(example)
class <- a$class
handler <- type
isList <- is.recursive(example)
- #this statement may be altered below
+ #This statement is eval'ed to do assignments. It may be altered below
+ #to account for arrays.
assignment <- quote(column[rows] <<- what)
a$names <- NULL
@@ -115,7 +114,7 @@ allocate_column <- function(example, nrows, dfs, var) {
if (length(dims) > 1)
stop("Array variable ", var, " has inconsistent dims")
- # add empty args
+ # Adjust assignment statement
assignment[[2]] <- as.call(
c(as.list(assignment[[2]]),
rep(list(quote(expr = )), length(dims[[1]]))))
Please sign in to comment.
Something went wrong with that request. Please try again.