People with weakened immune systems because of disease or certain types of treatment can have a higher risk of skin cancer.