Returns common element of question text.

Share:

Description

Given a question id, e.g. "Q4", finds all subquestions, e.g. Q4_1, Q4_2, etc, and returns the question text that is common to each.

Usage

1
  qTextCommon(x, Q)

Arguments

x

A surveydata object

Q

The question id, e.g. "Q4"

Value

character vector

See Also

Other Question functions: qText, qTextUnique, questions, splitCommonUnique, which.q

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Basic operations on a surveydata object, illustrated with the example dataset membersurvey

class(membersurvey)

questions(membersurvey)

which.q(membersurvey, "Q1")
which.q(membersurvey, "Q3")
which.q(membersurvey, c("Q1", "Q3"))

qText(membersurvey, "Q3")
qTextUnique(membersurvey, "Q3")
qTextCommon(membersurvey, "Q3")

# Extracting columns from a surveydata object

head(membersurvey[, "Q1"])
head(membersurvey["Q1"])
head(membersurvey[, "Q3"])
head(membersurvey[, c("Q1", "Q3")])

# Note that the result is always a surveydata object, even if only one column is extracted

head(membersurvey[, "id"])
str(membersurvey[, "id"])

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.