brouwern / compbio2021

Assignments for Computational Biology Fall 2021 at the University of Pittsburgh
0 stars 3 forks source link

for() loops #41

Open kimdudding opened 3 years ago

kimdudding commented 3 years ago

https://github.com/brouwern/compbio2021/blob/4fc22d26cd66119a177fd9572bd409ffa989216d/KEY-MSA-walkthrough-shroom.Rmd#L544

what is the "i" in for(i......) referring to in the line of code? is it just a variable that's always part of a for loop?

harrisonyen19 commented 3 years ago

the i in the for loop represents the index of the list you are looping through. So i would start from 1 and increment all the way up to the length of shrooms_list

brouwern commented 3 years ago

for now its just useful to know that its a feature of for loops

we'll cover what it is in detail in a few weeks, and you'll learn how to write your own simple loops. I'll share a number of worked examples when we get there

On Mon, Oct 4, 2021 at 2:22 PM kimdudding @.***> wrote:

https://github.com/brouwern/compbio2021/blob/4fc22d26cd66119a177fd9572bd409ffa989216d/KEY-MSA-walkthrough-shroom.Rmd#L544

what is the "i" in for(i......) referring to in the line of code? is it just a variable that's always part of a for loop?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brouwern/compbio2021/issues/41, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB32NEZDXVIPKMSHQPZFQG3UFHWHLANCNFSM5FJ7EOZA .

--

Nathan L. Brouwer, PhD

@.***

Lecturer

Department of Biological Sciences https://www.biology.pitt.edu/

University of Pittsburgh

Biostatistics course: brouwern.github.io/BIOSC_1120/index.html

Research Associate

National Aviary, Dept. of Conservation & Field Research https://www.aviary.org/conservation

R code: github.com/brouwern

R tweets: @lobrowR https://twitter.com/lobrowR