Hi,
I am trying to convert the simulation object output to a data frame using DataFrame() function but I am receiving the following error ERROR: DimensionMismatch(“array could not be broadcast to match destination”)
I would like to know how to interpret this error
Yes I have a time varying covariate. It seems that there was a bug when there is time varying covariate (from a previous post) and It should have been resolved in the next release of Pumas
I have a PK dataset with the standard dosing and observations records such as: id, time, amt, conc, evid, cmt. My amt column is in mg. I am trying to create another amt column called amt_in_ug = amt * 1000. However, I get errors most likely because several amt rows are missing. how to handle such mathematical operations with columns with missing rows? This is a very frequent data formatting maneuver and unfortunately I could not find any info when I searched in google for julia code. The first link was to this Missing Values · The Julia Language but I could not find any answer to my a question similar to mine. Thank you.
Bob
This looks like a new syntax from what I learned from the tutorials? @rtransform pkdata @passmissing :amt_Bool=convert(Bool, :amt)
pkdata[!,:amt_in_ug] = pkdata.amt_Bool .* 1000
I am not sure what is your data formatting, syntax you use and the error you get but assuming the following example you should get the new column like this:
@ahmed.salem thank you. I think I had a problem with ‘.’ (forgot to include).
However, the syntax that is provided in the tutorial and the above are different. One uses @transform etc; the above uses a format I am more used to. However, I did not realize I had to use ‘@.’. I have only used ‘@’ in the derived block after an ‘=’. Is there a preferred format?
Bob
But in case you want to multiply by another column (for example here I added 100 in a column called factor), you need to do broadcasting in one of two ways like the following