[R] converting data.frame into a numeric ( integer) form

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon Apr 18 18:22:39 CEST 2011



On 17.04.2011 19:29, Haillie wrote:
> Hi Everyone,
>
> I am relatively new to R and would appreciate your help on this problem that
> I encontered this morning.
> When running an ordinal IRT model using Ratings package on R, I keep getting
> this error message.
>
> ord.out<-ordrating(UNORD, burnin = 1000, mcmc = 40,000, thin = 400, tune =
> 1, verbose = 1000, seed = NA)
>
> Error in as.vector(as.integer(Y)) :
>    (list) object cannot be coerced to type 'integer'
>
> UNORD is my data.frame

... but ?ordrating tells you it must be a matrix rather than a data.frame.

Uwe Ligges


> and it is in the form of delimited CSV file without
> either row or column name.
> According to the help page on Ordinal ratings, Y should be "a Matrix of data
> to be analyzed. Entries must be integers from 1; : : : ;C or NA where C is
> the number of ordinal categories. Items are on the rows and subjects are on
> the columns." I am confused because my data.frame only contains numerica
> values of 1,2,3, and NA. I checked and my NAs were all numeric.
>
> Any help or advice you could provide on this issue would be greatly
> appreciated. Thank you very much.
> I would like to thank all the R experts navigating this forum in advance.
>
> Sincerely,
> Haillie
>
> --
> View this message in context: http://r.789695.n4.nabble.com/converting-data-frame-into-a-numeric-integer-form-tp3455811p3455811.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list