Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updata types and structures #65
Comments
|
Agreed this discussion could be improved. Perhaps an abridged version of the discussion here: https://swcarpentry.github.io/r-novice-inflammation/13-supp-data-structures/, with a link to the complete discussion there? Maybe mentioning the atomic vector types (character, numeric, etc.) plus some of the many "data structures" (list, data frame, etc.) would help clarify? @ErinBecker I'm tagging you because I'm not sure who to tag lol |
|
It seems that this define the different vector data types but it’s sequenced to be discussed after the examples showing how to use functions to assign parameters to vectors and inspect the content. These definitions are essential concepts to be familiar with to understand what’s going on in the examples presented. I would move this up in the episode sequence so it’s discussed right after introducing the concept of what a vector is. Perhaps something like this: A vector is most common and basic data structure in R, and is pretty much the workhorse of R. There are 6 atomic vector types and each vector contains only a single data type.
Additionally, the lesson doesn’t explicitly state what vector is being used in the examples until near the end of the episode. So students can correlate the concept of the demonstrated vector the type should be stated at the beginning rather than at the end when comes across more as an afterthought. "For example, we can assign a series of values to a vector using the c() function by creating a numeric vector of household members...." Finally, under Objectives vectors are mentioned two different times but it's not included in the list of terms that students should be able to define as they relate to R. All other terms listed are later mentioned in other objectives. So change the first objective from: Define the following terms as they relate to R: object, assign, call, function, arguments, options to Define the following terms as they relate to R: object, assign, call, function, arguments, vectors, options. |
|
The vector discussion seems fairly flushed out now, but I think a couple things should be clarified about data types. Users coming from other languages (like Java or C++) might appreciate the clarification that in R, there's no real distinction between character data and string data. You can use 'single quotes' or "double quotes" to indicate a string. Further, if you want to include a string that contains quotation marks or a possessive single comma (a common desire for people parsing text and doing text analysis), you merely need to encapsulate the string inside the other type of quotation marks. To make things less confusing, I would suggest editing the "Vectors and data types" section to be two separate parts: "Data Types" and then "Vectors." It would be much easier to understand vectors if there's an overview first discussing the different data types. For example "character" is used but not defined in the beginning of the vector example. The data types part could look something like the below. Note that I stole a few pieces from the "Vector" discussion and moved them up here, to clarify things. Basic Data Types in R
When we want to store several of these data pieces inside the same object, we can use more complex data types, like a vector. Vectors |
|
@allisonrobertsTN Thank you! Those are really great points. I don't have a background in languages that distinguish single and double quotes. Def worth including. Would you be interested in creating a PR to incorporate your suggestions? That way you can get credit for your ideas! |
|
Thank you! I'm glad they were helpful. I can definitely draft a PR! I'm still pretty new to using Github and the Carpentries, but I can probably figure it out. |
|
Awesome! Well if you need guidance, don't hesitate to reach out |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

The discussion of data types and data structures in "Vectors and data types" could be clarified. Perhaps even defining these terms before using them would help. Also note that the first sentence of the section reads "A vector is the most common and basic data type in R, and is pretty much the workhorse of R." perhaps this should be changed to "basic data structure"