Javascript Get Set Function In R