my_function = function(x,y,type = "shared"){
count = 0
same = character()
tryCatch(
if(class(x) == class(y)){
for(i in x){
for (j in y){
if(i == j){
if(!(is.element(i,same))){
same = append(same, i)
count = count + 1}
else{print ("class error")}
}
}
}
},
error = function(e) print("error at alleles"),
warning = function(w) print("warning at alleles"), finally = NULL)
if(type == "shared"){
return(count)
}else if(type == "different"){
return(length(x) - count)
}else{
return("error at type")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.