tracks/r/exercises/rna-transcription/example.R in trackler-2.1.0.21 vs tracks/r/exercises/rna-transcription/example.R in trackler-2.1.0.22
- old
+ new
@@ -1,14 +1,14 @@
to_rna <- function(dna) {
- dna_to_rna <- list(G="C", C="G", T="A", A="U")
+ dna_to_rna <- list(G = "C", C = "G", T = "A", A = "U")
func <- function(x) {
- if (!(x %in% c("G","C","T","A"))) {
+ if (!(x %in% c("G", "C", "T", "A"))) {
stop("invalid dna strand")
}
dna_to_rna[[x]]
}
- paste(lapply(strsplit(dna, "")[[1]], FUN=func), collapse = "")
+ paste(lapply(strsplit(dna, "")[[1]], FUN = func), collapse = "")
}