A method for identifying R waves in an ECG signal is proposed. An ECG measuring instrument measures ECG signals of a patient in which R waves are to be detected. The measured ECG signals are compared with respective reference quantities based on at least two comparison rules. The second comparison rule is dependent on a result of a first comparison conducted according to a first comparison rule. A signal that an R wave has been detected is issued if the first and the second comparison rules are fulfilled. Making the second comparison rule dependent on the result of the first comparison rule enables an adept response to changes of measurement conditions. These changes can be taken into account in further comparisons. Therefore the detection of R waves in an ECG signal can be optimized, leading to an improvement in the image quality in ECG-triggered MR examinations.