Behavioural data from publication: Winters, A.E., Green, N.F., Wilson, N.G, How, M.J., Garson, M.J., Marshall, N.J., Cheney, K.L. 2017. Stabilizing selection on individual pattern elements of aposematic signals. Proceedings of the Royal Society B. In Press. The data contained in these files were collected during behavioural experiments testing learning and generalisation of warning signals in reef fish, Rhinecanthus aculeatus, in aquaria at the University of Queensland or at Lizard Island Research Station. Data were entered into excel, and analysed using R version 3.1.3. Experiments 1a and 1b: learning experiments analysed using a survival analysis. The file ‘final survival analysis r script.xlsx and final survival analysis.R give the R script for the survival analysis used to analysis two learning experiments 1a and 1b. Terms red : Group B (a stimuli featuring a red spot and no yellow rim). border: Group C (a stimuli featuring just a yellow rim) redyellow : Group A and D combined ( a stimuli featuring a red spot and yellow rim) redyellowfirst: Group A (experiment 1a) redyellowfirst: Group D (experiment 1b) Three separate data files are associated with these analyses: 1) ‘red spot versus red spot with yellow border old and new data combined.csv ‘. Gives the pairwise data for analysis of the stimuli for Group B: a red spot stimuli compared with Group A and D combined. 2) ‘first exp red yellow vs second exp red yellow.csv ‘. Gives the pairwise data for analysis of Group A and D. 3) ‘border vs border and spot.csv’. Gives the pairwise data for analysis of Group C compared with Group A and D combined. Experiment 2: Generalisation experiment This data in file ‘generalisation two ties twelth Nov.csv’ were analysed using the GenDavidson formula in the Davidson model of the Bradley-Terry package in R. Terms Redspots: S- stimuli featuring five small, red internal spots (no yellow rim) Yelbord: S- stimuli featuring a yellow rim (no red spots) Yelbordredspots: a S- stimuli featuring a yellow rim and five small, red spots. Outcome: whether the stimuli in the column ‘Player A’ was: 1: chosen two out of two trials -1: not chose at all, 0 out of 2 trials 0: chosen once out of two trials. The first half of the R script gives the analysis and statistical significance. The second half converts the BT coefficients to ‘Preference Indices’ (‘probs’) similar to probabilities, and standard error (‘ses’), to allow results to plotted graphically as a likelihood of being chosen.