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.18 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.17 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.16 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.15 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.14 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.13 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.12 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.11 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.10 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.9 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.8 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.7 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.6 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.5 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.4 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.3 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.2 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.1 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.1.0 tracks/r/exercises/rna-transcription/example.R
trackler-2.2.0.6 tracks/r/exercises/rna-transcription/example.R