I don't understand the cbind(bi) sintax, but you can do this with the folowing: (Using iris data from R)
form <- formula(paste(paste(names(iris), collapse = " + "), "~ 1")) 2009/9/8 "Biedermann, Jürgen" <juergen.biederm...@charite.de> > Hi there, > > I have the following problem: > > I have a package called "polLCA" which has the following syntax: > > poLCA(formula, data) > > and needs the following formula definition: > > formula <- cbind(V1,V2,V3,...) > > So far so good. > > What I tried now was the following: > #Get "data" with the "read.table" fuction > data <- read.table("d:/ .....) > #Select cols to use in the analysis > aktDat <- data[2:15] > #get the names > names(aktDat) > #put them together in one string, comma as separation sign > bi <- paste(names(aktDat),collapse=",") > #use this string in the "f" function to bind the variables > formula <- cbind(bi)~1 > #Calculate the modell > poLCA(formula, data) > > but this doesn't work: I get the following error message: > > "Warnung in model.matrix.default(formula, mframe) : > variable 'cbind(bi)' converted to a factor" > > Could anyone help me? > Thanks > > Greetings > Jürgen > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.