R functions that create the various connection types may accept different arguments and have slightly different initialization steps. However, the life cycle of an R connection is fairly consistent across connections types. Many R functions operate on connections in one stage or another (usually in the Initialization stage, or between Initialization and Finalization) see R Functions for a partial listing. Many of these functions ultimately result in a call to one of the I/O methods set in a
struct Rconn. In this manner, data is passed to and from the connection and the R program, possibly undergoing some useful transformation, such as text re-encoding. Without loss of generality, the following discussion considers the life cycle of a file connection.