Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Submitted by email #98

Open
ErinBecker opened this issue Mar 4, 2019 · 0 comments
Open

Submitted by email #98

ErinBecker opened this issue Mar 4, 2019 · 0 comments

Comments

@ErinBecker
Copy link
Contributor

To whom it may concern:
As I am still unfamiliar (although trying to find more time to explore) with Github/Git, I'm submitting my checkout contribution via email. I've been exploring the https://datacarpentry.org/R-genomics/01-intro-to-R.html webpage and found a spot I think might be more easily understandable if an addition is made. At the bottom of "Creating objects" the fact that = and -> can be used is mentioned. I would suggest two things:

Inside "creating objects" -- "->" is discouraged so that your code is easily readable by others as the standard methodology is "<-".
Inside "Functions" - I would add an example around a function that takes in more than 1 value (ex: median). Have the attendees work through the following after looking at "args". This will allow them to see the difference between = and <- when it comes to functions and may reinforce the idea that <- is used to assign values to objects.
mean(x=1:10); x (Ans: 5.5 and does not exist error)
mean(x<-1:10); x (ans: 5.5 and c(1,2,3,4,5,6,7,8,9,10))
y<-1:100; mean(y); mean(x=y); x; mean(x<-y); x (ans: 50.5; 50.5; c(1,2,3,4,5,6,7,8,9,10); 50.5; c(1:100))
This is also allows reinforcement of the idea that objects can be used for args, but would then need to clarify that without designated args, the objects/values are read in in order; with args, they can be listed in any order

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant