?rep
## httpd 도움말 서버를 시작합니다 ... 완료
vector1 <- rep("noun", 10)
vector1
## [1] "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun"
vector2 <- c(rep("noun", 10), rep("verb", 20))
vector2
## [1] "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun" "noun"
## [11] "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb"
## [21] "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb" "verb"
?seq
a <- seq(1, 20, by=2)
a
## [1] 1 3 5 7 9 11 13 15 17 19
1:10 %in% c(1,3,5,9)
## [1] TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE
sym <- c("c", "ab", "B", "bba", "NA", "@", "bla", "Ba", "%")
LETTERS <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
sym[sym %in% LETTERS]
## [1] "B"
a <- c("dog", "cat", "duck")
b <- c("dog", "puppy", "pet", "animal")
result <- match(a, b)
a[!is.na(result)]
## [1] "dog"