Learn R Programming

vvmover (version 1.6.0)

add_current_datetime_column: Add current date and time to data frame.

Description

This function adds a new column to a data frame with the current date and time. The name of the new column is a combination of the provided prefix, stage, and "Date_time". If the new column already exists, it will be overwritten.

Usage

add_current_datetime_column(data)

Value

Data frame with an additional column containing the current date and time.

Arguments

data

Data frame.

Examples

Run this code
if (FALSE) {
# Create a sample data frame
data <- data.frame(a = 1:5, b = letters[1:5])

# Add date to file name
add_current_datetime_column(data)
}

Run the code above in your browser using DataLab