0
在下面的示例中是否有替代使用%in%dosetimes
子集doserows
?我想使用別的原因是因爲我在我正在開發的R軟件包示例中添加了此部分,並且似乎不接受示例代碼中的%in%
!子集數據使用%替換%
#Set dose records:
dosetimes <- c(0,12)
#set number of subjects
ID <- 1:2
#Make dataframe: CLCR: is creatinine clearance
df <- expand.grid("ID"=ID,"TIME"=sort(unique(c(seq(0,24,1),dosetimes))),"AMT"=0,"DV"=NA)
doserows <- subset(df, TIME%in%dosetimes)