Uniform Resource Locator (URL): www.skysheng.io/dsci_100_sky_slides/
A remote file lives on the internet, and is accessed via a URL that starts with http:// or https://. For example:
http://traffic.libsyn.com/mbmbam/MyBrotherMyBrotherandMe367.mp3
No need to submit anything on Canvas β the server automatically submits your work for you at the deadline!
Remember: when in doubt, Kernel β Restart Kernel and Run All (or the βΆβΆ button)
When working on assignments, youβll see cells that say:
DOUBLE CLICK TO EDIT THIS CELL AND REPLACE THIS TEXT WITH YOUR ANSWER
β οΈ Make sure you double click and edit that cell directly β your answer wonβt be graded otherwise!
π Shut down the server when youβre done working
Image generated by OpenAI GPT-2.5-sunburst model

Hand-written notes

Excel sheet
Hand-written notes image source: DIDA: The Largest Historical Handwritten Digit Dataset
Comma-Separated Values (CSV) |
Tab-Separated Values (TSV) |
Semicolon-Separated Values (SSV) |
β¦or anything you want, just be consistent! |
Image generated by OpenAI GPT-2.5-sunburst model
Image generated by OpenAI GPT-2.5-sunburst model
Image generated by OpenAI GPT-2.5-sunburst model
_), and dots (.)2cats β)my_cat, not my cat βResult and result are two different variablesmy_age β
favorite_color β
student_count β
(not a or b β)Error: object 'my_variable' not found β Happens when you run cells out of order in Jupyter. Run the code cell that creates the variable first, then check your spelling.
Unmatched parentheses or quotes β Every ( needs a ), and every opening " needs a closing ".
What does # do? β # is a symbol to tell R that you are writing a comment for humans to read. R ignores everything after it on that line. Comments are not instructions for R.
Does empty space and indentation matter? β No,empty space and indentation are ignored by R.
<- or = ?Use <- to assign a value to a variable (standard convention)
Reserve = for setting arguments inside a function call.
Why does <- vs = matter? β To avoid ambiguity, reserve <- for assignment and = for function arguments.
Use quotes ("...") around character strings (text).
Variable and object names are never quoted.
Quotation marks "" is letting R know that you want to print exactly that sentence or words into the output or plot.
filter() β keep rows that match a conditionselect() β keep specific columnsarrange() β sort rows by a columnβs valuesslice() β keep rows by their positionmutate() β create or modify a columnggplot() β build a plot, layer by layerβ¦ and why canβt I just use Excel?
vs. 
There are many advantages to using a programming language like R (or Python, Julia, etc.) over spreadsheet software:
Using a programming language is like baking with a recipe:

Ingredients = data

Recipe = code
Source: Grolemund & Wickham, R for Data Science
4 most common ways to do this in data science:
//home/sky/documents/timesheet.xlsx/documents/timesheet.xlsx (where the working directory is /home/sky/)
File Explorer (OS GUI)
.../
βββ ... # other folders and files
βββ story_of_otter/
βββ clown_dungeon/
β βββ creature_david.txt
β βββ monster_bob.txt
β βββ ollie.txt
βββ home_of_ollie/
βββ ocean/
Directory Tree
story_of_otter Examplehome/
βββ isaac/
βββ sky/
βββ images/
βββ story_of_otter/ β¬
οΈ cwd
βββ clown_dungeon/
β βββ creature_david.txt
β βββ monster_bob.txt
β βββ ollie.txt
βββ home_of_ollie/
βββ ocean/
| absolute path | relative path |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Generally, to ensure your code can run on a different computer, you should use relative paths
Example:
/home/alice/project//home/alice/project/data/happiness_report.csvWorkflow:
read_csv(), read_delim(), etc.Letβs load the Old Faithful geyser dataset from Larry Wassermanβs book All of Statistics π
First, letβs navigate to the file and see what it looks like
worksheet_reading due THIS SATURDAY 11:59pmtutorial_reading due THIS SATURDAY 11:59pmThere are NO late submissions/concessions for worksheets. We will drop the lowest worksheet and lowest tutorial score. See policy for late registrants.
If not, letβs work together on this weekβs worksheet.