Depending on the flooring under the carpet. I would have the carpet taken out of the closet area first. That way if you do decide to change the carpet in the room later on you don't have to worry about the carpet in the closet. Just make that hard wood or whatever.