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.
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1997--2019 The R Core Team
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Pulic License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, a copy is available at
* https://www.R-project.org/Licenses/
*/
This file has been truncated. show original
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.