Re: Table formatting in NONMEM7- can I skip the "Table No." header row?

From: Paul Matthias Diderichsen Date: May 18, 2011 technical Source: mail-archive.com
On 5/18/2011 11:22 AM, Nick Holford wrote: > If you use R or SAS to skip the first TABLE and header records you still > need to figure out how to process the subsequent TABLE and header > records if you your table file has multiple tables as it often does when > it is created by simulation. I keep forgetting how to do this efficiently... this is one way to read nonmem simulation results (with ONEHEADER NOPRINT FILE=sdtab101): res.101<-read.table("sdtab101",head=T,skip=1,fill=T,as.is=T) res.101<-res.101[!is.na(as.numeric(res.101[,1])),] The important arguments to read.table are "fill", which makes R accept non-rectangular data, and "as.is", which prevents R from converting character data to factors. Later, res.101 should probably be converted to numeric, but that's a different story... (maybe somebody knows a more elegant solution to this?) -- Paul Matthias Diderichsen, PhD Quantitative Solutions B.V. +31 624 330 706