Is there any way, other than dput(), to output something that is not a
table to a text file and preserve its formatting? If you compare the
output of the implicit print statement in the R console line ">
pwt.m35.lp", to the following output from "# cat foo" as the OS
command line you'll see that the exported text file from dput is not
formatted and easy to read as the output inside of R:
=> cat foo
structure(list(method = "t tests with pooled SD", data.name = "g2$time
and g2$year",
p.value = structure(c(0.0367532070877987, 1, 1, 1, 1, 1,
1, 1, NA, 0.00718315554357665, 1, 1, 1, 1, 0.146481016374305,
0.00121854177777136, NA, NA, 0.973279068747759, 0.436956148539609,
0.709867943596168, 0.709867943596168, 1, 1, NA, NA, NA, 1,
1, 1, 1, 0.309223819660721, NA, NA, NA, NA, 1, 1, 1, 0.124449626396277,
NA, NA, NA, NA, NA, 1, 1, 0.210956065413139, NA, NA, NA,
NA, NA, NA, 1, 0.212525673297984, NA, NA, NA, NA, NA, NA,
NA, 1), .Dim = c(8L, 8L), .Dimnames = list(c("2003", "2004",
"2005", "2006", "2007", "2008", "2009", "2010"), c("2002",
"2003", "2004", "2005", "2006", "2007", "2008", "2009"))),
p.adjust.method = "holm"), .Names = c("method", "data.name",
"p.value", "p.adjust.method"), class = "pairwise.htest")
In addition to dput() I have tried using write(), write.table(), and
dump() to no avail. Is what I'm trying to do something that's not
normally done or am I just missing an obvious elephant in the room?
Thanks
Is there any way, other than dput(), to output something that is not a
table to a text file and preserve its formatting?
?capture.output
?mtable # I think in pkg:mtable
?ftable
?latex #in package:Hmisc
If you compare the
output of the implicit print statement in the R console line ">
pwt.m35.lp", to the following output from "# cat foo" as the OS
command line you'll see that the exported text file from dput is not
formatted and easy to read as the output inside of R:
=> cat foo
structure(list(method = "t tests with pooled SD", data.name = "g2$time
and g2$year",
p.value = structure(c(0.0367532070877987, 1, 1, 1, 1, 1,
1, 1, NA, 0.00718315554357665, 1, 1, 1, 1, 0.146481016374305,
0.00121854177777136, NA, NA, 0.973279068747759, 0.436956148539609,
0.709867943596168, 0.709867943596168, 1, 1, NA, NA, NA, 1,
1, 1, 1, 0.309223819660721, NA, NA, NA, NA, 1, 1, 1,
0.124449626396277,
NA, NA, NA, NA, NA, 1, 1, 0.210956065413139, NA, NA, NA,
NA, NA, NA, 1, 0.212525673297984, NA, NA, NA, NA, NA, NA,
NA, 1), .Dim = c(8L, 8L), .Dimnames = list(c("2003", "2004",
"2005", "2006", "2007", "2008", "2009", "2010"), c("2002",
"2003", "2004", "2005", "2006", "2007", "2008", "2009"))),
p.adjust.method = "holm"), .Names = c("method", "data.name",
"p.value", "p.adjust.method"), class = "pairwise.htest")
In addition to dput() I have tried using write(), write.table(), and
dump() to no avail. Is what I'm trying to do something that's not
normally done or am I just missing an obvious elephant in the room?
Thanks