Sri krishna Devarayalu Balanagu
2012-Jan-21 12:10 UTC
[R] error in data.frame(...., check.names = FALSE)
Hi all, Error is coming as "error in data.frame(...., check.names = FALSE): arguments has differents counts of rows: 0, 18" for the following code. Can you please help? Thank you Devarayalu library(ggplot2) setwd("D:\\General Check list") library(RODBC) conn <- odbcConnectExcel ("Book1.xls") Orange1 <- sqlFetch (conn, "Sheet2") odbcClose(conn) rm(conn) unique(Orange1$BSCHSTAT) -> change pdf("xxx.pdf") for (j in 1:length(change)){ ((Orange1$BASCHGAUT == "8-item scale")&(Orange1$BSCHSTAT == change[j])) -> b FD <- Orange1[b, ] unique(FD$REFID) -> refid for (i in refid) { Orange2 <- FD[i == Orange1$REFID, ] Orange2$ACTTRT<- factor(Orange2$ACTTRT) unique(Orange2$BSCHSTAT) -> x y <- paste("REFID=", i,"; ", "BSCHSTAT=", x, sep="") print(qplot(TIME1, BASCHGA, data=Orange2, geom= c("line", "point"), colour= factor(ACTTRT), main=y)) } } dev.off() [[alternative HTML version deleted]]
Hi> > Error in data.frame(...., check.names = FALSE) > > Hi Petr, > > I have added for loop for previous code. Some error is coming as ?error> in data.frame(...., check.names = FALSE): arguments has different counts> of rows: 0, 18? for the following code. > > Can you please help?Probably not. I do not have any data, I do not know where in your code is the error located, and I am can not repeat such error and I do not have intimate knowledge of R internals to evaluate from what operation such error can result. I recommend you to check your objects by str(object) Regards Petr> Thank you > Devarayalu > > library(ggplot2) > setwd("D:\\General Check list") > library(RODBC) > conn <- odbcConnectExcel ("Book1.xls") > Orange1 <- sqlFetch (conn, "Sheet2") > odbcClose(conn) > rm(conn) > > unique(Orange1$BSCHSTAT) -> change > pdf("xxx.pdf") > for (j in 1:length(change)){ > ((Orange1$BASCHGAUT == "8-item scale")&(Orange1$BSCHSTAT == change[j]))-> b> FD <- Orange1[b, ] > unique(FD$REFID) -> refid > for (i in refid) > { > Orange2 <- FD[i == Orange1$REFID, ] > Orange2$ACTTRT<- factor(Orange2$ACTTRT) > unique(Orange2$BSCHSTAT) -> x > y <- paste("REFID=", i,"; ", "BSCHSTAT=", x, sep="") > print(qplot(TIME1, BASCHGA, data=Orange2, geom= c("line", "point"), > colour= factor(ACTTRT), main=y)) > } > } > dev.off() >