I am not sure exactly what errors you are getting, but here are some comments.
It is good practice to initialize a vector to the total length that you will
require instead of changing the dimension each time you substitute a value. I.e.
use something like
deter <- rep(NA, length(true.dose) )
instead of deter = c().
Do not put the source() statements inside the loop except when values in them
change after each iteration.
You need to close the bracket, i.e. ), as in
for (i in 1:length(true.dose))
You are sure that PFIM() only uses its defaults? I am not familiar with the
function so I can't comment on its use.
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at
r-project.org]
> On Behalf Of Naser Jamil
> Sent: Sunday, October 14, 2012 15:19
> To: r-help at r-project.org
> Subject: [R] PFIM 3.2
>
> Dear R-user,
> I'm having some difficulty with working PFIM 3.2, a package for
implementing
> population PK/PD in R. I wish to evaluate the determinant of Fisher
> information matrix each time with successive dose from a pre defined
> sequence of doses and want to store those values in a vector. It's
important
> to note that in my 'stdin.r' file, dose<-c(u) and each time u is
to be replaced
> as I said. I think a quick look on the following R codes will give a more
clearer
> picture of the objective:
>
>
----------------------------------------------------------------------------------------------
> ---------
>
> directory<-"F:\\PFIM3.2_examples\\experiment" # working
directory
>
directory.program<-"F:\\PFIM3.2.2\\PFIM3.2.2\\PFIM3.2.2\\Program"
#
> program directory
>
> true.dose<-seq(0,10,0.5) # predefined sequence of doses
> deter=c() # to store determinant values
> for (i in 1:length(true.dose) {
> u<-true.dose[i]
>
source("F:\\PFIM3.2.2\\PFIM3.2.2\\PFIM3.2.2\\Program\\LibraryPK.r")
> source("F:\\PFIM3.2_examples\\experiment\\model.r")
> source("F:\\PFIM3.2_examples\\experiment\\stdin.r")
> source("F:\\PFIM3.2_examples\\experiment\\PFIM3.2.r")
> res<-PFIM()
> deter[i]<-res$determinant
> }
>
>
----------------------------------------------------------------------------------------------
> -------------
>
> But it's not working anyway and of course showing some error messages.
>
> I have attached the the associated files.
>
> Any suggestion in this regard will help me a lot.
>
>
> Thank you very much for the patience!
>
>
> Regards,
>
> Jamil.