change_COLSRC: Change COLSRC date and time stamp

View source: R/reflections.R

change_COLSRCR Documentation

Change COLSRC date and time stamp

Description

Function to update the created column of the data frame COLSRC with current date and time.

Usage

change_COLSRC(hdr)

Arguments

hdr

A data frame. The COLSRC data frame included in the header component of the named list obtained with readMTZ or readMTZHeader.

Details

The COLSRC data frame of an MTZ header has a column called created which displays the date and time at which the MTZ file data columns were created. When writing out a modified list obtained from reading an MTZ file, one might want to change the created column with the current date and time. Other specific types of change can be operated by handling the COLSRC data frame in an *ad hoc* manner.

Value

The hdr input data frame with the created column of the COLSRC data frame changed to display the current date and time.

Examples

# Read a sample MTZ file
datadir <- system.file("extdata",package="cry")
filename <- file.path(datadir,"1dei_phases.mtz")
lMTZ <- readMTZ(filename)

# Original COLSRC
print(lMTZ$header$COLSRC)

# Update date and time stamp
lMTZ$header <- change_COLSRC(lMTZ$header)

# New COLSRC
print(lMTZ$header$COLSRC)


cry documentation built on Oct. 10, 2022, 9:06 a.m.