R/index.dataframe.R

## File Name: index.dataframe.R
## File Version: 1.07


####################################################
# adds an index to a data frame
index.dataframe <- function (data, systime=FALSE)
{
    data <- as.data.frame(data)
    data$index <- NULL
    data$file_created <- NULL
    data1 <- data.frame(index=seq(1, nrow(data)))
    if (systime) {
        data1$file_created <- paste0(" ", substring(Sys.time(), 1, 20))
        }
    data1 <- cbind( data1, data )
    return(data1)
}
########################################################

Try the miceadds package in your browser

Any scripts or data that you put into this service are public.

miceadds documentation built on Jan. 7, 2023, 1:09 a.m.