Typescript Function Command In R