What is the differenca between colnames(x[1]) and colnames(x)[1]?
===

i want to rename colnames in data.frame,

    > x=data.frame(name=c("n1","n2"),sex=c("F","M"))
    > colnames(x[1])="Name"
    > x
      name sex
    1   n1   F
    2   n2   M
    > colnames(x)[1]="Name"
    > x
      Name sex
    1   n1   F
    2   n2   M
    > 

why  colnames(x[1])="Name"  can't work?why  colnames(x)[1]="Name"  can?  
what is the reason?  
what is the difference betweent them?  

