CS100: Studio 0 - Brown Universitycs.brown.edu/courses/cs100/studios/studio0.pdf · 2019. 9. 6. ·...

Preview:

Citation preview

CS100:Studio0Welcome!September4,2019

Instructions:WelcometoyourfirstCS100studio!Duringthisstudio,youwilltake

careofvariousadministrativenecessities,togetyoureadyforan

excitingandproductivesemester.Forexample,youwillbeginby

signingthecourseCollaborationPolicy.Youwillalsogetstartedwith

Markdown,atoolforcreatingdocumentsthatcanbeconvertedinto

webpages,pdfs,etc…

YouwillcompletemoststudiosinacomputerlabintheCIT,withyour

fellowclassmates.Forthisstudioonly,youcan/shoulddomostofyour

workindependently,andthenvisittheCS100TAsduringofficehoursto

introduceyourselvestothem,andgetcreditforcompletingthisstudio.

Theycanalsohelpyouwiththevariousstudiotasks,asnecessary.

TofindoutwhenTAhoursareheldeachweek,youcanchecktheTA

hourshere.Thisweek(only),theTAswillbeholdingextrahourson

Monday,soyouwillhaveplentyofopportunitiestostopby.

ObjectivesBytheendofthisstudio,youwillhave:

ReadandsignedacopyofthecourseCollaborationPolicy

JoinedthecourseonPiazza

Learnedaboutpairprogramming

LearnedsomeMarkdown

Hadfunsearchingfordata

InstalledRandRStudio

CollaborationPolicyReadandsignthecoursecollaborationpolicy.

Youmustsubmitthisformtoreceivecreditforthisstudio.

PiazzaPleasesignupforourcourseonPiazza.Throughoutthesemester,you

canpostanyquestionsyouhaveaboutthecourseonPiazza,andaTA

willreply.Feelfreetogiveitatrynow:Ifyouhaveafavoritedata

visualization(orcanfindacoolonequickly),postitasanoteandtagit

studio0 .

PairprogrammingDuringfuturestudiosessions,wewillbe“pairprogramming,”meaning

thattwostudentswillbeworkingtogethertocompletethetasks.Toget

abetterunderstandingofwhattoexpect,pleasereadthispair

programmingguide.NotethatAmycompiledthisguideoveradecade

ago,whenshestartingteachingCS17/18.

Onceyouhavefinished,pleaseanswertheseTrueorFalsequestions.

Youcanjotyouranswersdownonapieceofpaper,ortypethemintoa

textfile.Beforeyouleavestudiotoday,youwillneedtohavethem

checkedoffbyaTA.

1. Onestudentshouldbeinchargeoftypingfortheentireduration

ofastudiosession.

2. Pairprogrammingisadivide-and-conquerstrategy,inwhich

eachstudentworksonadifferentpartoftheassignment.

3. Pairprogramminghelpsstudentslearnmoreandwritebetter

code.

4. Itisimportanttocommunicaterespectfullywhilepair

programming.

MarkdownTutorialsAllCS100documents,includingthisone,arewritteninMarkdown,a

simplelanguageforeasilygeneratingwebpages,pdfs,etc.Inafew

weeks,wewillrequirethatyourhandinsbegeneratedfromMarkdown,

specificallyRMarkdown.Toprepare,youshouldcompletelessons1-7of

thisMarkdowntutorial.

Funfindingdata!Atsomepointsoon,youwillfindyourselfsearchingfordata,sowe’re

goingtopracticenow.

Electronicdataarestoredinvariousformats,includingCSV,meaning

comma-separatedvalues,andTSV,meaningtab-separatedvalues.

GooglecanhelpyousearchforCSV(orTSV)files.Yousimplyappend

thefiletypeofinteresttotheendofyourquery,asfollows:

+filetype:csv .

Forexample,searchingfor SouthAfrica+filetype:csv produces

CSVfilesmentioningSouthAfrica:

FindaCSVorTSVfileonatopicyouareinterestedin.Onceyou’ve

foundsomething,postitonPiazzaandcommentonwhyyoufindthe

datainteresting.(Asabove,tagyourpost studio0 .)Wearealwayson

thehuntforinterestingdata,soyouneverknow…yourfilemight

reappearlateronascoursematerial!

SoftwareInstallationsonaLaptopAllofthenecessarysoftwareforthecoursecanbeaccessedon

computersintheCIT.(Inadditiontotheroomswherewewillbeholding

studio—CIT201andCIT167,a.k.a.theMSLab—youmayalsousethe

computersintheSunlab,whichisthelargeroomfullofcomputerson

thefirstflooroftheCIT.)Youmayalsochoosetoworkonyour

assignmentsusingapersonallaptop.Toinstallthenecessarysoftware

onalaptop,pleasefollowtheinstructionsbelow.

Atthestartofthecourse,we’llbeusingGoogleSheets.Sheetscomes

withyourBrownGoogleaccount,soyoushouldbeabletoaccessit

directlyfromyourGoogleDrive.Visitdrive.google.com,andclickon

New ,andselect GoogleSheets .

Afewweeksintothecourse,wewilladdtwofurthertoolstoourtoolkit:

R,aprogramminglanguagetailoredtostatisticsandvisualizations,and

RStudio,adevelopmentenvironmentforRprograms.Toinstallthis

software,followtheseinstructions:

SettingupR:1. TodownloadR,visitthislink

2. IfyouareusingaWindowscomputerdownloadRforWindows,

ifyouareusingaMacdownloadRfor(Mac)OSX.

Windows:Clickon installRforthefirsttime ,andthenfollowthe

downloadinstructions:

Mac:TherearemultipleRpackagesforMacs,dependingonyourinstallation

(OSX10.11(ElCapitan)andhigher,MacOSX10.9(Mavericks),etc.).

SelectthecorrectRpackageforyoursystem,andthenfollowthe

downloadinstructions:

OnceyouhavedownloadedR,youcanmoveontoinstallingRStudio.

SettingupRStudio:InCS100,weuseRStudiotowriteRprograms—alsocalledscripts—and

toviewtheiroutput(often,datavisualizations).RStudioisanIDEforR.

IDEstandsfor"integrateddevelopmentenvironment,”whichisan

applicationthatfacilitateswritingandexecutingofcode.

GototheRStudiowebsite.Scrolldownasnecessaryuntilyoucanclick

on“DownloadRStudioDesktop”.Thislinkwilltakeyoutoatableof

differentproducts.YoushoulddownloadthefirstRStudioDesktop

product,becauseitisfree!

Onceyouclickonthedownloadlink,the .exe fileforRStudioshould

begindownloading.Clickthedownloaded .exe fileandfollowthe

directionsontheRStudiosetupguide.

Clicknexttocontinuewhentheinstallwizardopens.

Clicknexttoacceptthedefaultinstalllocation.

Laststep!Click Install toacceptthedefaultstartmenufolderand

installRStudio!

Click Finish toclosethewizard.

OnceRStudioisinstalled,openituptomakesureitwascorrectly

installed.Youshouldseeafewpanelsonyourscreen.Theoneonthe

bottomleftiscalledtheconsole.IfyoutypeRcodeintotheconsole,

andthenhitenter,RStudiowillrunyourcode,anddisplaytheresults.

Asasimpletest,enterthislineofcodeintotheconsole,andseewhat

happens:

print("Welcometotheworldofdata!")

EndofStudioCongratulations!You’vecompletedyourfirstCS100studio.Youarenow

ingoodshapetocompletefuture,moreinteresting,assignments.

PleasegotoTAhourssothataTAcancheckyourwork.Youmustget

checkedofftogetcreditforcompletingthisstudio.

Recommended