```
#' Function to count the number of some occurences in a vector
#'
#'
#' @param vec A character or boolean vector
#' @param something A character vector of lenght one specifying the strings or boolean we want to count
#' @author Alexander Kheirallah ([email protected])
#' @export
#'
countOfsomething.2 <- function(vec,something) {
if(anyNA(vec)){
print("Input vector to countOfsomething.2 has NA. Returning NA.")
return(NA)
}
count_out <- 0
for(i in 1:length(vec)){
if(vec[i] == something){
count_out <- count_out + 1
}
}
return(count_out)
}
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.