r - Error in `colnames<-`(`*tmp*`, value = "0") : attempt to set 'colnames' on an object with less than two dimensions -


i new r , having trouble error. data:

datekey horseno winner  draw    winodds age 65529   1   0   1   10.34   7 65529   2   0   6   22.15   7 65529   3   0   2   53.13   8 65529   5   0   8   9.71    4 65529   6   0   9   2.74    4 65529   7   1   12  9.92    5 65529   8   0   5   150.81  6 65529   9   0   4   6.58    4 65529   11  0   3   16.19   6 65529   12  0   10  61.64   4 65529   13  0   11  31.03   4 65529   14  0   7   919.51  7 65598   1   1   1   2.65    7 65598   2   0   2   8.62    7 65598   3   0   6   26.3    8 65598   5   0   7   7.58    4 65598   6   0   9   97.64   4 65598   7   0   5   271.17  5 65598   8   0   11  97.64   6 65598   9   0   3   13.96   4 65598   11  0   4   54.56   6 65598   12  0   8   6.34    4 65598   13  0   10  91.23   4 65598   14  0   12  18.74   7   > library(rodbc) > library(mlogit) > z<-odbcconnectexcel("c:\\users\\andrewc\\desktop\\test4.xls") > y<-sqlfetch(z,"sheet2") > x<-mlogit.data(y,choice="winner",shape="long",id.var="datekey",alt.var="horseno") > summary(mlogit(winner~winodds+age+draw-1,data=x)) error in `colnames<-`(`*tmp*`, value = "0") :    attempt set 'colnames' on object less 2 dimensions 

y<-sqlfetch(z,"sheet2") x<-mlogit.data(y,choice="winner",shape="long",id.var="datekey",alt.var="horseno")

from memory function wants x<-mlogit.data(data=y, etc etc) don't know how finicky is. needs y dataframe. happens when str(y)? importing data excel spreadsheets may require careful inspection in r in experience.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -