A unified framework for input-output operations in R