Closed reblake closed 1 year ago
I learnt from some R resources. I think 'c' function can be both, concatenate or combine. There is an explanation: if factor concatenation by c() should give a factor. It means, when user use c() function, they combine some details. In other words, I don't think by replacing combine with concatenate will provide significant changes in clarity.
We would like to stick to the standard definition from ?c
:
Thanks for bringing this up though!
@HaoZeke, the definition of the function is not the name of the function. The name of the function is "concatenate" ("c" for short), while the definition of the function is what it does ("combine values...").
See the comments here: https://stackoverflow.com/questions/11488820/why-use-c-to-define-vector
Also, see the R manual section 2.1: https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf
Many functions can combine objects in R, so being specific that this functions is concatenate (vs. paste, cat, etc.) is important for learners, especially those new to R.
@reblake my apologies. For posterity I'm also putting the relevant section of the manual (linked)
However, it seems to still be a little contested, not an authoritative reference at all but R For Dummies feels happy to call it combine
.
Further muddying the waters, I normally teach paste
for concatenate, simply because of the R definition.
I'll leave this open for a bit, but I'm not sure we should call it anything at all at this point. A PR to remove mention of what it stands for would be best.
fixed in #537
I'm currently teaching this SWC R lesson, and I noticed an incorrect definition of the
c
function in the 01-starting-with-data section. It says thec
function means "combine", but it actually means "concatenate". Correcting this definition will improve clarity for learners.