Hi,
I'm trying to make it easier for my survey evaluators to read the
results of my survey analysis. To that end, I'd like to suppress R's
habit of filling every line up to width columns. How do I do that?
For instance, using 'print()', R outputs something like:
[,1]
It looks like you are printing a matrix and that you want to print all
rows of the first column before all rows of the second column. Apply
should do it. Assume the matrix is named AA
apply(AA, c(2,1), cat, \n) # the \n is the line-feed character
--
DW
On Jul 7, 2009, at 10:06 AM,
On Tue, Jul 7, 2009 at 12:20 PM, David Winsemiusdwinsem...@comcast.net wrote:
It looks like you are printing a matrix and that you want to print all rows
of the first column before all rows of the second column. Apply should do
it. Assume the matrix is named AA
apply(AA, c(2,1), cat, \n) #
On Tue, Jul 7, 2009 at 1:22 PM, Godmar Backgod...@gmail.com wrote:
apply(AA, c(2,1), cat, \n)
Error in cat(list(...), file, sep, fill, labels, append) :
argument 1 (type 'list') cannot be handled by 'cat'
ps: but your idea of using 'apply' led me to this:
dummy - apply(AA, c(2), function
4 matches
Mail list logo