DNA TO RNA USING USER DEFINED FUNCTION
Hello, While doing my assignment (DNA TO RNA USING USER DEFINED FUNCTION) i ran the following script
DNA <- "ACCTGTCATCATCCC"
DNA_to_RNA.R <- function(DNA){
RNA <- gsub("T", "U", DNA)
Basecheck <- substring(RNA, seq(1, nchar(RNA), by = 1))
return(RNAsequence)
}
My question is can i replace gsub with user defined function that converts dna to rna Thanks
• 876 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Is this the same assignment as here? script in R to convert DNA to RNA sequence
Also, why are you splitting the converted string by base?
gsubalready did the job. Still, the variable you are returning does not exist in your function. Why user-defined?gsubis already as lowlevel as it gets. Do not start with something like looping over every base, this is terribly inefficient.