put_help | R Documentation |
Put values into a vector/list, vectors into rows, and vectors into columns.
put_help()
put(x, v, e)
putr(x, v, r)
putc(x, v, c)
x |
For |
v |
A vector of replacement values. Must be of the same length as |
e |
A complete indexer vec of length equal to that of |
r , c |
Complete indexer scalars indicating row or column to replace, respectively. |
An object of the same class and dimension as x
.
put()
: Puts vector v
into e
-indexed elements of x
(assumed to be a vector or vlist).
putr()
: Puts vector v
into c
-indexed column of x
(assumed to be a data.frame or matrix).
putc()
: Puts vector v
into r
-indexed row of x
(assumed to be a data.frame or matrix).
egVec <- letters[1:5]
egVls <- list(a = letters[1:5], b = 1:5)
egMat <- matrix(1:25, nrow = 5)
egDtf <- data.frame(a = letters[1:5], b = 1:5, stringsAsFactors = FALSE)
egVec
egVls
egMat
egDtf
put(egVec, "z", 1:2)
put(egVls, 7, 2)
putr(egMat, 1:5, 1)
putc(egDtf, 1:5, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.