DNA TO RNA USING USER DEFINED FUNCTION
0
0
Entering edit mode
2.4 years ago

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

R • 386 views
ADD COMMENT
2
Entering edit mode

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? gsub already did the job. Still, the variable you are returning does not exist in your function. Why user-defined? gsub is already as lowlevel as it gets. Do not start with something like looping over every base, this is terribly inefficient.

ADD REPLY

Login before adding your answer.

Traffic: 1381 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6