$运算符对HH R中的原子向量无效

时间:2012-04-12 05:20:07

标签: r rscript

我正在尝试生成此图表。 Using this package

以下是数据文件
         RAND,PREF,SEA,SN

Cummulative,Q1,68,1238
Current,Q1,67,1243
Cummulative,Q2,70,1238
Current,Q2,69,1243
Cummulative,Q3,75,1238
Current,Q3,75,1243
Cummulative,Q4,78,1238
Current,Q4,81,1243
Cummulative,Q5,71,1238
Current,Q5,68,1243
Cummulative,Q6,77,1238
Current,Q6,76,1243
Cummulative,Q7,78,1238
Current,Q7,80,1243
Cummulative,Q8,78,1238
Current,Q8,81,1243
Cummulative,Q9,69,1238
Current,Q9,68,1243
Cummulative,Q10,69,1238
Current,Q10,68,1243
Cummulative,Q11,73,1238
Current,Q11,74,1243
Cummulative,Q12,77,1238
Current,Q12,79,1243
Cummulative,Q13,74,1238
Current,Q13,73,1243
Cummulative,Q14,76,1238
Current,Q14,75,1243
Cummulative,Q15,71,1238
Current,Q15,72,1243
Cummulative,Q16,63,1238
Current,Q16,67,1243
Cummulative,Q17,71,1238
Current,Q17,70,1243

代码:

eqdata <- read.table(datafile , header = T,sep=",")
#eqdata <- as.data.frame(eqdata)
eqdata1 <- hh(eqdata)

aed <- logrelrisk(eqdata1)

p <- ae.dotplot(aed, A.name="TREATMENT A (N=216)",B.name="TREATMENT B (N=431)")

输出: ae $ SAE出错:$运算符对原子向量无效 电话:logrelrisk

任何帮助非常感谢。

1 个答案:

答案 0 :(得分:0)

剪切eqdata1 <- hh(eqdata)行。从?hh文档中,此函数仅返回指定文件的路径,因此不是data.frame所需的logrelrisk()

eqdata <- read.table(datafile , header = T,sep=",")
#eqdata <- as.data.frame(eqdata)
# eqdata1 <- hh(eqdata)

aed <- logrelrisk(eqdata)

p <- ae.dotplot(aed, A.name="TREATMENT A (N=216)",B.name="TREATMENT B (N=431)")