own R() implementation