DSCI 100
Late Registrants
Welcome!
Any assignment from a class that happened before you registered is due 1 week after you registered
Any assignment from a class that happened after you registered is due at the regular time
Communications:
Questions about course material/worksheets/clarification questions -> Piazza or Office Hours
Questions about academic consessions, due dates, late registration, admin stuff -> Julia (courses@stat.ubc.ca)
Private matters, accommodations, mentorship -> Email me or come by Office Hours
No need to submit anything on Canvas. Server will submit your work for you at the deadline!
Remember: when in doubt,
When you are working on assignments there is a cell that says
DOUBLE CLICK TO EDIT THIS CELL AND REPLACE THIS TEXT WITH YOUR ANSWER
make sure you double click and edit that cell directly. Your question won’t be graded otherwise.
Taking our first step in data analysis: loading data into R!
… And why can’t I just use Excel???
vs.
Ingredients = data
Recipe = code
(source: Grolemund & Wickham, R for Data Science)
starts with /
e.g. /home/instructor/documents/timesheet.xlsx
doesn’t start with /
e.g. documents/timesheet.xlsx
(where working directory is /home/instructor/)
via “URL” that starts with http:// or https://
http://traffic.libsyn.com/mbmbam/MyBrotherMyBrotherandMe367.mp3
Generally to ensure your code can be run on a different computer, you should use relative paths
Example:
Alice is working inside the folder /home/alice/project/.
To specify where to load data from in her Jupyter notebook, she uses the absolute path /home/alice/project/data/happiness_report.csv.
What issue will arise when she shares the notebook with her collaborator Keeran who tries to read in the data on their computer?
Notes:
/home/alice/project/data/happiness_report.csv.Notes:
Workflow:.
Navigate to the file and see what it looks like
Prepare to load the data into R - Might need to load a library, download a file, or connect to a database
Load the data into R - Using read_csv, read_delim, etc
Inspect the result to make sure it worked!
Let’s load the Old Faithful geyser dataset from Larry Wasserman’s book All of Statistcs
First, let’s navigate to the file and see what it looks like
Notes: