I'd like to have the output of print(df.to.print)
to be printed on a plot. It would be great if I could place the location with topleft
or topright
like in a call to `legend(...), but that's just a bonus.
Some code:
# A data.frame to play with
df.to.print <- structure(list(p.val = c(0.05, 0.1), self = c(0.0498, 0.0997),
H2007.REML = c(0, 0.01), H2007.ref = c(0, 0)), .Names = c("p.val",
"self", "H2007.REML", "H2007.ref"), row.names = c(NA, -2L), class = "data.frame")
# A simple plot
plot(1)
text(1,1, df.to.print )
# All of the entries are overlapping
# I can insert newlines easily enough
plot(1)
text(1,1, paste(as.character(df.to.print), collapse='\n'))
# But that looses all of the nice formatting in the data.frame.
# Which is easy enough to get on the console with:
print(df.to.print)
# Bonus points for 'topleft', 'topright', etc. like in legend().
Any help would be appreciated.