Piccone, Jason E.
2005-Jun-15 17:15 UTC
[R] cannot coerce class "matchit" into a data.frame"
Greetings fellow humans, I am attempting to export a text file after using the MatchIt package to match control with treatment subjects. I attempted to write.table and used the following syntax: "write.table(social,"shaka.txt",sep=" ",quote=FALSE,row.names=FALSE,col.names= FALSE)" But received the following error message: "Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class "matchit" into a data.frame" I thought that maybe I had to convert to a data frame, and tinkered with data.frame, as.data.frame, and is.data.frame, but this didn't work (although I could had done it improperly). Please pardon my novice R skills. Any guidance will be greatly appreciated. Cheers, Jason E. Piccone, Ph.D. Research and Evaluation Specialist Department of Correctional Education
Piccone, Jason E. wrote:> Greetings fellow humans, > > I am attempting to export a text file after using the MatchIt package to match control with treatment subjects. I attempted to write.table and used the following syntax: > > "write.table(social,"shaka.txt",sep=" ",quote=FALSE,row.names=FALSE,col.names= FALSE)" > > But received the following error message: > "Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class "matchit" into a data.frame" > > I thought that maybe I had to convert to a data frame, and tinkered with data.frame, as.data.frame, and is.data.frame, but this didn't work (although I could had done it improperly). Please pardon my novice R skills. > > Any guidance will be greatly appreciated."MatchIt" is a special package, so you might have to contact the author / maintainer directly. [You can save() a MatchIt object, of course, and load() it afterwards, if this is sufficient.] Uwe Ligges> Cheers, > > > Jason E. Piccone, Ph.D. > Research and Evaluation Specialist > Department of Correctional Education > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html