Displaying 1 result from an estimated 1 matches for "mydosequivalents".
2011 Sep 28
1
number of items to replace is not a multiple of replacement length
...in the n+16 th column on in the same row of drugbook.
Not all of the grabbed names from Drugbook will be in the dataframe Equivs,
though. So sometimes the == will return a null.
i.e. DrugDose16 is the dose of Drug 16
this I think should work: ( I did try apply and got knotted, so stopped)
>mydosequivalents=list()
>for( c in 1:16) {
for (r in 1:885){
name<-as.character(drugbook[r,c]);
equivalent<-Equivs$Equiv[Equivs$Name==name];
dosequivalent<-drugbook[r,c+16] * equivalent;
if (length(dosequivalent)>0) mydosequivalents[r][c]<-dosequivalent
else (mydosequivalents...