R Codes For Planar Structures