R/defineADictionary.R

Defines functions defineADictionary

defineADictionary <- function(numberOfSymbols){
  
  print("Define your own dictionary (symbols have to be composed of 3, 2 or 1 letter(s)): ")
  
  if(numberOfSymbols > 9){
    print("9 is the highest number of sybols you can define")
    numberOfSymbols<-9
  } 
  
  yourDictionary<-vector("character", length = numberOfSymbols)
  
  for (i in 1:numberOfSymbols){
    yourDictionary[i]<-toupper(as.character(readline("Type in the [1-3] letter code: ")))
  }
  
  dictionary<-as.data.frame(yourDictionary)
  names(dictionary)<-c("PDB")
  dictionary
}

Try the PdPDB package in your browser

Any scripts or data that you put into this service are public.

PdPDB documentation built on Nov. 17, 2017, 5:09 a.m.