Shift Column(s) in a Dataset
DESCRIPTION:
Shifts a column (or columns) in a 2-dimensional dataset.
USAGE:
shift.col(target, start.column, end.column, shift.count,
column.names=NULL)
REQUIRED ARGUMENTS:
- target
-
2-dimensional dataset in which the column(s) will be shifted.
- start.column
-
integer value specifying the first column of
target
which is to be shifted.
- end.column
-
integer value specifying the last column of
target
which is to be shifted.
- shift.count
-
integer value specifying the number of columns
start.column
through
end.column
will be shifted towards the last column of
target
.
OPTIONAL ARGUMENTS:
- column.names
-
character vector specifying the name(s) of the column(s) that will be created
by the shift. If not specified, default names will be generated.
VALUE:
The target dataset with the column(s) shifted. New column(s) will be created
between
start.column
and
start.column + shift.count - 1
, inclusive.
SEE ALSO:
,
,
,
,
,
.
EXAMPLES:
new.stats <- shift.col(auto.stats, 4, count.cols(auto.stats),
2, c("CO2 emissions", "EPA Fines"))