Description Usage Arguments Value Author(s) References Examples
The function performs search and replace.
1 |
file |
is a vector or a data.frame. |
search |
is the item to be replaced. |
replace |
is the new item or value to be attributed. |
An object of the same type as file.
Daniel Marcelino
http://danielmarcelino.com/SciencePo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # First example: generate some raw data
data <- data.frame(
i=i <- rep(1, len = 100),
t=t<-sample(c('2008', '2012'), 100, replace=TRUE),
p=p <- sample(LETTERS[1:3], 100, replace=TRUE),
j=j <- sample(letters[1:13], 100, replace=TRUE) )
data$ide <-gsr(data$p,
c('A', 'B'),
c('Left', 'Centre'))
print(data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.