index.dataframe: R Utilities: Include an Index to a Data Frame

Description Usage Arguments Author(s) Examples

View source: R/index.dataframe.R

Description

This function includes an index variable to a data frame in the first column.

Usage

1

Arguments

data

Data frame

systime

Should system time be included in the second column of the data frame?

Author(s)

Alexander Robitzsch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
dfr <- matrix( 2*1:12-3 , 4 ,3 )
colnames(dfr) <- paste0("X",1:ncol(dfr))
index.dataframe( dfr)
  ##     index X1 X2 X3
  ##   1     1 -1  7 15
  ##   2     2  1  9 17
  ##   3     3  3 11 19
  ##   4     4  5 13 21
index.dataframe( dfr , systime=TRUE)
  ##     index         file_created X1 X2 X3
  ##   1     1  2013-08-22 10:26:28 -1  7 15
  ##   2     2  2013-08-22 10:26:28  1  9 17
  ##   3     3  2013-08-22 10:26:28  3 11 19
  ##   4     4  2013-08-22 10:26:28  5 13 21

miceadds documentation built on Aug. 9, 2017, 5:04 p.m.