Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Types and Structures: discussion on types versus structures #423

Open
captainalan opened this issue May 4, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@captainalan
Copy link

commented May 4, 2019

I think it would be helpful to include a discussion on data types versus structures in the Data Types and Structures lesson.

Particularly for users of R that have some experience with other programming languages (e.g. Python, ...), one of the most difficult parts of getting started with R is understanding what sorts of objects there are in R and how these objects behave. As the lesson points out, "Everything in R is an object". However, unlike in other programming languages, users typically interact with primitive data types only through the (complex) data structures of atomic vector, list, etc.

This contrasts with how many students typically first encounter the idea of "data types". In C++/C#/Java/etc. students might first learn int i = 0;. We don't typically discuss i as a "data structure" and to do something like add i to an array would not work. However, in R you can do things like c(1:10) + 1

I would be happy to work on this issue, in particular by adding some information from the Data Strcutures chapter of Hadley Wickham's Advanced R.

Note: I stumbled across this repository/project through a Google search for "r data types vs structures". It is the first result for this search query as of 5/4/2019!

@katrinleinweber

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2019

Thanks for pointing this out, Alan! Do you think that any of the "objectives" or "keypoints" should be clarified or corrected? If yes, we can discuss specifics in a (draft) PR. Adding the book reference you suggest could also work nicely (to the start or end of that episode, maybe? See 14-supp-call-stack.Rmd for a template.).

Before working on anything larger than that, however, please note that this lesson is "for non-programmers" and that "more concepts and tools" are outside of its scope.

Re: Note Some SEO just does itself :-D

@captainalan

This comment has been minimized.

Copy link
Author

commented May 4, 2019

Here are some suggestions I believe could easily be incorporated without introducing more concepts and tools.

Addition to first objective

  • Expose learners to the different data types in R and show how these data types are used in data structures.

Addition to second key point

  • R's basic data structures include [...]. Some of these structures require that all members be of the same datatype (e.g. vectors) while others permit multiple datatypes (e.g. lists).

This information is presented implicitly in the lesson, which describes how to work with some data structures and restrictions that go into making them. Clarifying these points in the objectives/key points will be reinforcing what is already there.

Other things

I could also look over doing some edits to some wording in the text, e.g.

Make objectives consistently start with verbs:

Getting familiar -> Get familiar with the different...

the second paragraph in "Understanding Basic Data Types in R":

Data structures are very important to understand because these are the objects you will manipulate...

@katrinleinweber

This comment has been minimized.

Copy link
Collaborator

commented May 5, 2019

As a pull request, please ;-) If you open https://github.com/swcarpentry/r-novice-inflammation/edit/master/_episodes_rmd/13-supp-data-structures.Rmd, is there Propose file change at the bottom? If yes, please make the edits.

captainalan added a commit to captainalan/r-novice-inflammation that referenced this issue May 5, 2019

Issue swcarpentry#423 enhancements/fixes
Clearing up some style/diction as well. Cheers!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.