At first you need to install "agricolae" package in R software. After loading the agricolae package you can copy and paste the statements available in the attached file. This stability analysis has been done for 7 genotypes over 6 locations.
I think the following pdf file will help you very much.