# NOT RUN {
x <- c("@hadley I like #rstats for #ggplot2 work. ftp://cran.r-project.org/incoming/",
"Difference between #magrittr and #pipeR, both implement pipeline operators for #rstats:
http://renkun.me/r/2014/07/26/difference-between-magrittr-and-pipeR.html @timelyportfolio",
"Slides from great talk: @ramnath_vaidya: Interactive slides from Interactive Visualization
presentation #user2014. https://ramnathv.github.io/user2014-rcharts/#1",
NA
)
replace_url(x)
replace_url(x, replacement = '<<URL>>')
# }
# NOT RUN {
## Replacement with a function
library(urltools)
replace_url(x,
replacement = function(x){
sprintf('{{%s}}', urltools::url_parse(x)$domain)
}
)
# }
Run the code above in your browser using DataLab