Printing the elements of a vector one per line in R

You know how R prints the elements of a vector horizontally?

> 1:5
[1] 1 2 3 4 5

Today I needed the elements printed one per line. After a bit of searching and hair-pulling, I stumbled upon the cat command:

> cat(1:5,sep="\n")

This is particularly useful when you need a line-by-line list of the variables in a data frame, which you can get with:


To output the list directly to a file, use write instead of cat.

Creativity, divergent thinking, and psychopathology

[T]hinking outside the box might be facilitated by having a somewhat less intact box.

Source: de Manzano Ö, Cervenka S, Karabanov A, Farde L, Ullén F (2010) Thinking Outside a Less Intact Box: Thalamic Dopamine D2 Receptor Densities Are Negatively Related to Psychometric Creativity in Healthy Individuals. PLoS ONE 5(5): e10670. doi:10.1371/journal.pone.0010670

Sensory Marketing in the Maine Antique Digest

Book CoverIt isn’t every day that academic texts receive coverage in the popular press, so I was excited to learn that a review of a book I contributed to, Sensory Marketing: Research on the Sensuality of Products, was published in the November 2010 issue of the Maine Antique Digest.

If you’re interested, you can read the review here: “A Book Review: Please Touch!” And if you’re really interested, you can buy the book on Amazon!

Why would anyone want to start their own business?

In response to a question about why people start their own businesses, Seth Godin writes:

The people who successfully start independent businesses … do it because we have no real choice in the matter. The voice in our heads won’t shut up until we discover if we’re right, if we can do it, if we can make something happen. This is an art, our art, and to leave it bottled up is a crime.

This jibes with a recent article in The New York Times: “Just manic enough: Seeking perfect entrepreneurs“.

Of course, another common reason may be a desire for control over one’s work environment.

The birth of academic disciplines

Progress is driven by new scientific questions, which demand new ways of thinking. You want to go where a question takes you, not where your training left you. … New disciplines eventually self-organize around new problems and approaches, creating a new shared culture. This shared culture coalesces into the next essential training regimen for the next generation of scientists, and with luck, some of these people will overcome their training to open up more new fields of inquiry. —Sean R. Eddy

Source: “Antedisciplinary” Science, PLoS Computational Biology

It’s okay to be stupid, as long as your stupidity is productive

One of the beautiful things about science is that it allows us to bumble along, getting it wrong time after time, and feel perfectly fine as long as we learn something each time. No doubt, this can be difficult for students who are accustomed to getting the answers right. No doubt, reasonable levels of confidence and emotional resilience help, but I think scientific education might do more to ease what is a very big transition: from learning what other people once discovered to making your own discoveries. The more comfortable we become with being stupid, the deeper we will wade into the unknown and the more likely we are to make big discoveries. —Martin A. Schwartz

Source: “The importance of stupidity in scientific research”, Journal of Cell Science, 2008.

What constitutes the typical publication?

Few of us will ever write a classic paper … The papers that represent great leaps forward are few in number. The majority of our collective publications, and hence scientific progress, comes from incremental insights in which the context is provided by the ongoing struggle to resolve a number of outstanding questions in a field. … [T]hese experimentally solid papers are “timely, targeted, and temporary”. That is, they address unanswered issues that are on the minds of those in the field, they target specific issues amenable to experimental or theoretical resolution, and in some ways their impact is temporary, because subsequent papers using the emerging insights and new methodologies will supersede these solid papers. Yet these solid papers are the foundation for progress most of the time. —Virginia Walbot

Source: “Are we training pit bulls to review our manuscripts?”, Journal of Biology, March 9, 2009.

On the challenges of writing a dissertation

The major problem with writing a dissertation is the management of emotions. Few students have ever attempted such a large project prior to undertaking their dissertations. They will encounter ups and downs, optimism and pessimism about their progress. My best advice stems from very basic knowledge about the psychology of learning: break large tasks into small tasks and set your goal to finish the small tasks in a timely fashion. —Professor Jerry Marwell, Department of Sociology, University of Wisconsin–Madison

Source: A Dissertator’s Primer, The Writing Center at UW–Madison