strings must be converted into character vectors before creating substrings

I was reading through Julia's noteworthy differences from R. This bullet point left me feeling a bit confused.

Julia can create substrings by indexing into strings. In R, strings must be converted into character vectors before creating substrings.

Is the conversion happening behind the scenes? Is what is happening in Julia different than, for example, substr("test", 2, 3)? Has the Julia documentation mischaracterized R?

I don't know, but maybe because we can't do "test"[2:3] to get "es"?

R documentation also explicitly mentions in the Description: Extract or replace substrings in a character vector.

I don't have much knowledge of C, but taking a look at the following suggests that it might be the case.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.