replace_ids | R Documentation |
Replace the individual IDs in an object with new ones
replace_ids(x, ids)
## S3 method for class 'cross2'
replace_ids(x, ids)
## S3 method for class 'calc_genoprob'
replace_ids(x, ids)
## S3 method for class 'viterbi'
replace_ids(x, ids)
## S3 method for class 'sim_geno'
replace_ids(x, ids)
## S3 method for class 'matrix'
replace_ids(x, ids)
## S3 method for class 'data.frame'
replace_ids(x, ids)
x |
Object whose IDs will be replaced |
ids |
Vector of character strings with the new individual IDs, with the names being the original IDs. |
The input x
object, but with individual IDs replaced.
replace_ids(cross2)
: Replace IDs in a "cross2"
object
replace_ids(calc_genoprob)
: Replace IDs in output from calc_genoprob()
replace_ids(viterbi)
: Replace IDs in output from viterbi()
replace_ids(sim_geno)
: Replace IDs in output from sim_geno()
replace_ids(matrix)
: Replace IDs in a matrix
replace_ids(data.frame)
: Replace IDs in a data frame
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
ids <- as.numeric(ind_ids(iron))
# replace the numeric IDs with IDs like "mouse003"
new_ids <- setNames( sprintf("mouse%03d", as.numeric(ids)), ids)
iron <- replace_ids(iron, new_ids)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.