R Programming hw assignement