Mach2
Mach2

Reputation: 11

How to bypass RStudio console upper limit on character string length?

I'm just starting to learn R, and I'm trying to write a function that translates an mRNA character string into a protein sequence. Hopefully someone with more experience can help me out pretty easily.

My function seems to work just fine on shorter strings, but when I try it on long RNA sequences, the console just prints a new line with + after the function call and nothing else. Nothing happens.

I found this thread which seems to say that there's a length limit of 4096 characters, but I can't find anything that indicates any way around this.

Is there a way to bypass this? Is there another environment I could try running my function in that will work with longer strings? I'd like to be able to pass strings of up to 10 000 characters as arguments to this function. Thanks in advance

Upvotes: 1

Views: 2253

Answers (1)

Maurits Evers
Maurits Evers

Reputation: 50668

I'm not sure what you mean or perhaps I misunderstood; there is definitely no 4096 character limit on character vectors in RStudio (or in R for that matter).

Here is a screenshot of a minimal reproducible example where I generate a string of length 10^5

s <- paste0(sample(c("A", "C", "G", "T"), 10^5, replace = T), collapse = "")

enter image description here

Upvotes: 1

Related Questions