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
if (any(idx<- lengths(.SDcols) >1L| vapply_1c(.SDcols, typeof) !='logical'| vapply_1b(.SDcols, anyNA)))
1063
-
stopf("When .SDcols is a function, it is applied to each column; the output of this function must be a non-missing boolean scalar signalling inclusion/exclusion of the column. However, these conditions were not met for: %s", brackify(names(x)[idx]))
if (any(idx<- lengths(.SDcols) >1L| vapply_1c(.SDcols, typeof) !='logical'| vapply_1b(.SDcols, anyNA)))
1086
+
stopf("When .SDcols is a function, it is applied to each column; the output of this function must be a non-missing boolean scalar signalling inclusion/exclusion of the column. However, these conditions were not met for: %s", brackify(names(x)[idx]))
1087
+
.SDcols= unlist(.SDcols, use.names=FALSE)
1088
+
}
1065
1089
}
1066
1090
}
1067
-
}
1068
-
if (anyNA(.SDcols))
1069
-
stopf(".SDcols missing at the following indices: %s", brackify(which(is.na(.SDcols))))
1070
-
if (is.logical(.SDcols)) {
1071
-
if (length(.SDcols)!=length(x)) stopf(".SDcols is a logical vector of length %d but there are %d columns", length(.SDcols), length(x))
1072
-
ansvals= which_(.SDcols, !negate_sdcols)
1073
-
ansvars=sdvars=names_x[ansvals]
1074
-
} elseif (is.numeric(.SDcols)) {
1075
-
.SDcols= as.integer(.SDcols)
1076
-
#if .SDcolsis numeric, use 'dupdiff' instead of 'setdiff'
1077
-
if (length(unique(sign(.SDcols))) >1L) stopf(".SDcols is numeric but has both +ve and -ve indices")
1078
-
if (any(idx<- abs(.SDcols)>ncol(x)| abs(.SDcols)<1L))
1079
-
stopf(".SDcols is numeric but out of bounds [1, %d] at: %s", ncol(x), brackify(which(idx)))
0 commit comments