Learn R Programming

FREddyPro (version 1.0)

createTimestamp: Create a time stamp

Description

It creates a new timestam colume using the date and time output of EddyPro. It then converts the column to a POSIXct class and extracts to separate columns the year, month, day and hour. It requires the lubridate package.

Usage

createTimestamp(data, timestamp = NULL)

Arguments

data
The data frame
timestamp
A character giving the name of the timestamp column

Details

For the function to work properly, two columns need to exist. The data and time, each one with a specific format. The date column should be formated as YYYY-MM-DD and the time as HH:MM. The functions can be used with an existing timestamp column too and that should be formated as YYYY-MM-DD HH:MM:SS.

Examples

Run this code
##Load the data
data(fluxes)

## Create the time stamp
fluxes=createTimestamp(fluxes)

Run the code above in your browser using DataLab