Sha256: 9dbf2c231a84abc675a2bfcb6c602a2fc00430d07704921de63e90744eef1215

Contents?: true

Size: 294 Bytes

Versions: 219

Compression:

Stored size: 294 Bytes

Contents

to_rna <- function(dna) {
  
  dna_to_rna <- list(G = "C", C = "G", T = "A", A = "U")
  
  func <- function(x) {
    if (!(x %in% c("G", "C", "T", "A"))) {
      stop("invalid dna strand")
    }
    dna_to_rna[[x]]
  }
  
  paste(lapply(strsplit(dna, "")[[1]], FUN = func), collapse = "")
  
}

Version data entries

219 entries across 219 versions & 1 rubygems

Version Path
trackler-2.2.1.38 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.37 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.36 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.35 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.34 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.33 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.32 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.31 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.30 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.29 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.28 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.27 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.26 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.25 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.24 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.23 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.22 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.21 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.20 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.19 tracks/r/exercises/rna-transcription/example.R