R maxpolys