Skip to content
Prev 253889 / 398498 Next

Saving summary outputs in a table form

Hi,

You should carefully and thoroughly read the help page for the 
extraction operators. See ?"["

Let's say your output below is in a data.frame called df. You can do 
something like this:
df[, "Mean"]

To select only some specific "phi" rows, you probably need to set some 
regular expressions, see ?grep

Row.names that start with "phi.1.":
grep(pattern="^phi\\.1\\.", x=row.names(df))
Row.names that start with "phi." and end up with "2":
grep(pattern="^phi\\.[0-9]+\\.2$", x=row.names(df))

So in your data.frame:
df[grep(pattern="^phi\\.1\\.", x=row.names(df)), ]
df[grep(pattern="^phi\\.1\\.", x=row.names(df)), "Mean"]

See ?write.table if you want to write a data.frame to a file.

HTH,
Ivan

Le 3/16/2011 15:47, Haillie a ?crit :