How to build SAS type custom formats in R?



Hi all,
My requirement is to build SAS style custom formats in R, did some googling but was not able to come up with anything. I have a dataset with 4 columns. I need to build 3 custom formats. Based on the value read from column4 and type of custom format specified i will display either value from column1 ,2 or 3. Is there a package or some function that can assist me with this task? Thanks