1. A method of transmitting a physical sidelink shared channel (PSSCH) by a device-to-device (D2D) user equipment (UE) in a wireless communication system, the method comprising:receiving a physical sidelink control channel (PSCCH) and the PSSCH which is transmitted in a resource area indicated by the PSCCH;
selecting a transmission resource after excluding the resource area in which the PSSCH has been transmitted, based on a measurement value of energy of the PSSCH being larger than a predetermined threshold; and
transmitting a D2D signal based on the selected transmission resource,
wherein the threshold has a different value based on at least one of the PSSCH being a retransmission or a redundancy version (RV) of the PSSCH, or whether the PSCCH and the PSSCH are received in a same subframe, and
wherein a threshold related to the PSSCH of an initial transmission is smaller than a threshold related to the PSSCH of a retransmission.