Q methodology: produce printable cards for Q study with ID...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/


Creates cards for administering a Q study. Full item wordings are printed on the front of business cards and item IDs on the back.


    study.language = NULL,
    paper.format = "AveryZweckformC32010.Rnw",
    output.pdf = TRUE,
    manual.lookup = NULL,
    wording.font.size = NULL, = "QCards",
    babel.language = NULL



A matrix with handles as row names ("q-is-great", for example), languages (if applicable) in columns, as produced by build.q.set.


A character vector of length 1. Must be one of the languages from the column names in the specified q.set (which will be the same as the respective Q concourse object). Defaults to NULL, in which case the first column from q.set is selected.


A character vector of length 1, choosing among available templates of business card sheets. Defaults to the only currently available "AveryZweckformC32010.Rnw". Must include file extension of template.


Logical. If TRUE, function invokes knit2pdf to create a PDF in the workspace. If FALSE, function invokes knit to return only a *.TEX in the workspace, may be preferable if no LaTeX installation is available on the used computer. Defaults to TRUE.


A matrix with handles (same as in build.q.set, import.q.concourse) as row names, and arbitrary, unique identifying strings in any of the columns as also expected in import.q.sorts and Defaults to NULL in which case items are automatically identified by full item hashes, as also detected by import.q.sorts and


A character vector of length 1 to set the font size of the full item wording on the cards. Defaults to NULL in which case the default font size 12pt is used. Only standard LaTeX font sizes are allowed, from \tiny to \Huge.

A character vector of length 1 to set the filename without file extension. Defaults to QCards.


A character vector of length 1 to set the babel language for appropriate hyphenation, special letters and other international support as provided by the babel LaTeX package. Only available babel options are permissible. Defaults to NULL, in which case babel is never called. Changing babel.language between function calls can occasionally leave inconsistent LaTeX temp files, which may trip up compilation. Please re-run the function once again or clean up temp files (in the working directory) in that case.


Preparing cards with full items and IDs quickly becomes cumbersome if a study is done several times or if items change frequently. Participants require well-printed, well-designed cards for their sorting task, ideally on heavier paper. Cards should include shorthand, unique identifiers to simplify later data entry.

This function prepares a properly typeset *.PDF (or *.TEX source), where items are printed on readily-available business card templates, from which individual cards can be easily broken out.

The function prints the full item wording on the right column of any page, and the identifier (ID) on the left column. If templates are duplex printed with the same page on the front and back, and in proper orientation, the front of each card includes the full wording, and the back its unique identifier (ID).

Identifiers (ID) entered manually or automatically hashed from full wordings are also expected in the import functions import.q.sorts and The automatic summary of full item wordings, technically known as hashing, proceeds internally by passing the full item wording to the digest function of the package digest (with arguments set to

algo = crc32, serialize = FALSE.)

The function proceeds internally by preparing a dataframe with full item wordings and identifiers (ID), and then invokes a prepared *.RNW template included with this package, which in turn includes a knitr chunk, which in turn calls xtable to return a neatly layed-out multi-page table.

If you are not familiar with the terminology of item handle, ID and wording or the file structure expected for import functions, please read the respective sections in the documentation for qmethod-package first or consider the package wiki


Writes a *.PDF file or its source *.TEX file to the working directory ready for printout.


Hashed identification has not been widely tested in Q studies and should be used with great care and only for extra convenience. When using hash identification, researchers should be careful to record the precise item wordings at the time of hashing for the printed Q-cards, preferably with a version control system. Researchers should also record the complete Q-sorts of participants in an unhashed form, such as a picture of the completed sort in full wordings, in case problems with the hashing arise.

When output.pdf = TRUE, the function will sometimes fail with the error message
"Running 'texi2dvi' on ... failed". This is not a bug with the function, but simply indicates that the path to pdflatex is not available in the current R environment. To fix this issue, compile the resulting *.TEX manually, use RStudio or try this fix. You can also report other suggestions here.

This function does not automatically scale the font size to fit the given card size. Instead, users will have to proceed by trial and error, using a wording.font.size that works for their longest item. The default value should work for most Q items.

This function currently only works for Avery Zweckform C32010 templates, designed in
/cardtemplates/AveryZweckformC32010.Rnw. If you would like support for other templates, check out / chip in here:


Maximilian Held

See Also

build.q.set,, import.q.sorts, import.q.concourse


## Make cards from importexample
data(importexample)$q.set, output.pdf = FALSE)

qmethod documentation built on May 22, 2018, 5:04 p.m.