<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Dear All- I am having difficulty troubleshooting the following rowSums(bd) error on running DataCheck, and would be extremely grateful for any solutions or suggestions you might have.
<div><br>
<div>for dates I am using the format yyyy-mm-dd and have 1420 observations across each of my three input matrices (observation dates, births and deaths, covariates).</div>
<div>
<div><br>
</div>
<div>when I run inputMat <- as.data.frame (see below) the individual sample names, 1501c1 etc, are not removed from the matrix.</div>
<div><br>
</div>
<div>If I alternatively run the merge commands</div>
<div>
<div>inputMat <- merge(birthDeath, Y, by.x = "ID", by.y = "ID")</div>
<div>inputMat <- merge(inputMat, covMat, by.x = "ID", by.y = "ID")</div>
<div>the individual sample names are removed in the merged matrix, but the same rowSums error is returned on running DataCheck.</div>
<div><br>
</div>
<div>I would be exceedingly appreciative of your help solving this one....</div>
<div><br>
</div>
<div>with thanks and</div>
<div>best regards,</div>
<div>Caroline.<br>
<div><br>
</div>
<div>
<div>cv <- read.delim("~/fixed_ROBSDATESuse3.csv", sep=",", header=T)</div>
<div>rd <- cv$ROBSDATES</div>
<div>class(rd)</div>
<div>sum(is.na(cv))</div>
<div>rd<-as.Date(rd)</div>
<div>Y <- CensusToCaptHist(ID = cv[,1], d=rd, timeInt="D")</div>
<div>head(Y)</div>
<div> birthDeath <- read.delim("~/fixed_birthdeath.csv", sep=",", header=T)</div>
<div>head(birthDeath)</div>
<div>covar <- read.delim("~/fixed_covars.csv", sep=",", header=T)</div>
<div>covMat <- MakeCovMat(x=c("CLADE"), data = covar)</div>
<div>inputMat <- as.data.frame(cbind(birthDeath, Y[, -1], covMat[, -1]))</div>
<div>DataCheck(inputMat, studyStart = 1, studyEnd = 109, autofix = rep(1, 7), silent=FALSE)</div>
<div>
<div>
<div style="word-wrap: break-word; ">
<div><b>Error in rowSums(bd) : 'x' must be numeric</b></div>
<div><b><br>
</b></div>
<div><b><br>
</b></div>
</div>
</div>
</div>
<div>
<div>> head(inputMat)</div>
<div>        ID realROBSBIRTH realSENDEATH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47</div>
<div>1501c1   1             0   2012-09-19 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>1501c2   2             0   2012-09-19 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>1501c3   3             0            0 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>1501n1   4    2012-07-14            0 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>1501n10 13    2012-07-14            0 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>1501n11 14    2012-07-14            0 1 0</div>
</div>
<div>
<div><br>
</div>
</div>
<div>> inputMat <- merge(birthDeath, Y, by.x = "ID", by.y = "ID")</div>
<div>> inputMat <- merge(inputMat, covMat, by.x = "ID", by.y = "ID")</div>
<div>> print(inputMat)</div>
<div>       ID realROBSBIRTH realSENDEATH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47</div>
<div>1       1             0   2012-09-19 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>2       2             0   2012-09-19 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>3       3             0            0 1 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0</div>
<div>4       4    2012-07-14            0 1 0 0 0 0</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>