UBC STAT545 2014 Cm002 deep thoughts

26
STAT 545A Class meeting 002 Deep thoughts re: data analytic work + Getting started with R and RStudio web companion: STAT 545 web home > Syllabus > cm002 Monday, September 8, 2014

description

Lecture slides from UBC STAT545 2014. Not a stand-alone document. http://stat545-ubc.github.io

Transcript of UBC STAT545 2014 Cm002 deep thoughts

Page 3: UBC STAT545 2014 Cm002 deep thoughts

Deep

Thoughts

about data analytic work

Page 4: UBC STAT545 2014 Cm002 deep thoughts

get better at typing

Page 5: UBC STAT545 2014 Cm002 deep thoughts

tough love:

typos mattercase mattersth_is is different from th-isspaces in filenames are EVIL

want computer to do tedious work for you?then you must give precise instructions

Page 6: UBC STAT545 2014 Cm002 deep thoughts

A place for everything,everything in its place.

Benjamin Franklin

Page 7: UBC STAT545 2014 Cm002 deep thoughts
Page 8: UBC STAT545 2014 Cm002 deep thoughts
Page 9: UBC STAT545 2014 Cm002 deep thoughts

“The source code is real. The objects are realizations of the source code. Source for EVERY user modified object is placed in a particular directory or directories, for later editing and retrieval.”

-- from the Emacs Speaks Statistics (ESS) manual

source is real

Page 10: UBC STAT545 2014 Cm002 deep thoughts
Page 12: UBC STAT545 2014 Cm002 deep thoughts

data written for humans ...

http://cdec.water.ca.gov/cgi-progs/reports/PRECIPOUT.2011

Page 14: UBC STAT545 2014 Cm002 deep thoughts

code written (only) for computers ...

... creates misery for humans

Page 15: UBC STAT545 2014 Cm002 deep thoughts

Names matter

Page 16: UBC STAT545 2014 Cm002 deep thoughts

myabstract.docxJoe’s Filenames Use Spaces and Punctuation.xlsxfigure 1.pngfig 2.pngJW7d^(2sl@deletethisandyourcareerisoverWx2*.txt

NO

2014-06-08_abstract-for-sla.docxjoes-filenames-are-getting-better.xlsxfig01_scatterplot-talk-length-vs-interest.pngfig02_histogram-talk-attendance.png1986-01-28_raw-data-from-challenger-o-rings.txt

YES

Page 17: UBC STAT545 2014 Cm002 deep thoughts

minimize the creation of data excerpts and copies ...

... they will just confuse you later

Page 18: UBC STAT545 2014 Cm002 deep thoughts

reshape your data

Page 19: UBC STAT545 2014 Cm002 deep thoughts

where is the file or executable you need?

what is your working directory?

Page 20: UBC STAT545 2014 Cm002 deep thoughts

Oops, I see a small mistake right there.

Do you mind going back to fix that?

Page 21: UBC STAT545 2014 Cm002 deep thoughts

If the thought of re-running your analysis makes you ill ...

... you’re not doing it right

Page 22: UBC STAT545 2014 Cm002 deep thoughts

Deep

Thoughts

about data analytic work

Page 23: UBC STAT545 2014 Cm002 deep thoughts

switch to live coding ...

see web companion for indicative content:STAT 545 web home > Syllabus > cm002

Students with R/RStudio experience were encouraged to contribute something to the “Learn R” world.Suggestion: use, review, extend swirl (see next slide).

Page 24: UBC STAT545 2014 Cm002 deep thoughts

http://swirlstats.com

Page 25: UBC STAT545 2014 Cm002 deep thoughts

you do know that R ≠ RStudio, right?

we use RStudio because it makes us happier in our work, but notice that nothing we produce -- no code, no figures, nothing -- requires RStudio to be created, appreciated or reused

this is important

this is intentional

Page 26: UBC STAT545 2014 Cm002 deep thoughts

photos

Deep Thoughts, tree, mist, sunLoco Steve, Goldie Dawnhttp://www.flickr.com/photos/36989019@N08/5546134597/

Messy beer canshttp://www.schiesshouse.com/dontdothis.htm

Hanging beer canshttp://www.beastpieces.com/2009/07/its-superior/

Messy computer desktophttps://www.flickr.com/photos/jeanbaptisteparis/724619122/in/photolist-272S29-auRiXZ

Triflehttp://assets.cougar.nineentertainmentco.com.au/Assets/GourmetTraveller/2013/05/09/8837/1209gtpmtrifle-628.jpg

Trifle recipehttp://www.gourmettraveller.com.au/recipes/print-recipe/?id=8837

Winner of 2004 Obfuscated C code competitionhttp://m.eet.com/media/1076421/1106esdGanssle01.gif

Cheers “Where Everybody Knows Your Name”http://cheersboston.blogspot.ca

PC vs Machttp://www.frumsatire.net/2009/03/14/mac-vs-pc/

You can’t get there from herehttp://cstacalicious.ning.com/photo/liss-platt-still-from-you-can-t-get-there-from-here-2005-8?context=latest

Hand-crafted basket woven chairhttp://www.visitscotland.com/cms-images/2x1/regions/orkney/hand-crafted-furniture