Write data to an XDS_ASCII file.
writeXDS_ASCII.Rd
Function to write an XDS_ASCII-tye named list to a file with XDS_ASCII format (unmerged or merged).
Arguments
- proc_info
The first component of an XDS_ASCII-type object. It includes up to three components,
MERGE
,FRIEDEL
andPROFILE_FITTING
(this last component is missing for files with merged observations, obtained with the program XSCALE).- header
The second component of an XDS_ASCII-type object. This object includes several other objects (see
readXDS_ASCII
).- reflections
The third component of an XDS_ASCII-type object. It contains the data (the experimental observations). See
readXDS_ASCII
for more details.- filename
A character string. The path to a valid XDS_ASCII file. If a file with the same name exists, it will be deleted.
Value
This function does not return any R object. It outputs an XDS_ASCII reflection file to some target location.
Details
The XDS_ASCII-type named list includes three components,
processing_info
, header
and reflections
(see readXDS_ASCII
).
Examples
# Load one of the XDS ASCII files included with
# this distribution of cry
datadir <- system.file("extdata",package="cry")
filename <- file.path(datadir,"xds00_ascii.hkl")
lXDS <- readXDS_ASCII(filename)
# Change date
print(lXDS$header$DATE)
#> [1] "4-Jul-2014"
lXDS$header$DATE <- "7-Apr-2021"
# Write to a file called "new.hkl"
wd <- tempdir()
fname <- file.path(wd,"new.hkl")
writeXDS_ASCII(lXDS$processing_info,lXDS$header,
lXDS$reflections,fname)