View source: R/repgrid-constructs.r
constructs | R Documentation |
Allows to get and set construct poles.
Replaces the older functions getConstructNames
, getConstructNames2
,
and eNames
which are deprecated.
constructs(x, collapse = FALSE, sep = " - ")
constructs(x, i, j) <- value
leftpoles(x)
leftpoles(x, position) <- value
rightpoles(x)
rightpoles(x, position) <- value
x |
A repgrid object. |
collapse |
Return vector with both poles instead. |
sep |
Separator if |
i , j |
Row and column Index of repgrid matrix. |
value |
Character vector of construct poles names. |
position |
Index where to insert construct |
# shorten object name
x <- boeker
## get construct poles
constructs(x) # both left and right poles
leftpoles(x) # left poles only
rightpoles(x)
constructs(x, collapse = TRUE)
## replace construct poles
constructs(x)[1, 1] <- "left pole 1"
constructs(x)[1, "leftpole"] <- "left pole 1" # alternative
constructs(x)[1:3, 2] <- paste("right pole", 1:3)
constructs(x)[1:3, "rightpole"] <- paste("right pole", 1:3) # alternative
constructs(x)[4, 1:2] <- c("left pole 4", "right pole 4")
l <- leftpoles(x)
leftpoles(x) <- sample(l) # brind poles into random order
leftpoles(x)[1] <- "new left pole 1" # replace name of first left pole
# replace left poles of constructs 1 and 3
leftpoles(x)[c(1, 3)] <- c("new left pole 1", "new left pole 3")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.