A switch transfer packets without changing the content of the packets, and may change the transfe rate on each port. A router will remap the ip address information in the packets between internal ports and it's external port. A router will also assign ip addresses to all the devices connected to it's internal ports.
They work on the different layers.
The switch is the device used on data link layer which takes circuit identifier to determies the port that the packets are sent to.
The router is the network layer device which looks at IP address and decide where to forward the packet based on it.