datacarpentry / R-genomics

Lesson on data analysis and visualization in R for genomics
http://datacarpentry.github.io/R-genomics
Other
40 stars 76 forks source link

Submitted by email #98

Open ErinBecker opened 5 years ago

ErinBecker commented 5 years ago

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