According to NY landlord-tenant information provided by the NY Attorney General's Office:
Quote Quoting Tenants' Right to Privacy
Tenants have the right to privacy within their apartments. A landlord, however, may enter a tenant's apartment with reasonable prior notice, and at a reasonable time: (a) to provide necessary or agreed upon repairs or services; or (b) in accordance with the lease; or (c) to show the apartment to prospective purchasers or tenants. In emergencies, such as fires, the landlord may enter the apartment without the tenant's consent. A landlord may not abuse this limited right of entry or use it to harass a tenant. A landlord may not interfere with the installation of cable television facilities.
The landlord cannot compel you to be absent during showings, and obviously there are good reasons why a tenant would want to be present.