Поделиться через


rxSetInfo: Set info such as a description

Description

Set .xdf file or data frame information, such as a description

Usage

  rxSetInfo(data, description = "")
  rxSetInfoXdf(file, description = "")

Arguments

data

An .xdf file name, an RxXdfData object, or a data frame.

file

An .xdf file name or an RxXdfData object

description

character string containing the file or data frame description

Value

An RxXdfData object representing the .xdf file, or a new data frame with the .rxDescription attribute set to the specified description.

See Also

rxGetInfo.

Examples



 # Create a sample data frame and .xdf file
 outFile <- tempfile(pattern= ".rxTempFile", fileext = ".xdf")
 if (file.exists(outFile)) file.remove(outFile)

 origData <- data.frame(x=1:10)
 rxDataStep(inData = origData, outFile = outFile, rowsPerRead = 5)

 # Set a description in the data file
 myDescription <- "Hello Data File!"
 rxSetInfo( data = outFile, description = myDescription)
 rxGetInfo(outFile)

 # Read a data frame out of the output file    
 myData <- rxDataStep(outFile )
 # Look at its attribute
 attr(myData, ".rxDescription")    

 file.remove(outFile)

 myNewDescription = "Good-by data."
 myData <- rxSetInfo(data=myData, description = myNewDescription)
 rxGetInfo(myData)