You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
origListNames=if (missing(.named)) names(x) elseNULL# as.data.table called directly, not from inside data.table() which provides .named, #3854
135
135
empty_atomic=FALSE
136
-
137
-
#Handle keep.rownames for vectors (mimicking data.frame behavior)
136
+
# Handle keep.rownames for vectors (mimicking data.frame behavior)
138
137
vector_rownames=NULL
139
-
if (!isFALSE(keep.rownames)) {
140
-
for (iin seq_len(n)) {
141
-
xi=x[[i]]
142
-
if (!is.null(xi) && is.atomic(xi) &&!is.null(names(xi)) && is.null(dim(xi))) {
143
-
valid_names= names(xi)
144
-
if (any(nzchar(valid_names))) {
145
-
vector_rownames=valid_names
146
-
x[[i]] = unname(xi)
147
-
break
148
-
}
149
-
}
150
-
}
151
-
}
138
+
check_rownames=!isFALSE(keep.rownames)
152
139
for (iin seq_len(n)) {
153
140
xi=x[[i]]
154
141
if (is.null(xi)) next# eachncol already initialized to 0 by integer() above
142
+
if (check_rownames&& is.null(vector_rownames) &&!is.null(xi) && is.atomic(xi) &&!is.null(names(xi)) && is.null(dim(xi))) {
143
+
valid_names= names(xi)
144
+
if (any(nzchar(valid_names))) {
145
+
vector_rownames=valid_names
146
+
x[[i]] = unname(xi)
147
+
}
148
+
}
155
149
if (!is.null(dim(xi)) &&missing.check.names) check.names=TRUE
156
150
if ("POSIXlt" %chin% class(xi)) {
157
151
warningf("POSIXlt column type detected and converted to POSIXct. We do not recommend use of POSIXlt at all because it uses 40 bytes to store one date.")
0 commit comments